Class LiftChart


  • public final class LiftChart
    extends Object
    Represents a lift chart, used to measure predictive performance. Lift charts are used to measure the predictive performance of a classification network, and tell us how the model compares to a random model and the ideal model.

    Lift charts are particularly useful when the probabilities of correct classification are low, such as when predicting rare events or anomalies. In these circumstances, a confusion matrix may give very high accuracy simply because most cases are not rare events or anomalies and hence correctly predicted. A lift chart however can take small probabilities into account to assess the improvement (lift) in prediction of these rare events or anomalies.

    • Method Detail

      • create

        public static LiftChart create​(String actual,
                                       String predictedProbability,
                                       String caseWeight,
                                       Comparable targetValue,
                                       DataReaderCommand readerCommand)
        Creates a lift chart, used to measure predictive performance.
        Parameters:
        actual - The name of the data column containing the actual classification.
        predictedProbability - The name of the data column which contains the predicted probability generated by an inference query.
        caseWeight - Optional case weight. Can be null.
        targetValue - The target value of interest. E.g. True if we are interested in predicting Purchase=True.
        readerCommand - The predictions.
        Returns:
        A lift chart.
      • getScore

        public double getScore()
        Gets the overall score, which is a positive or negative probability between 0 and 1 indicating the classification performance of the network.

        Score = (area under predicted - area under random) / (area under ideal - area under random)

        A score of 0 indicates that the predictive performance is no better than random.

        A score of 1 indicates the network perfectly predicts all cases.

        A negative score indicates the network performs worse than random, which may indicate incorrect usage.

      • getActual

        public String getActual()
        Gets the name of the data column containing the actual classification.
      • getIdeal

        public double getIdeal()
        Gets the population probability value at which the target reaches 100 %.
      • getPoints

        public List<LiftChartPoint> getPoints()
        Gets the xy points that make up the lift chart.
      • getPredictedProbability

        public String getPredictedProbability()
        Gets the name of the data column which contains the predicted probability generated by an inference query.
      • getTargetValue

        public Comparable getTargetValue()
        Gets the target value which we are interested in. For example, for a variable 'Purchase' with state values True and False, if we are trying to predict whether someone will make a purchase or not, the target value would be True.