Пример #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            CEA cea = new CEA();

            cea.Generate();
            pattern = specific[2, 0];

            DecisionTreeImplementation sam = new DecisionTreeImplementation();

            TextBoxDT.Text = sam.GetTree("J:\\Desktop\\SZI2016-Marge\\SZI2016-master\\FinalProject\\testdata.txt");
        }
Пример #2
0
 public string Training()
 {
     //Predictions Matrix: Branch	Customer type	Gender	 Payment
     //Labels List: Product line
     predictions = new string[700, 4];
     labels      = new List <string>();
     DataRow[] dr = dt.Select();
     predictions[0, 0] = "Branch";
     predictions[0, 1] = "Customer type";
     predictions[0, 2] = "Gender";
     predictions[0, 3] = "Payment";
     labels.Add("Product line");
     for (int i = 1; i < 700; i++)
     {
         predictions[i, 0] = dr[i - 1]["Branch"].ToString();
         predictions[i, 1] = dr[i - 1]["Customer type"].ToString();
         predictions[i, 2] = dr[i - 1]["Gender"].ToString();
         predictions[i, 3] = dr[i - 1]["Payment"].ToString();
         labels.Add(dr[i]["Product line"].ToString());
     }
     tree = new DecisionTreeImplementation(predictions, labels);
     tree.PintarArbol("", true, "");
     return(tree.getSTree());
 }