Module datarush.analytics
Class PredictiveModelQuality
- java.lang.Object
-
- com.pervasive.datarush.analytics.pmml.ModelQuality
-
- com.pervasive.datarush.analytics.pmml.PredictiveModelQuality
-
public class PredictiveModelQuality extends ModelQuality
A PMML object model for some of the metadata about a predictive (usually regression) model's quality.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PredictiveModelQuality.Usage
Indicator for the phases of model-building during which a dataset may be used.
-
Field Summary
Fields Modifier and Type Field Description protected static String
ELEM_THIS
Constant for the name of thePredictiveModelQuality
element.-
Fields inherited from class com.pervasive.datarush.analytics.pmml.ModelQuality
ATT_DATA_NAME
-
-
Constructor Summary
Constructors Constructor Description PredictiveModelQuality()
Default constructor for bean-like behavior
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Double
getAIC()
Get the Akaike Information Criterion, a measure of the relative goodness of fit of a statistical model.Double
getBIC()
Get the Bayesian Information Criterion, a measure of the relative goodness of fit of a statistical model which penalizes the number of parameters more strongly than AIC.PredictiveModelQuality.Usage
getDataUsage()
Get the dataUsage, the relationship between the model and the dataset used to measure its quality.Integer
getDegreesOfFreedom()
Get the Degrees of Freedom of the error of the modeldouble
getExtensionStatistic(String name)
Retrieve a statistic about the model that is not directly supported by PMMLSet<String>
getExtensionStatisticNames()
Double
getMeanAbsoluteError()
Get the meanAbsoluteError, the mean of the absolute values of the predictive errors on that dataset.Double
getMeanSquaredError()
Get the Mean Squared Error, the mean of the squares of the predictive errors on that dataset.Double
getR_squared()
Get the r-squared attribute, a measure of the amount of variance in the target variable explained by a model.Double
getRootMeanSquaredError()
Get the rootMeanSquaredError, the square root of the mean of the squares of the predictive errors on the dataset.Double
getSumSquaredError()
Get the Sum Of Squares (Error) statistic.Double
getSumSquaredRegression()
Get the Sum Of Squares (Regression) statistic.String
getTargetField()
Get the predicted field on which the quality information was measured.boolean
hasExtensionStatistic(String name)
Check whether a certain statistic is available as an extensionprotected void
parse(Element toParse)
Initialize this object's state from a PMML element with the appropriate typevoid
setAIC(Double AIC)
void
setBIC(Double BIC)
void
setDataUsage(PredictiveModelQuality.Usage dataUsage)
Sets the "dataUsage" attribute for the model.void
setDegreesOfFreedom(Integer degreesOfFreedom)
void
setExtensionStatistic(String name, double value)
Sets the value of an attribute not directly supported by PMML.void
setMeanAbsoluteError(Double meanAbsoluteError)
Sets the "meanAbsoluteError" attribute for the model.void
setMeanSquaredError(Double meanSquaredError)
Sets the "meanSquaredError" attribute for the model.void
setR_squared(Double r_squared)
Sets the "r-squared" attribute for the model.void
setRootMeanSquaredError(Double rootMeanSquaredError)
void
setSumSquaredError(Double sumSquaredError)
void
setSumSquaredRegression(Double sumSquaredRegression)
void
setTargetField(String targetField)
Sets the "targetField" attribute for the model.void
toPMML(Element parent)
Build this ModelQuality as a PMML element with a given parent-
Methods inherited from class com.pervasive.datarush.analytics.pmml.ModelQuality
getDataName, setDataName, smartParse
-
-
-
-
Field Detail
-
ELEM_THIS
protected static final String ELEM_THIS
Constant for the name of thePredictiveModelQuality
element.- See Also:
- Constant Field Values
-
-
Method Detail
-
toPMML
public void toPMML(Element parent)
Description copied from class:ModelQuality
Build this ModelQuality as a PMML element with a given parent- Specified by:
toPMML
in classModelQuality
- Parameters:
parent
- the future parent of the element
-
parse
protected void parse(Element toParse)
Description copied from class:ModelQuality
Initialize this object's state from a PMML element with the appropriate type- Specified by:
parse
in classModelQuality
- Parameters:
toParse
- The element with the state
-
getR_squared
public Double getR_squared()
Get the r-squared attribute, a measure of the amount of variance in the target variable explained by a model. It ranges from 0.0 (the model explains nothing) to 1.0 (the model is a perfect predictor).- Returns:
- the "r-squared" attribute for the model, or null if it is not included.
-
getMeanAbsoluteError
public Double getMeanAbsoluteError()
Get the meanAbsoluteError, the mean of the absolute values of the predictive errors on that dataset.- Returns:
- the "meanAbsoluteError" attribute for the model, or null if it is not included.
-
getRootMeanSquaredError
public Double getRootMeanSquaredError()
Get the rootMeanSquaredError, the square root of the mean of the squares of the predictive errors on the dataset.- Returns:
- the "rootMeanSquaredError" attribute for the model, or null if it is not included.
-
getAIC
public Double getAIC()
Get the Akaike Information Criterion, a measure of the relative goodness of fit of a statistical model.- Returns:
- the "AIC" attribute for the model, or null if it is not included.
-
getBIC
public Double getBIC()
Get the Bayesian Information Criterion, a measure of the relative goodness of fit of a statistical model which penalizes the number of parameters more strongly than AIC.- Returns:
- the "BIC" attribute for the model, or null if it is not included.
-
getDegreesOfFreedom
public Integer getDegreesOfFreedom()
Get the Degrees of Freedom of the error of the model- Returns:
- the "degreesOfFreedom" attribute for the model, or null if it is not included.
-
getMeanSquaredError
public Double getMeanSquaredError()
Get the Mean Squared Error, the mean of the squares of the predictive errors on that dataset.- Returns:
- the "meanSquaredeError" attribute for the model-quality element, or null if it is not included.
-
getSumSquaredError
public Double getSumSquaredError()
Get the Sum Of Squares (Error) statistic.- Returns:
- the "sumSquaredError" attribute for the model-quality element, or null if it is not included.
-
getSumSquaredRegression
public Double getSumSquaredRegression()
Get the Sum Of Squares (Regression) statistic.- Returns:
- the "sumSquaredRegression" attribute for the model-quality element, or null if it is not included.
-
getDataUsage
public PredictiveModelQuality.Usage getDataUsage()
Get the dataUsage, the relationship between the model and the dataset used to measure its quality. It indicates the phase of model-building during which the model was first exposed to data from that set.- Returns:
- the "dataUsage" attribute for the model-quality element.
-
getTargetField
public String getTargetField()
Get the predicted field on which the quality information was measured.- Returns:
- the "dataUsage" attribute for the model-quality element.
-
hasExtensionStatistic
public boolean hasExtensionStatistic(String name)
Check whether a certain statistic is available as an extension- Parameters:
name
- The name of the statistic to check- Returns:
- true iff the statistic is present and available.
-
getExtensionStatistic
public double getExtensionStatistic(String name)
Retrieve a statistic about the model that is not directly supported by PMML- Parameters:
name
- the extension statistic to check- Returns:
- the value of the named extension statistic, or Double.NaN if the extension is not present.
-
getExtensionStatisticNames
public Set<String> getExtensionStatisticNames()
- Returns:
- a collection of Strings which, when passed to hasExtensionStatistic, return true
-
setTargetField
public void setTargetField(String targetField)
Sets the "targetField" attribute for the model.- Parameters:
targetField
- the "targetField" attribute for the model.
-
setR_squared
public void setR_squared(Double r_squared)
Sets the "r-squared" attribute for the model. If null, the attribute will be absent.- Parameters:
r_squared
- the "r-squared" attribute for the model.
-
setMeanAbsoluteError
public void setMeanAbsoluteError(Double meanAbsoluteError)
Sets the "meanAbsoluteError" attribute for the model. If null, the attribute will be absent.- Parameters:
meanAbsoluteError
- the "meanAbsoluteError" attribute for the model.
-
setMeanSquaredError
public void setMeanSquaredError(Double meanSquaredError)
Sets the "meanSquaredError" attribute for the model. If null, the attribute will be absent.- Parameters:
meanSquaredError
- the "meanSquaredError" attribute for the model.
-
setRootMeanSquaredError
public void setRootMeanSquaredError(Double rootMeanSquaredError)
-
setAIC
public void setAIC(Double AIC)
-
setBIC
public void setBIC(Double BIC)
-
setDegreesOfFreedom
public void setDegreesOfFreedom(Integer degreesOfFreedom)
-
setSumSquaredError
public void setSumSquaredError(Double sumSquaredError)
-
setSumSquaredRegression
public void setSumSquaredRegression(Double sumSquaredRegression)
-
setDataUsage
public void setDataUsage(PredictiveModelQuality.Usage dataUsage)
Sets the "dataUsage" attribute for the model. If null, the attribute will be set to "training", the default.- Parameters:
dataUsage
- the "dataUsage" attribute for the model.
-
setExtensionStatistic
public void setExtensionStatistic(String name, double value)
Sets the value of an attribute not directly supported by PMML. It will appear as an Extension element instead of as an attribute.- Parameters:
name
- the "name" attribute of the extensionvalue
- the "value" attribute of the extension
-
-