Esempio n. 1
0
        //Training Set Tab
        private void BuildTrainingSetTable(DataGridView dgw)
        {
            dt_training_set.Rows.Clear();
            dt_training_set.Columns.Clear();
            List <DSProbeWrapper> training_set = classifier_.getTrainingSet();

            foreach (DSAttributeWrapper attribute in attributes_)
            {
                dt_training_set.Columns.Add(new DataColumn(attribute.getName()));
            }
            foreach (DSClassWrapper Class in classes_)
            {
                dt_training_set.Columns.Add(new DataColumn(Class.getName(), System.Type.GetType("System.Double")));
            }

            foreach (DSProbeWrapper probe in training_set)
            {
                DataRow row = dt_training_set.NewRow();
                for (int i = 0; i < probe.getAttribValues().Count; i++)
                {
                    row[i] = probe.getAttribValues()[i].getValue();
                }
                for (int i = 0; i < probe.getClassMemFuncs().Count; i++)
                {
                    row[i + probe.getAttribValues().Count] = probe.getClassMemFuncs()[i].getMembershipFunction();
                }
                dt_training_set.Rows.Add(row);
            }
            dgw.DataSource = dt_training_set;
        }