//Evaluo la segmentacion con las medidas RandIndex, VI and NMI y dejo los resultados en el set. Evaluo contra el mejor ground-truth y el promedio contra todos. private void EvaluateMatrixSegmentation(Segmentation segm) { RandIndexSegSim rand = new RandIndexSegSim(); NMISegSim nmi = new NMISegSim(); VISegSim vi = new VISegSim(); //Calcular el rand double min = double.MaxValue; double ave = 0; double aux = 0; for (int i = 0; i < this.Set.GroundTruths.Count; i++) { aux = 1 - rand.Process(segm, this.Set.GroundTruths[i]); if (aux < min) { min = aux; } ave += aux; } ave = ave / this.Set.GroundTruths.Count; this.Set.Best_RandEvaluation = min; this.Set.Ave_RandEvaluation = ave; //Calcular NMI min = double.MaxValue; ave = 0; aux = 0; for (int i = 0; i < this.Set.GroundTruths.Count; i++) { aux = 1 - nmi.Process(segm, this.Set.GroundTruths[i]); if (aux < min) { min = aux; } ave += aux; } ave = ave / this.Set.GroundTruths.Count; this.Set.Best_NMIEvaluation = min; this.Set.Ave_NMIEvaluation = ave; //Calcular VI min = double.MaxValue; ave = 0; aux = 0; for (int i = 0; i < this.Set.GroundTruths.Count; i++) { aux = vi.Process(segm, this.Set.GroundTruths[i]); if (aux < min) { min = aux; } ave += aux; } ave = ave / this.Set.GroundTruths.Count; this.Set.Best_VIEvaluation = min; this.Set.Ave_VIEvaluation = ave; }
//Evaluo la segmentacion con las medidas RandIndex, VI and NMI y dejo los resultados en el set. Evaluo contra el mejor ground-truth y el promedio contra todos. private void EvaluateMatrixSegmentation(Segmentation segm) { RandIndexSegSim rand = new RandIndexSegSim(); NMISegSim nmi = new NMISegSim(); VISegSim vi = new VISegSim(); //Calcular el rand double min = double.MaxValue; double ave = 0; double aux = 0; for (int i = 0; i < this.Set.GroundTruths.Count; i++) { aux = 1 - rand.Process(segm, this.Set.GroundTruths[i]); if (aux < min) min = aux; ave += aux; } ave = ave / this.Set.GroundTruths.Count; this.Set.Best_RandEvaluation = min; this.Set.Ave_RandEvaluation = ave; //Calcular NMI min = double.MaxValue; ave = 0; aux = 0; for (int i = 0; i < this.Set.GroundTruths.Count; i++) { aux = 1- nmi.Process(segm, this.Set.GroundTruths[i]); if (aux < min) min = aux; ave += aux; } ave = ave / this.Set.GroundTruths.Count; this.Set.Best_NMIEvaluation = min; this.Set.Ave_NMIEvaluation = ave; //Calcular VI min = double.MaxValue; ave = 0; aux = 0; for (int i = 0; i < this.Set.GroundTruths.Count; i++) { aux = vi.Process(segm, this.Set.GroundTruths[i]); if (aux < min) min = aux; ave += aux; } ave = ave / this.Set.GroundTruths.Count; this.Set.Best_VIEvaluation = min; this.Set.Ave_VIEvaluation = ave; }