Class AggregateEvaluations

    • Field Detail

      • m_RelationName

        protected String m_RelationName
        dataset name.
      • m_Predictions

        protected List<weka.classifiers.evaluation.Prediction> m_Predictions
        the collected predictions.
      • m_Aggregated

        protected transient weka.classifiers.Evaluation m_Aggregated
        the aggregated evaluation.
      • m_ClassLabels

        protected List<String> m_ClassLabels
        the optional class labels.
      • m_SortLabels

        protected boolean m_SortLabels
        whether to sort the labels.
      • m_Comparator

        protected Comparator m_Comparator
        the comparator to use.
      • m_Reverse

        protected boolean m_Reverse
        whether to reverse the sorting.
      • m_LastError

        protected String m_LastError
        the last error.
    • Constructor Detail

      • AggregateEvaluations

        public AggregateEvaluations()
        Initializes the object.
    • Method Detail

      • initialize

        protected void initialize()
        Initializes the members.
      • getPredictions

        public List<weka.classifiers.evaluation.Prediction> getPredictions()
        Returns all the currently stored predictions.
        Returns:
        the predictions
      • setClassLabels

        public void setClassLabels​(List<String> value)
        Sets the class labels to use.
        Parameters:
        value - the labels
      • getClassLabels

        public List<String> getClassLabels()
        Returns the currently set class labels, if any.
        Returns:
        the labels, null if none set
      • setSortLabels

        public void setSortLabels​(boolean value)
        Sets whether to sort the labels with the specified comparator.
        Parameters:
        value - true if to sort
      • getSortLabels

        public boolean getSortLabels()
        Returns whether to store the labels with the specified comparator.
        Returns:
        true if to sort
      • setComparator

        public void setComparator​(Comparator value)
        Sets the comparator to use.
        Parameters:
        value - the comparator
      • getComparator

        public Comparator getComparator()
        Returns the comparator to use.
        Returns:
        the comparator
      • setReverse

        public void setReverse​(boolean value)
        Sets whether to reverse the sorting.
        Parameters:
        value - true if to reverse
      • getReverse

        public boolean getReverse()
        Returns whether to reverse the sorting.
        Returns:
        true if to reverse
      • add

        public String add​(weka.classifiers.evaluation.Prediction pred)
        Adds the prediction.
        Parameters:
        pred - the prediction to add
        Returns:
        null if successfully added, otherwise error message
      • add

        public String add​(weka.classifiers.Evaluation eval)
        Adds the predictions of the given Evaluation object.
        Parameters:
        eval - the evaluation to add
        Returns:
        null if successfully added, otherwise error message
      • add

        public String add​(SpreadSheet sheet,
                          int colAct,
                          int colPred,
                          int colWeight,
                          int[] colsDist,
                          boolean useColNamesAsLabels)
        Adds the data from the spreadsheet as predictions.
        Parameters:
        sheet - the spreadsheet with the data
        colAct - the "actual" column index
        colPred - the "predicted" column index
        colWeight - the column with the weight, -1 if not present
        colsDist - the columns with the class distribution, null if not present
        useColNamesAsLabels - whether to use the column names as class labels, requires colsDist
        Returns:
        null if successfully added, otherwise error message
      • doAggregate

        protected weka.classifiers.Evaluation doAggregate()
        Performs the aggregation.
        Returns:
        the aggregated evaluation
      • aggregated

        public weka.classifiers.Evaluation aggregated()
        Returns the aggregated evaluation.
        Returns:
        the aggregated evaluation
      • hasLastError

        public boolean hasLastError()
        Returns whether an error was encountered during the last operation.
        Specified by:
        hasLastError in interface ErrorProvider
        Returns:
        true if an error occurred
      • getLastError

        public String getLastError()
        Returns the error that occurred during the last operation.
        Specified by:
        getLastError in interface ErrorProvider
        Returns:
        the error string, null if none occurred
      • toString

        public String toString()
        Returns a short description of current state.
        Overrides:
        toString in class Object
        Returns:
        short description