Class AbstractDataPreparation

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

    public abstract class AbstractDataPreparation
    extends adams.core.option.AbstractOptionHandler
    Ancestor for classes that prepare data for the SocketFacade classifier.
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Summary

      • 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 Abstract Methods 
      Modifier and Type Method Description
      abstract double parseClassify​(byte[] data)
      Parses the data received from the process, to be returned by the Classifier.classifyInstance(Instance) method.
      abstract double[] parseDistribution​(byte[] data, int numClasses)
      Parses the data received from the process, to be returned by the Classifier.distributionForInstance(Instance) method.
      abstract String parseTrain​(byte[] data)
      Parses the data received from the process from the training process.
      abstract byte[] prepareClassify​(weka.core.Instance inst, SocketFacade facade)
      Prepares the instance for the Classifier.classifyInstance(Instance) method.
      abstract byte[] prepareDistribution​(weka.core.Instance inst, SocketFacade facade)
      Prepares the instance for the Classifier.distributionForInstance(Instance) method.
      abstract byte[] prepareTrain​(weka.core.Instances data, SocketFacade facade)
      Prepares the data for training.
      • Methods inherited from class adams.core.option.AbstractOptionHandler

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

        configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
      • Methods inherited from interface adams.core.logging.LoggingLevelHandler

        getLoggingLevel
    • Constructor Detail

      • AbstractDataPreparation

        public AbstractDataPreparation()
    • Method Detail

      • prepareTrain

        public abstract byte[] prepareTrain​(weka.core.Instances data,
                                            SocketFacade facade)
        Prepares the data for training.
        Parameters:
        data - the data to use
        facade - the classifier using the data preparation
        Returns:
        the prepared data
      • prepareClassify

        public abstract byte[] prepareClassify​(weka.core.Instance inst,
                                               SocketFacade facade)
        Prepares the instance for the Classifier.classifyInstance(Instance) method.
        Parameters:
        inst - the data to use
        facade - the classifier using the data preparation
        Returns:
        the prepared data
      • prepareDistribution

        public abstract byte[] prepareDistribution​(weka.core.Instance inst,
                                                   SocketFacade facade)
        Prepares the instance for the Classifier.distributionForInstance(Instance) method.
        Parameters:
        inst - the data to use
        facade - the classifier using the data preparation
        Returns:
        the prepared data
      • parseTrain

        public abstract String parseTrain​(byte[] data)
        Parses the data received from the process from the training process.
        Parameters:
        data - the data to parse
        Returns:
        null if successful, otherwise error message
      • parseClassify

        public abstract double parseClassify​(byte[] data)
        Parses the data received from the process, to be returned by the Classifier.classifyInstance(Instance) method.
        Parameters:
        data - the data to parse
        Returns:
        the classification
      • parseDistribution

        public abstract double[] parseDistribution​(byte[] data,
                                                   int numClasses)
        Parses the data received from the process, to be returned by the Classifier.distributionForInstance(Instance) method.
        Parameters:
        data - the data to parse
        numClasses - the number of classes
        Returns:
        the class distribution