Ignore:
Timestamp:
11/06/17 13:12:41 (4 years ago)
Author:
gkronber
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/MathNetNumerics-Exploration-2789/Test/UnitTest1.cs

    r15443 r15450  
    110110
    111111      Console.WriteLine("Best tolerance {0}, RMSE (LOO): {1}", optTol, looRMSE);
     112    }
    112113
     114    [TestMethod]
     115    public void TestGAM() {
     116      var provider = new HeuristicLab.Problems.Instances.DataAnalysis.VariousInstanceProvider();
     117      var problemData = provider.LoadData(provider.GetDataDescriptors().First(dd => dd.Name.Contains("Poly")));
     118      // var provider = new HeuristicLab.Problems.Instances.DataAnalysis.RegressionRealWorldInstanceProvider();
     119      // var problemData = provider.LoadData(provider.GetDataDescriptors().First(dd => dd.Name.Contains("Chem")));
     120
     121      var gam = new GAM();
     122      gam.MaxIterations = 10;
     123      gam.MaxInteractions = 3;
     124      gam.Problem.ProblemData = problemData;
     125      gam.Start();
     126
     127      var solution = (IRegressionSolution)gam.Results["Ensemble solution"].Value;
     128
     129      Console.WriteLine("RMSE (train) {0}", solution.TrainingRootMeanSquaredError);
     130      Console.WriteLine("RMSE (test) {0}", solution.TestRootMeanSquaredError);
    113131    }
    114      
     132
    115133  }
    116134}
Note: See TracChangeset for help on using the changeset viewer.