Module datarush.analytics
Class AbstractPMMLRegressionModel
- java.lang.Object
-
- com.pervasive.datarush.analytics.pmml.PMMLModel
-
- com.pervasive.datarush.analytics.regression.AbstractPMMLRegressionModel
-
- Direct Known Subclasses:
PMMLRegressionClassificationModel
,PMMLRegressionModel
public abstract class AbstractPMMLRegressionModel extends PMMLModel
A representation of features found in PMML regressionModel elements that do not depend on its attributes.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractPMMLRegressionModel.CategoricalPredictor
static class
AbstractPMMLRegressionModel.ModelType
The possible values of the ModelType attribute of a PMML regressionModel.static class
AbstractPMMLRegressionModel.NormalizationMethod
The normalization methods used.static class
AbstractPMMLRegressionModel.NumericPredictor
Capture information about numeric predictor values.protected static class
AbstractPMMLRegressionModel.RegressionTable
-
Nested classes/interfaces inherited from class com.pervasive.datarush.analytics.pmml.PMMLModel
PMMLModel.MiningFunction
-
-
Constructor Summary
Constructors Constructor Description AbstractPMMLRegressionModel()
AbstractPMMLRegressionModel(PMMLModelSpec objectSpec)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
buildModelElement(Element element)
Subclasses must implement this method to fill-in the contents of the model element.protected String
getModelElementName()
Return the element name of the primary model element associated with this PMMLString
getModelName()
AbstractPMMLRegressionModel.NormalizationMethod
getNormalizationMethod()
boolean
isScorable()
static double
logistic(double value)
An implementation of the logit model's normalization function.protected void
parseModelElement(Element element)
Parse the given model element into the respective model object.void
setModelName(String modelName)
void
setNormalizationMethod(AbstractPMMLRegressionModel.NormalizationMethod normalizationMethod)
void
setScorable(boolean b)
Whether a consumer can use the model to make predictions (set to false to indicate the model is for information purposes only.)-
Methods inherited from class com.pervasive.datarush.analytics.pmml.PMMLModel
findModelElement, getAnnotationText, getModelExplanation, getModelSpec, getVersion, parse, setAnnotationText, setModelExplanation, setVersion, toPMML
-
-
-
-
Constructor Detail
-
AbstractPMMLRegressionModel
public AbstractPMMLRegressionModel(PMMLModelSpec objectSpec)
-
AbstractPMMLRegressionModel
public AbstractPMMLRegressionModel()
-
-
Method Detail
-
logistic
public static double logistic(double value)
An implementation of the logit model's normalization function.- Parameters:
value
- the real number to normalize.- Returns:
- the normalized value, between 0 and 1, or NaN if the input value is not-a-number.
-
setScorable
public void setScorable(boolean b)
Whether a consumer can use the model to make predictions (set to false to indicate the model is for information purposes only.)- Parameters:
b
-
-
isScorable
public boolean isScorable()
- Returns:
- whether the model should be used for predictions.
-
setNormalizationMethod
public void setNormalizationMethod(AbstractPMMLRegressionModel.NormalizationMethod normalizationMethod)
- Parameters:
normalizationMethod
- the normalization method to use to transform the linear result to a prediction
-
getNormalizationMethod
public AbstractPMMLRegressionModel.NormalizationMethod getNormalizationMethod()
- Returns:
- the normalization method used to transform the linear result to a prediction
-
setModelName
public void setModelName(String modelName)
- Parameters:
modelName
- the desired "modelName" PMML attribute
-
getModelName
public String getModelName()
- Returns:
- the current value of the "modelName" PMML attribute. The modelName is a brief natural-language description of the model.
-
getModelElementName
protected String getModelElementName()
Description copied from class:PMMLModel
Return the element name of the primary model element associated with this PMML- Specified by:
getModelElementName
in classPMMLModel
- Returns:
- the element name of the primary model element
-
buildModelElement
protected abstract void buildModelElement(Element element)
Description copied from class:PMMLModel
Subclasses must implement this method to fill-in the contents of the model element. At the time this method is invoked, the element will have its name and MiningSchema sub-element populated.- Specified by:
buildModelElement
in classPMMLModel
- Parameters:
element
- the model element
-
parseModelElement
protected void parseModelElement(Element element)
Parse the given model element into the respective model object. This implementation only reads the normalizationMethod and scorable attributes. Subclasses SHOULD override this and are responsible for Regression Tables and the function name and target field attributes.- Specified by:
parseModelElement
in classPMMLModel
- Parameters:
element
- root element of model object- Throws:
UnsupportedPPMMLException
- if the normalization method is not represented in the NormalizationMethod enum.
-
-