Class OnlineAccuracyUpdatedEnsemble

    • Field Detail

      • learnerOption

        public ClassOption learnerOption
        Type of classifier to use as a component classifier.
      • memberCountOption

        public IntOption memberCountOption
        Number of component classifiers.
      • windowSizeOption

        public FloatOption windowSizeOption
        Chunk size.
      • maxByteSizeOption

        public IntOption maxByteSizeOption
        Determines the maximum size of model (evaluated after every chunk).
      • verboseOption

        public FlagOption verboseOption
        Determines whether additional information should be sent to the output.
      • linearOption

        public FlagOption linearOption
        Determines whether additional information should be sent to the output.
      • weights

        protected double[][] weights
        The weights of stored classifiers. weights[x][0] = weight weights[x][1] = classifier number in learners
      • classDistributions

        protected long[] classDistributions
        Class distributions.
      • processedInstances

        protected int processedInstances
        Number of processed examples.
      • currentWindow

        protected int[] currentWindow
        Current window of instance class values.
      • mse_r

        protected double mse_r
        The mean square residual in a given moment, based on a window of latest examples.
      • windowSize

        protected int windowSize
        Window size.
    • Constructor Detail

      • OnlineAccuracyUpdatedEnsemble

        public OnlineAccuracyUpdatedEnsemble()
    • Method Detail

      • prepareForUseImpl

        public void prepareForUseImpl​(TaskMonitor monitor,
                                      ObjectRepository repository)
        Description copied from class: AbstractOptionHandler
        This method describes the implementation of how to prepare this object for use. All classes that extends this class have to implement prepareForUseImpl and not prepareForUse since prepareForUse calls prepareForUseImpl.
        Overrides:
        prepareForUseImpl in class AbstractClassifier
        Parameters:
        monitor - the TaskMonitor to use
        repository - the ObjectRepository to use
      • 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
      • isRandomizable

        public boolean isRandomizable()
        Determines whether the classifier is randomizable.
        Specified by:
        isRandomizable in interface Learner<Example<Instance>>
        Returns:
        true if the learner needs a random seed.
      • getVotesForInstance

        public double[] getVotesForInstance​(Instance inst)
        Predicts a class for an example.
        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
      • 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
      • createNewClassifier

        protected void createNewClassifier​(Instance inst)
        Processes a chunk.
        Parameters:
        inst - New example
      • enforceMemoryLimit

        protected void enforceMemoryLimit()
        Checks if the memory limit is exceeded and if so prunes the classifiers in the ensemble.
      • computeMseR

        protected void computeMseR()
        Computes the MSEr threshold.
      • computeWeight

        protected double computeWeight​(int i,
                                       Instance example)
        Computes the weight of a learner before training a given example.
        Parameters:
        i - the identifier (in terms of array learners) of the classifier for which the weight is supposed to be computed
        example - the newest example
        Returns:
        the computed weight.
      • addToStored

        protected void addToStored​(OnlineAccuracyUpdatedEnsemble.ClassifierWithMemory newClassifier,
                                   double newClassifiersWeight)
        Adds a classifier to the storage.
        Parameters:
        newClassifier - The classifier to add.
        newClassifiersWeight - The new classifiers weight.