Class AbstractWEKAFitnessFunction

  • All Implemented Interfaces:
    adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.SizeOfHandler, adams.opt.optimise.FitnessFunction, Serializable
    Direct Known Subclasses:
    AttributeSelection

    public abstract class AbstractWEKAFitnessFunction
    extends adams.opt.optimise.AbstractFitnessFunction
    Perform attribute selection using WEKA classification.
    Author:
    dale
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected weka.classifiers.Classifier m_Classifier
      the classifier to use if no serialized model is given.
      protected String m_ClassIndex
      the class index.
      protected int m_CrossValidationSeed
      the cross-validation seed.
      protected adams.core.io.PlaceholderFile m_Dataset
      the filename of the data to use for cross-validation.
      protected int m_Folds
      the number of folds for cross-validation.
      protected boolean m_init
      initialised?
      protected weka.core.Instances m_Instances
      the data to use for cross-validation.
      protected AbstractWEKAFitnessFunction.Measure m_Measure
      the measure to use for evaluating the fitness.
      protected adams.core.io.PlaceholderDirectory m_OutputDirectory
      the directory to store the generated ARFF files in.
      • Fields inherited from class adams.core.option.AbstractOptionHandler

        m_OptionManager
      • Fields inherited from class adams.core.logging.LoggingObject

        m_Logger, m_LoggingIsEnabled, m_LoggingLevel
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      String classifierTipText()
      Returns the tip text for this property.
      String classIndexTipText()
      Returns the tip text for this property.
      String crossValidationSeedTipText()
      Returns the tip text for this property.
      String datasetTipText()
      Returns the tip text for this property.
      void defineOptions()
      Adds options to the internal list of options.
      String foldsTipText()
      Returns the tip text for this property.
      weka.classifiers.Classifier getClassifier()
      Returns the currently set classifier.
      String getClassIndex()
      Returns the current class index.
      int getCrossValidationSeed()
      Returns the current seed value for cross-validation.
      adams.core.io.PlaceholderFile getDataset()
      Returns the currently set filename of the dataset for cross-validation.
      int getFolds()
      Returns the number of folds to use in cross-validation.
      weka.core.Instances getInstances()
      Returns the currently set dataset for cross-validation.
      AbstractWEKAFitnessFunction.Measure getMeasure()
      Returns the current measure for evaluating the fitness.
      adams.core.io.PlaceholderDirectory getOutputDirectory()
      Returns the currently set directory for the generated ARFF files.
      String globalInfo()  
      protected void init()  
      String measureTipText()
      Returns the tip text for this property.
      String outputDirectoryTipText()
      Returns the tip text for this property.
      void setClassifier​(weka.classifiers.Classifier value)
      Sets the classifier to use (if no serialized model is used).
      void setClassIndex​(String value)
      Sets the class index.
      void setCrossValidationSeed​(int value)
      Sets the seed value to use for cross-validation.
      void setDataset​(adams.core.io.PlaceholderFile value)
      Sets the filename of the dataset to use for cross-validation.
      void setFolds​(int value)
      Sets the number of folds to use in cross-validation.
      void setInstances​(weka.core.Instances value)
      Sets the data to use for cross-validation.
      void setMeasure​(AbstractWEKAFitnessFunction.Measure value)
      Sets the measure used for evaluating the fitness.
      void setOutputDirectory​(adams.core.io.PlaceholderDirectory value)
      Sets the directory for the generated ARFF files.
      • Methods inherited from class adams.opt.optimise.AbstractFitnessFunction

        newBest
      • Methods inherited from class adams.core.option.AbstractOptionHandler

        cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, toCommandLine, toString
      • Methods inherited from class adams.core.logging.CustomLoggingLevelObject

        setLoggingLevel
      • Methods inherited from class adams.core.logging.LoggingObject

        configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
      • Methods inherited from interface adams.opt.optimise.FitnessFunction

        evaluate
      • Methods inherited from interface adams.core.logging.LoggingLevelHandler

        getLoggingLevel
    • Field Detail

      • m_Instances

        protected weka.core.Instances m_Instances
        the data to use for cross-validation.
      • m_Dataset

        protected adams.core.io.PlaceholderFile m_Dataset
        the filename of the data to use for cross-validation.
      • m_Classifier

        protected weka.classifiers.Classifier m_Classifier
        the classifier to use if no serialized model is given.
      • m_OutputDirectory

        protected adams.core.io.PlaceholderDirectory m_OutputDirectory
        the directory to store the generated ARFF files in.
      • m_Folds

        protected int m_Folds
        the number of folds for cross-validation.
      • m_CrossValidationSeed

        protected int m_CrossValidationSeed
        the cross-validation seed.
      • m_ClassIndex

        protected String m_ClassIndex
        the class index.
      • m_init

        protected boolean m_init
        initialised?
    • Constructor Detail

      • AbstractWEKAFitnessFunction

        public AbstractWEKAFitnessFunction()
    • Method Detail

      • defineOptions

        public void defineOptions()
        Adds options to the internal list of options.
        Specified by:
        defineOptions in interface adams.core.option.OptionHandler
        Overrides:
        defineOptions in class adams.core.option.AbstractOptionHandler
      • setFolds

        public void setFolds​(int value)
        Sets the number of folds to use in cross-validation.
        Parameters:
        value - the number of folds
      • getFolds

        public int getFolds()
        Returns the number of folds to use in cross-validation.
        Returns:
        the number of folds
      • foldsTipText

        public String foldsTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setCrossValidationSeed

        public void setCrossValidationSeed​(int value)
        Sets the seed value to use for cross-validation.
        Parameters:
        value - the seed to use
      • getCrossValidationSeed

        public int getCrossValidationSeed()
        Returns the current seed value for cross-validation.
        Returns:
        the seed value
      • crossValidationSeedTipText

        public String crossValidationSeedTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setInstances

        public void setInstances​(weka.core.Instances value)
        Sets the data to use for cross-validation.
        Parameters:
        value - the dataset
      • getInstances

        public weka.core.Instances getInstances()
        Returns the currently set dataset for cross-validation.
        Returns:
        the dataset
      • setDataset

        public void setDataset​(adams.core.io.PlaceholderFile value)
        Sets the filename of the dataset to use for cross-validation.
        Parameters:
        value - the filename
      • getDataset

        public adams.core.io.PlaceholderFile getDataset()
        Returns the currently set filename of the dataset for cross-validation.
        Returns:
        the filename
      • datasetTipText

        public String datasetTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setClassifier

        public void setClassifier​(weka.classifiers.Classifier value)
        Sets the classifier to use (if no serialized model is used).
        Parameters:
        value - the classifier
      • getClassifier

        public weka.classifiers.Classifier getClassifier()
        Returns the currently set classifier.
        Returns:
        the classifier
      • classifierTipText

        public String classifierTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setOutputDirectory

        public void setOutputDirectory​(adams.core.io.PlaceholderDirectory value)
        Sets the directory for the generated ARFF files.
        Parameters:
        value - the directory
      • getOutputDirectory

        public adams.core.io.PlaceholderDirectory getOutputDirectory()
        Returns the currently set directory for the generated ARFF files.
        Returns:
        the directory
      • outputDirectoryTipText

        public String outputDirectoryTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setClassIndex

        public void setClassIndex​(String value)
        Sets the class index.
        Parameters:
        value - the class index
      • getClassIndex

        public String getClassIndex()
        Returns the current class index.
        Returns:
        the class index
      • classIndexTipText

        public String classIndexTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • measureTipText

        public String measureTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • globalInfo

        public String globalInfo()
        Specified by:
        globalInfo in interface adams.core.GlobalInfoSupporter
        Specified by:
        globalInfo in class adams.core.option.AbstractOptionHandler
      • init

        protected void init()