Class AbstractSimpleClassifier

    • Constructor Detail

      • AbstractSimpleClassifier

        public AbstractSimpleClassifier()
    • Method Detail

      • classifyInstance

        public double classifyInstance​(weka.core.Instance instance)
                                throws Exception
        Classifies the given test instance. The instance has to belong to a dataset when it's being classified. Note that a classifier MUST implement either this or distributionForInstance().
        Specified by:
        classifyInstance in interface weka.classifiers.Classifier
        Parameters:
        instance - the instance to be classified
        Returns:
        the predicted most likely class for the instance or Utils.missingValue() if no prediction is made
        Throws:
        Exception - if an error occurred during the prediction
      • distributionForInstance

        public double[] distributionForInstance​(weka.core.Instance instance)
                                         throws Exception
        Predicts the class memberships for a given instance. If an instance is unclassified, the returned array elements must be all zero. If the class is numeric, the array must consist of only one element, which contains the predicted value. Note that a classifier MUST implement either this or classifyInstance().
        Specified by:
        distributionForInstance in interface weka.classifiers.Classifier
        Parameters:
        instance - the instance to be classified
        Returns:
        an array containing the estimated membership probabilities of the test instance in each class or the numeric prediction
        Throws:
        Exception - if distribution could not be computed successfully
      • runClassifier

        public static void runClassifier​(weka.classifiers.Classifier classifier,
                                         String[] options)
        runs the classifier instance with the given options.
        Parameters:
        classifier - the classifier to run
        options - the commandline options
      • getCapabilities

        public weka.core.Capabilities getCapabilities()
        Returns the Capabilities of this classifier. Maximally permissive capabilities are allowed by default. Derived classifiers should override this method and first disable all capabilities and then enable just those capabilities that make sense for the scheme.
        Specified by:
        getCapabilities in interface weka.core.CapabilitiesHandler
        Specified by:
        getCapabilities in interface weka.classifiers.Classifier
        Returns:
        the capabilities of this object
        See Also:
        Capabilities