java.lang.Object
com.pervasive.datarush.analytics.pmml.PMMLModel
- Direct Known Subclasses:
AbstractPMMLRegressionModel,GenericPMMLModel,PMMLAssociationModel,PMMLClusteringModel,PMMLNaiveBayesModel,PMMLSummaryStatisticsModel,PMMLSupportVectorMachineModel,PMMLTreeModel
Base class for PMML object model objects. Provides a basic framework
for creating the PMML header, MiningSchema, DataDictionary, etc.
Subclasses provide the rest.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnumeration of values for the "functionName" attribute -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefault constructor.protectedPMMLModel(PMMLModelSpec objectSpec) Create a model, specifying a model spec. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidbuildModelElement(Element element) Subclasses must implement this method to fill-in the contents of the model element.protected ElementfindModelElement(Document document) Subclasses that require custom selection of their model element should override this method.final StringReturns the value of theAnnotationsub-element.protected abstract StringReturn the element name of the primary model element associated with this PMMLReturns the value of theModelExplanationsub-element.final PMMLModelSpecReturns the meta-information associated with this PMML modelReturns the PMML version used by this modelprotected final voidTo be invoked by subclasses constructor.protected abstract voidparseModelElement(Element element) Parse the given model element into the respective model object.final voidsetAnnotationText(String annotationText) Sets the value of theAnnotationsub-element.voidsetModelExplanation(ModelExplanation modelExplanation) Sets the value of theModelExplanationsub-element.voidsetVersion(PMMLVersion version) Sets the PMML version used by this modelfinal DocumenttoPMML()Returns a PMML document from this PMMLModel.
-
Constructor Details
-
PMMLModel
Create a model, specifying a model spec. Subclasses should mirror this constructor, defining one constructor that takes a model spec.- Parameters:
objectSpec- the model spec
-
PMMLModel
protected PMMLModel()Default constructor. Subclasses should define a constructor that takes aDocument, invokes this constructor and then invokesparse(Document).
-
-
Method Details
-
getVersion
Returns the PMML version used by this model- Returns:
- the PMML version
-
setVersion
Sets the PMML version used by this model- Parameters:
version- the PMML version
-
getModelSpec
Returns the meta-information associated with this PMML model- Returns:
- the meta-information
-
getModelExplanation
Returns the value of theModelExplanationsub-element.- Returns:
- the model explanation
-
setModelExplanation
Sets the value of theModelExplanationsub-element.- Parameters:
modelExplanation- the model explanation
-
getAnnotationText
Returns the value of theAnnotationsub-element.- Returns:
- the value of the
Annotationsub-element.
-
setAnnotationText
Sets the value of theAnnotationsub-element.- Parameters:
annotationText- the value of theAnnotationsub-element.
-
toPMML
Returns a PMML document from this PMMLModel.- Returns:
- the PMML for this model
-
parse
To be invoked by subclasses constructor. By-convension, each subclass should defined a constructor that takes a single argument of typeDocument.- Parameters:
document- the PMML document
-
getModelElementName
Return the element name of the primary model element associated with this PMML- Returns:
- the element name of the primary model element
-
buildModelElement
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.- Parameters:
element- the model element
-
parseModelElement
Parse the given model element into the respective model object.- Parameters:
element- root element of model object
-
findModelElement
Subclasses that require custom selection of their model element should override this method. By default, we find the first element that matchesthe model element name. In general the default implementation is sufficient; this is primarily intended for PMMLModels whose model element is a PMML extension.- Parameters:
document- The PMML document.- Returns:
- The model element.
-