public class Projectron extends BaseUpdateableClassifier implements BinaryScoreClassifier, Parameterized
Perceptron
that bound the number of
support vectors used, with the latter incorporating some similarities from
PassiveAggressive
. setEta(double)
.
Modifier | Constructor and Description |
---|---|
|
Projectron(KernelTrick k)
Creates a new Projectron++ learner
|
|
Projectron(KernelTrick k,
double eta)
Creates a new Projectron++ learner
|
|
Projectron(KernelTrick k,
double eta,
boolean useMarginUpdates)
Creates a new Projectron learner
|
protected |
Projectron(Projectron toCopy)
Copy constructor
|
Modifier and Type | Method and Description |
---|---|
CategoricalResults |
classify(DataPoint data)
Performs classification on the given data point.
|
Projectron |
clone() |
double |
getEta()
Returns the sparsity parameter value
|
KernelTrick |
getKernel()
Returns the kernel trick in use
|
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 |
isUseMarginUpdates()
Returns
true if margin errors can cause updates, false if
not. |
void |
setEta(double eta)
Sets the η parameter which controls the sparsity of the Projection
solution.
|
void |
setKernel(KernelTrick k)
Sets the kernel trick to be used
|
void |
setUp(CategoricalData[] categoricalAttributes,
int numericAttributes,
CategoricalData predicting)
Prepares the classifier to begin learning from its
UpdateableClassifier.update(jsat.classifiers.DataPoint, int) method. |
void |
setUseMarginUpdates(boolean useMarginUpdates)
Sets whether or not projection updates will be performed for margin
errors.
|
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 Projectron(KernelTrick k)
k
- the kernel to usepublic Projectron(KernelTrick k, double eta)
k
- the kernel to useeta
- the sparsity parameterpublic Projectron(KernelTrick k, double eta, boolean useMarginUpdates)
k
- the kernel to useeta
- the sparsity parameteruseMarginUpdates
- whether or not to perform projection updates on
margin errorsprotected Projectron(Projectron toCopy)
toCopy
- the object to copypublic void setKernel(KernelTrick k)
k
- the kernel trick to be usepublic KernelTrick getKernel()
public void setEta(double eta)
setUseMarginUpdates(boolean)
is
false
, the Projectron degenerates into the standard kernelized
Perceptron.eta
- the sparsity parameter in [0, Infinity)public double getEta()
public void setUseMarginUpdates(boolean useMarginUpdates)
true
, this behaves as the Projectrion++ algorithm. If
false
, the behavior is equal to the standard Projectron.useMarginUpdates
- true
to perform updates on margin errorspublic boolean isUseMarginUpdates()
true
if margin errors can cause updates, false
if
not.true
if margin errors can cause updates, false
if
not.public Projectron 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 CategoricalResults classify(DataPoint data)
Classifier
classify
in interface Classifier
data
- the data point to classifypublic boolean supportsWeightedData()
Classifier
supportsWeightedData
in interface Classifier
public double getScore(DataPoint dp)
BinaryScoreClassifier
getScore
in interface BinaryScoreClassifier
dp
- the data point to predict the class label ofpublic 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.