Package weka.classifiers.pmml.consumer
Class PMMLClassifier
- java.lang.Object
-
- weka.classifiers.Classifier
-
- weka.classifiers.pmml.consumer.PMMLClassifier
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,CapabilitiesHandler,OptionHandler,PMMLModel,RevisionHandler
- Direct Known Subclasses:
GeneralRegression,NeuralNetwork,Regression
public abstract class PMMLClassifier extends Classifier implements java.io.Serializable, PMMLModel
Abstract base class for all PMML classifiers.- Version:
- $Revision: 5562 $
- Author:
- Mark Hall (mhall{[at]}pentaho{[dot]}com)
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbuildClassifier(Instances data)Throw an exception - PMML models are pre-built.voiddone()Signal that a scoring run has been completed.java.lang.StringgetCreatorApplication()Get the name of the application that created this modelInstancesgetDataDictionary()Get the data dictionary.java.lang.StringgetFieldsMappingString()Get a textual description of the mapping between mining schema fields and incoming data fields.LoggergetLog()Get the logger.MiningSchemagetMiningSchema()Get the mining schema for this model.java.lang.StringgetPMMLVersion()Get the PMML version used for this model.voidmapToMiningSchema(Instances dataSet)Map mining schema to incoming instances.voidsetCreatorApplication(org.w3c.dom.Document doc)Set the name of the application (if specified) that created this modelvoidsetLog(Logger log)Set a logger to use.voidsetPMMLVersion(org.w3c.dom.Document doc)Set the version of PMML used for this model.-
Methods inherited from class weka.classifiers.Classifier
classifyInstance, debugTipText, distributionForInstance, forName, getCapabilities, getDebug, getOptions, getRevision, listOptions, makeCopies, makeCopy, setDebug, setOptions
-
-
-
-
Method Detail
-
setPMMLVersion
public void setPMMLVersion(org.w3c.dom.Document doc)
Set the version of PMML used for this model.- Specified by:
setPMMLVersionin interfacePMMLModel- Parameters:
doc- the Document encapsulating the pmml
-
setCreatorApplication
public void setCreatorApplication(org.w3c.dom.Document doc)
Set the name of the application (if specified) that created this model- Specified by:
setCreatorApplicationin interfacePMMLModel- Parameters:
doc- the Document encapsulating the pmml
-
getDataDictionary
public Instances getDataDictionary()
Get the data dictionary.- Returns:
- the data dictionary
-
getMiningSchema
public MiningSchema getMiningSchema()
Get the mining schema for this model.- Specified by:
getMiningSchemain interfacePMMLModel- Returns:
- the mining schema
-
getPMMLVersion
public java.lang.String getPMMLVersion()
Get the PMML version used for this model.- Specified by:
getPMMLVersionin interfacePMMLModel- Returns:
- the PMML version
-
getCreatorApplication
public java.lang.String getCreatorApplication()
Get the name of the application that created this model- Specified by:
getCreatorApplicationin interfacePMMLModel- Returns:
- the name of the creating application or null if not specified in the pmml.
-
setLog
public void setLog(Logger log)
Set a logger to use.
-
getLog
public Logger getLog()
Get the logger.
-
buildClassifier
public void buildClassifier(Instances data) throws java.lang.Exception
Throw an exception - PMML models are pre-built.- Specified by:
buildClassifierin classClassifier- Parameters:
data- the Instances to learn from- Throws:
java.lang.Exception- if something goes wrong
-
done
public void done()
Signal that a scoring run has been completed. Resets the initialized state to false so that a subsequent scoring run will trigger the mapping of the mining schema to incoming instances. If not called after a scoring run, then the classifier will assume that the current mapping is still valid.
-
mapToMiningSchema
public void mapToMiningSchema(Instances dataSet) throws java.lang.Exception
Map mining schema to incoming instances.- Parameters:
dataSet- the structure of the incoming Instances- Throws:
java.lang.Exception- if something goes wrong
-
getFieldsMappingString
public java.lang.String getFieldsMappingString()
Get a textual description of the mapping between mining schema fields and incoming data fields.- Returns:
- a description of the fields mapping as a String or null if no mapping has been constructed yet.
-
-