Package weka.core.pmml
Class PMMLFactory
- java.lang.Object
-
- weka.core.pmml.PMMLFactory
-
public class PMMLFactory extends Object
This class is a factory class for reading/writing PMML models- Version:
- $Revision$
- Author:
- Mark Hall (mhall{[at]}pentaho{[dot]}com)
-
-
Constructor Summary
Constructors Constructor Description PMMLFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringapplyClassifier(PMMLModel model, Instances test)static PMMLModelgetPMMLModel(File file)Read and return a PMML model.static PMMLModelgetPMMLModel(File file, Logger log)Read and return a PMML model.static PMMLModelgetPMMLModel(InputStream stream)Read and return a PMML model.static PMMLModelgetPMMLModel(InputStream stream, Logger log)Read and return a PMML model.static PMMLModelgetPMMLModel(String filename)Read and return a PMML model.static PMMLModelgetPMMLModel(String filename, Logger log)Read and return a PMML model.static voidmain(String[] args)static voidserializePMMLModel(PMMLModel model, File file)Serialize aPMMLModelobject that encapsulates a PMML modelstatic voidserializePMMLModel(PMMLModel model, OutputStream stream)Serialize aPMMLModelobject that encapsulates a PMML modelstatic voidserializePMMLModel(PMMLModel model, String filename)Serialize aPMMLModelobject that encapsulates a PMML model
-
-
-
Method Detail
-
getPMMLModel
public static PMMLModel getPMMLModel(String filename) throws Exception
Read and return a PMML model.- Parameters:
filename- the name of the file to read from- Returns:
- a PMML model
- Throws:
Exception- if there is a problem while reading the file
-
getPMMLModel
public static PMMLModel getPMMLModel(File file) throws Exception
Read and return a PMML model.- Parameters:
file- aFileto read from- Returns:
- a PMML model
- Throws:
Exception- if there is a problem while reading the file
-
getPMMLModel
public static PMMLModel getPMMLModel(InputStream stream) throws Exception
Read and return a PMML model.- Parameters:
stream- theInputStreamto read from- Returns:
- a PMML model
- Throws:
Exception- if there is a problem while reading from the stream
-
getPMMLModel
public static PMMLModel getPMMLModel(String filename, Logger log) throws Exception
Read and return a PMML model.- Parameters:
filename- the name of the file to read fromlog- the logging object to use (or null if none is to be used)- Returns:
- a PMML model
- Throws:
Exception- if there is a problem while reading the file
-
getPMMLModel
public static PMMLModel getPMMLModel(File file, Logger log) throws Exception
Read and return a PMML model.- Parameters:
file- aFileto read fromlog- the logging object to use (or null if none is to be used)- Returns:
- a PMML model
- Throws:
Exception- if there is a problem while reading the file
-
getPMMLModel
public static PMMLModel getPMMLModel(InputStream stream, Logger log) throws Exception
Read and return a PMML model.- Parameters:
stream- theInputStreamto read fromlog- the logging object to use (or null if none is to be used)- Returns:
- a PMML model
- Throws:
Exception- if there is a problem while reading from the stream
-
serializePMMLModel
public static void serializePMMLModel(PMMLModel model, String filename) throws Exception
Serialize aPMMLModelobject that encapsulates a PMML model- Parameters:
model- thePMMLModelto serializefilename- the name of the file to save to- Throws:
Exception- if something goes wrong during serialization
-
serializePMMLModel
public static void serializePMMLModel(PMMLModel model, File file) throws Exception
Serialize aPMMLModelobject that encapsulates a PMML model- Parameters:
model- thePMMLModelto serializefile- theFileto save to- Throws:
Exception- if something goes wrong during serialization
-
serializePMMLModel
public static void serializePMMLModel(PMMLModel model, OutputStream stream) throws Exception
Serialize aPMMLModelobject that encapsulates a PMML model- Parameters:
model- thePMMLModelto serializestream- theOutputStreamto serialize to- Throws:
Exception- if something goes wrong during serialization
-
applyClassifier
public static String applyClassifier(PMMLModel model, Instances test) throws Exception
- Throws:
Exception
-
main
public static void main(String[] args)
-
-