public Vector<oneClustererResult> getClusterers() { // TODO Auto-generated method stub double[][] nmi = new double[clustersRes.size()][clustersRes.size()]; for (int i = 0; i < clustersRes.size(); ++i) { if (!myUtils.ClusterUtils.isAllSame(clustersRes.elementAt(i))) for (int j = i + 1; j < clustersRes.size(); ++j) { nmi[i][j] = ClusterUtils.NMI(clustersRes.elementAt(i), clustersRes.elementAt(j)); nmi[j][i] = nmi[i][j]; } } Vector<oneClustererResult> res = new Vector<oneClustererResult>(); for (int i = 0; i < clustersRes.size(); ++i) { oneClustererResult aRes = new oneClustererResult(); aRes.cluster = clustersRes.elementAt(i).clone(); aRes.semi_weigth = this.getWeight(clustersRes.elementAt(i)); double sum_nmi = 0; for (int j = 0; j < clustersRes.size(); ++j) { sum_nmi += nmi[i][j]; } // aRes.nmi_weigth = (double)1/sum_nmi; //1/beta aRes.nmi_weigth = sum_nmi; // beta aRes.squarederror_weigth = (double) 1 / this.SquaredError[i]; // ԽСԽºÃ res.add(aRes); } NormalizedWeightAndBaseInd(res); return res; }
public void Evalution() { this.ac = ClusterUtils.getAC_ByBipartiteGraph(this.classes, this.clusters); this.nmi = ClusterUtils.NMI(this.classes, this.clusters); }