Package weka.classifiers.functions
Class FromPredictions
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- weka.core.AbstractSimpleOptionHandler
-
- weka.classifiers.simple.AbstractSimpleClassifier
-
- weka.classifiers.functions.FromPredictions
-
- 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
,weka.classifiers.Classifier
,weka.core.CapabilitiesHandler
,weka.core.OptionHandler
public class FromPredictions extends AbstractSimpleClassifier
Encapsulates predictions from a spreadsheet. Dummy classifier for the Investigator.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected adams.data.spreadsheet.SpreadSheetColumnIndex
m_Actual
the column with the actual values.protected int
m_ActualIndex
the actual column index.protected adams.data.spreadsheet.SpreadSheetColumnRange
m_Additional
the additional columns in the spreadsheet to add to the plot containers.protected int[]
m_AdditionalIndices
the additional column indices.protected adams.data.spreadsheet.SpreadSheetUnorderedColumnRange
m_ClassDistribution
the class distribution columns (if any).protected int[]
m_ClassDistributionIndices
the class distribution column indices.protected adams.data.spreadsheet.SpreadSheetColumnIndex
m_Predicted
the column with the predicted values.protected int
m_PredictedIndex
the predicted column index.protected adams.data.spreadsheet.SpreadSheet
m_Predictions
the actual predictions.protected adams.core.io.PlaceholderFile
m_PredictionsFile
the predictions to use.protected adams.data.io.input.SpreadSheetReader
m_Reader
the spreadsheet reader to use.protected adams.data.spreadsheet.SpreadSheetColumnIndex
m_Weight
the column with the error values (optional).protected int
m_WeightIndex
the weight column index.
-
Constructor Summary
Constructors Constructor Description FromPredictions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
actualTipText()
Returns the tip text for this property.String
additionalTipText()
Returns the tip text for this property.void
buildClassifier(weka.core.Instances data)
Just loads the predictions.String
classDistributionTipText()
Returns the tip text for this property.double
classifyInstance(weka.core.Instance instance)
Always returns 0.void
defineOptions()
Adds options to the internal list of options.adams.data.spreadsheet.SpreadSheetColumnIndex
getActual()
Returns the column with the actual values.int
getActualIndex()
Returns the actual 0-based index.adams.data.spreadsheet.SpreadSheetColumnRange
getAdditional()
Returns the additional columns to add to the plot containers.int[]
getAdditionalIndices()
Returns the 0-based indices of the additional columns.adams.data.spreadsheet.SpreadSheetUnorderedColumnRange
getClassDistribution()
Returns the class distribution columns.int[]
getClassDistributionIndices()
Returns the 0-based indices of the class distribution columns.adams.data.spreadsheet.SpreadSheetColumnIndex
getPredicted()
Returns the column with the predicted values.int
getPredictedIndex()
Returns the predicted 0-based index.adams.data.spreadsheet.SpreadSheet
getPredictions()
Returns the predictions that were loaded.adams.core.io.PlaceholderFile
getPredictionsFile()
Returns the file with the predictions.adams.data.io.input.SpreadSheetReader
getReader()
Returns the spreadsheet reader to use.adams.data.spreadsheet.SpreadSheetColumnIndex
getWeight()
Returns the column with the weight values.int
getWeightIndex()
Returns the weight 0-based index.String
globalInfo()
Returns a string describing the object.String
predictedTipText()
Returns the tip text for this property.String
predictionsFileTipText()
Returns the tip text for this property.String
readerTipText()
Returns the tip text for this property.void
setActual(adams.data.spreadsheet.SpreadSheetColumnIndex value)
Sets the column with the actual values.void
setAdditional(adams.data.spreadsheet.SpreadSheetColumnRange value)
Sets the additional columns to add to the plot containers.void
setClassDistribution(adams.data.spreadsheet.SpreadSheetUnorderedColumnRange value)
Sets the class distribution columns.void
setPredicted(adams.data.spreadsheet.SpreadSheetColumnIndex value)
Sets the column with the predicted values.void
setPredictionsFile(adams.core.io.PlaceholderFile value)
Sets the file with the predictions.void
setReader(adams.data.io.input.SpreadSheetReader value)
Sets the spreadsheet reader to use.void
setWeight(adams.data.spreadsheet.SpreadSheetColumnIndex value)
Sets the column with the weight values.String
weightTipText()
Returns the tip text for this property.-
Methods inherited from class weka.classifiers.simple.AbstractSimpleClassifier
distributionForInstance, getCapabilities, runClassifier
-
Methods inherited from class weka.core.AbstractSimpleOptionHandler
getOptions, listOptions, setOptions
-
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
-
-
-
-
Field Detail
-
m_PredictionsFile
protected adams.core.io.PlaceholderFile m_PredictionsFile
the predictions to use.
-
m_Reader
protected adams.data.io.input.SpreadSheetReader m_Reader
the spreadsheet reader to use.
-
m_Actual
protected adams.data.spreadsheet.SpreadSheetColumnIndex m_Actual
the column with the actual values.
-
m_ActualIndex
protected int m_ActualIndex
the actual column index.
-
m_Predicted
protected adams.data.spreadsheet.SpreadSheetColumnIndex m_Predicted
the column with the predicted values.
-
m_PredictedIndex
protected int m_PredictedIndex
the predicted column index.
-
m_Weight
protected adams.data.spreadsheet.SpreadSheetColumnIndex m_Weight
the column with the error values (optional).
-
m_WeightIndex
protected int m_WeightIndex
the weight column index.
-
m_ClassDistribution
protected adams.data.spreadsheet.SpreadSheetUnorderedColumnRange m_ClassDistribution
the class distribution columns (if any).
-
m_ClassDistributionIndices
protected int[] m_ClassDistributionIndices
the class distribution column indices.
-
m_Additional
protected adams.data.spreadsheet.SpreadSheetColumnRange m_Additional
the additional columns in the spreadsheet to add to the plot containers.
-
m_AdditionalIndices
protected int[] m_AdditionalIndices
the additional column indices.
-
m_Predictions
protected adams.data.spreadsheet.SpreadSheet m_Predictions
the actual predictions.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceadams.core.GlobalInfoSupporter
- Specified by:
globalInfo
in classadams.core.option.AbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceadams.core.option.OptionHandler
- Overrides:
defineOptions
in classadams.core.option.AbstractOptionHandler
-
setPredictionsFile
public void setPredictionsFile(adams.core.io.PlaceholderFile value)
Sets the file with the predictions.- Parameters:
value
- the file
-
getPredictionsFile
public adams.core.io.PlaceholderFile getPredictionsFile()
Returns the file with the predictions.- Returns:
- the file
-
predictionsFileTipText
public String predictionsFileTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setReader
public void setReader(adams.data.io.input.SpreadSheetReader value)
Sets the spreadsheet reader to use.- Parameters:
value
- the reader
-
getReader
public adams.data.io.input.SpreadSheetReader getReader()
Returns the spreadsheet reader to use.- Returns:
- the reader
-
readerTipText
public String readerTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setActual
public void setActual(adams.data.spreadsheet.SpreadSheetColumnIndex value)
Sets the column with the actual values.- Parameters:
value
- the column
-
getActual
public adams.data.spreadsheet.SpreadSheetColumnIndex getActual()
Returns the column with the actual values.- Returns:
- the range
-
actualTipText
public String actualTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setPredicted
public void setPredicted(adams.data.spreadsheet.SpreadSheetColumnIndex value)
Sets the column with the predicted values.- Parameters:
value
- the column
-
getPredicted
public adams.data.spreadsheet.SpreadSheetColumnIndex getPredicted()
Returns the column with the predicted values.- Returns:
- the range
-
predictedTipText
public String predictedTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setWeight
public void setWeight(adams.data.spreadsheet.SpreadSheetColumnIndex value)
Sets the column with the weight values.- Parameters:
value
- the column
-
getWeight
public adams.data.spreadsheet.SpreadSheetColumnIndex getWeight()
Returns the column with the weight values.- Returns:
- the column
-
weightTipText
public String weightTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setClassDistribution
public void setClassDistribution(adams.data.spreadsheet.SpreadSheetUnorderedColumnRange value)
Sets the class distribution columns.- Parameters:
value
- the columns
-
getClassDistribution
public adams.data.spreadsheet.SpreadSheetUnorderedColumnRange getClassDistribution()
Returns the class distribution columns.- Returns:
- the columns
-
classDistributionTipText
public String classDistributionTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setAdditional
public void setAdditional(adams.data.spreadsheet.SpreadSheetColumnRange value)
Sets the additional columns to add to the plot containers.- Parameters:
value
- the columns
-
getAdditional
public adams.data.spreadsheet.SpreadSheetColumnRange getAdditional()
Returns the additional columns to add to the plot containers.- Returns:
- the columns
-
additionalTipText
public String additionalTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getPredictions
public adams.data.spreadsheet.SpreadSheet getPredictions()
Returns the predictions that were loaded.- Returns:
- the predictions, null if not available
-
getActualIndex
public int getActualIndex()
Returns the actual 0-based index.- Returns:
- the index, -1 if not initialized
-
getPredictedIndex
public int getPredictedIndex()
Returns the predicted 0-based index.- Returns:
- the index, -1 if not initialized
-
getWeightIndex
public int getWeightIndex()
Returns the weight 0-based index.- Returns:
- the index, -1 if not initialized
-
getClassDistributionIndices
public int[] getClassDistributionIndices()
Returns the 0-based indices of the class distribution columns.- Returns:
- the indices, 0-length array if not initialized or not used
-
getAdditionalIndices
public int[] getAdditionalIndices()
Returns the 0-based indices of the additional columns.- Returns:
- the indices, 0-length array if not initialized or not used
-
buildClassifier
public void buildClassifier(weka.core.Instances data) throws Exception
Just loads the predictions.- Parameters:
data
- ignored- Throws:
Exception
- if loading of predictions failed
-
classifyInstance
public double classifyInstance(weka.core.Instance instance) throws Exception
Always returns 0.- Specified by:
classifyInstance
in interfaceweka.classifiers.Classifier
- Overrides:
classifyInstance
in classAbstractSimpleClassifier
- Parameters:
instance
- the instance to be classified- Returns:
- always 0
- Throws:
Exception
- never thrown
-
-