Class ReevaluateModel
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.gui.tools.wekainvestigator.evaluation.AbstractEvaluation<ClusterTab,ResultItem>
-
- adams.gui.tools.wekainvestigator.tab.clustertab.evaluation.AbstractClustererEvaluation
-
- adams.gui.tools.wekainvestigator.tab.clustertab.evaluation.ReevaluateModel
-
- All Implemented Interfaces:
GlobalInfoSupporter
,LoggingSupporter
,SizeOfHandler
,StatusMessageHandler
,Serializable
public class ReevaluateModel extends AbstractClustererEvaluation
Re-evaluates a serialized model.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
KEY_DATASET
static String
KEY_MODEL
protected BaseComboBox<String>
m_ComboBoxDatasets
the datasets.protected weka.core.Instances
m_Header
the training header (if any).protected weka.clusterers.Clusterer
m_Model
the current model.protected DefaultComboBoxModel<String>
m_ModelDatasets
the datasets model.protected FileChooserPanel
m_PanelModel
the serialized model.protected ParameterPanel
m_PanelParameters
the panel with the parameters.-
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 ReevaluateModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
activate(int index)
Activates the specified dataset.String
canEvaluate(weka.clusterers.Clusterer clusterer)
Tests whether the clusterer can be evaluated.void
deserialize(Map<String,Object> data, MessageCollection errors)
Restores the objects.protected void
doEvaluate(weka.clusterers.Clusterer clusterer, ResultItem item)
Evaluates the clusterer and updates the result item.String
getName()
Returns the name of the evaluation (displayed in combobox).String
globalInfo()
Returns a string describing the object.ResultItem
init(weka.clusterers.Clusterer clusterer)
Initializes the result item.protected void
initGUI()
Initializes the widgets.protected void
initialize()
Initializes the members.protected String
loadModel()
Attempts to load the model and (if available) the header.Map<String,Object>
serialize(Set<AbstractInvestigatorTab.SerializationOption> options)
Returns the objects for serialization.void
update()
Updates the settings panel.-
Methods inherited from class adams.gui.tools.wekainvestigator.tab.clustertab.evaluation.AbstractClustererEvaluation
evaluate, getEvaluations
-
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_DATASET
public static final String KEY_DATASET
- See Also:
- Constant Field Values
-
KEY_MODEL
public static final String KEY_MODEL
- See Also:
- Constant Field Values
-
m_PanelParameters
protected ParameterPanel m_PanelParameters
the panel with the parameters.
-
m_ComboBoxDatasets
protected BaseComboBox<String> m_ComboBoxDatasets
the datasets.
-
m_ModelDatasets
protected DefaultComboBoxModel<String> m_ModelDatasets
the datasets model.
-
m_PanelModel
protected FileChooserPanel m_PanelModel
the serialized model.
-
m_Model
protected weka.clusterers.Clusterer m_Model
the current model.
-
m_Header
protected weka.core.Instances m_Header
the training header (if any).
-
-
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:
initialize
in classAbstractEvaluation<ClusterTab,ResultItem>
-
initGUI
protected void initGUI()
Initializes the widgets.- Overrides:
initGUI
in classAbstractEvaluation<ClusterTab,ResultItem>
-
getName
public String getName()
Returns the name of the evaluation (displayed in combobox).- Specified by:
getName
in classAbstractEvaluation<ClusterTab,ResultItem>
- Returns:
- the name
-
loadModel
protected String loadModel()
Attempts to load the model and (if available) the header.- Returns:
- null if successfully loaded, otherwise error message
-
canEvaluate
public String canEvaluate(weka.clusterers.Clusterer clusterer)
Tests whether the clusterer can be evaluated.- Specified by:
canEvaluate
in classAbstractClustererEvaluation
- Parameters:
clusterer
- the current clusterer- Returns:
- null if successful, otherwise error message
-
init
public ResultItem init(weka.clusterers.Clusterer clusterer) throws Exception
Initializes the result item.- Specified by:
init
in classAbstractClustererEvaluation
- Parameters:
clusterer
- the current clusterer- Returns:
- the initialized history item
- Throws:
Exception
- if initialization fails
-
doEvaluate
protected void doEvaluate(weka.clusterers.Clusterer clusterer, ResultItem item) throws Exception
Evaluates the clusterer and updates the result item.- Specified by:
doEvaluate
in classAbstractClustererEvaluation
- Parameters:
clusterer
- the current clustereritem
- the item to update- Throws:
Exception
- if evaluation fails
-
update
public void update()
Updates the settings panel.- Specified by:
update
in classAbstractEvaluation<ClusterTab,ResultItem>
-
activate
public void activate(int index)
Activates the specified dataset.- Specified by:
activate
in classAbstractEvaluation<ClusterTab,ResultItem>
- Parameters:
index
- the index of the dataset
-
serialize
public Map<String,Object> serialize(Set<AbstractInvestigatorTab.SerializationOption> options)
Returns the objects for serialization.- Overrides:
serialize
in classAbstractEvaluation<ClusterTab,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:
deserialize
in classAbstractEvaluation<ClusterTab,ResultItem>
- Parameters:
data
- the data to restoreerrors
- for storing errors
-
-