public class UpdatableStacking extends Object implements UpdateableClassifier, UpdateableRegressor
LinearBatch
)
is used, which translates to learning a weighted vote of the classifier
outputs. However any classifier may be used so long as it supports the
desired target type. weighted data instances
if
the aggregating model does.
Constructor and Description |
---|
UpdatableStacking(UpdatableStacking toCopy)
Copy constructor
|
UpdatableStacking(UpdateableClassifier aggregatingClassifier,
List<UpdateableClassifier> baseClassifiers)
Creates a new Stacking classifier
|
UpdatableStacking(UpdateableClassifier aggregatingClassifier,
UpdateableClassifier... baseClassifiers)
Creates a new Stacking classifier.
|
UpdatableStacking(UpdateableRegressor aggregatingRegressor,
List<UpdateableRegressor> baseRegressors)
Creates a new Stacking regressor
|
UpdatableStacking(UpdateableRegressor aggregatingRegressor,
UpdateableRegressor... baseRegressors)
Creates a new Stacking regressor.
|
Modifier and Type | Method and Description |
---|---|
CategoricalResults |
classify(DataPoint data)
Performs classification on the given data point.
|
UpdatableStacking |
clone() |
double |
regress(DataPoint data) |
void |
setUp(CategoricalData[] categoricalAttributes,
int numericAttributes)
Prepares the classifier to begin learning from its
UpdateableRegressor.update(jsat.classifiers.DataPoint, double) method. |
void |
setUp(CategoricalData[] categoricalAttributes,
int numericAttributes,
CategoricalData predicting)
Prepares the classifier to begin learning from its
UpdateableClassifier.update(jsat.classifiers.DataPoint, int) method. |
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.
|
void |
update(DataPoint dataPoint,
double targetValue)
Updates the classifier by giving it a new data point to learn from.
|
void |
update(DataPoint dataPoint,
int targetClass)
Updates the classifier by giving it a new data point to learn from.
|
public UpdatableStacking(UpdateableClassifier aggregatingClassifier, List<UpdateableClassifier> baseClassifiers)
aggregatingClassifier
- the classifier used to merge the results of all the input classifiersbaseClassifiers
- the list of base classifiers to ensemblepublic UpdatableStacking(UpdateableClassifier aggregatingClassifier, UpdateableClassifier... baseClassifiers)
aggregatingClassifier
- the classifier used to merge the results of all the input classifiersbaseClassifiers
- the array of base classifiers to ensemblepublic UpdatableStacking(UpdateableRegressor aggregatingRegressor, List<UpdateableRegressor> baseRegressors)
aggregatingRegressor
- the regressor used to merge the results of all the input classifiersbaseRegressors
- the list of base regressors to ensemblepublic UpdatableStacking(UpdateableRegressor aggregatingRegressor, UpdateableRegressor... baseRegressors)
aggregatingRegressor
- the regressor used to merge the results of all the input classifiersbaseRegressors
- the array of base regressors to ensemblepublic UpdatableStacking(UpdatableStacking toCopy)
toCopy
- the object to copypublic CategoricalResults classify(DataPoint data)
Classifier
classify
in interface Classifier
data
- the data point to classifypublic void setUp(CategoricalData[] categoricalAttributes, int numericAttributes, CategoricalData predicting)
UpdateableClassifier
UpdateableClassifier.update(jsat.classifiers.DataPoint, int)
method.setUp
in interface UpdateableClassifier
categoricalAttributes
- an array containing the categorical
attributes that will be in each data pointnumericAttributes
- the number of numeric attributes that will be in
each data pointpredicting
- the information for the target class that will be
predictedpublic void update(DataPoint dataPoint, int targetClass)
UpdateableClassifier
update
in interface UpdateableClassifier
dataPoint
- the data point to learntargetClass
- the target class of the data pointpublic void setUp(CategoricalData[] categoricalAttributes, int numericAttributes)
UpdateableRegressor
UpdateableRegressor.update(jsat.classifiers.DataPoint, double)
method.setUp
in interface UpdateableRegressor
categoricalAttributes
- an array containing the categorical
attributes that will be in each data pointnumericAttributes
- the number of numeric attributes that will be in
each data pointpublic void update(DataPoint dataPoint, double targetValue)
UpdateableRegressor
update
in interface UpdateableRegressor
dataPoint
- the data point to learntargetValue
- the target value of the data pointpublic 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 UpdatableStacking clone()
clone
in interface Classifier
clone
in interface UpdateableClassifier
clone
in interface Regressor
clone
in interface UpdateableRegressor
clone
in class Object
Copyright © 2017. All rights reserved.