discriminant_analysis_classifier¶
Module: missions.nodes.classification.discriminant_analysis_classifier
¶
Discriminant analysis type classifiers
Inheritance diagram for pySPACE.missions.nodes.classification.discriminant_analysis_classifier
:
Class Summary¶
DiscriminantAnalysisClassifierBase ([...]) |
Template for discriminant analysis type classifier nodes |
LinearDiscriminantAnalysisClassifierNode ([...]) |
Classify by linear discriminant analysis |
QuadraticDiscriminantAnalysisClassifierNode ([...]) |
Classify by quadratic discriminant analysis |
Classes¶
DiscriminantAnalysisClassifierBase
¶
-
class
pySPACE.missions.nodes.classification.discriminant_analysis_classifier.
DiscriminantAnalysisClassifierBase
(prior_probability=[1.0, 1.0], class_labels=[], **kwargs)[source]¶ Bases:
pySPACE.missions.nodes.base_node.BaseNode
Template for discriminant analysis type classifier nodes
This class has the is_trainable method and so on. Also a generic training method, which simply collects all training data, exists here. A classifier that inherits from here should implement stop_training and execute.
Parameters
class_labels: Determines the order of the two classes. This is important, when you want that the prediction value is negative for the first class and positive for the other one. Otherwise this variable is set by adding the labels, when they first occur.
(optional, default: [])
prior_probability: The prior probability for any given sample to belong to either class. Pass a list with two entries in the same order as in class_labels. The values in prior_probability don’t have to be actual probabilities, i.e., they don’t have to add up to 1: [1,3] is equivalent to [.25,.75]. Note that this parameter is in some sense inverse to the SVM weights: The underrepresented class will typically get assigned a higher SVM weight but the smaller prior probability.
(optional, default: [1.,1.])
Author: David Feess (David.Feess@dfki.de) Created: 2012/05/30 Class Components Summary
_train
(data, label)Train node on given example data for class label. is_supervised
()Returns whether this node requires supervised training is_trainable
()Returns whether this node is trainable.
LinearDiscriminantAnalysisClassifierNode
¶
-
class
pySPACE.missions.nodes.classification.discriminant_analysis_classifier.
LinearDiscriminantAnalysisClassifierNode
(class_labels=[], **kwargs)[source]¶ -
Classify by linear discriminant analysis
A detailed description can be found in: [1] Bishop, 2006 C.M. Bishop, “Pattern recognition and machine learning”, Springer (2006), 4.1.3-4.1.5
Implementation strategies originate from [2] Schloegl et al., Adaptive Methods in BCI Research - An Introductory Tutorial. Brain-Computer Interfaces (2010) pp. 331
Parameters
See description ofDiscriminantAnalysisClassifierBase
Exemplary Call
- node : LDA parameters : class_labels : ["Target","Standard"] prior_probability : [1,6]
Author: David Feess (David.Feess@dfki.de)
Created: 2012/05/29
POSSIBLE NODE NAMES: - LDA
- LinearDiscriminantAnalysisClassifier
- LinearDiscriminantAnalysisClassifierNode
POSSIBLE INPUT TYPES: - FeatureVector
Class Components Summary
_execute
(data)Executes the classifier on the given data vector _stop_training
([debug])Perform the actual model building input_types
-
input_types
= ['FeatureVector']¶
QuadraticDiscriminantAnalysisClassifierNode
¶
-
class
pySPACE.missions.nodes.classification.discriminant_analysis_classifier.
QuadraticDiscriminantAnalysisClassifierNode
(class_labels=[], **kwargs)[source]¶ -
Classify by quadratic discriminant analysis
Performs a QDA classification (basically evaluates the log of a likelihood ratio test).
Implementation originates from [1] Schloegl et al., Adaptive Methods in BCI Research - An Introductory Tutorial. Brain-Computer Interfaces (2010) pp. 331
Parameters
See description of DiscriminantAnalysisClassifierBaseExemplary Call
- node : QDA parameters : class_labels : ["Target","Standard"] prior_probability : [1,6]
Author: David Feess (David.Feess@dfki.de)
Created: 2012/05/29
POSSIBLE NODE NAMES: - QuadraticDiscriminantAnalysisClassifier
- QuadraticDiscriminantAnalysisClassifierNode
- QDA
POSSIBLE INPUT TYPES: - FeatureVector
Class Components Summary
_execute
(data)Executes the classifier on the given data vector _stop_training
([debug])Perform the actual model building input_types
logdet_from_ECM
(ECM)Compute logdet of cov matrix from extended cov matrix (ECM) -
input_types
= ['FeatureVector']¶