Writing Classifiers
Import the following packages
import weka.classifiers.*;
import weka.core.*;
import weka.util.*;
Extend Classifier
- If predicting class probabilities then extend DistributionClassifier
Essential methods
buildClassifier(Instances) Generates a classifier
classifyInstance(Instance) Classifies a given instance
distributionForInstance(Instance) Predicts the class memberships
(for DistributionClassifier)
Interfaces that can be implemented
UpdateableClassifier For incremental classifiers
WeightedInstanceHandler If classifier can make use of instance weights