Free cookie consent management tool by TermsFeed Policy Generator

source: branches/MathNetNumerics-Exploration-2789/Main/Program.cs @ 15450

Last change on this file since 15450 was 15450, checked in by gkronber, 6 years ago

#2789 more tests with CV and automatic determination of smoothing parameter

File size: 1.2 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Globalization;
4using System.Linq;
5using System.Text;
6using System.Threading;
7using System.Threading.Tasks;
8using HeuristicLab.Algorithms.DataAnalysis.Experimental;
9using HeuristicLab.Problems.DataAnalysis;
10
11namespace Main {
12  class Program {
13    static void Main(string[] args) {
14      var provider = new HeuristicLab.Problems.Instances.DataAnalysis.VariousInstanceProvider();
15      var problemData = provider.LoadData(provider.GetDataDescriptors().First(dd => dd.Name.Contains("Poly")));
16      // var provider = new HeuristicLab.Problems.Instances.DataAnalysis.RegressionRealWorldInstanceProvider();
17      // var problemData = provider.LoadData(provider.GetDataDescriptors().First(dd => dd.Name.Contains("Chem")));
18
19      var gam = new GAM();
20      gam.MaxIterations = 10;
21      gam.MaxInteractions = 3;
22      gam.Problem.ProblemData = problemData;
23      gam.Start();
24
25      var solution = (IRegressionSolution)gam.Results["Ensemble solution"].Value;
26
27      Console.WriteLine("RMSE (train) {0}", solution.TrainingRootMeanSquaredError);
28      Console.WriteLine("RMSE (test) {0}", solution.TestRootMeanSquaredError);
29    }
30  }
31}
Note: See TracBrowser for help on using the repository browser.