![]() |
Multivariate Pattern Analysis in Python |
Classes for meta classifiers – classifiers which use other classifiers
Meta Classifiers can be grouped according to their function as
| group BoostedClassifiers: | |
|---|---|
| CombinedClassifier MulticlassClassifier SplitClassifier | |
| group ProxyClassifiers: | |
| ProxyClassifier BinaryClassifier MappedClassifier FeatureSelectionClassifier | |
| group PredictionsCombiners for CombinedClassifier: | |
| PredictionsCombiner MaximalVote MeanPrediction | |
The comprehensive API documentation for this module, including all technical details, is available in the Epydoc-generated API reference for mvpa.clfs.meta (for developers).
Bases: mvpa.clfs.meta.ProxyClassifier
ProxyClassifier which maps set of two labels into +1 and -1
Note
Available state variables:
- feature_ids: Feature IDS which were used for the actual training.
- predicting_time+: Time (in seconds) which took classifier to predict
- predictions+: Most recent set of predictions
- trained_dataset: The dataset it has been trained on
- trained_labels+: Set of unique labels it has been trained on
- training_confusion: Confusion matrix of learning performance
- training_time+: Time (in seconds) which took classifier to train
- values+: Internal classifier values the most recent predictions are based on
(States enabled by default are listed with +)
| Parameters: |
|
|---|
See also
Derived classes might provide additional methods via their base classes. Please refer to the list of base classes (if it exists) at the begining of the BinaryClassifier documentation.
Full API documentation of BinaryClassifier in module mvpa.clfs.meta.
Bases: mvpa.clfs.base.Classifier, mvpa.misc.state.Harvestable
Classifier containing the farm of other classifiers.
Should rarely be used directly. Use one of its childs instead
Note
Available state variables:
- feature_ids: Feature IDS which were used for the actual training.
- harvested: Store specified attributes of classifiers at each split
- predicting_time+: Time (in seconds) which took classifier to predict
- predictions+: Most recent set of predictions
- raw_predictions: Predictions obtained from each classifier
- raw_values: Values obtained from each classifier
- trained_dataset: The dataset it has been trained on
- trained_labels+: Set of unique labels it has been trained on
- training_confusion: Confusion matrix of learning performance
- training_time+: Time (in seconds) which took classifier to train
- values+: Internal classifier values the most recent predictions are based on
(States enabled by default are listed with +)
See also
Please refer to the documentation of the base classes for more information:
Initialize the instance.
| Parameters: |
|
|---|
Untrain BoostedClassifier
Has to untrain any known classifier
See also
Derived classes might provide additional methods via their base classes. Please refer to the list of base classes (if it exists) at the begining of the BoostedClassifier documentation.
Full API documentation of BoostedClassifier in module mvpa.clfs.meta.
Bases: mvpa.clfs.meta.PredictionsCombiner
Provides a decision using training a classifier on predictions/values
TODO: implement
Note
Available state variables:
- predictions+: Trained predictions
(States enabled by default are listed with +)
See also
Please refer to the documentation of the base class for more information:
Initialize ClassifierCombiner
| Parameters: |
|
|---|
See also
Derived classes might provide additional methods via their base classes. Please refer to the list of base classes (if it exists) at the begining of the ClassifierCombiner documentation.
Full API documentation of ClassifierCombiner in module mvpa.clfs.meta.
Bases: mvpa.clfs.meta.BoostedClassifier
BoostedClassifier which combines predictions using some PredictionsCombiner functor.
Note
Available state variables:
- feature_ids: Feature IDS which were used for the actual training.
- harvested: Store specified attributes of classifiers at each split
- predicting_time+: Time (in seconds) which took classifier to predict
- predictions+: Most recent set of predictions
- raw_predictions: Predictions obtained from each classifier
- raw_values: Values obtained from each classifier
- trained_dataset: The dataset it has been trained on
- trained_labels+: Set of unique labels it has been trained on
- training_confusion: Confusion matrix of learning performance
- training_time+: Time (in seconds) which took classifier to train
- values+: Internal classifier values the most recent predictions are based on
(States enabled by default are listed with +)
See also
Please refer to the documentation of the base class for more information:
Initialize the instance.
| Parameters: |
|
|---|
See also
Derived classes might provide additional methods via their base classes. Please refer to the list of base classes (if it exists) at the begining of the CombinedClassifier documentation.
Full API documentation of CombinedClassifier in module mvpa.clfs.meta.
Bases: mvpa.clfs.meta.ProxyClassifier
ProxyClassifier which uses some FeatureSelection prior training.
FeatureSelection is used first to select features for the classifier to use for prediction. Internally it would rely on MappedClassifier which would use created MaskMapper.
TODO: think about removing overhead of retraining the same classifier if feature selection was carried out with the same classifier already. It has been addressed by adding .trained property to classifier, but now we should expclitely use isTrained here if we want... need to think more
Note
Available state variables:
- feature_ids: Feature IDS which were used for the actual training.
- predicting_time+: Time (in seconds) which took classifier to predict
- predictions+: Most recent set of predictions
- trained_dataset: The dataset it has been trained on
- trained_labels+: Set of unique labels it has been trained on
- training_confusion: Confusion matrix of learning performance
- training_time+: Time (in seconds) which took classifier to train
- values+: Internal classifier values the most recent predictions are based on
(States enabled by default are listed with +)
Initialize the instance
| Parameters: |
|
|---|
Untrain FeatureSelectionClassifier
Has to untrain any known classifier
See also
Derived classes might provide additional methods via their base classes. Please refer to the list of base classes (if it exists) at the begining of the FeatureSelectionClassifier documentation.
Full API documentation of FeatureSelectionClassifier in module mvpa.clfs.meta.
Bases: mvpa.clfs.meta.ProxyClassifier
ProxyClassifier which uses some mapper prior training/testing.
MaskMapper can be used just a subset of features to train/classify. Having such classifier we can easily create a set of classifiers for BoostedClassifier, where each classifier operates on some set of features, e.g. set of best spheres from SearchLight, set of ROIs selected elsewhere. It would be different from simply applying whole mask over the dataset, since here initial decision is made by each classifier and then later on they vote for the final decision across the set of classifiers.
Note
Available state variables:
- feature_ids: Feature IDS which were used for the actual training.
- predicting_time+: Time (in seconds) which took classifier to predict
- predictions+: Most recent set of predictions
- trained_dataset: The dataset it has been trained on
- trained_labels+: Set of unique labels it has been trained on
- training_confusion: Confusion matrix of learning performance
- training_time+: Time (in seconds) which took classifier to train
- values+: Internal classifier values the most recent predictions are based on
(States enabled by default are listed with +)
Initialize the instance
| Parameters: |
|
|---|
See also
Derived classes might provide additional methods via their base classes. Please refer to the list of base classes (if it exists) at the begining of the MappedClassifier documentation.
Full API documentation of MappedClassifier in module mvpa.clfs.meta.
Bases: mvpa.clfs.meta.PredictionsCombiner
Provides a decision using maximal vote rule
Note
Available state variables:
- all_label_counts: Counts across classifiers for each label/sample
- predictions+: Voted predictions
(States enabled by default are listed with +)
See also
Please refer to the documentation of the base class for more information:
XXX Might get a parameter to use raw decision values if voting is not unambigous (ie two classes have equal number of votes
| Parameters: |
|
|---|
See also
Derived classes might provide additional methods via their base classes. Please refer to the list of base classes (if it exists) at the begining of the MaximalVote documentation.
Full API documentation of MaximalVote in module mvpa.clfs.meta.
Bases: mvpa.clfs.meta.PredictionsCombiner
Provides a decision by taking mean of the results
Note
Available state variables:
- predictions+: Mean predictions
(States enabled by default are listed with +)
See also
Please refer to the documentation of the base class for more information:
See also
Derived classes might provide additional methods via their base classes. Please refer to the list of base classes (if it exists) at the begining of the MeanPrediction documentation.
Full API documentation of MeanPrediction in module mvpa.clfs.meta.
Bases: mvpa.clfs.meta.CombinedClassifier
CombinedClassifier to perform multiclass using a list of BinaryClassifier.
such as 1-vs-1 (ie in pairs like libsvm doesn) or 1-vs-all (which is yet to think about)
Note
Available state variables:
- feature_ids: Feature IDS which were used for the actual training.
- harvested: Store specified attributes of classifiers at each split
- predicting_time+: Time (in seconds) which took classifier to predict
- predictions+: Most recent set of predictions
- raw_predictions: Predictions obtained from each classifier
- raw_values: Values obtained from each classifier
- trained_dataset: The dataset it has been trained on
- trained_labels+: Set of unique labels it has been trained on
- training_confusion: Confusion matrix of learning performance
- training_time+: Time (in seconds) which took classifier to train
- values+: Internal classifier values the most recent predictions are based on
(States enabled by default are listed with +)
See also
Please refer to the documentation of the base class for more information:
Initialize the instance
| Parameters: |
|
|---|
See also
Derived classes might provide additional methods via their base classes. Please refer to the list of base classes (if it exists) at the begining of the MulticlassClassifier documentation.
Full API documentation of MulticlassClassifier in module mvpa.clfs.meta.
Bases: mvpa.misc.state.ClassWithCollections
Base class for combining decisions of multiple classifiers
PredictionsCombiner might need to be trained
| Parameters: |
|
|---|
See also
Derived classes might provide additional methods via their base classes. Please refer to the list of base classes (if it exists) at the begining of the PredictionsCombiner documentation.
Full API documentation of PredictionsCombiner in module mvpa.clfs.meta.
Bases: mvpa.clfs.base.Classifier
Classifier which decorates another classifier
Possible uses:
- modify data somehow prior training/testing: * normalization * feature selection * modification
- optimized classifier?
Note
Available state variables:
- feature_ids: Feature IDS which were used for the actual training.
- predicting_time+: Time (in seconds) which took classifier to predict
- predictions+: Most recent set of predictions
- trained_dataset: The dataset it has been trained on
- trained_labels+: Set of unique labels it has been trained on
- training_confusion: Confusion matrix of learning performance
- training_time+: Time (in seconds) which took classifier to train
- values+: Internal classifier values the most recent predictions are based on
(States enabled by default are listed with +)
Initialize the instance
| Parameters: |
|
|---|
See also
Derived classes might provide additional methods via their base classes. Please refer to the list of base classes (if it exists) at the begining of the ProxyClassifier documentation.
Full API documentation of ProxyClassifier in module mvpa.clfs.meta.
Bases: mvpa.clfs.meta.CombinedClassifier
BoostedClassifier to work on splits of the data
Note
Available state variables:
- confusion: Resultant confusion whenever classifier trained on 1 part and tested on 2nd part of each split
- feature_ids: Feature IDS which were used for the actual training.
- harvested: Store specified attributes of classifiers at each split
- predicting_time+: Time (in seconds) which took classifier to predict
- predictions+: Most recent set of predictions
- raw_predictions: Predictions obtained from each classifier
- raw_values: Values obtained from each classifier
- splits: Store the actual splits of the data. Can be memory expensive
- trained_dataset: The dataset it has been trained on
- trained_labels+: Set of unique labels it has been trained on
- training_confusion: Confusion matrix of learning performance
- training_time+: Time (in seconds) which took classifier to train
- values+: Internal classifier values the most recent predictions are based on
(States enabled by default are listed with +)
See also
Please refer to the documentation of the base class for more information:
Initialize the instance
| Parameters: |
|
|---|
See also
Derived classes might provide additional methods via their base classes. Please refer to the list of base classes (if it exists) at the begining of the SplitClassifier documentation.
Full API documentation of SplitClassifier in module mvpa.clfs.meta.