timedecoder_utils.decode_time_step(X_i, y, y_dict, clf, scaler, n_splits=5, sampler=[], do_pca=False, n_components=0.95, permute_train_labels=False, compute_auc=False)¶Run a classification of data X_i with labels y using a Stratified K-Folds cross-validation
where n_splits is the number of folds.
Classification pipeline, for each one of the Stratified K-Folds :
- If
do_pcais True, first do a standardization scaling and then apply PCA and keep only the firstn_components- Apply the
scaler. Fit the transform on the training set and apply it on the test set- Resample the train set so that the train set is balanced between classes, using the
samplerargument- Train the classifier on the train set (If
permute_train_labelsis True, permute the training labels first)- Predict labels on the test set
- Evaluate the performances with several scores
See also timedecoder.TimeDecoder.decode()
| Parameters: |
|
|---|---|
| Returns: |
|
timedecoder_utils.temporal_generalization_step(X, i_time, y, y_dict, clf, scaler, n_splits=5, sampler=[], do_pca=False, n_components=0.95, permute_train_labels=False)¶Temporal generalization step.
Train at time i_time and test for all time points. Use a stratified K-folds cross validation.
do_pca is True, first do a standardization scaling and then apply PCA and keep only the first n_components on the train setscaler. Fit the transform on the training setsampler argumentpermute_train_labels is True, permute the training labels first)
- If
do_pcais True, do a standardization scaling and then apply PCA on the test set- Apply the
scaleron the test set- Predict labels on the test set
- Evaluate the performances with several scores
See also timedecoder.TimeDecoder.temporal_generalization()
| Parameters: |
|
|---|---|
| Returns: |
|