jsat.classifiers.boosting
Class LogitBoost
- java.lang.Object
-
- jsat.classifiers.boosting.LogitBoost
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, Classifier, Parameterized
- Direct Known Subclasses:
- LogitBoostPL
public class LogitBoost extends java.lang.Object implements Classifier, Parameterized
An implementation of the original 2 class LogitBoost algorithm. While there is a multi-class description in the original paper, its implementation is congruent with the result of using LogitBoost withOneVSAllclassifier.
LogitBoost differs from its predecessors in that it boostsregressionmodels to create a powerful classifier.
Paper: Special Invited Paper Additive Logistic Regression: A Statistical View of Boosting, By Jerome Friedman, Trevor Hastie and Robert Tibshirani. The Annals of Statistics 2000, Vol. 28, No. 2, 337–407- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description LogitBoost(int M)Creates a new LogitBoost using the standardMultipleLinearRegression.LogitBoost(Regressor baseLearner, int M)Creates a new LogitBoost using the given base 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.LogitBoostclone()intgetMaxIterations()The maximum number of iterations of boosting that may occur.java.util.List<Regressor>getModels()doublegetzMax()Returns the maximum miss-classification penalty used by the algorithm.voidsetMaxIterations(int maxIterations)Sets the maximum number of iterations of boosting that can occur, giving the maximum number of base learners that may be trainedvoidsetzMax(double zMax)Sets the penalty bound for miss-classification of results.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.classifiers.Classifier
train
-
Methods inherited from interface jsat.parameters.Parameterized
getParameter, getParameters
-
-
-
-
Constructor Detail
-
LogitBoost
public LogitBoost(int M)
Creates a new LogitBoost using the standardMultipleLinearRegression.- Parameters:
M- the maximum number of iterations.
-
LogitBoost
public LogitBoost(Regressor baseLearner, int M)
Creates a new LogitBoost using the given base learner.- Parameters:
baseLearner- the weak learner to build an ensemble out of.M- the maximum number of iterations.
-
-
Method Detail
-
getModels
public java.util.List<Regressor> getModels()
- Returns:
- a list of the models that are in this ensemble.
-
setMaxIterations
public void setMaxIterations(int maxIterations)
Sets the maximum number of iterations of boosting that can occur, giving the maximum number of base learners that may be trained- Parameters:
maxIterations- the maximum number of iterations
-
getMaxIterations
public int getMaxIterations()
The maximum number of iterations of boosting that may occur.- Returns:
- maximum number of iterations of boosting that may occur.
-
setzMax
public void setzMax(double zMax)
Sets the penalty bound for miss-classification of results. This also provides numerical stability to the algorithm. The results are not sensitive to this value. The recommended value range is in [2, 4]- Parameters:
zMax- the penalty bound- Throws:
java.lang.ArithmeticException- if the value is not in (0,Double.MAX_VALUE]
-
getzMax
public double getzMax()
Returns the maximum miss-classification penalty used by the algorithm.- Returns:
- the maximum miss-classification
-
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 LogitBoost clone()
- Specified by:
clonein interfaceClassifier- Overrides:
clonein classjava.lang.Object
-
-
DataMelt 3.0 © DataMelt by jWork.ORG