Class RandomModelTrees

  • All Implemented Interfaces:
    Serializable, Cloneable, weka.classifiers.Classifier, weka.core.BatchPredictor, weka.core.CapabilitiesHandler, weka.core.CapabilitiesIgnorer, weka.core.CommandlineRunnable, weka.core.OptionHandler, weka.core.Randomizable, weka.core.RevisionHandler, weka.core.WeightedInstancesHandler

    public class RandomModelTrees
    extends weka.classifiers.RandomizableClassifier
    implements weka.core.OptionHandler, weka.core.WeightedInstancesHandler
    Version:
    $Revision$
    Author:
    Bernhard Pfahringer ([email protected])
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected weka.core.Instances m_data  
      protected int m_max  
      protected weka.classifiers.trees.Node[] m_node  
      protected int m_numIterations
      The number of iterations.
      protected int m_numTrials  
      protected double m_ridge  
      • Fields inherited from class weka.classifiers.RandomizableClassifier

        m_Seed
      • Fields inherited from class weka.classifiers.AbstractClassifier

        BATCH_SIZE_DEFAULT, m_BatchSize, m_Debug, m_DoNotCheckCapabilities, m_numDecimalPlaces, NUM_DECIMAL_PLACES_DEFAULT
    • Field Detail

      • m_node

        protected weka.classifiers.trees.Node[] m_node
      • m_numIterations

        protected int m_numIterations
        The number of iterations.
      • m_max

        protected int m_max
      • m_data

        protected weka.core.Instances m_data
      • m_numTrials

        protected int m_numTrials
      • m_ridge

        protected double m_ridge
    • Constructor Detail

      • RandomModelTrees

        public RandomModelTrees()
    • Method Detail

      • globalInfo

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

        public Enumeration listOptions()
        Returns an enumeration describing the available options.
        Specified by:
        listOptions in interface weka.core.OptionHandler
        Overrides:
        listOptions in class weka.classifiers.RandomizableClassifier
        Returns:
        an enumeration of all the available options.
      • setOptions

        public void setOptions​(String[] options)
                        throws Exception
        Parses a given list of options.
        Specified by:
        setOptions in interface weka.core.OptionHandler
        Overrides:
        setOptions in class weka.classifiers.RandomizableClassifier
        Parameters:
        options - the list of options as an array of strings
        Throws:
        Exception - if an option is not supported
      • getOptions

        public String[] getOptions()
        Gets the current settings of the Classifier.
        Specified by:
        getOptions in interface weka.core.OptionHandler
        Overrides:
        getOptions in class weka.classifiers.RandomizableClassifier
        Returns:
        an array of strings suitable for passing to setOptions
      • getTrials

        public int getTrials()
      • setTrials

        public void setTrials​(int n)
      • trialsTipText

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

        public double getRidge()
      • setRidge

        public void setRidge​(double c)
      • ridgeTipText

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

        public void setNumIterations​(int numIterations)
        Sets the number of iterations.
      • getNumIterations

        public int getNumIterations()
        Gets the number of iterations.
        Returns:
        the maximum number of iterations
      • numIterationsTipText

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

        public int getMax()
      • setMax

        public void setMax​(int n)
      • maxTipText

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

        public weka.core.Capabilities getCapabilities()
        Returns default capabilities of the classifier.
        Specified by:
        getCapabilities in interface weka.core.CapabilitiesHandler
        Specified by:
        getCapabilities in interface weka.classifiers.Classifier
        Overrides:
        getCapabilities in class weka.classifiers.AbstractClassifier
        Returns:
        the capabilities of this classifier
      • buildClassifier

        public void buildClassifier​(weka.core.Instances data)
                             throws Exception
        Specified by:
        buildClassifier in interface weka.classifiers.Classifier
        Parameters:
        data - the training data to be used for generating the
        Throws:
        Exception - if the classifier could not be built successfully
      • getComparators

        public Comparator<weka.core.Instance>[] getComparators​(int k)
      • classifyInstance

        public double classifyInstance​(weka.core.Instance instance)
                                throws Exception
        Calculates the class membership probabilities for the given test instance.
        Specified by:
        classifyInstance in interface weka.classifiers.Classifier
        Overrides:
        classifyInstance in class weka.classifiers.AbstractClassifier
        Parameters:
        instance - the instance to be classified
        Returns:
        preedicted class probability distribution
        Throws:
        Exception - if distribution can't be computed successfully
      • toStringOLD

        public String toStringOLD()
        Returns description of the bagged classifier.
        Returns:
        description of the bagged classifier as a string
      • getRevision

        public String getRevision()
        Specified by:
        getRevision in interface weka.core.RevisionHandler
        Overrides:
        getRevision in class weka.classifiers.AbstractClassifier
      • main

        public static void main​(String[] argv)
        Main method for testing this class.
        Parameters:
        argv - the options