jsat.classifiers.svm.extended
Class AMM
- java.lang.Object
-
- jsat.classifiers.BaseUpdateableClassifier
-
- jsat.classifiers.svm.extended.OnlineAMM
-
- jsat.classifiers.svm.extended.AMM
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, Classifier, UpdateableClassifier, Parameterized
public class AMM extends OnlineAMM
This is the batch variant of the Adaptive Multi-Hyperplane Machine (AMM) algorithm. It is related to linear SVMs where instead of having only a single weight vector, it is extended to multi-class problems by giving each class its own weight vector. It is further extended by allowing each class to dynamically add new weight vectors to increase the non-linearity of the solution.
This algorithm works best for problems with a very large number of data points where traditional kernelized SVMs are prohibitively expensive to train due to computational cost.
While the AMM trained in a batch setting can continue to be updated in an online fashion, the accuracy may reduce if done. This is because only the batch variant will reach a local optima.
For this version theBaseUpdateableClassifier.setEpochs(int)method controls the total number of iterations of the learning algorithm. A small value in [5, 20] should be sufficient.
See:- Wang, Z., Djuric, N., Crammer, K., & Vucetic, S. (2011). Trading representability for scalability Adaptive Multi-Hyperplane Machine for nonlinear Classification. In Proceedings of the 17th ACM SIGKDD international conference on Knowledge discovery and data mining - KDD ’11 (p. 24). New York, New York, USA: ACM Press. doi:10.1145/2020408.2020420
- Djuric, N., Lan, L., Vucetic, S., & Wang, Z. (2014). BudgetedSVM: A Toolbox for Scalable SVM Approximations. Journal of Machine Learning Research, 14, 3813–3817. Retrieved from here
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class jsat.classifiers.svm.extended.OnlineAMM
DEFAULT_CLASS_BUDGET, DEFAULT_PRUNE_CONSTANT, DEFAULT_PRUNE_FREQUENCY, DEFAULT_REGULARIZER
-
-
Constructor Summary
Constructors Constructor and Description AMM()Creates a new batch AMM learnerAMM(AMM toCopy)Copy constructorAMM(double lambda)Creates a new batch AMM learnerAMM(double lambda, int classBudget)Creates a new batch AMM learner
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description AMMclone()intgetSubEpochs()Returns the number of passes through the data set done on each iterationvoidsetSubEpochs(int subEpochs)Each iteration of the batch AMM algorithm requires at least one epoch over the training set.voidtrain(ClassificationDataSet dataSet)Trains the classifier and constructs a model for classification using the given data set.voidtrain(ClassificationDataSet dataSet, boolean parallel)Trains the classifier and constructs a model for classification using the given data set.-
Methods inherited from class jsat.classifiers.svm.extended.OnlineAMM
classify, getC, getClassBudget, getLambda, getPruneFrequency, guessLambda, setC, setClassBudget, setLambda, setPruneFrequency, setUp, supportsWeightedData, update
-
Methods inherited from class jsat.classifiers.BaseUpdateableClassifier
getEpochs, setEpochs, trainEpochs
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jsat.parameters.Parameterized
getParameter, getParameters
-
-
-
-
Constructor Detail
-
AMM
public AMM()
Creates a new batch AMM learner
-
AMM
public AMM(double lambda)
Creates a new batch AMM learner- Parameters:
lambda- the regularization value to use
-
AMM
public AMM(double lambda, int classBudget)Creates a new batch AMM learner- Parameters:
lambda- the regularization value to useclassBudget- the maximum number of weight vectors for each class
-
AMM
public AMM(AMM toCopy)
Copy constructor- Parameters:
toCopy- the object to copy
-
-
Method Detail
-
setSubEpochs
public void setSubEpochs(int subEpochs)
Each iteration of the batch AMM algorithm requires at least one epoch over the training set. This control how many epochs make up each iteration of training.- Parameters:
subEpochs- the number passes through the training set done on each iteration of training
-
getSubEpochs
public int getSubEpochs()
Returns the number of passes through the data set done on each iteration- Returns:
- the number of passes through the data set done on each iteration
-
train
public void train(ClassificationDataSet dataSet, boolean parallel)
Description copied from interface:ClassifierTrains the classifier and constructs a model for classification using the given data set. If the training method knows how, it will used the threadPool to conduct training in parallel. This method will block until the training has completed.- Specified by:
trainin interfaceClassifier- Overrides:
trainin classBaseUpdateableClassifier- Parameters:
dataSet- the data set to train onparallel-trueif multiple threads should be used to train the model.falseif it should be done in a single threaded manner.
-
train
public void train(ClassificationDataSet dataSet)
Description copied from interface:ClassifierTrains the classifier and constructs a model for classification using the given data set.- Specified by:
trainin interfaceClassifier- Overrides:
trainin classBaseUpdateableClassifier- Parameters:
dataSet- the data set to train on
-
clone
public AMM clone()
- Specified by:
clonein interfaceClassifier- Specified by:
clonein interfaceUpdateableClassifier- Overrides:
clonein classOnlineAMM
-
-
DataMelt 3.0 © DataMelt by jWork.ORG