API Reference#

This is the class and function reference of MVPy. Please also refer to the examples for further details.

Object

Description

__version__

cross_val_score

Implements a shorthand for automated cross-validation scoring over estimators or pipelines.

KFold

Implements a k-folds cross-validator.

RepeatedKFold

Implements a repeated k-folds cross-validator.

StratifiedKFold

Implements a stratified k-folds cross-validator.

RepeatedStratifiedKFold

Implements a repeated stratified k-folds cross-validator.

Validator

Implements automated cross-validation and scoring over estimators or pipelines.

make_meeg_categorical

Create an M-EEG dataset based on continuous time-varying stimuli that group together into features and classes.

make_meeg_colours

Create spatial colours for sensor layout.

make_meeg_continuous

Create an M-EEG dataset based on continuous time-varying stimuli.

make_meeg_discrete

Create an M-EEG dataset based on stimuli defined as discrete events.

make_meeg_layout

Create a concentric channel layout for M-EEG sensors.

B2B

Implements a back-to-back regression to disentangle causal contributions of correlated features.

Classifier

Implements a wrapper for classifiers that handle one-versus-one (OvO) and one-versus-rest (OvR) classification schemes.

Covariance

Implements covariance and precision estimation as well as whitening of data.

KernelRidgeCV

Implements a kernel ridge regression with cross-validation.

ReceptiveField

Implements receptive field estimation (for multivariate temporal response functions or stimulus reconstruction).

RidgeClassifier

Implements a linear ridge classifier.

RidgeCV

Implements ridge regression with cross-validation.

RidgeDecoder

Implements a linear ridge decoder.

RidgeEncoder

Implements a linear ridge encoder.

RSA

Implements representational similarity analysis.

Sliding

Implements a sliding estimator that allows you to fit estimators iteratively over a set of dimensions.

SVC

Implements a support vector classifier.

TimeDelayed

Implements time delayed ridge regression (for multivariate temporal response functions or stimulus reconstruction).

accuracy

Compute accuracy between x and y. Note that accuracy is always computed over the final dimension.

cosine

Compute cosine similarities between x and y. Note that similarities are always computed over the final dimension.

cosine_d

Compute cosine distances between x and y. Note that distances are always computed over the final dimension.

cv_euclidean

Computes cross-validated euclidean distances between vectors in x and y.

cv_mahalanobis

Computes cross-validated mahalanobis distances between x and y. This is sometimes also referred to as the crossnobis distance.

euclidean

Computes euclidean distances between x and y.

kernel_linear

Compute the linear kernel function.

kernel_poly

Compute the polynomial kernel function.

kernel_rbf

Compute the radial basis kernel function.

kernel_sigmoid

Compute the sigmoid kernel function.

mahalanobis

Computes mahalanobis distance between x and y using inverse covariance matrix Σ.

pearsonr

Computes pearson correlations between x and y. Note that correlations are always computed over the final dimension.

pearsonr_d

Computes Pearson distance between x and y. Note that distances are always computed over the final dimension in your inputs.

r2

Rank data in x along its final feature dimension. Ties are computed as averages.

rank

Rank data in x along its final feature dimension. Ties are computed as averages.

roc_auc

Compute ROC AUC score between y_true and y_score. Note that ROC AUC is always computed over the final dimension.

spearmanr

Compute Spearman correlation between x and y. Note that correlations are always computed over the final dimension in your inputs.

spearmanr_d

Compute Spearman distance between x and y. Note that distances are always computed over the final dimension in your inputs.

Accuracy

Metric

R2

Roc_auc

score

Hierarchical

Implements a hierarchical scoring procedure over all feature permutations in \(X\) describing \(y\).

hierarchical_score

Implements a shorthand for hierarchical scoring over all feature permutations in \(X\) describing \(y\).

Shapley

Implements a Shapley value scoring procedure over all feature permutations in \(X\) describing \(y\).

shapley_score

Implements a shorthand for Shapley scoring over all feature permutations in \(X\) describing \(y\).

Clamp

Implements a clamp to handle extreme values.

LabelBinariser

Class to create and handle multiclass and multifeature one-hot encodings.

RobustScaler

Implements a robust scaler that is invariant to outliers.

Scaler

A standard scaler akin to sklearn.preprocessing.StandardScaler. See notes for some differences.

hamming_window

hann_window

raised_cosine_window

numpy

Decorator that compiles a function with numba.jit, if available.

torch

Decorator that compiles a function with torch.compile, if available.

get_var

Grab var from environment, respecting defaults and flag.

is_enabled

Check if var is enabled in environment variables.

Progressbar

Simple class for progress bars that can be enabled or disabled.

compare

Compare two version strings.