Class WekaClassifierErrors.DataGenerator

  • Enclosing class:
    WekaClassifierErrors

    public static class WekaClassifierErrors.DataGenerator
    extends Object
    Helper class for generating visualization data.
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    • Field Detail

      • m_Evaluation

        protected weka.classifiers.Evaluation m_Evaluation
        the underlying Evaluation object.
      • m_PlotInstances

        protected weka.core.Instances m_PlotInstances
        the underlying data.
      • m_PlotShapes

        protected weka.core.FastVector m_PlotShapes
        for storing the plot shapes.
      • m_PlotSizes

        protected weka.core.FastVector m_PlotSizes
        for storing the plot sizes.
      • m_Processed

        protected boolean m_Processed
        whether the data has already been processed.
    • Constructor Detail

      • DataGenerator

        public DataGenerator​(weka.classifiers.Evaluation eval,
                             AbstractErrorScaler scaler)
        Initializes the generator.
        Parameters:
        eval - the Evaluation object to use
        scaler - the scaler scheme to use for the errors
    • Method Detail

      • process

        protected void process()
        Processes the data if necessary.
      • getEvaluation

        public weka.classifiers.Evaluation getEvaluation()
        Returns the underlying Evaluation object.
        Returns:
        the Evaluation object
      • getErrorScaler

        public AbstractErrorScaler getErrorScaler()
        Returns the scaling scheme.
        Returns:
        the scaler
      • getPlotInstances

        public weka.core.Instances getPlotInstances()
        Returns the generated dataset that is plotted.
        Returns:
        the dataset
      • createDataset

        protected void createDataset​(weka.classifiers.Evaluation eval)
        Generates a dataset, containing the predicted vs actual values.
        Parameters:
        eval - for obtaining the dataset information and predictions
      • getPlotData

        public weka.gui.visualize.PlotData2D getPlotData()
                                                  throws Exception
        Assembles and returns the plot. The relation name of the dataset gets added automatically.
        Returns:
        the plot
        Throws:
        Exception - if plot generation fails