Class TargetStatistics


  • public final class TargetStatistics
    extends Object
    PMML extension used to support numerical data. Corresponds to a "TargetStatistics" element that provides mean, stddev, and non-null count such that a predictor can predict using a Gaussian model. The following is an example of the extension:
     <BayesInput fieldName="continuous1">
        <Extension name="targetStatistics">
           <TargetStatistics value="bad" mean="7.5" nonNullCount="4" sum="30.0" sumSquares="230.0" variance="1.6666666666666667"/>
           <TargetStatistics value="good" mean="3.0" nonNullCount="5" sum="15.0" sumSquares="55.0" variance="2.5"/>
           <TargetStatistics value="ok" mean="11.0" nonNullCount="3" sum="33.0" sumSquares="365.0" variance="1.0"/>
        </Extension>
    </BayesInput>
     
    In PMML 4.2 or later a TargetValueStats element was added that should be used for continuous/numerical data. Currently we only support GaussianDistribution although the element also supports PoissonDistribution.
    • Constructor Detail

      • TargetStatistics

        public TargetStatistics​(double sum,
                                double sumSquares,
                                long nonNullCount)
        Creates a TargetStatistics object.
        Parameters:
        sum - The sum of the data values.
        sumSquares - The sum of the squares of the data values.
        nonNullCount - The number of non-null values.
    • Method Detail

      • getSum

        public final double getSum()
        Returns the sum of the data values.
        Returns:
        the sum of the data values.
      • getSumSquares

        public final double getSumSquares()
        Returns the sum of the squares of the data values.
        Returns:
        the sum of the squares of the data data values.
      • getNonNullCount

        public long getNonNullCount()
        Returns the number of non-null data values.
        Returns:
        the number of non-null data values.
      • getMean

        public double getMean()
        Returns the mean of the data values.
        Returns:
        the mean of the data values.
      • getVariance

        public double getVariance()
        Returns the sample variance of the data values.
        Returns:
        the sample variance of the data values.