Class FromPredictions
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.gui.tools.wekainvestigator.evaluation.AbstractEvaluation<ClassifyTab,ResultItem>
-
- adams.gui.tools.wekainvestigator.tab.classifytab.evaluation.AbstractClassifierEvaluation
-
- adams.gui.tools.wekainvestigator.tab.classifytab.evaluation.FromPredictions
-
- All Implemented Interfaces:
GlobalInfoSupporter,LoggingSupporter,SizeOfHandler,StatusMessageHandler,Serializable
public class FromPredictions extends AbstractClassifierEvaluation
Loads predictions from a spreadsheet for evaluation.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringKEY_ACTUALstatic StringKEY_ADDITIONALstatic StringKEY_CLASSDISTRIBUTIONstatic StringKEY_FILEstatic StringKEY_PREDICTEDstatic StringKEY_READERstatic StringKEY_WEIGHTprotected FromPredictionsm_Modelthe fake model.protected SpreadSheetFileChooserPanelm_PanelFilethe preditions file.protected ParameterPanelm_PanelParametersthe panel with the parameters.protected IndexTextFieldm_TextActualthe text with the actual column index.protected RangeTextFieldm_TextAdditionalthe columns with the additional data to store.protected RangeTextFieldm_TextClassDistributionthe columns with the class distribution columns range.protected IndexTextFieldm_TextPredictedthe text with the predicted column index.protected IndexTextFieldm_TextWeightthe text with the weight column index.-
Fields inherited from class adams.gui.tools.wekainvestigator.evaluation.AbstractEvaluation
m_Owner, m_PanelOptions
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description FromPredictions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate(int index)Activates the specified dataset.StringcanEvaluate(weka.classifiers.Classifier classifier)Tests whether the classifier can be evaluated.protected StringcreateFakeModel()Creates the fake model.voiddeserialize(Map<String,Object> data, MessageCollection errors)Restores the objects.protected voiddoEvaluate(weka.classifiers.Classifier classifier, ResultItem item)Evaluates the classifier and updates the result item.StringgetName()Returns the name of the evaluation (displayed in combobox).StringglobalInfo()Returns a string describing the object.ResultIteminit(weka.classifiers.Classifier classifier)Initializes the result item.protected voidinitGUI()Initializes the widgets.protected voidinitialize()Initializes the members.Map<String,Object>serialize(Set<AbstractInvestigatorTab.SerializationOption> options)Returns the objects for serialization.voidupdate()Updates the settings panel.-
Methods inherited from class adams.gui.tools.wekainvestigator.tab.classifytab.evaluation.AbstractClassifierEvaluation
evaluate, fillWithAttributeNames, getEvaluations, transferAdditionalAttributes
-
Methods inherited from class adams.gui.tools.wekainvestigator.evaluation.AbstractEvaluation
addObjectSize, addToHistory, getOwner, getPanel, getProperties, getTestingUpdateInterval, isValidDataIndex, listOrArray, setOwner, showStatus, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
KEY_FILE
public static final String KEY_FILE
- See Also:
- Constant Field Values
-
KEY_READER
public static final String KEY_READER
- See Also:
- Constant Field Values
-
KEY_ACTUAL
public static final String KEY_ACTUAL
- See Also:
- Constant Field Values
-
KEY_PREDICTED
public static final String KEY_PREDICTED
- See Also:
- Constant Field Values
-
KEY_WEIGHT
public static final String KEY_WEIGHT
- See Also:
- Constant Field Values
-
KEY_CLASSDISTRIBUTION
public static final String KEY_CLASSDISTRIBUTION
- See Also:
- Constant Field Values
-
KEY_ADDITIONAL
public static final String KEY_ADDITIONAL
- See Also:
- Constant Field Values
-
m_PanelParameters
protected ParameterPanel m_PanelParameters
the panel with the parameters.
-
m_PanelFile
protected SpreadSheetFileChooserPanel m_PanelFile
the preditions file.
-
m_TextActual
protected IndexTextField m_TextActual
the text with the actual column index.
-
m_TextPredicted
protected IndexTextField m_TextPredicted
the text with the predicted column index.
-
m_TextWeight
protected IndexTextField m_TextWeight
the text with the weight column index.
-
m_TextClassDistribution
protected RangeTextField m_TextClassDistribution
the columns with the class distribution columns range.
-
m_TextAdditional
protected RangeTextField m_TextAdditional
the columns with the additional data to store.
-
m_Model
protected FromPredictions m_Model
the fake model.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Returns:
- a description suitable for displaying in the gui
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initializein classAbstractEvaluation<ClassifyTab,ResultItem>
-
initGUI
protected void initGUI()
Initializes the widgets.- Overrides:
initGUIin classAbstractEvaluation<ClassifyTab,ResultItem>
-
getName
public String getName()
Returns the name of the evaluation (displayed in combobox).- Specified by:
getNamein classAbstractEvaluation<ClassifyTab,ResultItem>- Returns:
- the name
-
createFakeModel
protected String createFakeModel()
Creates the fake model.- Returns:
- null if successfully loaded, otherwise error message
-
canEvaluate
public String canEvaluate(weka.classifiers.Classifier classifier)
Tests whether the classifier can be evaluated.- Specified by:
canEvaluatein classAbstractClassifierEvaluation- Returns:
- null if successful, otherwise error message
-
init
public ResultItem init(weka.classifiers.Classifier classifier) throws Exception
Initializes the result item.- Specified by:
initin classAbstractClassifierEvaluation- Parameters:
classifier- the current classifier- Returns:
- the initialized history item
- Throws:
Exception- if initialization fails
-
doEvaluate
protected void doEvaluate(weka.classifiers.Classifier classifier, ResultItem item) throws ExceptionEvaluates the classifier and updates the result item.- Specified by:
doEvaluatein classAbstractClassifierEvaluation- Parameters:
classifier- the current classifieritem- the item to update- Throws:
Exception- if evaluation fails
-
update
public void update()
Updates the settings panel.- Specified by:
updatein classAbstractEvaluation<ClassifyTab,ResultItem>
-
activate
public void activate(int index)
Activates the specified dataset.- Specified by:
activatein classAbstractEvaluation<ClassifyTab,ResultItem>- Parameters:
index- the index of the dataset
-
serialize
public Map<String,Object> serialize(Set<AbstractInvestigatorTab.SerializationOption> options)
Returns the objects for serialization.- Overrides:
serializein classAbstractEvaluation<ClassifyTab,ResultItem>- Parameters:
options- what to serialize- Returns:
- the mapping of the objects to serialize
-
deserialize
public void deserialize(Map<String,Object> data, MessageCollection errors)
Restores the objects.- Overrides:
deserializein classAbstractEvaluation<ClassifyTab,ResultItem>- Parameters:
data- the data to restoreerrors- for storing errors
-
-