public class PerceptronClassifier extends Object implements IClassifier
| Modifier and Type | Field and Description |
|---|---|
protected PerceptronModel |
model |
| Constructor and Description |
|---|
PerceptronClassifier() |
| Modifier and Type | Method and Description |
|---|---|
void |
loadModel(InputStream inputStream) |
void |
onlineTrain(double[] x,
int labelIndex)
public use for doing one training sample.
|
void |
persistModel(String modelFile) |
Map<String,Double> |
predict(Tuple predict)
Do a prediction.
|
void |
setParameter(Properties props) |
IClassifier |
train(List<Tuple> trainingData) |
protected PerceptronModel model
public void onlineTrain(double[] x,
int labelIndex)
x - Feature VectorlabelIndex - label's index, from PerceptronModel.LabelIndexerpublic IClassifier train(List<Tuple> trainingData)
train in interface IClassifierpublic Map<String,Double> predict(Tuple predict)
predict in interface IClassifierpredict - predict tuple.public void setParameter(Properties props)
setParameter in interface IClassifierpublic void persistModel(String modelFile) throws IOException
persistModel in interface IClassifierIOExceptionpublic void loadModel(InputStream inputStream)
loadModel in interface IClassifierCopyright © 2016. All rights reserved.