Beispiel #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            Random rng  = new Random();
            int    iter = (int)(numIterations.Value);
            List <NormalizedDonor> norms = new List <NormalizedDonor>();

            for (int i = 0; i < iter; i++)
            {
                NormalizedDonor d = TrainingDonors[rng.Next(TrainingDonors.Count)];
                norms.Add(d);
                double[] ins = { d.Year, d.OperationYear, d.AxillaryNodes };
                double[] ots = { d.Status };
                nn.Train(new List <double>(ins), new List <double>(ots));
            }
            int hits = 0;

            foreach (NormalizedDonor n in norms)
            {
                double[] ins = { n.Year, n.OperationYear, n.AxillaryNodes };
                double   rez = nn.Run(new List <double>(ins))[0];
                if (Math.Abs(rez - n.Status) < 0.5)
                {
                    hits++;
                }
            }
            lblTrainAcc.Text = String.Format("Paskutinio apmokymo tikslumas: {0:0.00}%", (100.0 * hits) / iter);
            NetworkHelper.ToTreeView(treeView1, nn);
            NetworkHelper.ToPictureBox(pictureBox1, nn, 400, 100);
        }
Beispiel #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            List <double> ins = new List <double>();

            ins.Add(0);
            ins.Add(0);

            nn.Run(ins);

            NetworkHelper.ToTreeView(treeView1, nn);
            NetworkHelper.ToPictureBox(pictureBox1, nn, 400, 100);
        }
Beispiel #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            Random rng  = new Random();
            int    hits = 0;

            foreach (NormalizedDonor d in TestDonors)
            {
                double[] ins = { d.Year, d.OperationYear, d.AxillaryNodes };
                double   rez = nn.Run(new List <double>(ins))[0];
                if (Math.Abs(rez - d.Status) < 0.5)
                {
                    hits++;
                }
            }
            lblTestAcc.Text = String.Format("Paskutinio testo tikslumas: {0:0.00}%", (100.0 * hits) / TestDonors.Count);
            NetworkHelper.ToTreeView(treeView1, nn);
            NetworkHelper.ToPictureBox(pictureBox1, nn, 400, 100);
        }
Beispiel #4
0
        private void button2_Click(object sender, EventArgs e)
        {
            List <double> ins = new List <double>();

            ins.Add(0);
            ins.Add(1);

            List <double> ots = new List <double>();

            ots.Add(0);
            //ots.Add(0);

            for (int i = 0; i < 100000; i++)
            {
                nn.Train(ins, ots);
            }

            NetworkHelper.ToTreeView(treeView1, nn);
            NetworkHelper.ToPictureBox(pictureBox1, nn, 400, 100);
        }
Beispiel #5
0
 private void Form1_Load(object sender, EventArgs e)
 {
     NetworkHelper.ToTreeView(treeView1, nn);
     NetworkHelper.ToPictureBox(pictureBox1, nn, 400, 100);
 }