|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectclassifier.Classifier
public abstract class Classifier
Interface for fragment classification. Hopefully, a number of different classifiers will be incorporated and each will work under this general interface.
Assume that each classifier will be able to return 0 - n-1 different species classifications. They will provide a list of which species correspond to those numbers. -1 (for nothing I recognise) will also be a valid classification result.
these classifiers are not thread safe. e.g. When running classifiers, it's likely that you will call one of the runClassification functions which will return the most likely result, but you may follow this up with subsequent calls to getLogLikelyhood() and getProbability() to get more information about individual group probabilities.
| Nested Class Summary | |
|---|---|
static class |
Classifier.ProbabilityType
Type of probability that will be returned by this classifier. |
| Constructor Summary | |
|---|---|
Classifier()
|
|
| Method Summary | |
|---|---|
abstract java.lang.String |
getClassifierName()
|
abstract ClassifierParams |
getClassifierParams()
Will get called AFTER classifier training to get classifier specific parameters. |
double[] |
getLogLikelihoods1()
Get an array of log likelihoods from the most recent call to runClassification(double[] ); |
double[][] |
getLogLikelihoods2()
Get a double array of log likelihoods from the most recent call to runClassification(double[][] ); |
abstract Jama.Matrix |
getLogLikelihoodsM()
Get a matrix of log likelihoods from the most recent call to RunClassification(Matrix ) |
double[] |
getProbabilities1()
Get an array of probabilities from the most recent call to runClassification(double[] ); |
double[][] |
getProbabilities2()
Get a double array of probabilities from the most recent call to runClassification(double[][] ); |
abstract Jama.Matrix |
getProbabilitiesM()
Get a matrix of probabilities from the most recent call to RunClassification(Matrix ) |
abstract Classifier.ProbabilityType |
getProbabilityType()
Get the type of probability returned by a classifier. |
int |
runClassification(double[] params)
Run the classification on single parameter value. |
int[] |
runClassification(double[][] params)
Run classification on multiple parameter values. |
abstract int[] |
runClassification(Jama.Matrix data)
|
abstract boolean |
setClassifierParams(ClassifierParams classifierParams)
Will be called to load stored parameters into a classifier. |
java.lang.String |
toString()
|
java.lang.String |
trainClassification(double[][] params,
int[] group)
Train the classifier. |
abstract java.lang.String |
trainClassification(Jama.Matrix matrix,
int[] group)
/** Train the classifier. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Classifier()
| Method Detail |
|---|
public abstract ClassifierParams getClassifierParams()
public abstract boolean setClassifierParams(ClassifierParams classifierParams)
classifierParams - classifier parameters.
public int runClassification(double[] params)
Return true if the classification completed OK, false otherwise. The classification results can be obtained through calls to getClassLikelyhoods() and getBestSpeciesBet();
params - array of input parameters
public int[] runClassification(double[][] params)
params - array of input parameters
public abstract int[] runClassification(Jama.Matrix data)
public double[] getLogLikelihoods1()
This version will return a single row of data, which should be from a single classification
public double[][] getLogLikelihoods2()
This version will return a 2D array of data, which should be from a set of classifications
public abstract Jama.Matrix getLogLikelihoodsM()
This version will return a matrix of data, which should be from a set of classifications.
public double[] getProbabilities1()
This version will return a single row of data, which should be from a single classification
public double[][] getProbabilities2()
This version will return a 2D array of data, which should be from a set of classifications
public abstract Jama.Matrix getProbabilitiesM()
This version will return a matrix of data, which should be from a set of classifications.
public abstract Classifier.ProbabilityType getProbabilityType()
public java.lang.String trainClassification(double[][] params,
int[] group)
params - double array of input data, each row representing one
training value, and each column one parameter value.truth -
public abstract java.lang.String trainClassification(Jama.Matrix matrix,
int[] group)
params - double array of input data, each row representing one
training value, and each column one parameter value.matrix - matrix of training data (each row one training point, each col one parametergroup - truth
public java.lang.String toString()
toString in class java.lang.Objectpublic abstract java.lang.String getClassifierName()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||