public class DUOL extends BaseUpdateableClassifier implements BinaryScoreClassifier, Parameterized
PassiveAggressive
(PA-I) where one
previously learned support vector may be updated upon each addition to the
support vector set. The SV set is unbounded in size. The objective function
is not identical because of the dual updates.
C
value for DUOL has theoretical
improvements, as it increases the number of "strong" dual updates. The
default value is set to 10 as suggested in the paper.
See:Modifier and Type | Field and Description |
---|---|
protected List<Double> |
accelCache |
protected List<Double> |
alphas
Signed weights for each support vector.
|
protected double |
C |
protected List<Double> |
f_s
Cached outputs of the current decision function on each support vector
|
protected KernelTrick |
k
Kernel trick to use
|
protected DoubleList |
kTmp
Stores the values of k(x_i, y) for reuse when observing a new example
|
protected double |
rho |
protected List<Vec> |
S
Set of support vectors
|
Modifier | Constructor and Description |
---|---|
protected |
DUOL(DUOL other)
Copy constructor
|
|
DUOL(KernelTrick k)
Creates a new DUOL learner
|
Modifier and Type | Method and Description |
---|---|
CategoricalResults |
classify(DataPoint data)
Performs classification on the given data point.
|
DUOL |
clone() |
double |
getC()
Returns the aggressiveness parameter
|
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 |
getRho()
Returns the "conflict" parameter value for the threshold of performing double updates
|
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.
|
static Distribution |
guessC(DataSet d)
Guesses the distribution to use for the C parameter
|
void |
setC(double C)
Sets the aggressiveness parameter.
|
void |
setKernel(KernelTrick k)
Sets the kernel trick to use
|
void |
setRho(double rho)
Sets the "conflict" parameter, which controls how often double updates
are performed.
|
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
protected KernelTrick k
protected List<Double> f_s
protected List<Double> alphas
Math.signum(double)
protected DoubleList kTmp
protected double rho
protected double C
public DUOL(KernelTrick k)
k
- the kernel to useprotected DUOL(DUOL other)
other
- the object to copypublic DUOL clone()
clone
in interface BinaryScoreClassifier
clone
in interface Classifier
clone
in interface UpdateableClassifier
clone
in class BaseUpdateableClassifier
public void setC(double C)
C
- the aggressiveness parameter in (0, Inf)public double getC()
public void setRho(double rho)
rho
- the conflict parameter for when to update a second support vectorpublic double getRho()
public void setKernel(KernelTrick k)
k
- the kernel trick to usepublic KernelTrick getKernel()
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 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 static Distribution guessC(DataSet d)
d
- the dataset to get the guess forsetC(double)
public 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.