public class EmphasisBoost extends Object implements Classifier, Parameterized, BinaryScoreClassifier
λ
term
to control the trade off. With λ = 1/2, it becomes equivalent to Real
AdaBoost. If the weak learner does not support confidence outputs (non-hard
decisions), then it further becomes equivalent to Discrete Ada Boost. 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 |
---|---|
|
EmphasisBoost()
Creates a new EmphasisBooster with shallow decision trees and λ = 0.35
|
|
EmphasisBoost(Classifier weakLearner,
int maxIterations,
double lambda)
Creates a new EmphasisBoost learner
|
protected |
EmphasisBoost(EmphasisBoost toClone)
Copy constructor
|
Modifier and Type | Method and Description |
---|---|
CategoricalResults |
classify(DataPoint data)
Performs classification on the given data point.
|
EmphasisBoost |
clone() |
double |
getLambda()
Returns the value of the λ trade off parameter
|
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.
|
static Distribution |
guessLambda(DataSet d)
Guesses the distribution to use for the λ parameter
|
void |
setLambda(double lambda)
λ controls the trade off between weighting the errors based on
their distance to the margin and the quadratic error of the output.
|
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 EmphasisBoost()
public EmphasisBoost(Classifier weakLearner, int maxIterations, double lambda)
weakLearner
- the weak learner to usemaxIterations
- the maximum number of boosting iterationslambda
- the trade off parameter in [0, 1]protected EmphasisBoost(EmphasisBoost 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 static Distribution guessLambda(DataSet d)
d
- the dataset to get the guess forsetLambda(double)
public void setLambda(double lambda)
lambda
- the trade off parameter in [0, 1]public double getLambda()
public 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 EmphasisBoost 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.