weka.classifiers
Class DistributionClassifier
java.lang.Object
weka.classifiers.Classifier
weka.classifiers.DistributionClassifier
- All Implemented Interfaces:
- java.lang.Cloneable, java.io.Serializable
- Direct Known Subclasses:
- ActiveDecorate, ADTree, AttributeSelectedClassifier, BayesNet, ClassificationViaRegression, ConjunctiveRule, DecisionStump, DecisionTable, DistributionMetaClassifier, EnsembleClassifier, Fable, FilteredClassifier, HyperPipes, IBk, IBkMetric, Id3, J48, JRip, KStar, LBR, Logistic, LogitBoost, MultiBoostAB, MultiClassClassifier, NaiveBayes, NaiveBayesSimple, NaiveBayesSimpleSparse, NeuralNetwork, OrdinalClassClassifier, PART, Prototype, PrototypeMetric, RacedIncrementalLogitBoost, RandomForest, RandomTree, REPTree, SemiSupEM, SMO, SVMlight, ThresholdSelector, UserClassifier, VFI, VotedPerceptron, ZeroR
- 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).
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DistributionClassifier
public DistributionClassifier()
distributionForInstance
public abstract double[] distributionForInstance(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
calculateEntropy
public double calculateEntropy(Instance instance)
throws java.lang.Exception
- Throws:
java.lang.Exception
calculateMargin
public double calculateMargin(Instance instance)
throws java.lang.Exception
- Throws:
java.lang.Exception
calculateLabeledInstanceMargin
public double calculateLabeledInstanceMargin(Instance instance)
throws java.lang.Exception
- Throws:
java.lang.Exception
classifyInstance
public double classifyInstance(Instance instance)
throws java.lang.Exception
- Classifies the given test instance. The instance has to belong to a
dataset when it's being classified.
- Specified by:
classifyInstance
in class Classifier
- 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:
java.lang.Exception
- if an error occurred during the prediction