public class LibLinearClassifier extends Object implements Classifier
Constructor and Description |
---|
LibLinearClassifier(de.bwaldvogel.liblinear.SolverType solverType) |
Modifier and Type | Method and Description |
---|---|
ClassificationResult |
classify(DataPoint data)
Classify the given DataPoint.
|
double |
getC() |
double |
getEpsilon() |
FeatureDictionary |
getFeatureDictionary()
Returns the FeatureDictionary for this Classifier.
|
de.bwaldvogel.liblinear.Model |
getTrainedModel() |
boolean |
isSilentCorrect()
LibLinear has a nasty habit of outputting the wrong confidence.
|
void |
readParameters(Reader parameterIn,
Reader featuresIn)
Override the current parameters with the ones given in the Reader.
|
void |
setC(double C) |
void |
setEpsilon(double epsilon) |
void |
setSilentCorrect(boolean silentCorrect)
LibLinear has a nasty habit of outputting the wrong confidence.
|
void |
train(ArrayList<LabeledDataPoint> trainingData)
Adjust the classifier parameters according to the given training data.
|
void |
writeParamters(Writer parameterOut,
Writer featuresOut)
Write the current parameters and features of the classifier to the given
Writer.
|
public LibLinearClassifier(de.bwaldvogel.liblinear.SolverType solverType)
public void setC(double C)
public void setEpsilon(double epsilon)
public double getC()
public double getEpsilon()
public de.bwaldvogel.liblinear.Model getTrainedModel()
public FeatureDictionary getFeatureDictionary()
Classifier
getFeatureDictionary
in interface Classifier
public boolean isSilentCorrect()
public void setSilentCorrect(boolean silentCorrect)
silentCorrect
- true if the correction shall be done silently.public void train(ArrayList<LabeledDataPoint> trainingData)
train
in interface Classifier
trainingData
- a list of LabeledDataPoints. The user has to assure
that the training data points stem from a consistent data set.public ClassificationResult classify(DataPoint data)
classify
in interface Classifier
data
- a DataPoint.public void writeParamters(Writer parameterOut, Writer featuresOut) throws IOException
writeParamters
in interface Classifier
parameterOut
- a Writer for the parameters.featuresOut
- a Writer for the features.IOException
public void readParameters(Reader parameterIn, Reader featuresIn) throws IOException
readParameters
in interface Classifier
parameterIn
- a Reader containing parameter data.featuresIn
- a Reader containing the fitting feature data.IOException
Copyright © 2014. All rights reserved.