Class ResultItem
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.gui.tools.wekainvestigator.output.AbstractResultItem
-
- adams.gui.tools.wekainvestigator.output.AbstractNestableResultItem
-
- adams.gui.tools.wekainvestigator.tab.classifytab.ResultItem
-
- All Implemented Interfaces:
CleanUpHandler,LoggingSupporter,SizeOfHandler,Serializable
public class ResultItem extends AbstractNestableResultItem
Container for an evaluation, model, training set header. Used in the result history.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected SpreadSheetm_AdditionalAttributesadditional attributes.protected weka.classifiers.Evaluationm_Evaluationthe evaluation object.protected weka.classifiers.Evaluation[]m_FoldEvaluationsthe evaluation objects from the folds.protected weka.classifiers.Classifier[]m_FoldModelsthe fold models.protected int[][]m_FoldOriginalIndicesthe original indices (folds).protected weka.classifiers.Classifierm_Modelthe model.protected int[]m_OriginalIndicesthe original indices.protected weka.classifiers.Evaluation[]m_RunEvaluationsthe evaluation objects from the runs.protected MetaDatam_RunInformationthe run information.protected weka.classifiers.Classifier[]m_RunModelsthe run models.protected int[][]m_RunOriginalIndicesthe original indices (runs).protected weka.classifiers.Classifierm_Templatethe template.-
Fields inherited from class adams.gui.tools.wekainvestigator.output.AbstractNestableResultItem
m_NameSuffix, m_NestedItems
-
Fields inherited from class adams.gui.tools.wekainvestigator.output.AbstractResultItem
m_Header, m_Log, m_LogPanel, m_Name, m_TabbedPane, m_Timestamp, MAX_RELATIONNAME_LENGTH
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description ResultItem(weka.classifiers.Classifier template, weka.core.Instances header)Initializes the item.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringcreateName()Creates the name from the members.SpreadSheetgetAdditionalAttributes()Returns the stored additional attributes data.weka.classifiers.EvaluationgetEvaluation()Returns the stored Evaluation object.weka.classifiers.EvaluationgetFoldEvaluation(int index)Returns the stored Evaluation objects per specified fold.weka.classifiers.Evaluation[]getFoldEvaluations()Returns the stored Evaluation objects per fold.weka.classifiers.ClassifiergetFoldModel(int index)Returns the stored Classifier object for the specified fold.weka.classifiers.Classifier[]getFoldModels()Returns the stored Classifier objects per fold.int[][]getFoldOriginalIndices()Returns the stored original indices per fold.int[]getFoldOriginalIndices(int index)Returns the stored original indices for the specified fold.weka.classifiers.ClassifiergetModel()Returns the stored model object.int[]getOriginalIndices()Returns the stored original indices.weka.classifiers.EvaluationgetRunEvaluation(int index)Returns the stored Evaluation objects per specified run.weka.classifiers.Evaluation[]getRunEvaluations()Returns the stored Evaluation objects per run.MetaDatagetRunInformation()Returns the stored run information.weka.classifiers.Classifier[]getRunModels()Returns the stored Classifier objects per run.int[][]getRunOriginalIndices()Returns the stored original indices per run.int[]getRunOriginalIndices(int index)Returns the stored original indices for the specified run.weka.classifiers.ClassifiergetTemplate()Returns the stored template object.booleanhasAdditionalAttributes()Returns whether additional attributes data is present.booleanhasEvaluation()Returns whether an Evaluation object is present.booleanhasFoldEvaluations()Returns whether Evaluation objects per fold are present.booleanhasFoldModels()Returns whether Classifier objects per fold are present.booleanhasFoldOriginalIndices()Returns whether the original indices per fold are present.booleanhasModel()Returns whether an model object is present.booleanhasOriginalIndices()Returns whether the original indices are present.booleanhasRunEvaluations()Returns whether Evaluation objects per run are present.booleanhasRunInformation()Returns whether run information is present.booleanhasRunModels()Returns whether Classifier objects per run are present.booleanhasRunOriginalIndices()Returns whether the original indices per run are present.voidsetAdditionalAttributes(SpreadSheet value)Sets the additional attributes data.voidsetModel(weka.classifiers.Classifier value)Sets the model to make available.voidsetTemplate(weka.classifiers.Classifier value)Sets the stored template object.StringtoString()Returns a short description of the container.ResultItemupdate(int[] original)Updates the item.ResultItemupdate(MetaData runInfo)Updates the item.ResultItemupdate(SpreadSheet additional)Updates the item.ResultItemupdate(weka.classifiers.Classifier model)Updates the item.ResultItemupdate(weka.classifiers.Evaluation evaluation)Updates the item.ResultItemupdateFolds(int[][] foldOriginal)Updates the item.ResultItemupdateFolds(weka.classifiers.Classifier[] foldModels)Updates the item.ResultItemupdateFolds(weka.classifiers.Evaluation[] foldEvaluations)Updates the item.ResultItemupdateRuns(int[][] runOriginal)Updates the item.ResultItemupdateRuns(weka.classifiers.Classifier[] runModels)Updates the item.ResultItemupdateRuns(weka.classifiers.Evaluation[] runEvaluations)Updates the item.-
Methods inherited from class adams.gui.tools.wekainvestigator.output.AbstractNestableResultItem
addNestedItem, cleanUp, getNameSuffix, getNestedItem, hasNestedItems, nestedItemNames, setNameSuffix
-
Methods inherited from class adams.gui.tools.wekainvestigator.output.AbstractResultItem
getHeader, getLogPanel, getName, getTabbedPane, hasHeader, invalidateName, logError, logMessage
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
m_Evaluation
protected weka.classifiers.Evaluation m_Evaluation
the evaluation object.
-
m_FoldEvaluations
protected weka.classifiers.Evaluation[] m_FoldEvaluations
the evaluation objects from the folds.
-
m_RunEvaluations
protected weka.classifiers.Evaluation[] m_RunEvaluations
the evaluation objects from the runs.
-
m_Template
protected weka.classifiers.Classifier m_Template
the template.
-
m_Model
protected weka.classifiers.Classifier m_Model
the model.
-
m_FoldModels
protected weka.classifiers.Classifier[] m_FoldModels
the fold models.
-
m_RunModels
protected weka.classifiers.Classifier[] m_RunModels
the run models.
-
m_RunInformation
protected MetaData m_RunInformation
the run information.
-
m_OriginalIndices
protected int[] m_OriginalIndices
the original indices.
-
m_FoldOriginalIndices
protected int[][] m_FoldOriginalIndices
the original indices (folds).
-
m_RunOriginalIndices
protected int[][] m_RunOriginalIndices
the original indices (runs).
-
m_AdditionalAttributes
protected SpreadSheet m_AdditionalAttributes
additional attributes.
-
-
Method Detail
-
createName
protected String createName()
Creates the name from the members.- Specified by:
createNamein classAbstractResultItem- Returns:
- the name
-
update
public ResultItem update(MetaData runInfo)
Updates the item.- Parameters:
runInfo- the meta-data for the run- Returns:
- itself
-
update
public ResultItem update(weka.classifiers.Evaluation evaluation)
Updates the item.- Parameters:
evaluation- the evaluation- Returns:
- itself
-
update
public ResultItem update(weka.classifiers.Classifier model)
Updates the item.- Parameters:
model- the model- Returns:
- itself
-
update
public ResultItem update(int[] original)
Updates the item.- Parameters:
original- the original indices- Returns:
- itself
-
update
public ResultItem update(SpreadSheet additional)
Updates the item.- Parameters:
additional- the additional attributes- Returns:
- itself
-
updateFolds
public ResultItem updateFolds(weka.classifiers.Evaluation[] foldEvaluations)
Updates the item.- Parameters:
foldEvaluations- the evaluations per fold- Returns:
- itself
-
updateFolds
public ResultItem updateFolds(weka.classifiers.Classifier[] foldModels)
Updates the item.- Parameters:
foldModels- the models per fold- Returns:
- itself
-
updateFolds
public ResultItem updateFolds(int[][] foldOriginal)
Updates the item.- Parameters:
foldOriginal- the original indices per fold- Returns:
- itself
-
updateRuns
public ResultItem updateRuns(weka.classifiers.Evaluation[] runEvaluations)
Updates the item.- Parameters:
runEvaluations- the evaluations per run- Returns:
- itself
-
updateRuns
public ResultItem updateRuns(weka.classifiers.Classifier[] runModels)
Updates the item.- Parameters:
runModels- the models per run- Returns:
- itself
-
updateRuns
public ResultItem updateRuns(int[][] runOriginal)
Updates the item.- Parameters:
runOriginal- the original indices per run- Returns:
- itself
-
hasEvaluation
public boolean hasEvaluation()
Returns whether an Evaluation object is present.- Returns:
- true if available
-
getEvaluation
public weka.classifiers.Evaluation getEvaluation()
Returns the stored Evaluation object.- Returns:
- the evaluation, null if not present
-
hasFoldEvaluations
public boolean hasFoldEvaluations()
Returns whether Evaluation objects per fold are present.- Returns:
- true if available
-
getFoldEvaluations
public weka.classifiers.Evaluation[] getFoldEvaluations()
Returns the stored Evaluation objects per fold.- Returns:
- the evaluations per fold, null if not present
-
getFoldEvaluation
public weka.classifiers.Evaluation getFoldEvaluation(int index)
Returns the stored Evaluation objects per specified fold.- Parameters:
index- the index of the fold to return- Returns:
- the evaluation for the fold, null if not present
-
hasRunEvaluations
public boolean hasRunEvaluations()
Returns whether Evaluation objects per run are present.- Returns:
- true if available
-
getRunEvaluations
public weka.classifiers.Evaluation[] getRunEvaluations()
Returns the stored Evaluation objects per run.- Returns:
- the evaluations per run, null if not present
-
getRunEvaluation
public weka.classifiers.Evaluation getRunEvaluation(int index)
Returns the stored Evaluation objects per specified run.- Parameters:
index- the index of the run to return- Returns:
- the evaluation for the run, null if not present
-
setTemplate
public void setTemplate(weka.classifiers.Classifier value)
Sets the stored template object.- Parameters:
value- the template
-
getTemplate
public weka.classifiers.Classifier getTemplate()
Returns the stored template object.- Returns:
- the template
-
hasModel
public boolean hasModel()
Returns whether an model object is present.- Returns:
- true if available
-
setModel
public void setModel(weka.classifiers.Classifier value)
Sets the model to make available.- Parameters:
value- the model
-
getModel
public weka.classifiers.Classifier getModel()
Returns the stored model object.- Returns:
- the model, null if not present
-
hasFoldModels
public boolean hasFoldModels()
Returns whether Classifier objects per fold are present.- Returns:
- true if available
-
getFoldModels
public weka.classifiers.Classifier[] getFoldModels()
Returns the stored Classifier objects per fold.- Returns:
- the classifiers per fold, null if not present
-
getFoldModel
public weka.classifiers.Classifier getFoldModel(int index)
Returns the stored Classifier object for the specified fold.- Parameters:
index- the index of the fold- Returns:
- the classifier for the fold, null if not present
-
hasRunModels
public boolean hasRunModels()
Returns whether Classifier objects per run are present.- Returns:
- true if available
-
getRunModels
public weka.classifiers.Classifier[] getRunModels()
Returns the stored Classifier objects per run.- Returns:
- the classifiers per run, null if not present
-
hasRunInformation
public boolean hasRunInformation()
Returns whether run information is present.- Returns:
- true if available
-
getRunInformation
public MetaData getRunInformation()
Returns the stored run information.- Returns:
- the information, null if not present
-
hasOriginalIndices
public boolean hasOriginalIndices()
Returns whether the original indices are present.- Returns:
- true if available
-
getOriginalIndices
public int[] getOriginalIndices()
Returns the stored original indices.- Returns:
- the indices, null if not present
-
hasFoldOriginalIndices
public boolean hasFoldOriginalIndices()
Returns whether the original indices per fold are present.- Returns:
- true if available
-
getFoldOriginalIndices
public int[][] getFoldOriginalIndices()
Returns the stored original indices per fold.- Returns:
- the indices, null if not present
-
getFoldOriginalIndices
public int[] getFoldOriginalIndices(int index)
Returns the stored original indices for the specified fold.- Parameters:
index- the index of the fold to return- Returns:
- the indices for the fold, null if not present
-
hasRunOriginalIndices
public boolean hasRunOriginalIndices()
Returns whether the original indices per run are present.- Returns:
- true if available
-
getRunOriginalIndices
public int[][] getRunOriginalIndices()
Returns the stored original indices per run.- Returns:
- the indices, null if not present
-
getRunOriginalIndices
public int[] getRunOriginalIndices(int index)
Returns the stored original indices for the specified run.- Parameters:
index- the index of the run to return- Returns:
- the indices for the run, null if not present
-
hasAdditionalAttributes
public boolean hasAdditionalAttributes()
Returns whether additional attributes data is present.- Returns:
- true if available
-
setAdditionalAttributes
public void setAdditionalAttributes(SpreadSheet value)
Sets the additional attributes data.- Parameters:
value- the data, null if not present
-
getAdditionalAttributes
public SpreadSheet getAdditionalAttributes()
Returns the stored additional attributes data.- Returns:
- the data, null if not present
-
toString
public String toString()
Returns a short description of the container.- Specified by:
toStringin classAbstractResultItem- Returns:
- the description
-
-