Module datarush.analytics
Class PMMLNaiveBayesModel
java.lang.Object
com.pervasive.datarush.analytics.pmml.PMMLModel
com.pervasive.datarush.analytics.naivebayes.PMMLNaiveBayesModel
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.-
Nested Class Summary
Nested classes/interfaces inherited from class com.pervasive.datarush.analytics.pmml.PMMLModel
PMMLModel.MiningFunction -
Constructor Summary
ConstructorsConstructorDescriptionPMMLNaiveBayesModel(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
Modifier and TypeMethodDescriptionprotected voidbuildModelElement(Element element) Subclasses must implement this method to fill-in the contents of the model element.Gets the map of inputs for the PMML.protected StringReturn the element name of the primary model element associated with this PMMLReturns the "modelName" attribute for the model.Gets the map of target counts for the PMML.doubleGets the "threshold" attribute for the model.protected voidparseModelElement(Element element) Parse the given model element into the respective model object.voidsetInputMappings(Map<String, InputMappingModel> inputMappings) Sets the map of inputs for the PMML.voidsetModelName(String modelName) Sets the "modelName" attribute for the model.voidsetTargetCounts(Map<String, Long> targetCounts) Sets the map of target counts for the PMML.voidsetThreshold(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 Details
-
PMMLNaiveBayesModel
Create a PMMLNaiveBayesModel for the given spec.- Parameters:
modelSpec- The PMMLModelSpec
-
PMMLNaiveBayesModel
Create a PMMLNaiveBayesModel, initialized to the contents of the given PMML document.- Parameters:
document- The PMML document.
-
-
Method Details
-
setModelName
Sets the "modelName" attribute for the model.- Parameters:
modelName- the "modelName" attribute for the model.
-
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
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
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
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
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
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 classPMMLModel- Parameters:
element- the model element
-
parseModelElement
Description copied from class:PMMLModelParse the given model element into the respective model object.- Specified by:
parseModelElementin classPMMLModel- Parameters:
element- root element of model object
-
getModelElementName
Description copied from class:PMMLModelReturn the element name of the primary model element associated with this PMML- Specified by:
getModelElementNamein classPMMLModel- Returns:
- the element name of the primary model element
-