Class MultiScheme

    • Constructor Detail

      • MultiScheme

        public MultiScheme()
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing classifier
        Returns:
        a description suitable for displaying in the explorer/experimenter gui
      • setOptions

        public void setOptions​(String[] options)
                        throws Exception
        Parses a given list of options.

        Valid options are:

         -X <number of folds>
          Use cross validation for model selection using the
          given number of folds. (default 0, is to
          use training error)
         -S <num>
          Random number seed.
          (default 1)
         -B <classifier specification>
          Full class name of classifier to include, followed
          by scheme options. May be specified multiple times.
          (default: "weka.classifiers.rules.ZeroR")
        Specified by:
        setOptions in interface OptionHandler
        Overrides:
        setOptions in class RandomizableMultipleClassifiersCombiner
        Parameters:
        options - the list of options as an array of strings
        Throws:
        Exception - if an option is not supported
      • classifiersTipText

        public String classifiersTipText()
        Returns the tip text for this property
        Overrides:
        classifiersTipText in class MultipleClassifiersCombiner
        Returns:
        tip text for this property suitable for displaying in the explorer/experimenter gui
      • setClassifiers

        public void setClassifiers​(Classifier[] classifiers)
        Sets the list of possible classifers to choose from.
        Overrides:
        setClassifiers in class MultipleClassifiersCombiner
        Parameters:
        classifiers - an array of classifiers with all options set.
      • getClassifier

        public Classifier getClassifier​(int index)
        Gets a single classifier from the set of available classifiers.
        Overrides:
        getClassifier in class MultipleClassifiersCombiner
        Parameters:
        index - the index of the classifier wanted
        Returns:
        the Classifier
      • numFoldsTipText

        public String numFoldsTipText()
        Returns the tip text for this property
        Returns:
        tip text for this property suitable for displaying in the explorer/experimenter gui
      • getNumFolds

        public int getNumFolds()
        Gets the number of folds for cross-validation. A number less than 2 specifies using training error rather than cross-validation.
        Returns:
        the number of folds for cross-validation
      • setNumFolds

        public void setNumFolds​(int numFolds)
        Sets the number of folds for cross-validation. A number less than 2 specifies using training error rather than cross-validation.
        Parameters:
        numFolds - the number of folds for cross-validation
      • getBestClassifierIndex

        public int getBestClassifierIndex()
        Get the index of the classifier that was determined as best during cross-validation.
        Returns:
        the index in the classifier array
      • buildClassifier

        public void buildClassifier​(Instances data)
                             throws Exception
        Buildclassifier selects a classifier from the set of classifiers by minimising error on the training data.
        Parameters:
        data - the training data to be used for generating the boosted classifier.
        Throws:
        Exception - if the classifier could not be built successfully
      • toString

        public String toString()
        Output a representation of this classifier
        Overrides:
        toString in class Object
        Returns:
        a string representation of the classifier
      • main

        public static void main​(String[] argv)
        Main method for testing this class.
        Parameters:
        argv - should contain the following arguments: -t training file [-T test file] [-c class index]