List of usage examples for weka.clusterers ClusterEvaluation getLogLikelihood
public double getLogLikelihood()
From source file:com.actelion.research.orbit.imageAnalysis.imaging.TMAPoints.java
License:Open Source License
private int guessNumClusters(EM clusterer, Instances instances, int start, int end) throws Exception { ClusterEvaluation eval = new ClusterEvaluation(); int bestNum = start; double best = Double.POSITIVE_INFINITY; double bic;/* w ww.j av a 2 s . c o m*/ for (int c = start; c <= end; c++) { clusterer.setNumClusters(c); clusterer.buildClusterer(instances); eval.setClusterer(clusterer); eval.evaluateClusterer(instances); bic = bic(eval.getLogLikelihood(), c, instances.numInstances()); logger.trace("numCluster " + c + " -> BIC: " + bic); if (bic < best) { best = bic; bestNum = c; logger.trace("bestNum: " + bestNum); } } return bestNum; }