|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--weka.classifiers.Classifier | +--probabilityMachine.VennProbabilityClassifier
Abstract classification model that produces (for each test instance) a valid probability estimation of the membership in each class.
Constructor Summary | |
VennProbabilityClassifier()
|
Method Summary | |
double |
classifyInstance(Instance instance)
Classifies the given test instance. |
static void |
computeRowOfVPMMatrix(java.lang.String[] typeDefinitions,
Matrix vpmMatrix,
Instances trainingSet,
Instance testExample)
Counts the number of examples with the same type as the new example to create each row of the VPM matrix. |
double[] |
distributionForInstance(Instance instance)
Returns a single distribution for an instance, by crudely averaging the Venn probabilities. |
java.lang.String |
printArray(double[] array)
Debugging function |
java.lang.String |
printArray(int[] array)
Debugging function |
static double[] |
returnDistribution(Matrix vennProbs)
Converts the Venn Probability Matrix into a distribution for each class |
static double[] |
returnUpperAndLowerProbability(Matrix vennProbs)
Calculates the upper and lower probabilities for the predicted label (a bit like a region prediction) |
abstract Matrix |
vennProbsForInstance(Instance instance)
Predicts the Venn probabilities for each instance. |
Methods inherited from class weka.classifiers.Classifier |
buildClassifier, debugTipText, forName, getDebug, getOptions, listOptions, makeCopies, setDebug, setOptions |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public VennProbabilityClassifier()
Method Detail |
public abstract Matrix vennProbsForInstance(Instance instance) throws java.lang.Exception
instance
- the instance to be classified
java.lang.Exception
- if distribution could not be
computed successfullypublic double classifyInstance(Instance instance) throws java.lang.Exception
classifyInstance
in class Classifier
instance
- the instance to be classified
java.lang.Exception
- if an error occurred during the predictionpublic double[] distributionForInstance(Instance instance) throws java.lang.Exception
distributionForInstance
in class Classifier
instance
- the instance to be classified
java.lang.Exception
- if an error occurred during the predictionpublic static double[] returnDistribution(Matrix vennProbs) throws java.lang.Exception
vennProbs
- matrix containing the Venn probabilities
java.lang.Exception
public static double[] returnUpperAndLowerProbability(Matrix vennProbs)
vennProbs
- matrix containing the Venn probabilities
public static void computeRowOfVPMMatrix(java.lang.String[] typeDefinitions, Matrix vpmMatrix, Instances trainingSet, Instance testExample) throws java.lang.Exception
typeDefinitions
- this contains the training types + new test example at the end.vpmMatrix
- the current VPM matrix, this will be updated in the function
java.lang.Exception
public java.lang.String printArray(double[] array)
public java.lang.String printArray(int[] array)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) 2003 David Lindsay, Computer Learning Research Centre, Dept. Computer Science, Royal Holloway, University of London