程序包 weka.core.pmml

类 PMMLFactory

java.lang.Object
weka.core.pmml.PMMLFactory

public class PMMLFactory extends Object
This class is a factory class for reading/writing PMML models
版本:
$Revision: 5562 $
作者:
Mark Hall (mhall{[at]}pentaho{[dot]}com)
  • 构造器详细资料

    • PMMLFactory

      public PMMLFactory()
  • 方法详细资料

    • getPMMLModel

      public static PMMLModel getPMMLModel(String filename) throws Exception
      Read and return a PMML model.
      参数:
      filename - the name of the file to read from
      返回:
      a PMML model
      抛出:
      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.
      参数:
      file - a File to read from
      返回:
      a PMML model
      抛出:
      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.
      参数:
      stream - the InputStream to read from
      返回:
      a PMML model
      抛出:
      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.
      参数:
      filename - the name of the file to read from
      log - the logging object to use (or null if none is to be used)
      返回:
      a PMML model
      抛出:
      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.
      参数:
      file - a File to read from
      log - the logging object to use (or null if none is to be used)
      返回:
      a PMML model
      抛出:
      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.
      参数:
      stream - the InputStream to read from
      log - the logging object to use (or null if none is to be used)
      抛出:
      Exception - if there is a problem while reading from the stream
    • serializePMMLModel

      public static void serializePMMLModel(PMMLModel model, String filename) throws Exception
      Serialize a PMMLModel object that encapsulates a PMML model
      参数:
      model - the PMMLModel to serialize
      filename - the name of the file to save to
      抛出:
      Exception - if something goes wrong during serialization
    • serializePMMLModel

      public static void serializePMMLModel(PMMLModel model, File file) throws Exception
      Serialize a PMMLModel object that encapsulates a PMML model
      参数:
      model - the PMMLModel to serialize
      file - the File to save to
      抛出:
      Exception - if something goes wrong during serialization
    • serializePMMLModel

      public static void serializePMMLModel(PMMLModel model, OutputStream stream) throws Exception
      Serialize a PMMLModel object that encapsulates a PMML model
      参数:
      model - the PMMLModel to serialize
      stream - the OutputStream to serialize to
      抛出:
      Exception - if something goes wrong during serialization
    • applyClassifier

      public static String applyClassifier(PMMLModel model, Instances test) throws Exception
      抛出:
      Exception
    • main

      public static void main(String[] args)