![]() |
Multivariate Pattern Analysis in Python |
Base classes for all classifiers.
Base Classifiers can be grouped according to their function as
group Basic Classifiers: | |
---|---|
Classifier BoostedClassifier ProxyClassifier | |
group BoostedClassifiers: | |
CombinedClassifier MulticlassClassifier SplitClassifier | |
group ProxyClassifiers: | |
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.base (for developers).
Bases: mvpa.clfs.base.ProxyClassifier
ProxyClassifier which maps set of two labels into +1 and -1
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.base.
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
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.base.
Bases: mvpa.misc.state.ClassWithCollections
Abstract classifier class to be inherited by all classifiers
Cheap initialization.
Either classifier was already trained.
MUST BE USED WITH CARE IF EVER
Predict classifier on data
Shouldn’t be overriden in subclasses unless explicitely needed to do so. Also subclasses trying to call super class’s predict should call _predict if within _predict instead of predict() since otherwise it would loop
Helper to avoid check if data was changed actually changed
Useful if classifier was (re)trained but with the same data (so just parameters were changed), so that it could be repredicted easily (on the same data as before) without recomputing for instance train/test kernel matrix. Should be used with caution and always compared to the results on not ‘retrainable’ classifier. Some additional checks are enabled if debug id ‘CHECK_RETRAIN’ is enabled, to guard against obvious mistakes.
Parameters: |
|
---|
Helper to avoid check if data was changed actually changed
Useful if just some aspects of classifier were changed since its previous training. For instance if dataset wasn’t changed but only classifier parameters, then kernel matrix does not have to be computed.
Words of caution: classifier must be previousely trained, results always should first be compared to the results on not ‘retrainable’ classifier (without calling retrain). Some additional checks are enabled if debug id ‘CHECK_RETRAIN’ is enabled, to guard against obvious mistakes.
Parameters: |
|
---|
Train classifier on a dataset
Shouldn’t be overriden in subclasses unless explicitely needed to do so
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 Classifier documentation.
Full API documentation of Classifier in module mvpa.clfs.base.
Bases: mvpa.clfs.base.PredictionsCombiner
Provides a decision using training a classifier on predictions/values
TODO
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.base.
Bases: mvpa.clfs.base.BoostedClassifier
BoostedClassifier which combines predictions using some PredictionsCombiner functor.
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.base.
Bases: mvpa.clfs.base.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
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.base.
Bases: mvpa.clfs.base.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.
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.base.
Bases: mvpa.clfs.base.PredictionsCombiner
Provides a decision using maximal vote rule
XXX Might get a parameter to use raw decision values if voting is not unambigous (ie two classes have equal number of votes
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.base.
Bases: mvpa.clfs.base.PredictionsCombiner
Provides a decision by taking mean of the results
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.base.
Bases: mvpa.clfs.base.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)
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.base.
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.base.
Bases: mvpa.clfs.base.Classifier
Classifier which decorates another classifier
Possible uses:
- modify data somehow prior training/testing: * normalization * feature selection * modification
- optimized classifier?
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.base.
Bases: mvpa.clfs.base.CombinedClassifier
BoostedClassifier to work on splits of the data
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.base.