jsat.classifiers.boosting
Class ModestAdaBoost
- java.lang.Object
-
- jsat.classifiers.boosting.ModestAdaBoost
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, BinaryScoreClassifier, Classifier, Parameterized
public class ModestAdaBoost extends java.lang.Object implements Classifier, Parameterized, BinaryScoreClassifier
Modest Ada Boost is a generalization of Discrete Ada Boost that attempts to reduce the generalization error and avoid over-fitting. Empirically, ModestBoost usually maintains a higher training-set error, and may take more iterations to obtain the same test set error as other algorithms, but doesn't not increase as much after it reaches the minimum error - which should make it easier to obtain the higher accuracy.
See:
Vezhnevets, A.,&Vezhnevets, V. (2005). “Modest AdaBoost” – Teaching AdaBoost to Generalize Better. GraphiCon. Novosibirsk Akademgorodok, Russia. Retrieved from here- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description ModestAdaBoost(Classifier weakLearner, int maxIterations)Creates a new ModestBoost learner
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description CategoricalResultsclassify(DataPoint data)Performs classification on the given data point.ModestAdaBoostclone()intgetMaxIterations()Returns the maximum number of iterations usedjava.util.List<Classifier>getModels()java.util.List<java.lang.Double>getModelWeights()doublegetScore(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.ClassifiergetWeakLearner()Returns the weak learner currently being used by this method.voidsetMaxIterations(int maxIterations)Sets the maximal number of boosting iterations that may be performedvoidsetWeakLearner(Classifier weakLearner)Sets the weak learner used during training.booleansupportsWeightedData()Indicates whether the model knows how to train using weighted data points.voidtrain(ClassificationDataSet dataSet, boolean parallel)Trains the classifier and constructs a model for classification using the given data set.-
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
-
Methods inherited from interface jsat.classifiers.Classifier
train
-
-
-
-
Constructor Detail
-
ModestAdaBoost
public ModestAdaBoost(Classifier weakLearner, int maxIterations)
Creates a new ModestBoost learner- Parameters:
weakLearner- the weak learner to usemaxIterations- the maximum number of boosting iterations
-
-
Method Detail
-
getModels
public java.util.List<Classifier> getModels()
- Returns:
- a list of the models that are in this ensemble.
-
getModelWeights
public java.util.List<java.lang.Double> getModelWeights()
- Returns:
- a list of the models weights that are in this ensemble.
-
getMaxIterations
public int getMaxIterations()
Returns the maximum number of iterations used- Returns:
- the maximum number of iterations used
-
setMaxIterations
public void setMaxIterations(int maxIterations)
Sets the maximal number of boosting iterations that may be performed- Parameters:
maxIterations- the maximum number of iterations
-
getWeakLearner
public Classifier getWeakLearner()
Returns the weak learner currently being used by this method.- Returns:
- the weak learner currently being used by this method.
-
setWeakLearner
public void setWeakLearner(Classifier weakLearner)
Sets the weak learner used during training.- Parameters:
weakLearner- the weak learner to use
-
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
-
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.
-
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- 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.
-
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
-
clone
public ModestAdaBoost clone()
- Specified by:
clonein interfaceBinaryScoreClassifier- Specified by:
clonein interfaceClassifier- Overrides:
clonein classjava.lang.Object
-
-
DataMelt 3.0 © DataMelt by jWork.ORG