- Timestamp:
- 06/11/10 13:06:42 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/BestSymbolicRegressionSolutionAnalyzer.cs
r3905 r3915 97 97 if (BestSolutionQualityParameter.ActualValue == null || BestSolutionQualityParameter.ActualValue.Value > Quality[i].Value) { 98 98 var model = new SymbolicRegressionModel((ISymbolicExpressionTreeInterpreter)SymbolicExpressionTreeInterpreter.Clone(), 99 SymbolicExpressionTree[i], 100 GetInputVariables(SymbolicExpressionTree[i])); 99 SymbolicExpressionTree[i]); 101 100 var solution = new SymbolicRegressionSolution(ProblemData, model, lowerEstimationLimit, upperEstimationLimit); 102 101 … … 134 133 } 135 134 136 private IEnumerable<string> GetInputVariables(SymbolicExpressionTree tree) {137 return (from varNode in tree.IterateNodesPrefix().OfType<VariableTreeNode>()138 select varNode.VariableName).Distinct();139 }140 135 } 141 136 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionModel.cs
r3884 r3915 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Drawing; 24 25 using System.Linq; 25 using System.Drawing;26 26 using HeuristicLab.Common; 27 27 using HeuristicLab.Core; 28 28 using HeuristicLab.Data; 29 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 30 using HeuristicLab.Operators; 29 31 using HeuristicLab.Optimization; 30 32 using HeuristicLab.Parameters; 31 33 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 32 34 using HeuristicLab.PluginInfrastructure; 33 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;34 35 using HeuristicLab.Problems.DataAnalysis; 35 using HeuristicLab.Operators;36 36 using HeuristicLab.Problems.DataAnalysis.Symbolic; 37 using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols; 37 38 38 39 namespace HeuristicLab.Problems.DataAnalysis.Regression.Symbolic { … … 45 46 : base(deserializing) { 46 47 } 47 public SymbolicRegressionModel(ISymbolicExpressionTreeInterpreter interpreter, SymbolicExpressionTree tree , IEnumerable<string> inputVariables)48 public SymbolicRegressionModel(ISymbolicExpressionTreeInterpreter interpreter, SymbolicExpressionTree tree) 48 49 : base() { 49 50 this.tree = tree; 50 51 this.interpreter = interpreter; 51 this.inputVariables = inputVariables.ToList();52 this.inputVariables = tree.IterateNodesPrefix().OfType<VariableTreeNode>().Select(var => var.VariableName).Distinct().ToList(); 52 53 } 53 54 … … 66 67 public IEnumerable<string> InputVariables { 67 68 get { return inputVariables.AsEnumerable(); } 68 set {69 if (value != null)70 inputVariables = new List<string>(value);71 }72 69 } 73 70
Note: See TracChangeset
for help on using the changeset viewer.