类 SerializedClassifier

java.lang.Object
weka.classifiers.Classifier
weka.classifiers.misc.SerializedClassifier
所有已实现的接口:
Serializable, Cloneable, CapabilitiesHandler, OptionHandler, RevisionHandler

public class SerializedClassifier extends Classifier
A wrapper around a serialized classifier model. This classifier loads a serialized models and uses it to make predictions.

Warning: since the serialized model doesn't get changed, cross-validation cannot bet used with this classifier.

Valid options are:

 -D
  If set, classifier is run in debug mode and
  may output additional info to the console
 -model <filename>
  The file containing the serialized model.
  (required)
版本:
$Revision: 7560 $
作者:
fracpete (fracpete at waikato dot ac dot nz)
另请参阅:
  • 构造器详细资料

    • SerializedClassifier

      public SerializedClassifier()
  • 方法详细资料

    • globalInfo

      public String globalInfo()
      Returns a string describing classifier
      返回:
      a description suitable for displaying in the explorer/experimenter gui
    • listOptions

      public Enumeration listOptions()
      Gets an enumeration describing the available options.
      指定者:
      listOptions 在接口中 OptionHandler
      覆盖:
      listOptions 在类中 Classifier
      返回:
      an enumeration of all the available options.
    • getOptions

      public String[] getOptions()
      returns the options of the current setup
      指定者:
      getOptions 在接口中 OptionHandler
      覆盖:
      getOptions 在类中 Classifier
      返回:
      the current options
    • setOptions

      public void setOptions(String[] options) throws Exception
      Parses the options for this object.

      Valid options are:

       -D
        If set, classifier is run in debug mode and
        may output additional info to the console
       -model <filename>
        The file containing the serialized model.
        (required)
      指定者:
      setOptions 在接口中 OptionHandler
      覆盖:
      setOptions 在类中 Classifier
      参数:
      options - the options to use
      抛出:
      Exception - if setting of options fails
    • modelFileTipText

      public String modelFileTipText()
      Returns the tip text for this property
      返回:
      tip text for this property suitable for displaying in the explorer/experimenter gui
    • getModelFile

      public File getModelFile()
      Gets the file containing the serialized model.
      返回:
      the file.
    • setModelFile

      public void setModelFile(File value)
      Sets the file containing the serialized model.
      参数:
      value - the file.
    • setModel

      public void setModel(Classifier value)
      Sets the fully built model to use, if one doesn't want to load a model from a file or already deserialized a model from somewhere else.
      参数:
      value - the built model
      另请参阅:
    • getCurrentModel

      public Classifier getCurrentModel()
      Gets the currently loaded model (can be null). Call buildClassifier method to load model from file.
      返回:
      the current model
      另请参阅:
    • getCapabilities

      public Capabilities getCapabilities()
      Returns default capabilities of the base classifier.
      指定者:
      getCapabilities 在接口中 CapabilitiesHandler
      覆盖:
      getCapabilities 在类中 Classifier
      返回:
      the capabilities of the base classifier
      另请参阅:
    • distributionForInstance

      public double[] distributionForInstance(Instance instance) throws Exception
      Calculates the class membership probabilities for the given test instance.
      覆盖:
      distributionForInstance 在类中 Classifier
      参数:
      instance - the instance to be classified
      返回:
      preedicted class probability distribution
      抛出:
      Exception - if distribution can't be computed successfully
    • buildClassifier

      public void buildClassifier(Instances data) throws Exception
      loads only the serialized classifier
      指定者:
      buildClassifier 在类中 Classifier
      参数:
      data - the training instances
      抛出:
      Exception - if something goes wrong
    • toString

      public String toString()
      Returns a string representation of the classifier
      覆盖:
      toString 在类中 Object
      返回:
      the string representation of the classifier
    • getRevision

      public String getRevision()
      Returns the revision string.
      指定者:
      getRevision 在接口中 RevisionHandler
      覆盖:
      getRevision 在类中 Classifier
      返回:
      the revision
    • main

      public static void main(String[] args)
      Runs the classifier with the given options
      参数:
      args - the commandline options