Example #1
0
        private void doKmeansThreaded()
        {
            int    numRuns     = (int)numericUpDown2.Value;
            int    numClustMin = (int)numClusters.Value;
            int    numClustMax = (int)numClustersMax.Value;
            String folder      = pointSetFile.Substring(0, pointSetFile.LastIndexOf('\\'));

            openFileDialog2.InitialDirectory = folder;


            PointSet points = new PointSet(pointSetFile);

            for (int i = 0; i < numRuns; i++)
            {
                for (int j = numClustMin; j <= numClustMax; j++)
                {
                    KMeans algo       = new KMeans(points, j);
                    String newCluster = folder + "/" + pointSetFileShort.Substring(0, pointSetFileShort.LastIndexOf('.')) + "_kmeans" + j + "_" + i;
                    algo.GetPartition().SavePartition(newCluster, pointSetFile.Substring(pointSetFile.LastIndexOf("\\") + 1), "");
                }
            }
            MessageBox.Show("Complete!");
        }