public class Wagging extends Object implements Classifier, Regressor, Parameterized
Bagging
. Instead
training on re-sampled data sets, it trains on randomly re-weighted data
sets. The weight of each point is selected at random from a specified
distribution, and set to zero if negative.
Modifier | Constructor and Description |
---|---|
|
Wagging(ContinuousDistribution dist,
Classifier weakL,
int iterations)
Creates a new Wagging classifier
|
|
Wagging(ContinuousDistribution dist,
Regressor weakR,
int iterations)
Creates a new Wagging regressor
|
protected |
Wagging(Wagging clone)
Copy constructor
|
Modifier and Type | Method and Description |
---|---|
CategoricalResults |
classify(DataPoint data)
Performs classification on the given data point.
|
Wagging |
clone() |
ContinuousDistribution |
getDistribution()
Returns the distribution used for weight sampling
|
int |
getIterations()
Returns the number of iterations to create weak learners
|
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.
|
Classifier |
getWeakClassifier()
Returns the weak learner used for classification.
|
Regressor |
getWeakRegressor()
Returns the weak learner used for regression
|
double |
regress(DataPoint data) |
void |
setDistribution(ContinuousDistribution dist)
Sets the distribution to select the random weights from
|
void |
setIterations(int iterations)
Sets the number of iterations to create weak learners
|
void |
setWeakLearner(Classifier weakL)
Sets the weak learner used for classification.
|
void |
setWeakLearner(Regressor weakR)
Sets the weak learner used for regressions .
|
boolean |
supportsWeightedData()
Indicates whether the model knows how to train using weighted data points.
|
void |
train(RegressionDataSet dataSet) |
void |
train(RegressionDataSet dataSet,
ExecutorService threadPool) |
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.
|
public Wagging(ContinuousDistribution dist, Classifier weakL, int iterations)
dist
- the distribution to select weights fromweakL
- the weak learner to useiterations
- the number of iterations to performpublic Wagging(ContinuousDistribution dist, Regressor weakR, int iterations)
dist
- the distribution to select weights fromweakR
- the weak learner to useiterations
- the number of iterations to performprotected Wagging(Wagging clone)
clone
- the one to clonepublic void setWeakLearner(Classifier weakL)
weakL
- the weak learner to usepublic Classifier getWeakClassifier()
public void setWeakLearner(Regressor weakR)
weakR
- the weak learner to usepublic Regressor getWeakRegressor()
public void setIterations(int iterations)
iterations
- the number of iterations to performpublic int getIterations()
public void setDistribution(ContinuousDistribution dist)
dist
- the distribution to usepublic ContinuousDistribution getDistribution()
public 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
supportsWeightedData
in interface Regressor
public void train(RegressionDataSet dataSet, ExecutorService threadPool)
public void train(RegressionDataSet dataSet)
public Wagging clone()
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.