![]() | [using it] | Interface Manipulation Package v4.0 (2008-06-25) | ![]() | ©copyright | ![]() |
java.lang.Objectimp.classifier.Classifier
public class Classifier
Defines a numerical data classifier.
Nested Class Summary | |
---|---|
static class |
Classifier.Data
Defines a classifier data set. |
Constructor Summary | |
---|---|
Classifier()
Constructs a raw-classifier (nearest-neighbor classifier). |
Method Summary | |
---|---|
Classifier |
add(double[] data,
String category,
double prob)
Add a data calibration sample and return this. |
String |
getCategory(double[] data)
Get the category for a given input. |
Classifier.Data |
getData()
Returns the current calibration data set. |
int |
getIndex(double[] data)
Performs a classification This method is called when a data category is requested. |
double |
getMargin(double[] data,
String category)
Estimates the margin of a given sample. |
String |
getName(int index)
Gets the name of a category. |
String |
toString()
Returns a string view of this classifier as a XML text with some classifier properties. |
void |
train(Classifier.Data data)
Performs the classifier training This method is automatically called, after calibration samples have been added and
before the next data category request. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Classifier()
Method Detail |
---|
public final Classifier add(double[] data, String category, double prob)
data
- calibration input value.category
- [optional, default is ""] category name or "" if the category is undefined.prob
- [optional, default is 1] Sample precision probability: 1 for an exact sample, 0 for an undefined sample.public final String getCategory(double[] data)
data
- data input value.
public Classifier.Data getData()
public int getIndex(double[] data)
data
- data input value.
public double getMargin(double[] data, String category)
data
- sample data.category
- sample category.
public String getName(int index)
index
- The category index.
public String toString()
toString
in class Object
public void train(Classifier.Data data)
data
- [optional, default is the current calibration data set] The calibration data set to be used to train the classifier.