예제 #1
0
        private void btnOurGRASP_Click(object sender, EventArgs e)
        {
            progressBar1.Value = 0;

            List <List <string> >      CategorizedList              = GetCategorizedList();
            List <List <int> >         CategorizedListCount         = new List <List <int> >();
            List <List <List <int> > > CategorizedListPerClassCount = new List <List <List <int> > >();

            for (int i = 0; i < CategorizedList.Count; i++)
            {
                CategorizedListCount.Add(GetCategorizedMembersCount(CategorizedList[i], i));
                //if (i + 1 < settingsInfo.TotalNumberOfFeatures)
                CategorizedListPerClassCount.Add(GetCategorizedMembersPerClassCount(CategorizedList[i], CategorizedList[settingsInfo.TotalNumberOfFeatures], i));
            }
            GRASP  grasp      = new GRASP(this, settingsInfo);
            string BestSubset = grasp.DoOurGRASP(CategorizedList, CategorizedListCount, CategorizedListPerClassCount);

            string subsetNames = string.Empty;

            for (int i = 0; i < dgvTrainingData.Columns.Count - 1; i++)
            {
                if (BestSubset[i] == '1')
                {
                    subsetNames += dgvTrainingData.Columns[i].HeaderCell.Value.ToString() + ", ";
                }
            }
            SetLog(">>>> Best subset is: " + BestSubset + "\r\nSelected Subset(s): " + subsetNames, true);
            //grasp.Search(data, dataType, fieldsName, 50, 50, 0.3);
            progressBar1.Value = 100;
        }
예제 #2
0
        private void btnClassicalGRASP_Click(object sender, EventArgs e)
        {
            progressBar1.Value = 0;
            GRASP  grasp       = new GRASP(this, settingsInfo);
            string BestSubset  = grasp.DoClassicalGRASP();
            string subsetNames = string.Empty;

            for (int i = 0; i < dgvTrainingData.Columns.Count - 1; i++)
            {
                if (BestSubset[i] == '1')
                {
                    subsetNames += dgvTrainingData.Columns[i].HeaderCell.Value.ToString() + ", ";
                }
            }
            SetLog(">>>> Best subset is: " + BestSubset + "\r\nSelected Subset(s): " + subsetNames, true);
            //grasp.Search(data, dataType, fieldsName, 50, 50, 0.3);
            progressBar1.Value = 100;
        }