Changeset 13062 for stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionErrorCharacteristicsCurveView.cs
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 13002-13004
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views merged: 13003
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionErrorCharacteristicsCurveView.cs
r12009 r13062 21 21 22 22 using System; 23 using System.Collections.Generic; 23 24 using System.Linq; 24 using System.Windows.Forms;25 25 using HeuristicLab.Algorithms.DataAnalysis; 26 26 using HeuristicLab.MainForm; … … 31 31 [Content(typeof(ISymbolicRegressionSolution))] 32 32 public partial class SymbolicRegressionSolutionErrorCharacteristicsCurveView : RegressionSolutionErrorCharacteristicsCurveView { 33 private IRegressionSolution linearRegressionSolution;34 33 public SymbolicRegressionSolutionErrorCharacteristicsCurveView() { 35 34 InitializeComponent(); … … 41 40 } 42 41 43 protected override void OnContentChanged() {44 if (Content != null)45 linearRegressionSolution = CreateLinearRegressionSolution();46 else47 linearRegressionSolution = null;48 49 base.OnContentChanged();50 }51 52 protected override void UpdateChart() {53 base.UpdateChart();54 if (Content == null || linearRegressionSolution == null) return;55 AddRegressionSolution(linearRegressionSolution);56 }57 58 42 private IRegressionSolution CreateLinearRegressionSolution() { 59 43 if (Content == null) throw new InvalidOperationException(); 60 44 double rmse, cvRmsError; 61 45 var problemData = (IRegressionProblemData)ProblemData.Clone(); 62 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)46 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) 63 47 64 48 //clear checked inputVariables … … 77 61 78 62 var solution = LinearRegression.CreateLinearRegressionSolution(problemData, out rmse, out cvRmsError); 79 solution.Name = " Linear Model";63 solution.Name = "Baseline (linear subset)"; 80 64 return solution; 81 65 } 82 66 83 protected override void Content_ModelChanged(object sender, EventArgs e) {84 linearRegressionSolution = CreateLinearRegressionSolution();85 base.Content_ModelChanged(sender, e);86 }87 67 88 protected override void Content_ProblemDataChanged(object sender, EventArgs e) {89 linearRegressionSolution = CreateLinearRegressionSolution();90 base.Content_ProblemDataChanged(sender, e);68 protected override IEnumerable<IRegressionSolution> CreateBaselineSolutions() { 69 foreach (var sol in base.CreateBaselineSolutions()) yield return sol; 70 yield return CreateLinearRegressionSolution(); 91 71 } 92 72 }
Note: See TracChangeset
for help on using the changeset viewer.