Changeset 14330 for branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression
- Timestamp:
- 10/13/16 19:47:41 (8 years ago)
- Location:
- branches/symbreg-factors-2650
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/symbreg-factors-2650
- Property svn:mergeinfo changed
/trunk/sources merged: 14282,14284-14300,14307,14314-14316,14319,14322
- Property svn:mergeinfo changed
-
branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.DataAnalysis merged: 14289-14290,14292-14295
- Property svn:mergeinfo changed
-
branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionModel.cs
r13992 r14330 20 20 #endregion 21 21 22 using System; 22 23 using System.Collections.Generic; 23 24 using HeuristicLab.Common; … … 33 34 public string TargetVariable { 34 35 get { return targetVariable; } 35 protected set { targetVariable = value; } 36 set { 37 if (string.IsNullOrEmpty(value) || targetVariable == value) return; 38 targetVariable = value; 39 OnTargetVariableChanged(this, EventArgs.Empty); 40 } 36 41 } 37 42 38 protected RegressionModel(bool deserializing) : base(deserializing) { } 43 protected RegressionModel(bool deserializing) 44 : base(deserializing) { 45 targetVariable = string.Empty; 46 } 39 47 40 48 protected RegressionModel(RegressionModel original, Cloner cloner) … … 56 64 } 57 65 58 [StorableHook(HookType.AfterDeserialization)]59 private void AfterDeserialization() {60 // BackwardsCompatibility3.361 #region Backwards compatible code, remove with 3.462 targetVariable = string.Empty;63 #endregion64 }65 66 public abstract IEnumerable<double> GetEstimatedValues(IDataset dataset, IEnumerable<int> rows); 66 67 public abstract IRegressionSolution CreateRegressionSolution(IRegressionProblemData problemData); 68 69 #region events 70 public event EventHandler TargetVariableChanged; 71 private void OnTargetVariableChanged(object sender, EventArgs args) { 72 var changed = TargetVariableChanged; 73 if (changed != null) 74 changed(sender, args); 75 } 76 #endregion 67 77 } 68 78 } -
branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolutionBase.cs
r14185 r14330 176 176 [StorableHook(HookType.AfterDeserialization)] 177 177 private void AfterDeserialization() { 178 if (string.IsNullOrEmpty(Model.TargetVariable)) 179 Model.TargetVariable = this.ProblemData.TargetVariable; 180 178 181 // BackwardsCompatibility3.4 179 182 #region Backwards compatible code, remove with 3.5 … … 230 233 231 234 double trainingR = OnlinePearsonsRCalculator.Calculate(originalTrainingValues, estimatedTrainingValues, out errorState); 232 TrainingRSquared = errorState == OnlineCalculatorError.None ? trainingR *trainingR : double.NaN;235 TrainingRSquared = errorState == OnlineCalculatorError.None ? trainingR * trainingR : double.NaN; 233 236 double testR = OnlinePearsonsRCalculator.Calculate(originalTestValues, estimatedTestValues, out errorState); 234 TestRSquared = errorState == OnlineCalculatorError.None ? testR *testR : double.NaN;237 TestRSquared = errorState == OnlineCalculatorError.None ? testR * testR : double.NaN; 235 238 236 239 double trainingRelError = OnlineMeanAbsolutePercentageErrorCalculator.Calculate(originalTrainingValues, estimatedTrainingValues, out errorState);
Note: See TracChangeset
for help on using the changeset viewer.