weka.classifiers
Interface SoftClassifier

All Known Implementing Classes:
NaiveBayesSimpleSoft, NaiveBayesSimpleSparseSoft

public interface SoftClassifier

Interface to a classifier that supports soft classified training data that are SoftClassifiedInstances that have probabilistic class labels


Method Summary
 void buildClassifier(SoftClassifiedInstances data)
          Generates a classifier.
 double[] unNormalizedDistributionForInstance(Instance instance)
          Predicts the class memberships for a given instance.
 

Method Detail

buildClassifier

public void buildClassifier(SoftClassifiedInstances data)
                     throws java.lang.Exception
Generates a classifier. Must initialize all fields of the classifier that are not being set via options (ie. multiple calls of buildClassifier must always lead to the same result). Must not change the dataset in any way.

Parameters:
data - set of instances serving as training data
Throws:
java.lang.Exception - if the classifier has not been generated successfully

unNormalizedDistributionForInstance

public double[] unNormalizedDistributionForInstance(Instance instance)
                                             throws java.lang.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.

Parameters:
instance - the instance to be classified
Returns:
an array containing the estimated membership probabilities of the test instance in each class (this should sum to at most 1)
Throws:
java.lang.Exception - if distribution could not be computed successfully