Module datarush.analytics
Class TargetStatistics
- java.lang.Object
-
- com.pervasive.datarush.analytics.naivebayes.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.
-
-
Field Summary
Fields Modifier and Type Field Description static String
ATT_MEAN
static String
ATT_VARIANCE
-
Constructor Summary
Constructors Constructor Description TargetStatistics(double sum, double sumSquares, long nonNullCount)
Creates a TargetStatistics object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getMean()
Returns the mean of the data values.long
getNonNullCount()
Returns the number of non-null data values.double
getSum()
Returns the sum of the data values.double
getSumSquares()
Returns the sum of the squares of the data values.double
getVariance()
Returns the sample variance of the data values.
-
-
-
Field Detail
-
ATT_MEAN
public static final String ATT_MEAN
- See Also:
- Constant Field Values
-
ATT_VARIANCE
public static final String ATT_VARIANCE
- See Also:
- Constant Field 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.
-
-