Class PredictionHelper
- java.lang.Object
-
- adams.gui.tools.wekainvestigator.tab.classifytab.PredictionHelper
-
public class PredictionHelper extends Object
Helper class for dealing with predictions from result items.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
-
-
Constructor Summary
Constructors Constructor Description PredictionHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SpreadSheettoSpreadSheet(LoggingSupporter logger, MessageCollection errors, ResultItem item, boolean addAdditionalAttributes, boolean showError)Turns the result item into a spreadsheet with the predictions.static SpreadSheettoSpreadSheet(LoggingSupporter logger, MessageCollection errors, ResultItem item, boolean addAdditionalAttributes, boolean addLabelIndex, boolean showDistribution, boolean showProbability, boolean showError, boolean showWeight)Turns the result item into a spreadsheet with the predictions.static SpreadSheettoSpreadSheet(LoggingSupporter logger, MessageCollection errors, weka.classifiers.Evaluation eval, int[] originalIndices, SpreadSheet additionalAttributes, boolean showError)Turns the result item into a spreadsheet with the predictions.static SpreadSheettoSpreadSheet(LoggingSupporter logger, MessageCollection errors, weka.classifiers.Evaluation eval, int[] originalIndices, SpreadSheet additionalAttributes, boolean addLabelIndex, boolean showDistribution, boolean showProbability, boolean showError, boolean showWeight)Turns the result item into a spreadsheet with the predictions.static SpreadSheettoSpreadSheet(LoggingSupporter logger, MessageCollection errors, weka.classifiers.Evaluation eval, int[] originalIndices, SpreadSheet additionalAttributes, boolean addLabelIndex, boolean showDistribution, boolean showProbability, boolean showError, boolean showWeight, boolean showAbsError, boolean showRelError)Turns the result item into a spreadsheet with the predictions.static int[]toSubset(int[] originalIndices)Treats the indices as a subset, generating new indices while maintaining order.static SpreadSheettoSubset(int[] originalIndices, SpreadSheet additionalAttributes)Returns the subset of the additional attributes as per indices.
-
-
-
Method Detail
-
toSubset
public static int[] toSubset(int[] originalIndices)
Treats the indices as a subset, generating new indices while maintaining order.- Parameters:
originalIndices- the indices to process- Returns:
- the indices for the subset
-
toSubset
public static SpreadSheet toSubset(int[] originalIndices, SpreadSheet additionalAttributes)
Returns the subset of the additional attributes as per indices.- Parameters:
originalIndices- the indices of the subsetadditionalAttributes- the full additional attributes- Returns:
- the subset of the additional attributes
-
toSpreadSheet
public static SpreadSheet toSpreadSheet(LoggingSupporter logger, MessageCollection errors, ResultItem item, boolean addAdditionalAttributes, boolean showError)
Turns the result item into a spreadsheet with the predictions.- Parameters:
logger- the object used for logging, can be nullerrors- for collecting errorsitem- the result item to useaddAdditionalAttributes- whether to add additional attributesshowError- whether to add the error in a separate column- Returns:
- the generated spreadsheet
-
toSpreadSheet
public static SpreadSheet toSpreadSheet(LoggingSupporter logger, MessageCollection errors, weka.classifiers.Evaluation eval, int[] originalIndices, SpreadSheet additionalAttributes, boolean showError)
Turns the result item into a spreadsheet with the predictions.- Parameters:
logger- the object used for logging, can be nullerrors- for collecting errorseval- the evaluation to useoriginalIndices- the original indices to use, can be nulladditionalAttributes- the additional attributes to add, can be nullshowError- whether to add the error in a separate column- Returns:
- the generated spreadsheet
-
toSpreadSheet
public static SpreadSheet toSpreadSheet(LoggingSupporter logger, MessageCollection errors, ResultItem item, boolean addAdditionalAttributes, boolean addLabelIndex, boolean showDistribution, boolean showProbability, boolean showError, boolean showWeight)
Turns the result item into a spreadsheet with the predictions.- Parameters:
logger- the object used for logging, can be nullerrors- for collecting errorsitem- the result item to useaddAdditionalAttributes- whether to add additional attributesaddLabelIndex- whether to add the label index in a separate columnshowDistribution- whether to add the distribution in a separate columnshowProbability- whether to add the probability in a separate columnshowError- whether to add the error in a separate columnshowWeight- whether to add the weight in a separate column- Returns:
- the generated spreadsheet, null if failed
-
toSpreadSheet
public static SpreadSheet toSpreadSheet(LoggingSupporter logger, MessageCollection errors, weka.classifiers.Evaluation eval, int[] originalIndices, SpreadSheet additionalAttributes, boolean addLabelIndex, boolean showDistribution, boolean showProbability, boolean showError, boolean showWeight)
Turns the result item into a spreadsheet with the predictions.- Parameters:
logger- the object used for logging, can be nullerrors- for collecting errorseval- the evaluation to useoriginalIndices- the original indices to use, can be nulladditionalAttributes- the additional attributes to use, can be nulladdLabelIndex- whether to add the label index in a separate columnshowDistribution- whether to add the distribution in a separate columnshowProbability- whether to add the probability in a separate columnshowError- whether to add the error in a separate columnshowWeight- whether to add the weight in a separate column- Returns:
- the generated spreadsheet, null if failed
-
toSpreadSheet
public static SpreadSheet toSpreadSheet(LoggingSupporter logger, MessageCollection errors, weka.classifiers.Evaluation eval, int[] originalIndices, SpreadSheet additionalAttributes, boolean addLabelIndex, boolean showDistribution, boolean showProbability, boolean showError, boolean showWeight, boolean showAbsError, boolean showRelError)
Turns the result item into a spreadsheet with the predictions.- Parameters:
logger- the object used for logging, can be nullerrors- for collecting errorseval- the evaluation to useoriginalIndices- the original indices to use, can be nulladditionalAttributes- the additional attributes to use, can be nulladdLabelIndex- whether to add the label index in a separate columnshowDistribution- whether to add the distribution in a separate columnshowProbability- whether to add the probability in a separate columnshowError- whether to add the error in a separate columnshowWeight- whether to add the weight in a separate columnshowAbsError- whether to show absolute errorsshowRelError- whether to show the relative error- Returns:
- the generated spreadsheet, null if failed
-
-