Class AccuracyUpdatedEnsemble

    • Field Detail

      • learnerOption

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

        public IntOption memberCountOption
        Number of component classifiers.
      • chunkSizeOption

        public IntOption chunkSizeOption
        Chunk size.
      • maxByteSizeOption

        public IntOption maxByteSizeOption
        Determines the maximum size of model (evaluated after every chunk). In effect only for HoeffdingTree-based component classifiers.
      • 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.
      • learners

        protected Classifier[] learners
        Ensemble classifiers.
      • processedInstances

        protected int processedInstances
        Number of processed examples.
      • candidate

        protected Classifier candidate
        Candidate classifier.
      • currentChunk

        protected Instances currentChunk
        Current chunk of instances.
    • Constructor Detail

      • AccuracyUpdatedEnsemble

        public AccuracyUpdatedEnsemble()
    • 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
      • processChunk

        protected void processChunk()
        Processes a chunk of instances. This method is called after collecting a chunk of examples.
      • enforceMemoryLimit

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

        protected double computeMseR()
        Computes the MSEr threshold.
        Returns:
        The MSEr threshold.
      • computeMse

        protected double computeMse​(Classifier learner,
                                    Instances chunk)
        Computes the MSE of a learner for a given chunk of examples.
        Parameters:
        learner - classifier to compute error
        chunk - chunk of examples
        Returns:
        the computed error.
      • addToStored

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