mne.decoding.
SlidingEstimator
(base_estimator, scoring=None, n_jobs=1)[source]¶Search Light.
Fit, predict and score a series of models to each subset of the dataset along the last dimension. Each entry in the last dimension is referred to as a task.
Parameters: | base_estimator : object
scoring : callable, string, defaults to None
n_jobs : int, optional (default=1)
|
---|
Attributes
``estimators_`` | (array-like, shape (n_tasks,)) List of fitted scikit-learn estimators (one per task). |
Methods
__hash__ () <==> hash(x) |
|
decision_function (X) |
Estimate distances of each data slice to the hyperplanes. |
fit (X, y, **fit_params) |
Fit a series of independent estimators to the dataset. |
fit_transform (X, y, **fit_params) |
Fit and transform a series of independent estimators to the dataset. |
get_params ([deep]) |
Get parameters for this estimator. |
predict (X) |
Predict each data slice/task with a series of independent estimators. |
predict_proba (X) |
Predict each data slice with a series of independent estimators. |
score (X, y) |
Score each estimator on each task. |
set_params (**params) |
Set the parameters of this estimator. |
transform (X) |
Transform each data slice/task with a series of independent estimators. |
__hash__
() <==> hash(x)¶decision_function
(X)[source]¶Estimate distances of each data slice to the hyperplanes.
Parameters: | X : array, shape (n_samples, nd_features, n_tasks)
|
---|---|
Returns: | y_pred : array, shape (n_samples, n_estimators, n_classes * (n_classes-1) // 2)
|
Notes
This requires base_estimator to have a decision_function
method.
fit
(X, y, **fit_params)[source]¶Fit a series of independent estimators to the dataset.
Parameters: | X : array, shape (n_samples, nd_features, n_tasks)
y : array, shape (n_samples,) | (n_samples, n_targets)
**fit_params : dict of string -> object
|
---|---|
Returns: | self : object
|
fit_transform
(X, y, **fit_params)[source]¶Fit and transform a series of independent estimators to the dataset.
Parameters: | X : array, shape (n_samples, nd_features, n_tasks)
y : array, shape (n_samples,) | (n_samples, n_targets)
**fit_params : dict of string -> object
|
---|---|
Returns: | y_pred : array, shape (n_samples, n_tasks) | (n_samples, n_tasks, n_targets)
|
get_params
(deep=True)[source]¶Get parameters for this estimator.
Parameters: | deep : boolean, optional
|
---|---|
Returns: | params : mapping of string to any
|
predict
(X)[source]¶Predict each data slice/task with a series of independent estimators.
The number of tasks in X should match the number of tasks/estimators given at fit time.
Parameters: | X : array, shape (n_samples, nd_features, n_tasks)
|
---|---|
Returns: | y_pred : array, shape (n_samples, n_estimators) | (n_samples, n_tasks, n_targets)
|
predict_proba
(X)[source]¶Predict each data slice with a series of independent estimators.
The number of tasks in X should match the number of tasks/estimators given at fit time.
Parameters: | X : array, shape (n_samples, nd_features, n_tasks)
|
---|---|
Returns: | y_pred : array, shape (n_samples, n_tasks, n_classes)
|
score
(X, y)[source]¶Score each estimator on each task.
The number of tasks in X should match the number of tasks/estimators
given at fit time, i.e. we need
X.shape[-1] == len(self.estimators_)
.
Parameters: | X : array, shape (n_samples, nd_features, n_tasks)
y : array, shape (n_samples,) | (n_samples, n_targets)
|
---|---|
Returns: | score : array, shape (n_samples, n_estimators)
|
set_params
(**params)[source]¶Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects
(such as pipelines). The latter have parameters of the form
<component>__<parameter>
so that it’s possible to update each
component of a nested object.
Returns
——-
self
transform
(X)[source]¶Transform each data slice/task with a series of independent estimators.
The number of tasks in X should match the number of tasks/estimators given at fit time.
Parameters: | X : array, shape (n_samples, nd_features, n_tasks)
|
---|---|
Returns: | Xt : array, shape (n_samples, n_estimators)
|