double ypos = -.5; // Skip space before first header
SVGPlot svgp = task.getPlot();
Element parent = svgp.svgElement(SVGConstants.SVG_G_TAG);
EvaluateClustering.ScoreResult sr = task.getResult();
ClusterContingencyTable cont = sr.getContingencyTable();
List<Result> parents = task.getContext().getHierarchy().getParents(sr);
for(Result r : parents) {
if(r instanceof Clustering) {
ypos = addHeader(svgp, parent, ypos, r.getLongName());
}
}
// TODO: use CSSClass and StyleLibrary
ypos = addHeader(svgp, parent, ypos, "Pair counting measures");
PairCounting paircount = cont.getPaircount();
ypos = addBarChart(svgp, parent, ypos, "Jaccard", 1, paircount.jaccard());
ypos = addBarChart(svgp, parent, ypos, "F1-Measure", 1, paircount.f1Measure());
ypos = addBarChart(svgp, parent, ypos, "Precision", 1, paircount.precision());
ypos = addBarChart(svgp, parent, ypos, "Recall", 1, paircount.recall());
ypos = addBarChart(svgp, parent, ypos, "Rand", 1, paircount.randIndex());
ypos = addBarChart(svgp, parent, ypos, "ARI", 1, paircount.adjustedRandIndex());
ypos = addBarChart(svgp, parent, ypos, "FowlkesMallows", 1, paircount.fowlkesMallows());
ypos = addHeader(svgp, parent, ypos, "Entropy based measures");
Entropy entropy = cont.getEntropy();
ypos = addBarChart(svgp, parent, ypos, "NMI Joint", 1, entropy.entropyNMIJoint());
ypos = addBarChart(svgp, parent, ypos, "NMI Sqrt", 1, entropy.entropyNMISqrt());
ypos = addHeader(svgp, parent, ypos, "BCubed-based measures");
BCubed bcubed = cont.getBCubed();
ypos = addBarChart(svgp, parent, ypos, "F1-Measure", 1, bcubed.f1Measure());
ypos = addBarChart(svgp, parent, ypos, "Recall", 1, bcubed.recall());
ypos = addBarChart(svgp, parent, ypos, "Precision", 1, bcubed.precision());
ypos = addHeader(svgp, parent, ypos, "Set-Matching-based measures");
SetMatchingPurity setm = cont.getSetMatching();
ypos = addBarChart(svgp, parent, ypos, "F1-Measure", 1, setm.f1Measure());
ypos = addBarChart(svgp, parent, ypos, "Purity", 1, setm.purity());
ypos = addBarChart(svgp, parent, ypos, "Inverse Purity", 1, setm.inversePurity());
ypos = addHeader(svgp, parent, ypos, "Editing-distance measures");
EditDistance edit = cont.getEdit();
ypos = addBarChart(svgp, parent, ypos, "F1-Measure", 1, edit.f1Measure());
ypos = addBarChart(svgp, parent, ypos, "Precision", 1, edit.editDistanceFirst());
ypos = addBarChart(svgp, parent, ypos, "Recall", 1, edit.editDistanceSecond());
ypos = addHeader(svgp, parent, ypos, "Gini measures");
final MeanVariance gini = cont.averageSymmetricGini();
ypos = addBarChart(svgp, parent, ypos, "Mean +-" + FormatUtil.format(gini.getSampleStddev(), FormatUtil.NF4), 1, gini.getMean());
// scale vis
double cols = 10; // Math.max(10, (int) (i * task.getHeight() /
// task.getWidth()));