Configurable
, java.io.Serializable
, CapabilitiesHandler
, Classifier
, MultiClassClassifier
, AWTRenderable
, Learner<Example<Instance>>
, MOAObject
, OptionHandler
public class OnlineAdaC2 extends AbstractClassifier implements MultiClassClassifier, CapabilitiesHandler
AdaC2 is a boosting algorithm that takes the different misclassification costs into consideration when calculating the classier weights, and updates the sample weight. AdaC2 increases more the weights on the misclassified positive samples, compared to misclassified negative samples.:math:`C_P` and :math:`C_N` are the positive and negative costs.
This online ensemble learner method is improved by the addition of an ADWIN change detector. ADWIN stands for Adaptive Windowing. It works by keeping updated statistics of a variable sized window, so it can detect changes and perform cuts in its window to better adapt the learning algorithms.
See details in:
B. Wang and J. Pineau, "Online Bagging and Boosting for Imbalanced Data Streams,"
in IEEE Transactions on Knowledge and Data Engineering, vol. 28, no. 12, pp.
3353-3366, 1 Dec. 2016. doi: 10.1109/TKDE.2016.2609424
Parameters:
Modifier and Type | Field | Description |
---|---|---|
protected java.util.ArrayList<ADWIN> |
adwinEnsemble |
|
protected Classifier |
baseLearner |
|
ClassOption |
baseLearnerOption |
|
protected double |
costNegative |
|
FloatOption |
costNegativeOption |
|
protected double |
costPositive |
|
FloatOption |
costPositiveOption |
|
FlagOption |
disableDriftDetectionOption |
|
protected boolean |
driftDetection |
|
protected java.util.ArrayList<Classifier> |
ensemble |
|
IntOption |
ensembleSizeOption |
|
protected java.util.ArrayList<java.lang.Double> |
lambdaFN |
|
protected java.util.ArrayList<java.lang.Double> |
lambdaFP |
|
protected java.util.ArrayList<java.lang.Double> |
lambdaSum |
|
protected java.util.ArrayList<java.lang.Double> |
lambdaTN |
|
protected java.util.ArrayList<java.lang.Double> |
lambdaTP |
|
protected int |
nEstimators |
|
protected java.util.ArrayList<java.lang.Double> |
wAcc |
|
protected java.util.ArrayList<java.lang.Double> |
wErr |
classifierRandom, modelContext, randomSeed, randomSeedOption, trainingWeightSeenByModel
config
Constructor | Description |
---|---|
OnlineAdaC2() |
Modifier and Type | Method | Description |
---|---|---|
protected void |
adjustEnsembleSize(int nClasses) |
|
ImmutableCapabilities |
defineImmutableCapabilities() |
Defines the set of capabilities the object has.
|
void |
getModelDescription(java.lang.StringBuilder arg0,
int arg1) |
Returns a string representation of the model.
|
protected Measurement[] |
getModelMeasurementsImpl() |
Gets the current measurements of this classifier.
The reason for ...Impl methods: ease programmer burden by not requiring them to remember calls to super in overridden methods. |
java.lang.String |
getPurposeString() |
Dictionary with option texts and objects
|
double[] |
getVotesForInstance(Instance instance) |
Predicts the class memberships for a given instance.
|
boolean |
isRandomizable() |
Gets whether this learner needs a random seed.
|
void |
resetLearningImpl() |
Resets this classifier.
|
void |
trainOnInstanceImpl(Instance instance) |
Trains this classifier incrementally using the given instance.
The reason for ...Impl methods: ease programmer burden by not requiring them to remember calls to super in overridden methods. |
contextIsCompatible, copy, correctlyClassifies, getAttributeNameString, getAWTRenderer, getClassLabelString, getClassNameString, getDescription, getModel, getModelContext, getModelMeasurements, getNominalValueString, getPredictionForInstance, getPredictionForInstance, getSubClassifiers, getSublearners, getVotesForInstance, modelAttIndexToInstanceAttIndex, modelAttIndexToInstanceAttIndex, prepareForUseImpl, resetLearning, setModelContext, setRandomSeed, trainingHasStarted, trainingWeightSeenByModel, trainOnInstance, trainOnInstance
copy, measureByteSize, measureByteSize, toString
getCLICreationString, getOptions, getPreparedClassOption, prepareClassOptions, prepareForUse, prepareForUse
getCapabilities
measureByteSize
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getCLICreationString, getOptions, prepareForUse, prepareForUse
public ClassOption baseLearnerOption
public IntOption ensembleSizeOption
public FloatOption costPositiveOption
public FloatOption costNegativeOption
public FlagOption disableDriftDetectionOption
protected Classifier baseLearner
protected int nEstimators
protected double costPositive
protected double costNegative
protected boolean driftDetection
protected java.util.ArrayList<Classifier> ensemble
protected java.util.ArrayList<ADWIN> adwinEnsemble
protected java.util.ArrayList<java.lang.Double> lambdaTP
protected java.util.ArrayList<java.lang.Double> lambdaTN
protected java.util.ArrayList<java.lang.Double> lambdaFP
protected java.util.ArrayList<java.lang.Double> lambdaFN
protected java.util.ArrayList<java.lang.Double> lambdaSum
protected java.util.ArrayList<java.lang.Double> wAcc
protected java.util.ArrayList<java.lang.Double> wErr
public java.lang.String getPurposeString()
AbstractOptionHandler
getPurposeString
in interface OptionHandler
getPurposeString
in class AbstractClassifier
public void resetLearningImpl()
AbstractClassifier
resetLearningImpl
in class AbstractClassifier
public void trainOnInstanceImpl(Instance instance)
AbstractClassifier
trainOnInstanceImpl
in class AbstractClassifier
instance
- the instance to be used for trainingpublic double[] getVotesForInstance(Instance instance)
Classifier
getVotesForInstance
in interface Classifier
getVotesForInstance
in class AbstractClassifier
instance
- the instance to be classifiedpublic boolean isRandomizable()
Learner
isRandomizable
in interface Learner<Example<Instance>>
public void getModelDescription(java.lang.StringBuilder arg0, int arg1)
AbstractClassifier
getModelDescription
in class AbstractClassifier
arg0
- the stringbuilder to add the descriptionarg1
- the number of characters to indentprotected Measurement[] getModelMeasurementsImpl()
AbstractClassifier
getModelMeasurementsImpl
in class AbstractClassifier
protected void adjustEnsembleSize(int nClasses)
public ImmutableCapabilities defineImmutableCapabilities()
CapabilitiesHandler
defineImmutableCapabilities
in interface CapabilitiesHandler
defineImmutableCapabilities
in class AbstractClassifier
Copyright © 2020 University of Waikato, Hamilton, NZ. All Rights Reserved.