Class PMMLRegressionModel


public class PMMLRegressionModel extends AbstractPMMLRegressionModel
PMML object model for Regression models.
  • Constructor Details

    • PMMLRegressionModel

      public PMMLRegressionModel(PMMLModelSpec objectSpec)
      Construct the PMML model from a model specification.
      Parameters:
      objectSpec - model specification
    • PMMLRegressionModel

      public PMMLRegressionModel(Document document)
      Construct the PMML model directly from an XML document.
      Parameters:
      document - XML document containing PMML
  • Method Details

    • setIntercept

      public void setIntercept(double value)
      Set the intercept value.
      Parameters:
      value - intercept value
    • setInterceptDegreesOfFreedom

      public void setInterceptDegreesOfFreedom(int value)
      Set the intercept's degrees of freedom.
      Parameters:
      value - interceptDegreesOfFreedom value
    • setInterceptStandardError

      public void setInterceptStandardError(double value)
      Set the intercept's standard error.
      Parameters:
      value - interceptStandardError value
    • setInterceptTTest

      public void setInterceptTTest(double value)
      Set the intercept's t test.
      Parameters:
      value - interceptTTest value
    • setInterceptPValue

      public void setInterceptPValue(double value)
      Set the intercept's p value.
      Parameters:
      value - interceptPValue value
    • getIntercept

      public double getIntercept()
      Get the intercept value.
      Returns:
      intercept value
    • addNumericPredictor

      public void addNumericPredictor(AbstractPMMLRegressionModel.NumericPredictor numericPredictor)
      Add a numeric predictor to the PMML model. A numeric predictor contains the model values for an independent variable and can be used to predict an outcome given an instance value of the independent variable.
      Parameters:
      numericPredictor - numeric predictor
    • getNumericPredictors

      public List<AbstractPMMLRegressionModel.NumericPredictor> getNumericPredictors()
      Return the list of numeric predictors for this model.
      Returns:
      numeric predictors
    • getNumericPredictor

      public AbstractPMMLRegressionModel.NumericPredictor getNumericPredictor(String indepVarName)
      Get the numeric predictor for the given independent variable. The given name must match the name of an independent variable in the model.
      Parameters:
      indepVarName - name of the independent variable
      Returns:
      numeric predictor
    • addCategoricalPredictor

      public void addCategoricalPredictor(AbstractPMMLRegressionModel.CategoricalPredictor categoricalPredictor)
      Adds a categorical predictor to the PMML model. A categorical predictor describes the behavior of the model with regards to a single possible value of a discrete independent variable
      Parameters:
      categoricalPredictor - the Categorical Predictor element
    • getCategoricalPredictors

      public List<AbstractPMMLRegressionModel.CategoricalPredictor> getCategoricalPredictors()
      Returns:
      all the Categorical Predictor elements
    • getCategoricalPredictor

      public List<AbstractPMMLRegressionModel.CategoricalPredictor> getCategoricalPredictor(String indepVarName)
      Get the categorical predictor for the given independent variable. The given name must match the name of an independent variable in the model.
      Parameters:
      indepVarName - name of the independent variable
      Returns:
      categorical predictor
    • getValuePredictor

      public com.pervasive.datarush.analytics.regression.AbstractPMMLRegressionModel.ValuePredictor getValuePredictor(RecordValued input, DoubleSettable target)
      Get a value predictor for this model. The input record is provided as input along with a settable target for the predicted value. The value predictor can be used to produce an output prediction for each input record of a dataflow.
      Parameters:
      input - input data source containing independent data values
      target - output field containing result of prediction
      Returns:
      value predictor
    • buildModelElement

      protected 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 class AbstractPMMLRegressionModel
      Parameters:
      element - the model element
    • parseModelElement

      protected void parseModelElement(Element element)
      Description copied from class: AbstractPMMLRegressionModel
      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.
      Overrides:
      parseModelElement in class AbstractPMMLRegressionModel
      Parameters:
      element - root element of model object