Class AbstractPMMLRegressionModel

    • 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
      • 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 class PMMLModel
        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 class PMMLModel
        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 class PMMLModel
        Parameters:
        element - root element of model object
        Throws:
        UnsupportedPPMMLException - if the normalization method is not represented in the NormalizationMethod enum.