All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home

Class weka.classifiers.DistributionClassifier

java.lang.Object
   |
   +----weka.classifiers.Classifier
           |
           +----weka.classifiers.DistributionClassifier

public abstract class DistributionClassifier
extends Classifier
Abstract classification model that produces (for each test instance) an estimate of the membership in each class (ie. a probability distribution).

Version:
$Revision: 1.2 $
Author:
Eibe Frank (trigg@cs.waikato.ac.nz), Len Trigg (trigg@cs.waikato.ac.nz)

Constructor Index

 o DistributionClassifier()

Method Index

 o classifyInstance(Instance)
Classifies the given test instance.
 o distributionForInstance(Instance)
Predicts the class memberships for a given instance.

Constructors

 o DistributionClassifier
 public DistributionClassifier()

Methods

 o distributionForInstance
 public abstract double[] distributionForInstance(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.

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: Exception
if distribution could not be computed successfully
 o classifyInstance
 public double classifyInstance(Instance instance) throws Exception
Classifies the given test instance. The instance has to belong to a datasets when it's being classified.

Parameters:
instance - the instance to be classified
Returns:
the predicted most likely class for the instance or Instance.missingValue() if no prediction is made
Throws: Exception
if an error occurred during the prediction
Overrides:
classifyInstance in class Classifier

All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home