Class AbstractDataPreparation
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- weka.classifiers.meta.socketfacade.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 theSocketFacade
classifier.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractDataPreparation()
-
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 theClassifier.classifyInstance(Instance)
method.abstract double[]
parseDistribution(byte[] data, int numClasses)
Parses the data received from the process, to be returned by theClassifier.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 theClassifier.classifyInstance(Instance)
method.abstract byte[]
prepareDistribution(weka.core.Instance inst, SocketFacade facade)
Prepares the instance for theClassifier.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
-
-
-
-
Method Detail
-
prepareTrain
public abstract byte[] prepareTrain(weka.core.Instances data, SocketFacade facade)
Prepares the data for training.- Parameters:
data
- the data to usefacade
- 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 theClassifier.classifyInstance(Instance)
method.- Parameters:
inst
- the data to usefacade
- 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 theClassifier.distributionForInstance(Instance)
method.- Parameters:
inst
- the data to usefacade
- 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 theClassifier.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 theClassifier.distributionForInstance(Instance)
method.- Parameters:
data
- the data to parsenumClasses
- the number of classes- Returns:
- the class distribution
-
-