Class DACC

    • Field Detail

      • learnerOption

        public ClassOption learnerOption
        Base classifier
      • memberCountOption

        public FloatOption memberCountOption
        Ensemble size
      • maturityOption

        public FloatOption maturityOption
        Maturity age of classifiers
      • evaluationSizeOption

        public FloatOption evaluationSizeOption
        Size of the evaluation window for weights computing
      • combinationOption

        public MultiChoiceOption combinationOption
        Combination functions: MAX and WVD (MAX leads to a faster reactivity to the change, WVD is more robust to noise)
      • ensemble

        protected Classifier[] ensemble
        Ensemble of classifiers
      • ensembleWeights

        protected DACC.Pair[] ensembleWeights
        Weights of classifiers
      • ensembleAges

        protected double[] ensembleAges
        Age of classifiers (to compare with maturity age)
      • ensembleWindows

        protected int[][] ensembleWindows
        Evaluation windows (recent classification errors)
      • nbInstances

        protected int nbInstances
        Number of instances from the stream
    • Constructor Detail

      • DACC

        public DACC()
    • Method Detail

      • initVariables

        protected void initVariables()
        Initializes the method variables
      • resetLearningImpl

        public void resetLearningImpl()
        Description copied from class: AbstractClassifier
        Resets this classifier. It must be similar to starting a new classifier from scratch.

        The reason for ...Impl methods: ease programmer burden by not requiring them to remember calls to super in overridden methods. Note that this will produce compiler errors if not overridden.
        Specified by:
        resetLearningImpl in class AbstractClassifier
      • trainOnInstanceImpl

        public void trainOnInstanceImpl​(Instance inst)
        Description copied from class: AbstractClassifier
        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. Note that this will produce compiler errors if not overridden.
        Specified by:
        trainOnInstanceImpl in class AbstractClassifier
        Parameters:
        inst - the instance to be used for training
      • getVotesForInstance

        public double[] getVotesForInstance​(Instance inst)
        Description copied from interface: Classifier
        Predicts the class memberships for a given instance. If an instance is unclassified, the returned array elements must be all zero.
        Specified by:
        getVotesForInstance in interface Classifier
        Specified by:
        getVotesForInstance in class AbstractClassifier
        Parameters:
        inst - the instance to be classified
        Returns:
        an array containing the estimated membership probabilities of the test instance in each class
      • trainAndClassify

        protected void trainAndClassify​(Instance inst)
        Receives a training instance from the stream and updates the adaptive classifiers accordingly
        Parameters:
        inst - the instance from the stream
      • discardModel

        public void discardModel​(int index)
        Resets a classifier in the ensemble
        Parameters:
        index - the index of the classifier in the ensemble
      • updateEvaluationWindow

        protected double updateEvaluationWindow​(int index,
                                                int val)
        Updates the evaluation window of a classifier and returns the updated weight value.
        Parameters:
        index - the index of the classifier in the ensemble
        val - the last evaluation record of the classifier
        Returns:
        the updated weight value of the classifier
      • getHalf

        protected DACC.Pair[] getHalf​(boolean bestHalf)
        Returns the best (or worst) half of classifiers in the adaptive ensemble. The best classifiers are used to compute the stability index in ADACC. The worst classifiers are returned in order to select a classifier for deletion.
        Parameters:
        bestHalf - boolean value set to true (false) if we want to return the best (worst) half of adaptive classifiers.
        Returns:
        an array containing the weight values of the corresponding classifiers and their indexes in the ensemble.
      • getMAXIndexes

        protected ArrayList<Integer> getMAXIndexes()
        Returns the classifiers that vote for the final prediction when the MAX combination function is selected
        Returns:
        the classifiers with the highest weight value
      • getWVDIndexes

        protected ArrayList<Integer> getWVDIndexes()
        Returns the classifiers that vote for the final prediction when the WVD combination function is selected
        Returns:
        the classifiers whose weights lie in the higher half of the ensemble's weight interval.
      • getNbActiveClassifiers

        protected int getNbActiveClassifiers()
        Returns the number of classifiers used for prediction which includes the adaptive learners and the snapshots in ADACC
        Returns:
        the number of classifiers used for prediction
      • getNbAdaptiveClassifiers

        protected int getNbAdaptiveClassifiers()
        Returns the number of adaptive classifiers in the ensemble which excludes the static snapshots in ADACC
        Returns:
        the number of adaptive classifiers
      • getModelDescription

        public void getModelDescription​(StringBuilder out,
                                        int indent)
        Description copied from class: AbstractClassifier
        Returns a string representation of the model.
        Specified by:
        getModelDescription in class AbstractClassifier
        Parameters:
        out - the stringbuilder to add the description
        indent - the number of characters to indent
      • getModelMeasurementsImpl

        protected Measurement[] getModelMeasurementsImpl()
        Description copied from class: AbstractClassifier
        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. Note that this will produce compiler errors if not overridden.
        Specified by:
        getModelMeasurementsImpl in class AbstractClassifier
        Returns:
        an array of measurements to be used in evaluation tasks
      • isRandomizable

        public boolean isRandomizable()
        Description copied from interface: Learner
        Gets whether this learner needs a random seed. Examples of methods that needs a random seed are bagging and boosting.
        Specified by:
        isRandomizable in interface Learner<Example<Instance>>
        Returns:
        true if the learner needs a random seed.