jsat.classifiers.linear.kernelized
Class DUOL
- java.lang.Object
-
- jsat.classifiers.BaseUpdateableClassifier
-
- jsat.classifiers.linear.kernelized.DUOL
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, BinaryScoreClassifier, Classifier, UpdateableClassifier, Parameterized
public class DUOL extends BaseUpdateableClassifier implements BinaryScoreClassifier, Parameterized
Provides an implementation of Double Update Online Learning (DUOL) algorithm. It is a kernelized extension ofPassiveAggressive(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.
Using a largerCvalue 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:
- Zhao, P., Hoi, S. C. H.,&Jin, R. (2011). Double Updating Online Learning. Journal of Machine Learning Research, 12, 1587–1615. Retrieved from here
- Zhao, P., Hoi, S. C. H.,&Jin, R. (2009). DUOL: A Double Updating Approach for Online Learning. In Y. Bengio, D. Schuurmans, J. Lafferty, C. K. I. Williams,&A. Culotta (Eds.), Advances in Neural Information Processing Systems 22 (pp. 2259–2267).
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description DUOL(KernelTrick k)Creates a new DUOL learner
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description CategoricalResultsclassify(DataPoint data)Performs classification on the given data point.DUOLclone()doublegetC()Returns the aggressiveness parameterKernelTrickgetKernel()Returns the kernel trick in usedoublegetRho()Returns the "conflict" parameter value for the threshold of performing double updatesdoublegetScore(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 DistributionguessC(DataSet d)Guesses the distribution to use for the C parametervoidsetC(double C)Sets the aggressiveness parameter.voidsetKernel(KernelTrick k)Sets the kernel trick to usevoidsetRho(double rho)Sets the "conflict" parameter, which controls how often double updates are performed.voidsetUp(CategoricalData[] categoricalAttributes, int numericAttributes, CategoricalData predicting)Prepares the classifier to begin learning from itsUpdateableClassifier.update(jsat.classifiers.DataPoint, int)method.booleansupportsWeightedData()Indicates whether the model knows how to train using weighted data points.voidupdate(DataPoint dataPoint, int targetClass)Updates the classifier by giving it a new data point to learn from.-
Methods inherited from class jsat.classifiers.BaseUpdateableClassifier
getEpochs, setEpochs, train, train, trainEpochs
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jsat.classifiers.Classifier
train, train
-
Methods inherited from interface jsat.parameters.Parameterized
getParameter, getParameters
-
-
-
-
Constructor Detail
-
DUOL
public DUOL(KernelTrick k)
Creates a new DUOL learner- Parameters:
k- the kernel to use
-
-
Method Detail
-
clone
public DUOL clone()
- Specified by:
clonein interfaceBinaryScoreClassifier- Specified by:
clonein interfaceClassifier- Specified by:
clonein interfaceUpdateableClassifier- Specified by:
clonein classBaseUpdateableClassifier
-
setC
public void setC(double C)
Sets the aggressiveness parameter. Increasing the value of this parameter increases the aggressiveness of the algorithm. It must be a positive value. This parameter essentially performs a type of regularization on the updates- Parameters:
C- the aggressiveness parameter in (0, Inf)
-
getC
public double getC()
Returns the aggressiveness parameter- Returns:
- the aggressiveness parameter
-
setRho
public void setRho(double rho)
Sets the "conflict" parameter, which controls how often double updates are performed. Smaller (near zero) values tend to produce more double updates, with values near 1 producing few double updates. The value must be in the range [0, 1]- Parameters:
rho- the conflict parameter for when to update a second support vector
-
getRho
public double getRho()
Returns the "conflict" parameter value for the threshold of performing double updates- Returns:
- the "conflict" parameter value for the threshold of performing double updates
-
setKernel
public void setKernel(KernelTrick k)
Sets the kernel trick to use- Parameters:
k- the kernel trick to use
-
getKernel
public KernelTrick getKernel()
Returns the kernel trick in use- Returns:
- the kernel trick in use
-
setUp
public void setUp(CategoricalData[] categoricalAttributes, int numericAttributes, CategoricalData predicting)
Description copied from interface:UpdateableClassifierPrepares the classifier to begin learning from itsUpdateableClassifier.update(jsat.classifiers.DataPoint, int)method.- Specified by:
setUpin interfaceUpdateableClassifier- Parameters:
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 predicted
-
update
public void update(DataPoint dataPoint, int targetClass)
Description copied from interface:UpdateableClassifierUpdates the classifier by giving it a new data point to learn from.- Specified by:
updatein interfaceUpdateableClassifier- Parameters:
dataPoint- the data point to learntargetClass- the target class of the data point
-
classify
public CategoricalResults classify(DataPoint data)
Description copied from interface:ClassifierPerforms classification on the given data point.- Specified by:
classifyin interfaceClassifier- Parameters:
data- the data point to classify- Returns:
- the results of the classification.
-
getScore
public double getScore(DataPoint dp)
Description copied from interface:BinaryScoreClassifierReturns 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.- Specified by:
getScorein interfaceBinaryScoreClassifier- Parameters:
dp- the data point to predict the class label of- Returns:
- the score for the given data point
-
supportsWeightedData
public boolean supportsWeightedData()
Description copied from interface:ClassifierIndicates whether the model knows how to train using weighted data points. If it does, the model will train assuming the weights. The values returned by this method may change depending on the parameters set for the model.- Specified by:
supportsWeightedDatain interfaceClassifier- Returns:
- true if the model supports weighted data, false otherwise
-
guessC
public static Distribution guessC(DataSet d)
Guesses the distribution to use for the C parameter- Parameters:
d- the dataset to get the guess for- Returns:
- the guess for the C parameter
- See Also:
setC(double)
-
-
DataMelt 3.0 © DataMelt by jWork.ORG