|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.clusterers.ClusterEvaluation
weka.clusterers.SemiSupClustererEvaluation
Class for evaluating clustering models - extends ClusterEvaluation.java
Implements different clustering evaluation metrics
Field Summary | |
protected boolean |
m_ClassIsNominal
Is the class nominal or numeric? |
protected java.lang.String[] |
m_ClassNames
The names of the classes. |
protected double[][] |
m_ConfusionMatrix
Array for storing the confusion matrix. |
protected double |
m_Entropy
Entropy of the clustering |
protected int |
m_goodPairs
|
protected double |
m_KLDivergence
KL Divergence of the clustering |
protected Instances |
m_LabeledTrain
All labeled training instances |
protected java.util.ArrayList |
m_labeledTrainPairs
Training pairs |
protected double |
m_MIMetric
MI Metric the clustering |
protected int |
m_NumClasses
The number of underlying classes |
protected int |
m_NumClusters
The number of produced clusters |
protected double |
m_Objective
Objective function of the clustering |
protected double |
m_Purity
Purity of the clustering |
protected Instances |
m_Test
All test instances |
protected double |
m_TotalCost
The total cost of predictions (includes instance weights) |
protected int |
m_totalPairs
If the class is not nominal, we do not need the confusion matrix but do pairs counts directly |
protected int |
m_trueGoodPairs
|
protected Instances |
m_UnlabeledTrain
All unlabaled training instances |
protected double |
m_WeightTestCorrect
The weight of all correctly categorized test instances. |
protected double |
m_WeightTestIncorrect
The weight of all incorrectly categorized test instances. |
protected double |
m_WeightTestUnclassified
The weight of all uncategorized test instances. |
protected double |
m_WeightTestWithClass
The weight of test instances that had a class assigned to them. |
Constructor Summary | |
SemiSupClustererEvaluation(java.util.ArrayList labeledTrainPairs,
Instances test,
int numClasses,
int numClusters)
|
|
SemiSupClustererEvaluation(Instances test,
int numClasses,
int numClusters)
|
Method Summary | |
double |
entropy()
|
void |
evaluateModel(Clusterer clusterer,
Instances testInstances,
Instances unlabeledTest)
Evaluates the semi-sup clusterer on a given set of test instances |
void |
evaluateModelOnce(Clusterer clusterer,
Instance testWithoutLabel,
int classValue)
Evaluates the semi-sup clusterer on a given test instance |
java.lang.String |
globalInfo()
Returns a string describing this evaluator |
double |
klDivergence()
|
protected double[] |
makeDistribution(int predictedCluster)
Convert a single prediction into a probability distribution with all zero probabilities except the predicted value which has probability 1.0; |
double |
mutualInformation()
|
double |
numDiffClassPairs()
|
double |
numSameClassPairs()
|
double |
objectiveFunction()
|
double |
pairwiseFMeasure()
|
double |
pairwisePrecision()
|
double |
pairwiseRecall()
|
double |
purity()
|
java.lang.String |
toMatrixString(java.lang.String title)
Outputs the performance statistics as a classification confusion matrix. |
java.lang.String |
toSummaryString()
|
protected void |
updateStatsForClusterer(double[] distrib,
int classValue)
Updates all the statistics about a clusterer performance for the current test instance. |
Methods inherited from class weka.clusterers.ClusterEvaluation |
clusterResultsToString, crossValidateModel, evaluateClusterer, evaluateClusterer, getClassesToClusters, getClusterAssignments, getNumClusters, main, setClusterer, setDoXval, setFolds, setSeed |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected double m_Purity
protected double m_Entropy
protected double m_Objective
protected double m_MIMetric
protected double m_KLDivergence
protected int m_NumClasses
protected int m_NumClusters
protected Instances m_LabeledTrain
protected Instances m_UnlabeledTrain
protected Instances m_Test
protected java.util.ArrayList m_labeledTrainPairs
protected double m_WeightTestIncorrect
protected double m_WeightTestCorrect
protected double m_WeightTestUnclassified
protected double m_WeightTestWithClass
protected double[][] m_ConfusionMatrix
protected java.lang.String[] m_ClassNames
protected boolean m_ClassIsNominal
protected int m_totalPairs
protected int m_goodPairs
protected int m_trueGoodPairs
protected double m_TotalCost
Constructor Detail |
public SemiSupClustererEvaluation(Instances test, int numClasses, int numClusters)
public SemiSupClustererEvaluation(java.util.ArrayList labeledTrainPairs, Instances test, int numClasses, int numClusters)
Method Detail |
public java.lang.String toSummaryString()
public java.lang.String globalInfo()
public void evaluateModel(Clusterer clusterer, Instances testInstances, Instances unlabeledTest) throws java.lang.Exception
clusterer
- semi-supervised clusterertestInstances
- set of test instances for evaluation
java.lang.Exception
- if model could not be evaluated successfullypublic void evaluateModelOnce(Clusterer clusterer, Instance testWithoutLabel, int classValue) throws java.lang.Exception
clusterer
- semi-supervised clusterer
java.lang.Exception
- if model could not be evaluated successfullyprotected double[] makeDistribution(int predictedCluster)
protected void updateStatsForClusterer(double[] distrib, int classValue)
distrib
- the probabilities assigned to each class
java.lang.Exception
- if the class of the instance is not setpublic final double objectiveFunction()
public final double purity()
public final double entropy()
public final double klDivergence()
public final double mutualInformation()
public java.lang.String toMatrixString(java.lang.String title) throws java.lang.Exception
title
- the title for the confusion matrix
java.lang.Exception
- if the class is numericpublic final double pairwisePrecision()
public final double pairwiseRecall()
public final double pairwiseFMeasure()
public final double numSameClassPairs()
public final double numDiffClassPairs()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |