classifier
Class MahalanobisClassifier

java.lang.Object
  extended by classifier.Classifier
      extended by classifier.MahalanobisClassifier

public class MahalanobisClassifier
extends Classifier


Nested Class Summary
 
Nested classes/interfaces inherited from class classifier.Classifier
Classifier.ProbabilityType
 
Field Summary
private  Jama.Matrix logLikelyhood
           
private  MahalanobisParams mhParams
           
 
Constructor Summary
MahalanobisClassifier()
           
 
Method Summary
 java.lang.String getClassifierName()
           
 ClassifierParams getClassifierParams()
          Will get called AFTER classifier training to get classifier specific parameters.
 Jama.Matrix getLogLikelihoodsM()
          Get a matrix of log likelihoods from the most recent call to RunClassification(Matrix )
 Jama.Matrix getProbabilitiesM()
          This need to be rewritten with real probabilities fromt he chi2 distribution Maniana !
 Classifier.ProbabilityType getProbabilityType()
          Get the type of probability returned by a classifier.
private  Jama.Matrix oneTrainingSet(Jama.Matrix allGroups, int iGroup, int[] truth)
          Makea matrix of data containing only one group.
 int[] runClassification(Jama.Matrix data)
           
 boolean setClassifierParams(ClassifierParams classifierParams)
          Will be called to load stored parameters into a classifier.
 java.lang.String trainClassification(Jama.Matrix matrix, int[] truth)
          /** Train the classifier.
 
Methods inherited from class classifier.Classifier
getLogLikelihoods1, getLogLikelihoods2, getProbabilities1, getProbabilities2, runClassification, runClassification, toString, trainClassification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mhParams

private MahalanobisParams mhParams

logLikelyhood

private Jama.Matrix logLikelyhood
Constructor Detail

MahalanobisClassifier

public MahalanobisClassifier()
Method Detail

getClassifierName

public java.lang.String getClassifierName()
Specified by:
getClassifierName in class Classifier
Returns:
the classifier name, e.g. Linear Discriminant Analysis

getClassifierParams

public ClassifierParams getClassifierParams()
Description copied from class: Classifier
Will get called AFTER classifier training to get classifier specific parameters.

Specified by:
getClassifierParams in class Classifier
Returns:
classifier specific parameters.

getLogLikelihoodsM

public Jama.Matrix getLogLikelihoodsM()
Description copied from class: Classifier
Get a matrix of log likelihoods from the most recent call to RunClassification(Matrix )

This version will return a matrix of data, which should be from a set of classifications.

Specified by:
getLogLikelihoodsM in class Classifier
Returns:
log likelihoods matrix.

getProbabilitiesM

public Jama.Matrix getProbabilitiesM()
This need to be rewritten with real probabilities fromt he chi2 distribution Maniana !

Specified by:
getProbabilitiesM in class Classifier
Returns:
probabilities matrix.

getProbabilityType

public Classifier.ProbabilityType getProbabilityType()
Description copied from class: Classifier
Get the type of probability returned by a classifier. this will either be NORMALISED, ABSOLUTE or UNAVAILABLE in which case the classifier should still return data (to stop things crashing) but should return arrays / Matrixes with zeros in all columns except the selected item, which should be 1.

Specified by:
getProbabilityType in class Classifier
Returns:
type of probability returned.

runClassification

public int[] runClassification(Jama.Matrix data)
Specified by:
runClassification in class Classifier

setClassifierParams

public boolean setClassifierParams(ClassifierParams classifierParams)
Description copied from class: Classifier
Will be called to load stored parameters into a classifier.

Specified by:
setClassifierParams in class Classifier
Parameters:
classifierParams - classifier parameters.
Returns:
Return true if parameters loaded OK. Reasons for not loading include the classifier being incompatible with the classifier parameters or the parameters not being present (e.t. null matrixes)

trainClassification

public java.lang.String trainClassification(Jama.Matrix matrix,
                                            int[] truth)
Description copied from class: Classifier
/** Train the classifier.

Specified by:
trainClassification in class Classifier
Parameters:
matrix - matrix of training data (each row one training point, each col one parameter
truth - truth
Returns:
null if OK or error string

oneTrainingSet

private Jama.Matrix oneTrainingSet(Jama.Matrix allGroups,
                                   int iGroup,
                                   int[] truth)
Makea matrix of data containing only one group.

Parameters:
allGroups -
iGroup -
truth -
Returns: