jsat.classifiers.boosting
Class ArcX4
- java.lang.Object
-
- jsat.classifiers.boosting.ArcX4
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, Classifier, Parameterized
public class ArcX4 extends java.lang.Object implements Classifier, Parameterized
Arc-x4 is a ensemble-classifier that performs re-weighting of the data points based on the total number of errors that have occurred for the data point.
See: Breiman, L. (1998). Arcing Classifiers. The Annals of Statistics, 26(3), 801–824.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description ArcX4(Classifier weakLearner, int iterations)Creates a new Arc-X4 classifier
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description CategoricalResultsclassify(DataPoint data)Performs classification on the given data point.ArcX4clone()doublegetCoefficient()Returns the coefficient use when re-weightingdoublegetExponent()Returns the exponent used when re-weightingintgetIterations()Returns the number of iterations to learnClassifiergetWeakLearner()Returns the weak learner usedvoidsetCoefficient(double coef)Weights are updated as 1+coef*errorsexpo.voidsetExponent(double expo)Weights are updated as 1+coef*errorsexpo.voidsetIterations(int iterations)Sets the number of iterations to performvoidsetWeakLearner(Classifier weakLearner)Sets the weak learner used at each iteration of learningbooleansupportsWeightedData()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
-
ArcX4
public ArcX4(Classifier weakLearner, int iterations)
Creates a new Arc-X4 classifier- Parameters:
weakLearner- the weak learner to useiterations- the number of iterations to perform
-
-
Method Detail
-
setWeakLearner
public void setWeakLearner(Classifier weakLearner)
Sets the weak learner used at each iteration of learning- Parameters:
weakLearner- the weak learner to use
-
getWeakLearner
public Classifier getWeakLearner()
Returns the weak learner used- Returns:
- the weak learner used
-
setIterations
public void setIterations(int iterations)
Sets the number of iterations to perform- Parameters:
iterations- the number of iterations to do
-
getIterations
public int getIterations()
Returns the number of iterations to learn- Returns:
- the number of iterations to learn
-
setCoefficient
public void setCoefficient(double coef)
Weights are updated as 1+coef*errorsexpo. This sets the coefficient used to update the errors- Parameters:
coef- the multiplicative factor on the errors in weight construction
-
getCoefficient
public double getCoefficient()
Returns the coefficient use when re-weighting- Returns:
- the coefficient use when re-weighting
-
setExponent
public void setExponent(double expo)
Weights are updated as 1+coef*errorsexpo. This sets the exponent used to update the errors- Parameters:
expo- the exponent to use
-
getExponent
public double getExponent()
Returns the exponent used when re-weighting- Returns:
- the exponent used when re-weighting
-
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 ArcX4 clone()
- Specified by:
clonein interfaceClassifier- Overrides:
clonein classjava.lang.Object
-
-
DataMelt 3.0 © DataMelt by jWork.ORG