public class Forgetron extends BaseUpdateableClassifier implements BinaryScoreClassifier, Parameterized
Perceptron
that maintains a fixed sized
buffer of data instances that it uses to form its decision boundary.
Modifier | Constructor and Description |
---|---|
protected |
Forgetron(Forgetron toClone)
Copy constructor
|
|
Forgetron(KernelTrick kernel,
int budget)
Creates a new Forgetron
|
Modifier and Type | Method and Description |
---|---|
CategoricalResults |
classify(DataPoint data)
Performs classification on the given data point.
|
Forgetron |
clone() |
int |
getBudget()
Returns the current budget
|
KernelTrick |
getKernelTrick()
Returns the current kernel trick
|
Parameter |
getParameter(String paramName)
Returns the parameter with the given name.
|
List<Parameter> |
getParameters()
Returns the list of parameters that can be altered for this learner.
|
double |
getScore(DataPoint dp)
Returns the numeric score for predicting a class of a given data point,
where the sign of the value indicates which class the data point is
predicted to belong to.
|
boolean |
isSelfTuned() |
void |
setBudget(int budget)
Sets the new budget, which is the maximum number of data points the
Forgetron can use to form its decision boundary.
|
void |
setKernelTrick(KernelTrick K)
Sets the kernel trick to use
|
void |
setSelfTurned(boolean selfTurned)
Sets whether or not the self-tuned variant of the Forgetron is used, the
default is
true |
void |
setUp(CategoricalData[] categoricalAttributes,
int numericAttributes,
CategoricalData predicting)
Prepares the classifier to begin learning from its
UpdateableClassifier.update(jsat.classifiers.DataPoint, int) method. |
boolean |
supportsWeightedData()
Indicates whether the model knows how to train using weighted data points.
|
void |
update(DataPoint dataPoint,
int targetClass)
Updates the classifier by giving it a new data point to learn from.
|
getEpochs, setEpochs, trainC, trainC, trainEpochs
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
trainC, trainC
public Forgetron(KernelTrick kernel, int budget)
kernel
- the kernel function to usebudget
- the maximum number of data points to useprotected Forgetron(Forgetron toClone)
toClone
- the forgetron to clonepublic void setSelfTurned(boolean selfTurned)
true
selfTurned
- true
to use the self-tuned variance,
false
otherwise.public boolean isSelfTuned()
true
if the self-tuned variant is used, false
otherwise.public void setBudget(int budget)
budget
- the maximum number of data points to usepublic int getBudget()
public void setKernelTrick(KernelTrick K)
K
- the kernel trick to usepublic KernelTrick getKernelTrick()
public CategoricalResults classify(DataPoint data)
Classifier
classify
in interface Classifier
data
- the data point to classifypublic double getScore(DataPoint dp)
BinaryScoreClassifier
getScore
in interface BinaryScoreClassifier
dp
- the data point to predict the class label ofpublic boolean supportsWeightedData()
Classifier
supportsWeightedData
in interface Classifier
public Forgetron clone()
clone
in interface BinaryScoreClassifier
clone
in interface Classifier
clone
in interface UpdateableClassifier
clone
in class BaseUpdateableClassifier
public void setUp(CategoricalData[] categoricalAttributes, int numericAttributes, CategoricalData predicting)
UpdateableClassifier
UpdateableClassifier.update(jsat.classifiers.DataPoint, int)
method.setUp
in interface UpdateableClassifier
categoricalAttributes
- an array containing the categorical
attributes that will be in each data pointnumericAttributes
- the number of numeric attributes that will be in
each data pointpredicting
- the information for the target class that will be
predictedpublic void update(DataPoint dataPoint, int targetClass)
UpdateableClassifier
update
in interface UpdateableClassifier
dataPoint
- the data point to learntargetClass
- the target class of the data pointpublic List<Parameter> getParameters()
Parameterized
getParameters
in interface Parameterized
public Parameter getParameter(String paramName)
Parameterized
getParameter
in interface Parameterized
paramName
- the name of the parameter to obtainCopyright © 2017. All rights reserved.