Exemple #1
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            double penalty;

            if (Double.TryParse(tbPenalty.Text, out penalty))
            {
                Penalty = penalty;
                if (Tree != null)
                {
                    Tree = new RegressionTree(TestDataSet, "Single Tree", Penalty);
                    RegressionTreeVisualizator.ClearChart(RegressionChart);
                    fillRegressionChart();
                }
                if (Forest != null)
                {
                    Forest = new RandomForest(dataSet, AmountOfTreesInForest, Penalty);
                    RegressionTreeVisualizator.ClearChart(RandomForestChart);
                    fillRandomForestChart();
                }
            }
            else
            {
                MessageBox.Show("Input double value in /Penalty on leaves amount/ field!", "Error");
            }
        }
Exemple #2
0
 private void fillRegressionChart()
 {
     if (dataSet[0].AmountOfArguments == 1)
     {
         RegressionTreeVisualizator.ClearChart(RegressionChart);
         RegressionTreeVisualizator.DrawCorrelationField(dataSet, RegressionChart);
         var treeVisualizator = new RegressionTreeVisualizator(Tree, RegressionChart);
         treeVisualizator.DrawRegressionLine("RegressionLine");
     }
 }
Exemple #3
0
 private void fillRandomForestChart()
 {
     if (dataSet[0].AmountOfArguments == 1)
     {
         RegressionTreeVisualizator.ClearChart(RandomForestChart);
         RegressionTreeVisualizator.DrawCorrelationField(dataSet, RandomForestChart);
         for (int i = 0; i < Forest.AmountOfTrees; i++)
         {
             var treeVisualizator = new RegressionTreeVisualizator(Forest.Trees[i], RandomForestChart);
             RandomForestChart.Series.Add(Forest.Trees[i].Name);
             RandomForestChart.Series[Forest.Trees[i].Name].Color       = Color.Red;
             RandomForestChart.Series[Forest.Trees[i].Name].BorderWidth = 1;
             RandomForestChart.Series[Forest.Trees[i].Name].ChartType   = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.StepLine;
             treeVisualizator.DrawRegressionLine(Forest.Trees[i].Name);
         }
     }
 }