Class PredictionUtils


  • public class PredictionUtils
    extends Object
    Helper class for predictions from repeated cross-validation runs.
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    • Constructor Detail

      • PredictionUtils

        public PredictionUtils()
    • Method Detail

      • calcStats

        public static adams.data.spreadsheet.SpreadSheet calcStats​(ResultItem item,
                                                                   adams.core.MessageCollection errors,
                                                                   CenterStatistic centerStat,
                                                                   LowerStatistic lowerStat,
                                                                   UpperStatistic upperStat,
                                                                   int numDecimals,
                                                                   adams.core.logging.Logger logger,
                                                                   gnu.trove.list.TIntList cols)
        Generates a spreadsheet with the statistics.
        Parameters:
        item - the item to calculate the statistics from
        errors - for collecting error messages
        centerStat - the center statistics like mean
        lowerStat - the lower bound statistic
        upperStat - the upper bound statistic
        numDecimals - the number of decimals in the spreadsheet, -1 for no rounding
        logger - for logging problems
        cols - for storing the column indices of the computed statistics (center, lower, upper), can be null
        Returns:
        the spreadsheet
      • calcStats

        public static adams.data.spreadsheet.SpreadSheet calcStats​(ResultItem item,
                                                                   adams.core.MessageCollection errors,
                                                                   CenterStatistic centerStat,
                                                                   LowerStatistic lowerStat,
                                                                   UpperStatistic upperStat,
                                                                   int numDecimals,
                                                                   adams.core.logging.Logger logger,
                                                                   gnu.trove.list.TIntList cols,
                                                                   boolean addActual)
        Generates a spreadsheet with the statistics.
        Parameters:
        item - the item to calculate the statistics from
        errors - for collecting error messages
        centerStat - the center statistics like mean
        lowerStat - the lower bound statistic
        upperStat - the upper bound statistic
        numDecimals - the number of decimals in the spreadsheet, -1 for no rounding
        logger - for logging problems
        cols - for storing the column indices of the computed statistics (center, lower, upper, [actual]), can be null
        addActual - whether to add the "actual" value in a separate column
        Returns:
        the spreadsheet
      • calcStats

        public static adams.data.spreadsheet.SpreadSheet calcStats​(WekaEvaluationContainer[] conts,
                                                                   adams.data.spreadsheet.SpreadSheet additional,
                                                                   adams.core.MessageCollection errors,
                                                                   CenterStatistic centerStat,
                                                                   LowerStatistic lowerStat,
                                                                   UpperStatistic upperStat,
                                                                   int numDecimals,
                                                                   adams.core.logging.Logger logger,
                                                                   gnu.trove.list.TIntList cols,
                                                                   boolean addActual)
        Generates a spreadsheet with the statistics.
        Parameters:
        conts - the evaluation containers to calculate the statistics from
        additional - the additional attributes to transfer, can be null
        errors - for collecting error messages
        centerStat - the center statistics like mean
        lowerStat - the lower bound statistic
        upperStat - the upper bound statistic
        numDecimals - the number of decimals in the spreadsheet, -1 for no rounding
        logger - for logging problems
        cols - for storing the column indices of the computed statistics (center, lower, upper, [actual]), can be null
        addActual - whether to add the "actual" value in a separate column
        Returns:
        the spreadsheet