Class InstancesIndexedSplitsRunsPredictions
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.transformer.indexedsplitsrunspredictions.AbstractIndexedSplitsRunsPredictions<weka.core.Instances>
-
- adams.flow.transformer.indexedsplitsrunspredictions.InstancesIndexedSplitsRunsPredictions
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,QuickInfoSupporter,SizeOfHandler,Stoppable,StoppableWithFeedback,FlowContextHandler,IndexedSplitsRunsPredictions<weka.core.Instances>,Serializable
public class InstancesIndexedSplitsRunsPredictions extends AbstractIndexedSplitsRunsPredictions<weka.core.Instances>
Trains the referenced classifier on the training splits and generates predictions for the test splits.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected CallableActorReferencem_Classifierthe name of the callable weka classifier.protected weka.classifiers.Classifierm_ManualClassifiera programmatically supplied classifier.protected Stringm_TestSplitNamethe split to use for testing.protected Stringm_TrainSplitNamethe split to use for training.-
Fields inherited from class adams.flow.transformer.indexedsplitsrunspredictions.AbstractIndexedSplitsRunsPredictions
m_FlowContext, m_Stopped
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description InstancesIndexedSplitsRunsPredictions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Classaccepts()The accepted classes.protected Map<String,weka.core.Instances>applyIndexedSplit(IndexedSplit indexedSplit, weka.core.Instances data)Applies the splits defined in the indexed split and returns the generated subsets.Stringcheck(weka.core.Instances data, IndexedSplitsRuns runs)For checking the data.StringclassifierTipText()Returns the tip text for this property.voiddefineOptions()Adds options to the internal list of options.protected SpreadSheetdoGenerate(weka.core.Instances data, IndexedSplitsRuns runs, MessageCollection errors)Generates predictions by applying the indexed splits runs to the data.CallableActorReferencegetClassifier()Returns the name of the callable classifier in use.protected weka.classifiers.ClassifiergetClassifierInstance(MessageCollection errors)Returns an instance of the callable classifier.weka.classifiers.ClassifiergetManualClassifier()Returns the manual to use instead of obtaining it from the flow.StringgetQuickInfo()Returns a quick info about the actor, which will be displayed in the GUI.StringgetTestSplitName()Returns the name of the split to use for testing, ie generating predictions.StringgetTrainSplitName()Returns the name of the split to use for training.StringglobalInfo()Returns a string describing the object.booleanrequiresFlowContext()Returns whether flow context is actually required.voidsetClassifier(CallableActorReference value)Sets the name of the callable classifier to use.voidsetManualClassifier(weka.classifiers.Classifier value)Sets the manual classifier to use instead of obtaining it from the flow.voidsetTestSplitName(String value)Sets the name of the split to use for testing, ie generating predictions.voidsetTrainSplitName(String value)Sets the name of the split to use for training.StringtestSplitNameTipText()Returns the tip text for this property.StringtrainSplitNameTipText()Returns the tip text for this property.-
Methods inherited from class adams.flow.transformer.indexedsplitsrunspredictions.AbstractIndexedSplitsRunsPredictions
generate, getFlowContext, isStopped, setFlowContext, stopExecution
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.Destroyable
destroy
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager, toCommandLine
-
-
-
-
Field Detail
-
m_TrainSplitName
protected String m_TrainSplitName
the split to use for training.
-
m_TestSplitName
protected String m_TestSplitName
the split to use for testing.
-
m_Classifier
protected CallableActorReference m_Classifier
the name of the callable weka classifier.
-
m_ManualClassifier
protected weka.classifiers.Classifier m_ManualClassifier
a programmatically supplied classifier.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractOptionHandler
-
setTrainSplitName
public void setTrainSplitName(String value)
Sets the name of the split to use for training.- Parameters:
value- the name
-
getTrainSplitName
public String getTrainSplitName()
Returns the name of the split to use for training.- Returns:
- the name
-
trainSplitNameTipText
public String trainSplitNameTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setTestSplitName
public void setTestSplitName(String value)
Sets the name of the split to use for testing, ie generating predictions.- Parameters:
value- the name
-
getTestSplitName
public String getTestSplitName()
Returns the name of the split to use for testing, ie generating predictions.- Returns:
- the name
-
testSplitNameTipText
public String testSplitNameTipText()
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(CallableActorReference value)
Sets the name of the callable classifier to use.- Parameters:
value- the name
-
getClassifier
public CallableActorReference getClassifier()
Returns the name of the callable classifier in use.- Returns:
- the name
-
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.
-
setManualClassifier
public void setManualClassifier(weka.classifiers.Classifier value)
Sets the manual classifier to use instead of obtaining it from the flow.- Parameters:
value- the classifier
-
getManualClassifier
public weka.classifiers.Classifier getManualClassifier()
Returns the manual to use instead of obtaining it from the flow.- Returns:
- the classifier
-
requiresFlowContext
public boolean requiresFlowContext()
Returns whether flow context is actually required.- Specified by:
requiresFlowContextin classAbstractIndexedSplitsRunsPredictions<weka.core.Instances>- Returns:
- true if required
-
accepts
public Class accepts()
The accepted classes.- Returns:
- the array of accepted types
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.- Specified by:
getQuickInfoin interfaceQuickInfoSupporter- Overrides:
getQuickInfoin classAbstractIndexedSplitsRunsPredictions<weka.core.Instances>- Returns:
- null if no info available, otherwise short string
-
check
public String check(weka.core.Instances data, IndexedSplitsRuns runs)
For checking the data.- Overrides:
checkin classAbstractIndexedSplitsRunsPredictions<weka.core.Instances>- Parameters:
data- the data to use for evaluationruns- the indexed splits to use- Returns:
- null if passed checks, otherwise error message
-
getClassifierInstance
protected weka.classifiers.Classifier getClassifierInstance(MessageCollection errors)
Returns an instance of the callable classifier.- Parameters:
errors- for collecting errors- Returns:
- the classifier
-
applyIndexedSplit
protected Map<String,weka.core.Instances> applyIndexedSplit(IndexedSplit indexedSplit, weka.core.Instances data)
Applies the splits defined in the indexed split and returns the generated subsets.- Parameters:
indexedSplit- the run to applydata- the data to obtain the subsets from- Returns:
- the generated splits
-
doGenerate
protected SpreadSheet doGenerate(weka.core.Instances data, IndexedSplitsRuns runs, MessageCollection errors)
Generates predictions by applying the indexed splits runs to the data.- Specified by:
doGeneratein classAbstractIndexedSplitsRunsPredictions<weka.core.Instances>- Parameters:
data- the data to use for evaluationruns- the indexed splits to useerrors- for collecting errors- Returns:
- the generated predictions, null in case of error
-
-