timedecoder.TimeDecoder(classifier, scaling='normalization', do_pca=0, n_components=0.95)¶Bases: object
Class representing a Decoding/MVPA/Classification pipeline This decoding works with 3D data having a temporal dimension.
| Attributes: |
|
|---|
Methods
decode(X, y, y_dict[, n_splits, n_iter, …]) |
Do the temporal decoding of 3D data X given labels y For each time point, run |
decode_mpver(X, y, y_dict[, n_splits, …]) |
Do the temporal decoding of 3D data X given labels y - Multiprocesses version |
plot_scores(scores, y_dict, n_iter, …[, …]) |
Plot the decoding performances measures listed in scores |
single_feature_decoding(X, y, y_dict[, …]) |
Apply the classifier on each feature separately. |
temporal_generalization(X, y, y_dict[, …]) |
Temporal Generalisation. |
decode(X, y, y_dict, n_splits=5, n_iter=1, resample='rus', smote_kind='regular', near_miss_ver=1, do_plot=1, score_to_plot=['auc', 'accuracy'], compute_auc=True, permute_train_labels=False)¶Do the temporal decoding of 3D data X given labels y
For each time point, run
| Parameters: |
|
|---|---|
| Returns: |
|
decode_mpver(X, y, y_dict, n_splits=5, n_iter=3, resample='rus', smote_kind='regular', near_miss_ver=1, do_plot=1, score_to_plot=['auc', 'accuracy'], compute_auc=True, permute_train_labels=False, n_processes=6)¶Do the temporal decoding of 3D data X given labels y - Multiprocesses version
| Parameters: |
|
|---|---|
| Returns: |
|
plot_scores(scores, y_dict, n_iter, n_splits, n_pnts, resample, score_to_plot=[])¶Plot the decoding performances measures listed in scores
| Parameters: |
|
|---|
single_feature_decoding(X, y, y_dict, n_splits=5, n_iter=3, resample='Rus', smote_kind='regular', near_miss_ver=1, do_plot=1, score_to_plot=['auc', 'accuracy'], compute_auc=True, permute_train_labels=False, n_processes=6, features_names=[])¶Apply the classifier on each feature separately. Plot the classification results as an image.
| Parameters: |
|
|---|---|
| Returns: |
|
temporal_generalization(X, y, y_dict, n_splits=5, n_iter=3, resample='None', smote_kind='regular', near_miss_ver=1, permute_train_labels=False, n_processes=6)¶Temporal Generalisation. For each time points, t_i, t_j, train the classifier at t_i, test at time t_j
| Parameters: |
|
|---|---|
| Returns: |
|
timedecoder.apply_pca(X, n_components=0.95)¶Not used ? - Should not be here
timedecoder.get_sampler(method, smote_kind='regular', near_miss_ver=1)¶Return a resampler instance from the imbalanced-learn API Resampling is used when the number of trials is not the same across the 2 classes. For more details see https://imbalanced-learn.readthedocs.io/en/stable/user_guide.html
| Parameters: |
|
|---|---|
| Returns: |
|
timedecoder.print_classes_composition(y, y_dict)¶Print the number of trials for the different classes
| Parameters: |
|
|---|
timedecoder.timethis(func)¶Timing Wrapper