Class PMMLNaiveBayesModel


  • public final class PMMLNaiveBayesModel
    extends PMMLModel
    PMML Naive Bayes Model. This model uses the standard PMML Naive Bayes model for categorical data. In addition, it uses an TargetStatistics extension in order to support numerical data.
    • Constructor Detail

      • PMMLNaiveBayesModel

        public PMMLNaiveBayesModel​(PMMLModelSpec modelSpec)
        Create a PMMLNaiveBayesModel for the given spec.
        Parameters:
        modelSpec - The PMMLModelSpec
      • PMMLNaiveBayesModel

        public PMMLNaiveBayesModel​(Document document)
        Create a PMMLNaiveBayesModel, initialized to the contents of the given PMML document.
        Parameters:
        document - The PMML document.
    • Method Detail

      • setModelName

        public void setModelName​(String modelName)
        Sets the "modelName" attribute for the model.
        Parameters:
        modelName - the "modelName" attribute for the model.
      • getModelName

        public String getModelName()
        Returns the "modelName" attribute for the model.
        Returns:
        the "modelName" attribute for the model.
      • setThreshold

        public void setThreshold​(double threshold)
        Sets the "threshold" attribute for the model.
        Parameters:
        threshold - the "threshold" attribute for the model.
      • getThreshold

        public double getThreshold()
        Gets the "threshold" attribute for the model.
        Returns:
        the "threshold" attribute for the model.
      • setTargetCounts

        public void setTargetCounts​(Map<String,​Long> targetCounts)
        Sets the map of target counts for the PMML. Provides the contents of the "TargetValueCounts" element. Keys in the map are target names. Values in the map are target counts.
        Parameters:
        targetCounts - the map of target counts
      • getTargetCounts

        public Map<String,​Long> getTargetCounts()
        Gets the map of target counts for the PMML. Provides the contents of the "TargetValueCounts" element. Keys in the map are target names. Values in the map are target counts.
        Returns:
        the map of target counts
      • setInputMappings

        public void setInputMappings​(Map<String,​InputMappingModel> inputMappings)
        Sets the map of inputs for the PMML. Provides the contents of the "BayesInputs" element. Each entry in the map corresponds to one "BayesInput" element. The key determines the "fieldName" attribute. The value determines the payload of the element (PairCounts for discrete).
        Parameters:
        inputMappings - the map of inputs
      • getInputMappings

        public Map<String,​InputMappingModel> getInputMappings()
        Gets the map of inputs for the PMML. Provides the contents of the "BayesInputs" element. Each entry in the map corresponds to one "BayesInput" element. The key determines the "fieldName" attribute. The value determines the payload of the element (PairCounts for discrete).
        Returns:
        the map of inputs
      • 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 PMMLModel
        Parameters:
        element - the model element
      • parseModelElement

        protected void parseModelElement​(Element element)
        Description copied from class: PMMLModel
        Parse the given model element into the respective model object.
        Specified by:
        parseModelElement in class PMMLModel
        Parameters:
        element - root element of model object
      • 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