Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/11/18 16:43:41 (6 years ago)
Author:
bburlacu
Message:

#2886: Add symbolic regression solution to results during algorithm run and scale model.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2886_SymRegGrammarEnumeration/HeuristicLab.Algorithms.DataAnalysis.SymRegGrammarEnumeration/Analysis/RSquaredEvaluator.cs

    r15993 r15994  
    8686
    8787      if (algorithm.BestTrainingSentence == null || r2 > bestR2 || (r2.IsAlmost(bestR2) && complexity < bestComplexity)) {
    88         results.AddOrUpdateResult(BestTrainingQualityResultName, new DoubleValue(r2));
     88        algorithm.BestTrainingSentence = symbolString;
     89
     90        var model = new SymbolicRegressionModel(problemData.TargetVariable, tree, expressionTreeLinearInterpreter);
     91        model.Scale(problemData);
     92        var bestSolution = model.CreateRegressionSolution(problemData);
     93
     94        results.AddOrUpdateResult(BestTrainingQualityResultName, new DoubleValue(bestSolution.TrainingRSquared));
     95        results.AddOrUpdateResult(BestTestQualityResultName, new DoubleValue(bestSolution.TestRSquared));
     96        results.AddOrUpdateResult(BestTrainingModelResultName, bestSolution.Model);
     97        results.AddOrUpdateResult(BestTrainingSolutionResultName, bestSolution);
    8998        results.AddOrUpdateResult(BestComplexityResultName, new IntValue(complexity));
    90         algorithm.BestTrainingSentence = symbolString;
    9199
    92100        // record best sentence quality & length
Note: See TracChangeset for help on using the changeset viewer.