Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/27/21 15:26:06 (3 years ago)
Author:
gkronber
Message:

#3087 reverse merge of 17991

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3087_Ceres_Integration/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionErrorCharacteristicsCurveView.cs

    r17991 r17996  
    2626using HeuristicLab.Algorithms.DataAnalysis;
    2727using HeuristicLab.MainForm;
    28 using HeuristicLab.PluginInfrastructure;
    2928using HeuristicLab.Problems.DataAnalysis.Views;
    3029
     
    4443    private IRegressionSolution CreateLinearRegressionSolution() {
    4544      if (Content == null) throw new InvalidOperationException();
     45      double rmse, cvRmsError;
    4646      var problemData = (IRegressionProblemData)ProblemData.Clone();
    4747      if (!problemData.TrainingIndices.Any()) return null; // don't create an LR model if the problem does not have a training set (e.g. loaded into an existing model)
     
    8787      newProblemData.TestPartition.End = problemData.TestPartition.End;
    8888
    89       try {
    90         var solution = LinearRegression.CreateSolution(newProblemData, out _, out _, out _);
    91         solution.Name = "Baseline (linear subset)";
    92         return solution;
    93       } catch (NotSupportedException e) {
    94         ErrorHandling.ShowErrorDialog("Could not create a linear regression solution.", e);
    95       } catch (ArgumentException e) {
    96         ErrorHandling.ShowErrorDialog("Could not create a linear regression solution.", e);
    97       }
    98       return null;
     89      var solution = LinearRegression.CreateLinearRegressionSolution(newProblemData, out rmse, out cvRmsError);
     90      solution.Name = "Baseline (linear subset)";
     91      return solution;
    9992    }
    10093
     
    10699      if (Content.Model.SymbolicExpressionTree.IterateNodesPrefix().OfType<LaggedVariableTreeNode>().Any()) yield break;
    107100
    108       var linearRegressionSolution = CreateLinearRegressionSolution();
    109       if (linearRegressionSolution != null) yield return linearRegressionSolution;
     101      yield return CreateLinearRegressionSolution();
    110102    }
    111103  }
Note: See TracChangeset for help on using the changeset viewer.