Module datarush.analytics
Class PMMLNaiveBayesModel
- java.lang.Object
-
- com.pervasive.datarush.analytics.pmml.PMMLModel
-
- com.pervasive.datarush.analytics.naivebayes.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 anTargetStatistics
extension in order to support numerical data.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.pervasive.datarush.analytics.pmml.PMMLModel
PMMLModel.MiningFunction
-
-
Constructor Summary
Constructors Constructor Description PMMLNaiveBayesModel(PMMLModelSpec modelSpec)
Create a PMMLNaiveBayesModel for the given spec.PMMLNaiveBayesModel(Document document)
Create a PMMLNaiveBayesModel, initialized to the contents of the given PMML document.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
buildModelElement(Element element)
Subclasses must implement this method to fill-in the contents of the model element.Map<String,InputMappingModel>
getInputMappings()
Gets the map of inputs for the PMML.protected String
getModelElementName()
Return the element name of the primary model element associated with this PMMLString
getModelName()
Returns the "modelName" attribute for the model.Map<String,Long>
getTargetCounts()
Gets the map of target counts for the PMML.double
getThreshold()
Gets the "threshold" attribute for the model.protected void
parseModelElement(Element element)
Parse the given model element into the respective model object.void
setInputMappings(Map<String,InputMappingModel> inputMappings)
Sets the map of inputs for the PMML.void
setModelName(String modelName)
Sets the "modelName" attribute for the model.void
setTargetCounts(Map<String,Long> targetCounts)
Sets the map of target counts for the PMML.void
setThreshold(double threshold)
Sets the "threshold" attribute for the model.-
Methods inherited from class com.pervasive.datarush.analytics.pmml.PMMLModel
findModelElement, getAnnotationText, getModelExplanation, getModelSpec, getVersion, parse, setAnnotationText, setModelExplanation, setVersion, toPMML
-
-
-
-
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 classPMMLModel
- 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 classPMMLModel
- 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 classPMMLModel
- Returns:
- the element name of the primary model element
-
-