Module datarush.analytics
Class PMMLRegressionClassificationModel
java.lang.Object
com.pervasive.datarush.analytics.pmml.PMMLModel
com.pervasive.datarush.analytics.regression.AbstractPMMLRegressionModel
com.pervasive.datarush.analytics.regression.PMMLRegressionClassificationModel
Implementation of a 'maximum likelihood' classifier on top of regression models. The classifier
has one RegressionTable for each category whose result on an input record is interpreted as the relative
likelihood of the record belonging to that category. The predicted category is the one with the highest
likelihood.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.pervasive.datarush.analytics.regression.AbstractPMMLRegressionModel
AbstractPMMLRegressionModel.CategoricalPredictor, AbstractPMMLRegressionModel.ModelType, AbstractPMMLRegressionModel.NormalizationMethod, AbstractPMMLRegressionModel.NumericPredictor, AbstractPMMLRegressionModel.RegressionTableNested classes/interfaces inherited from class com.pervasive.datarush.analytics.pmml.PMMLModel
PMMLModel.MiningFunction -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreate an empty model, to be filled in by the addCategory and addPredictor methods or by parse()PMMLRegressionClassificationModel(PMMLModelSpec objectSpec) PMMLRegressionClassificationModel(Document document) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCategoricalPredictor(String categoryName, AbstractPMMLRegressionModel.CategoricalPredictor predictor) Adds a categorical predictor to the sub-model that predicts membership in a given category.voidaddCategory(String categoryName) Extend the classifier to predict membership in another class.voidaddNumericPredictor(String categoryName, AbstractPMMLRegressionModel.NumericPredictor predictor) Adds a numeric predictor to the sub-model that predicts membership in a given category.protected voidbuildModelElement(Element element) Subclasses must implement this method to fill-in the contents of the model element.com.pervasive.datarush.analytics.regression.AbstractPMMLRegressionModel.ValuePredictorgetCategoryPredictor(String category, RecordValued input, DoubleSettable target) Get the likelihood predictor for a particular categoryprotected voidparseModelElement(Element element) Parse the given model element into the respective model object.voidsetIntercept(String categoryName, double intercept) Sets the intercept of the submodel that predicts membership in a given category.Methods inherited from class com.pervasive.datarush.analytics.regression.AbstractPMMLRegressionModel
getModelElementName, getModelName, getNormalizationMethod, isScorable, logistic, setModelName, setNormalizationMethod, setScorableMethods inherited from class com.pervasive.datarush.analytics.pmml.PMMLModel
findModelElement, getAnnotationText, getModelExplanation, getModelSpec, getVersion, parse, setAnnotationText, setModelExplanation, setVersion, toPMML
-
Field Details
-
FUNCTION_NAME
- See Also:
-
-
Constructor Details
-
PMMLRegressionClassificationModel
public PMMLRegressionClassificationModel()Create an empty model, to be filled in by the addCategory and addPredictor methods or by parse() -
PMMLRegressionClassificationModel
-
PMMLRegressionClassificationModel
-
-
Method Details
-
buildModelElement
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 classAbstractPMMLRegressionModel- Parameters:
element- the model element
-
parseModelElement
Description copied from class:AbstractPMMLRegressionModelParse 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.- Overrides:
parseModelElementin classAbstractPMMLRegressionModel- Parameters:
element- root element of model object
-
addCategory
Extend the classifier to predict membership in another class. Does nothing if it already predicts that class.- Parameters:
categoryName-
-
addNumericPredictor
public void addNumericPredictor(String categoryName, AbstractPMMLRegressionModel.NumericPredictor predictor) Adds a numeric predictor to the sub-model that predicts membership in a given category.- Parameters:
categoryName- which category the predictor's coefficient applies topredictor- the predictor to add
-
addCategoricalPredictor
public void addCategoricalPredictor(String categoryName, AbstractPMMLRegressionModel.CategoricalPredictor predictor) Adds a categorical predictor to the sub-model that predicts membership in a given category.- Parameters:
categoryName- which category the predictor's coefficient applies topredictor- the predictor to add
-
setIntercept
Sets the intercept of the submodel that predicts membership in a given category.- Parameters:
categoryName- which category the intercept belongs tointercept- the value of the intercept
-
getCategories
- Returns:
- a collection of the categories recognized by this classification model.
-
getCategoryPredictor
public com.pervasive.datarush.analytics.regression.AbstractPMMLRegressionModel.ValuePredictor getCategoryPredictor(String category, RecordValued input, DoubleSettable target) Get the likelihood predictor for a particular category- Parameters:
category- the category whose likelihood is to be predictedinput- the predictor's input recordtarget- the predictor's output- Returns:
- a likelihood predictor
-