discriminant_analysis_classifier

Module: missions.nodes.classification.discriminant_analysis_classifier

Discriminant analysis type classifiers

Inheritance diagram for pySPACE.missions.nodes.classification.discriminant_analysis_classifier:

Inheritance diagram of 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.
__init__(prior_probability=[1.0, 1.0], class_labels=[], **kwargs)[source]
is_trainable()[source]

Returns whether this node is trainable.

is_supervised()[source]

Returns whether this node requires supervised training

_train(data, label)[source]

Train node on given example data for class label.

In this method, all data items and labels are buffered in a matrix for batch training.

LinearDiscriminantAnalysisClassifierNode

class pySPACE.missions.nodes.classification.discriminant_analysis_classifier.LinearDiscriminantAnalysisClassifierNode(class_labels=[], **kwargs)[source]

Bases: pySPACE.missions.nodes.classification.discriminant_analysis_classifier.DiscriminantAnalysisClassifierBase

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

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
__init__(class_labels=[], **kwargs)[source]
_stop_training(debug=False)[source]

Perform the actual model building

_execute(data)[source]

Executes the classifier on the given data vector

input_types = ['FeatureVector']

QuadraticDiscriminantAnalysisClassifierNode

class pySPACE.missions.nodes.classification.discriminant_analysis_classifier.QuadraticDiscriminantAnalysisClassifierNode(class_labels=[], **kwargs)[source]

Bases: pySPACE.missions.nodes.classification.discriminant_analysis_classifier.DiscriminantAnalysisClassifierBase

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 DiscriminantAnalysisClassifierBase

Exemplary 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)
__init__(class_labels=[], **kwargs)[source]
_stop_training(debug=False)[source]

Perform the actual model building

_execute(data)[source]

Executes the classifier on the given data vector

logdet_from_ECM(ECM)[source]

Compute logdet of cov matrix from extended cov matrix (ECM)

input_types = ['FeatureVector']