private void button9_Click_1(object sender, EventArgs e) { while (ds.AttributesCount > (int)numericUpDown4.Value) { rtbdel.Text += "\n\n DataSet: " + ds.Quality[1]; double[] quals = new double[ds.AttributesCount]; if (removedAttrs == null) { removedAttrs = new bool[ds.AttributesCount]; } for (int i = 0; i < quals.Length; i++) { List <KMCluster> KMeans = Clustering.KMeans(ds, (int)numericUpDown3.Value, i); quals[i] = DataSet.QualityExcl(KMeans, i); rtbdel.Text += "\n DataSet without attr #" + i + ": " + quals[i]; } int minIndex = 0; for (int i = 0; i < quals.Length; i++) { if (quals[i] < quals[minIndex]) { minIndex = i; } } rtbdel.Text += "\n REMOVING attr #" + minIndex; ds.RemoveAttr(minIndex); int co = 0; for (int i = 0; i <= minIndex; i++) { if (removedAttrs[i]) { co += 1; } } removedAttrs[co + minIndex] = true; ds.KMeans = Clustering.KMeans(ds, (int)numericUpDown3.Value); rtbdel.Text += "\n New DataSet: " + ds.Quality[1]; } Printer.Objects(ds, dgv); Printer.KMeansMeans(ds, dataGridView2); rtbdel.Text += "\n\n\n Attrs were removed: "; for (int i = 0; i < removedAttrs.Length; i++) { if (removedAttrs[i]) { rtbdel.Text += " #" + i; } } }
private void button3_Click(object sender, EventArgs e) { ds.KMeans = Clustering.KMeans(ds, (int)numericUpDown3.Value); Printer.Objects(ds, dgv); Printer.KMeansMeans(ds, dataGridView2); }
private void button4_Click(object sender, EventArgs e) //#2 { ds.Hierarchy = Clustering.Hierarchy(ds, (int)numericUpDown3.Value); Printer.Objects(ds, dgv); Printer.HierarchyMeans(ds, dataGridView1); }
private void button2_Click(object sender, EventArgs e) { Clustering.Standardize(ds); Printer.Objects(ds, dgv); }