|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SavableClassifier
Savable classifier returns a model (an object of a Serializable class), so that the classifier may be persisted and loaded back to memory for use.
Classifier
Method Summary | |
---|---|
int[] |
classifyUsingModel(java.lang.Object model,
float[][] testingPatterns,
double[] prob)
Classifies the internal model using multiple testing patterns |
int |
classifyUsingModel(java.lang.Object model,
float[] testingPattern,
double[] prob)
Classifies the internal model using one testing pattern |
java.lang.Object |
getModel()
Gets the internal model from the classifier |
java.lang.Object |
loadModel(java.lang.String model_file_name)
Loads a previously saved model back into the classifier. |
void |
saveModel(java.lang.Object trainedModel,
java.lang.String model_file_name)
Saves a specified model to a specified file |
void |
setModel(java.lang.Object model)
Sets an internal model to be used by the classifier |
java.lang.Object |
trainingOnly(float[][] trainingpatterns,
int[] trainingtargets)
Trains and returns an internal model using a training set. |
Methods inherited from interface annotool.classify.Classifier |
---|
classify, doesSupportProbability, setParameters |
Method Detail |
---|
java.lang.Object trainingOnly(float[][] trainingpatterns, int[] trainingtargets) throws java.lang.Exception
trainingpatterns
- Pattern data to train the algorithmtrainingtargets
- Targets for the training pattern
java.lang.Exception
- Optional, generic exception to be thrownjava.lang.Object getModel()
void setModel(java.lang.Object model) throws java.lang.Exception
model
- Model to be used by the classifier
java.lang.Exception
- Exception thrown if model is incompatibleint classifyUsingModel(java.lang.Object model, float[] testingPattern, double[] prob) throws java.lang.Exception
model
- Model to be used by the classifiertestingPattern
- Pattern data to be classifiedprob
- Storage for probability result
java.lang.Exception
- Exception thrown if model is incompatibleint[] classifyUsingModel(java.lang.Object model, float[][] testingPatterns, double[] prob) throws java.lang.Exception
model
- Model to be used by the classifiertestingPatterns
- Pattern data to be classifiedprob
- Storage for probability result
java.lang.Exception
- Exception thrown if model is incompatiblevoid saveModel(java.lang.Object trainedModel, java.lang.String model_file_name) throws java.io.IOException
trainedModel
- Trained model that is to be savedmodel_file_name
- Name of the file to be saved to
java.lang.Exception
- Exception thrown if model cannot be saved
java.io.IOException
java.lang.Object loadModel(java.lang.String model_file_name) throws java.io.IOException
model_file_name
- Name of the file to be loaded
java.lang.Exception
- Exception thrown if file cannot be found
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |