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 classAbstractPMMLRegressionModel.CategoricalPredictorstatic classAbstractPMMLRegressionModel.ModelTypeThe possible values of the ModelType attribute of a PMML regressionModel.static classAbstractPMMLRegressionModel.NormalizationMethodThe normalization methods used.static classAbstractPMMLRegressionModel.NumericPredictorCapture information about numeric predictor values.protected static classAbstractPMMLRegressionModel.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 voidbuildModelElement(Element element)Subclasses must implement this method to fill-in the contents of the model element.protected StringgetModelElementName()Return the element name of the primary model element associated with this PMMLStringgetModelName()AbstractPMMLRegressionModel.NormalizationMethodgetNormalizationMethod()booleanisScorable()static doublelogistic(double value)An implementation of the logit model's normalization function.protected voidparseModelElement(Element element)Parse the given model element into the respective model object.voidsetModelName(String modelName)voidsetNormalizationMethod(AbstractPMMLRegressionModel.NormalizationMethod normalizationMethod)voidsetScorable(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:PMMLModelReturn the element name of the primary model element associated with this PMML- Specified by:
getModelElementNamein classPMMLModel- Returns:
- the element name of the primary model element
-
buildModelElement
protected abstract void buildModelElement(Element element)
Description copied from class:PMMLModelSubclasses 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:
buildModelElementin 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:
parseModelElementin classPMMLModel- Parameters:
element- root element of model object- Throws:
UnsupportedPPMMLException- if the normalization method is not represented in the NormalizationMethod enum.
-
-