Class PredictionHelper


  • public class PredictionHelper
    extends Object
    Helper class for dealing with predictions from result items.
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static adams.data.spreadsheet.SpreadSheet toSpreadSheet​(adams.core.logging.LoggingSupporter logger, adams.core.MessageCollection errors, ResultItem item, boolean addAdditionalAttributes, boolean showError)
      Turns the result item into a spreadsheet with the predictions.
      static adams.data.spreadsheet.SpreadSheet toSpreadSheet​(adams.core.logging.LoggingSupporter logger, adams.core.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 adams.data.spreadsheet.SpreadSheet toSpreadSheet​(adams.core.logging.LoggingSupporter logger, adams.core.MessageCollection errors, weka.classifiers.Evaluation eval, int[] originalIndices, adams.data.spreadsheet.SpreadSheet additionalAttributes, boolean showError)
      Turns the result item into a spreadsheet with the predictions.
      static adams.data.spreadsheet.SpreadSheet toSpreadSheet​(adams.core.logging.LoggingSupporter logger, adams.core.MessageCollection errors, weka.classifiers.Evaluation eval, int[] originalIndices, adams.data.spreadsheet.SpreadSheet additionalAttributes, boolean addLabelIndex, boolean showDistribution, boolean showProbability, boolean showError, boolean showWeight)
      Turns the result item into a spreadsheet with the predictions.
    • Constructor Detail

      • PredictionHelper

        public PredictionHelper()
    • Method Detail

      • toSpreadSheet

        public static adams.data.spreadsheet.SpreadSheet toSpreadSheet​(adams.core.logging.LoggingSupporter logger,
                                                                       adams.core.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 null
        errors - for collecting errors
        item - the result item to use
        addAdditionalAttributes - whether to add additional attributes
        showError - whether to add the error in a separate column
        Returns:
        the generated spreadsheet
      • toSpreadSheet

        public static adams.data.spreadsheet.SpreadSheet toSpreadSheet​(adams.core.logging.LoggingSupporter logger,
                                                                       adams.core.MessageCollection errors,
                                                                       weka.classifiers.Evaluation eval,
                                                                       int[] originalIndices,
                                                                       adams.data.spreadsheet.SpreadSheet additionalAttributes,
                                                                       boolean showError)
        Turns the result item into a spreadsheet with the predictions.
        Parameters:
        logger - the object used for logging, can be null
        errors - for collecting errors
        eval - the evaluation to use
        originalIndices - the original indices to use, can be null
        additionalAttributes - the additional attributes to add, can be null
        showError - whether to add the error in a separate column
        Returns:
        the generated spreadsheet
      • toSpreadSheet

        public static adams.data.spreadsheet.SpreadSheet toSpreadSheet​(adams.core.logging.LoggingSupporter logger,
                                                                       adams.core.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 null
        errors - for collecting errors
        item - the result item to use
        addAdditionalAttributes - whether to add additional attributes
        addLabelIndex - whether to add the label index in a separate column
        showDistribution - whether to add the distribution in a separate column
        showProbability - whether to add the probability in a separate column
        showError - whether to add the error in a separate column
        showWeight - whether to add the weight in a separate column
        Returns:
        the generated spreadsheet, null if failed
      • toSpreadSheet

        public static adams.data.spreadsheet.SpreadSheet toSpreadSheet​(adams.core.logging.LoggingSupporter logger,
                                                                       adams.core.MessageCollection errors,
                                                                       weka.classifiers.Evaluation eval,
                                                                       int[] originalIndices,
                                                                       adams.data.spreadsheet.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 null
        errors - for collecting errors
        eval - the evaluation to use
        originalIndices - the original indices to use, can be null
        additionalAttributes - the additional attributes to use, can be null
        addLabelIndex - whether to add the label index in a separate column
        showDistribution - whether to add the distribution in a separate column
        showProbability - whether to add the probability in a separate column
        showError - whether to add the error in a separate column
        showWeight - whether to add the weight in a separate column
        Returns:
        the generated spreadsheet, null if failed