Class ROCData

    • Constructor Detail

      • ROCData

        public ROCData​(double[] thresholds,
                       LabelAlphabet labelAlphabet)
        Constructs a new object
        Parameters:
        thresholds - Array of thresholds to track counts for
        labelAlphabet - Label alphabet for instances in Trial
    • Method Detail

      • add

        public void add​(Classification classification)
        Adds classification results to the ROC data
        Parameters:
        trial - Trial results to add to ROC data
      • add

        public void add​(Trial trial)
        Adds trial results to the ROC data
        Parameters:
        trial - Trial results to add to ROC data
      • add

        public void add​(ROCData rocData)
        Adds existing ROC data to this ROC data
        Parameters:
        rocData - ROC data to add
      • getCounts

        public int[] getCounts​(Label label,
                               double threshold)
        Gets the raw counts for a specified label and threshold. If data was not collected for the exact threshold specified, then results for the highest threshold <= the specified threshold will be returned.
        Parameters:
        label - Label to get counts for
        threshold - Threshold to get counts for
        Returns:
        Array of raw counts for specified label and threshold
        See Also:
        TRUE_POSITIVE, FALSE_POSITIVE, FALSE_NEGATIVE, TRUE_NEGATIVE
      • getLabelAlphabet

        public LabelAlphabet getLabelAlphabet()
        Gets the label alphabet
      • getPrecision

        public double getPrecision​(Label label,
                                   double threshold)
        Gets the precision for a specified label and threshold. If data was not collected for the exact threshold specified, then results will for the highest threshold <= the specified threshold will be returned.
        Parameters:
        label - Label to get precision for
        threshold - Threshold to get precision for
        Returns:
        Precision for specified label and threshold
      • getPrecisionForScore

        public double getPrecisionForScore​(Label label,
                                           double score)
        Gets the precision for a specified label and score. This differs from {@link ROCData.getPrecision(Label, double)} in that it is the precision for only scores falling in the one score value, not for all scores above the threshold. If data was not collected for the exact threshold specified, then results will for the highest threshold <= the specified threshold will be returned.
        Parameters:
        label - Label to get precision for
        threshold - Threshold to get precision for
        Returns:
        Precision for specified label and score
      • getPositivePercent

        public double getPositivePercent​(Label label,
                                         double threshold)
        Gets the estimated percentage of training events that exceed the threshold.
        Parameters:
        label - Label to get precision for
        threshold - Threshold to get precision for
        Returns:
        Estimated percentage of events exceeding threshold
      • getRecall

        public double getRecall​(Label label,
                                double threshold)
        Gets the recall rate for a specified label and threshold. If data was not collected for the exact threshold specified, then results will for the highest threshold <= the specified threshold will be returned.
        Parameters:
        label - Label to get recall for
        threshold - Threshold to get recall for
        Returns:
        Recall rate for specified label and threshold
      • getThresholds

        public double[] getThresholds()
        Gets the thresholds being tracked
        Returns:
        Array of thresholds
      • setCounts

        public void setCounts​(Label label,
                              double threshold,
                              int[] newCounts)
        Sets the raw counts for a specified label and threshold. If data is not collected for the exact threshold specified, then counts for the highest threshold <= the specified threshold will be set.
        Parameters:
        label - Label to get counts for
        threshold - Threshold to get counts for
        newCounts - New count values for the label and threshold
        See Also:
        TRUE_POSITIVE, FALSE_POSITIVE, FALSE_NEGATIVE, TRUE_NEGATIVE
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object