Package pycv :: Package cs :: Package ml :: Package cla :: Module lda
[hide private]
[frames] | no frames]

Module lda

source code

Functions [hide private]
 
project_LDA(stats2)
Project down to a line using the LDA projection.
source code
 
train_LDA(classification_dataset, crit, param1)
Take a 2-class WeightedCDataset, then train a TLinearClassifier.
source code
Function Details [hide private]

project_LDA(stats2)

source code 

Project down to a line using the LDA projection. Return the direction.

Input:

stats2: a Stats2 of J classes

Output:

w: the projection direction (vector) -- if input is a tensor, flatten it into a vector

train_LDA(classification_dataset, crit, param1)

source code 
Take a 2-class WeightedCDataset, then train a TLinearClassifier.
The projection direction is LDA. The threshold is trained using one of three criteria:
    crit = 0: param1 is 'thelambda', then call gaussian.find_classification_threshold()
    crit = 1: param1 is 'minDR', then call gaussian.find_filtering_threshold()
    crit = 2: param1 is 'maxFAR', then call gaussian.find_filtering_threshold2()
    
Input:
    classification_dataset: a 2-class WeightedCDataset
    crit, param1: as mentioned above
Output:
    lc: a LinearClassifier, with lc.err as the estimated 'error'