Class HeterogeneousEnsembleAbstract

    • Field Detail

      • baselearnersOption

        public ListOption baselearnersOption
      • gracePerionOption

        public IntOption gracePerionOption
      • activeClassifiersOption

        public IntOption activeClassifiersOption
      • weightClassifiersOption

        public FlagOption weightClassifiersOption
      • historyTotal

        protected double[] historyTotal
      • instancesSeen

        protected Integer instancesSeen
    • Constructor Detail

      • HeterogeneousEnsembleAbstract

        public HeterogeneousEnsembleAbstract()
    • Method Detail

      • getEnsembleSize

        public int getEnsembleSize()
      • getMemberCliString

        public String getMemberCliString​(int idx)
      • 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
      • setModelContext

        public void setModelContext​(InstancesHeader ih)
        Description copied from interface: Learner
        Sets the reference to the header of the data stream. The header of the data stream is extended from WEKA Instances. This header is needed to know the number of classes and attributes
        Specified by:
        setModelContext in interface Learner<Example<Instance>>
        Overrides:
        setModelContext in class AbstractClassifier
        Parameters:
        ih - the reference to the data stream header
      • 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.
      • getModelDescription

        public void getModelDescription​(StringBuilder arg0,
                                        int arg1)
        Description copied from class: AbstractClassifier
        Returns a string representation of the model.
        Specified by:
        getModelDescription in class AbstractClassifier
        Parameters:
        arg0 - the stringbuilder to add the description
        arg1 - 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
      • 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
      • topK

        protected static List<Integer> topK​(double[] scores,
                                            int k)
      • maxIndex

        protected static int maxIndex​(double[] scores)
      • normalize

        protected static double[] normalize​(double[] input)