Changeset 8639
- Timestamp:
- 09/13/12 09:48:24 (12 years ago)
- Location:
- trunk/sources
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/InteractiveSymbolicRegressionSolutionSimplifierView.cs
r8139 r8639 50 50 51 51 protected override void UpdateModel(ISymbolicExpressionTree tree) { 52 var model = new SymbolicRegressionModel(tree, Content.Model.Interpreter );52 var model = new SymbolicRegressionModel(tree, Content.Model.Interpreter, Content.Model.LowerEstimationLimit, Content.Model.UpperEstimationLimit); 53 53 SymbolicRegressionModel.Scale(model, Content.ProblemData); 54 54 Content.Model = model; -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveEvaluator.cs
r8635 r8639 78 78 double estimated = estimatedValuesEnumerator.Current; 79 79 cache[i] = estimated; 80 linearScalingCalculator.Add(estimated, target); 80 if (!double.IsNaN(estimated) && !double.IsInfinity(estimated)) 81 linearScalingCalculator.Add(estimated, target); 81 82 i++; 82 83 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionModel.cs
r8528 r8639 20 20 #endregion 21 21 22 using System; 22 23 using System.Collections.Generic; 23 24 using HeuristicLab.Common; … … 76 77 var estimatedValues = model.Interpreter.GetSymbolicExpressionTreeValues(model.SymbolicExpressionTree, dataset, rows); 77 78 var targetValues = dataset.GetDoubleValues(targetVariable, rows); 78 double alpha; 79 double beta; 80 OnlineCalculatorError errorState; 81 OnlineLinearScalingParameterCalculator.Calculate(estimatedValues, targetValues, out alpha, out beta, out errorState); 82 if (errorState != OnlineCalculatorError.None) return; 79 80 var linearScalingCalculator = new OnlineLinearScalingParameterCalculator(); 81 var targetValuesEnumerator = targetValues.GetEnumerator(); 82 var estimatedValuesEnumerator = estimatedValues.GetEnumerator(); 83 while (targetValuesEnumerator.MoveNext() & estimatedValuesEnumerator.MoveNext()) { 84 double target = targetValuesEnumerator.Current; 85 double estimated = estimatedValuesEnumerator.Current; 86 if (!double.IsNaN(estimated) && !double.IsInfinity(estimated)) 87 linearScalingCalculator.Add(estimated, target); 88 } 89 if (linearScalingCalculator.ErrorState == OnlineCalculatorError.None && (targetValuesEnumerator.MoveNext() || estimatedValuesEnumerator.MoveNext())) 90 throw new ArgumentException("Number of elements in target and estimated values enumeration do not match."); 91 92 double alpha = linearScalingCalculator.Alpha; 93 double beta = linearScalingCalculator.Beta; 94 if (linearScalingCalculator.ErrorState != OnlineCalculatorError.None) return; 83 95 84 96 ConstantTreeNode alphaTreeNode = null;
Note: See TracChangeset
for help on using the changeset viewer.