public class ModestAdaBoost extends Object implements Classifier, Parameterized, BinaryScoreClassifier
Modifier and Type | Field and Description |
---|---|
protected List<Classifier> |
hypoths
The list of weak hypothesis
|
protected List<Double> |
hypWeights
The weights for each weak learner
|
protected CategoricalData |
predicting |
Modifier | Constructor and Description |
---|---|
|
ModestAdaBoost(Classifier weakLearner,
int maxIterations)
Creates a new ModestBoost learner
|
protected |
ModestAdaBoost(ModestAdaBoost toClone)
Copy constructor
|
Modifier and Type | Method and Description |
---|---|
CategoricalResults |
classify(DataPoint data)
Performs classification on the given data point.
|
ModestAdaBoost |
clone() |
int |
getMaxIterations()
Returns the maximum number of iterations used
|
List<Classifier> |
getModels() |
List<Double> |
getModelWeights() |
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 |
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.
|
Classifier |
getWeakLearner()
Returns the weak learner currently being used by this method.
|
void |
setMaxIterations(int maxIterations)
Sets the maximal number of boosting iterations that may be performed
|
void |
setWeakLearner(Classifier weakLearner)
Sets the weak learner used during training.
|
boolean |
supportsWeightedData()
Indicates whether the model knows how to train using weighted data points.
|
void |
trainC(ClassificationDataSet dataSet)
Trains the classifier and constructs a model for classification using the
given data set.
|
void |
trainC(ClassificationDataSet dataSet,
ExecutorService threadPool)
Trains the classifier and constructs a model for classification using the
given data set.
|
protected List<Classifier> hypoths
protected CategoricalData predicting
public ModestAdaBoost(Classifier weakLearner, int maxIterations)
weakLearner
- the weak learner to usemaxIterations
- the maximum number of boosting iterationsprotected ModestAdaBoost(ModestAdaBoost toClone)
toClone
- the object to clonepublic List<Classifier> getModels()
public List<Double> getModelWeights()
public int getMaxIterations()
public void setMaxIterations(int maxIterations)
maxIterations
- the maximum number of iterationspublic Classifier getWeakLearner()
public void setWeakLearner(Classifier weakLearner)
weakLearner
- the weak learner to usepublic double getScore(DataPoint dp)
BinaryScoreClassifier
getScore
in interface BinaryScoreClassifier
dp
- the data point to predict the class label ofpublic CategoricalResults classify(DataPoint data)
Classifier
classify
in interface Classifier
data
- the data point to classifypublic void trainC(ClassificationDataSet dataSet, ExecutorService threadPool)
Classifier
trainC
in interface Classifier
dataSet
- the data set to train onthreadPool
- the source of threads to use.public void trainC(ClassificationDataSet dataSet)
Classifier
trainC
in interface Classifier
dataSet
- the data set to train onpublic boolean supportsWeightedData()
Classifier
supportsWeightedData
in interface Classifier
public ModestAdaBoost clone()
clone
in interface BinaryScoreClassifier
clone
in interface Classifier
clone
in class Object
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.