Class SerializedClassifier

    • Constructor Detail

      • SerializedClassifier

        public SerializedClassifier()
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing classifier
        Returns:
        a description suitable for displaying in the explorer/experimenter gui
      • 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)
         
        Specified by:
        setOptions in interface OptionHandler
        Overrides:
        setOptions in class AbstractClassifier
        Parameters:
        options - the options to use
        Throws:
        Exception - if setting of options fails
      • modelFileTipText

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

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

        public void setModelFile​(File value)
        Sets the file containing the serialized model.
        Parameters:
        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.
        Parameters:
        value - the built model
        See Also:
        getCurrentModel()
      • getCurrentModel

        public Classifier getCurrentModel()
        Gets the currently loaded model (can be null). Call buildClassifier method to load model from file.
        Returns:
        the current model
        See Also:
        setModel(Classifier)
      • buildClassifier

        public void buildClassifier​(Instances data)
                             throws Exception
        loads only the serialized classifier
        Parameters:
        data - the training instances
        Throws:
        Exception - if something goes wrong
      • toString

        public String toString()
        Returns a string representation of the classifier
        Overrides:
        toString in class Object
        Returns:
        the string representation of the classifier
      • main

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