Decoding¶
Decoding analyses are performed basically on a set of ROIs, contained in the dataset.
- class sekupy.analysis.decoding.Decoding(estimator=None, n_jobs=1, scoring='accuracy', cv=LeaveOneGroupOut(), permutation=0, verbose=1, name='decoding', **kwargs)[source]¶
Implement decoding analysis using an arbitrary type of classifier.
- Parameters:
estimator ('svr', 'svc', or an estimator object implementing 'fit') – The object to use to fit the data
n_jobs (int, optional. Default is -1.) – The number of CPUs to use to do the computation. -1 means ‘all CPUs’.
scoring (string or callable, optional) – The scoring strategy to use. See the scikit-learn documentation If callable, takes as arguments the fitted estimator, the test data (X_test) and the test target (y_test) if y is not None.
permutation (int. Default is 0.) – The number of permutation to be performed. If the number is 0, no permutation is performed.
cv (cross-validation generator, optional) – A cross-validation generator. If None, a 3-fold cross validation is used or 3-fold stratified cross-validation when y is supplied.
verbose (int, optional) – Verbosity level. Defaut is False
- scores¶
The dictionary of results for each roi selected. The key is the union of the name of the roi and the value(s). The value is a list of values, the number is equal to the permutations.
- Type:
dict.
Spatial decoding¶
- class sekupy.analysis.decoding.roi_decoding.RoiDecoding(estimator=None, n_jobs=1, scoring='accuracy', cv=LeaveOneGroupOut(), permutation=0, verbose=1, name='roi_decoding', **kwargs)[source]¶
Implement decoding analysis using an arbitrary type of classifier.
- Parameters:
estimator ('svr', 'svc', or an estimator object implementing 'fit') – The object to use to fit the data
n_jobs (int, optional. Default is -1.) – The number of CPUs to use to do the computation. -1 means ‘all CPUs’.
scoring (string or callable, optional) – The scoring strategy to use. See the scikit-learn documentation If callable, takes as arguments the fitted estimator, the test data (X_test) and the test target (y_test) if y is not None.
permutation (int. Default is 0.) – The number of permutation to be performed. If the number is 0, no permutation is performed.
cv (cross-validation generator, optional) – A cross-validation generator. If None, a 3-fold cross validation is used or 3-fold stratified cross-validation when y is supplied.
verbose (int, optional) – Verbosity level. Defaut is False
- scores¶
The dictionary of results for each roi selected. The key is the union of the name of the roi and the value(s). The value is a list of values, the number is equal to the permutations.
- Type:
dict.
- fit(ds, cv_attr='chunks', roi='all', roi_values=None, prepro=<sekupy.preprocessing.base.Transformer object>, return_predictions=False, return_splits=True, return_decisions=False, **kwargs)[source]¶
[summary]
- Parameters:
ds ([type]) – [description]
cv_attr (str, optional) – [description] (the default is ‘chunks’, which [default_description])
roi (list, optional) – list of strings that must be present in ds.fa keys (the default is ‘all’, which [default_description])
roi_values (list, optional) – A list of key, value tuple where the key is the roi name, specified in ds.fa.roi and value is the value of the subroi. (the default is None, which [default_description])
prepro ([type], optional) – [description] (the default is Transformer(), which [default_description])
return_predictions (bool, optional) – [description] (the default is False, which [default_description])
return_splits (bool, optional) – [description] (the default is True, which [default_description])
- Returns:
[description]
- Return type:
[type]
Temporal decoding¶
- class sekupy.analysis.decoding.temporal_decoding.TemporalDecoding(estimator=None, n_jobs=1, scoring='accuracy', cv=LeaveOneGroupOut(), permutation=0, verbose=1, **kwargs)[source]¶
- Implement temporal generalization decoding analysis
using an arbitrary type of classifier.
see King 2014 TICS
- Parameters:
estimator ('svr', 'svc', or an estimator object implementing 'fit') – The object to use to fit the data
n_jobs (int, optional. Default is -1.) – The number of CPUs to use to do the computation. -1 means ‘all CPUs’.
scoring (string or callable, optional) – The scoring strategy to use. See the scikit-learn documentation If callable, takes as arguments the fitted estimator, the test data (X_test) and the test target (y_test) if y is not None.
permutation (int. Default is 0.) – The number of permutation to be performed. If the number is 0, no permutation is performed.
cv (cross-validation generator, optional) – A cross-validation generator. If None, a 3-fold cross validation is used or 3-fold stratified cross-validation when y is supplied.
verbose (int, optional) – Verbosity level. Defaut is False
- scores¶
The dictionary of results for each roi selected. The key is the union of the name of the roi and the value(s). The value is a list of values, the number is equal to the permutations.
- Type:
dict.