- Timestamp:
- 01/14/17 19:21:44 (8 years ago)
- Location:
- stable
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 14289-14290
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.DataAnalysis merged: 14289-14290
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification merged: 14289-14290
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicClassificationModel.cs
r14186 r14571 20 20 #endregion 21 21 22 using System; 22 23 using System.Collections.Generic; 23 24 using HeuristicLab.Common; … … 34 35 public abstract class SymbolicClassificationModel : SymbolicDataAnalysisModel, ISymbolicClassificationModel { 35 36 [Storable] 36 private readonlystring targetVariable;37 private string targetVariable; 37 38 public string TargetVariable { 38 39 get { return targetVariable; } 40 set { 41 if (string.IsNullOrEmpty(value) || targetVariable == value) return; 42 targetVariable = value; 43 OnTargetVariableChanged(this, EventArgs.Empty); 44 } 39 45 } 40 46 41 47 [StorableConstructor] 42 protected SymbolicClassificationModel(bool deserializing) : base(deserializing) { } 48 protected SymbolicClassificationModel(bool deserializing) 49 : base(deserializing) { 50 targetVariable = string.Empty; 51 } 43 52 44 53 protected SymbolicClassificationModel(SymbolicClassificationModel original, Cloner cloner) … … 64 73 Scale(problemData, problemData.TargetVariable); 65 74 } 75 76 #region events 77 public event EventHandler TargetVariableChanged; 78 private void OnTargetVariableChanged(object sender, EventArgs args) { 79 var changed = TargetVariableChanged; 80 if (changed != null) 81 changed(sender, args); 82 } 83 #endregion 66 84 } 67 85 } -
stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression merged: 14289-14290
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4 merged: 14289-14290
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionModel.cs
r14186 r14571 35 35 public class SymbolicRegressionModel : SymbolicDataAnalysisModel, ISymbolicRegressionModel { 36 36 [Storable] 37 private readonlystring targetVariable;37 private string targetVariable; 38 38 public string TargetVariable { 39 39 get { return targetVariable; } 40 set { 41 if (string.IsNullOrEmpty(value) || targetVariable == value) return; 42 targetVariable = value; 43 OnTargetVariableChanged(this, EventArgs.Empty); 44 } 40 45 } 41 46 42 47 [StorableConstructor] 43 protected SymbolicRegressionModel(bool deserializing) : base(deserializing) { } 48 protected SymbolicRegressionModel(bool deserializing) 49 : base(deserializing) { 50 targetVariable = string.Empty; 51 } 44 52 45 53 protected SymbolicRegressionModel(SymbolicRegressionModel original, Cloner cloner) … … 74 82 Scale(problemData, problemData.TargetVariable); 75 83 } 84 85 #region events 86 public event EventHandler TargetVariableChanged; 87 private void OnTargetVariableChanged(object sender, EventArgs args) { 88 var changed = TargetVariableChanged; 89 if (changed != null) 90 changed(sender, args); 91 } 92 #endregion 76 93 } 77 94 } -
stable/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationModel.cs
r14027 r14571 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 ClassificationModel(bool deserializing) : base(deserializing) { } 43 protected ClassificationModel(bool deserializing) 44 : base(deserializing) { 45 targetVariable = string.Empty; 46 } 39 47 protected ClassificationModel(ClassificationModel original, Cloner cloner) 40 48 : base(original, cloner) { … … 55 63 } 56 64 57 [StorableHook(HookType.AfterDeserialization)]58 private void AfterDeserialization() {59 // BackwardsCompatibility3.360 #region Backwards compatible code, remove with 3.461 targetVariable = string.Empty;62 #endregion63 }64 65 65 public abstract IEnumerable<double> GetEstimatedClassValues(IDataset dataset, IEnumerable<int> rows); 66 66 public abstract IClassificationSolution CreateClassificationSolution(IClassificationProblemData problemData); 67 68 #region events 69 public event EventHandler TargetVariableChanged; 70 private void OnTargetVariableChanged(object sender, EventArgs args) { 71 var changed = TargetVariableChanged; 72 if (changed != null) 73 changed(sender, args); 74 } 75 #endregion 67 76 } 68 77 } -
stable/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationSolutionBase.cs
r14186 r14571 88 88 [StorableHook(HookType.AfterDeserialization)] 89 89 private void AfterDeserialization() { 90 if (string.IsNullOrEmpty(Model.TargetVariable)) 91 Model.TargetVariable = this.ProblemData.TargetVariable; 92 90 93 if (!this.ContainsKey(TrainingNormalizedGiniCoefficientResultName)) 91 94 Add(new Result(TrainingNormalizedGiniCoefficientResultName, "Normalized Gini coefficient of the model on the training partition.", new DoubleValue())); -
stable/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionModel.cs
r14027 r14571 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 } -
stable/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolutionBase.cs
r14186 r14571 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); -
stable/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Classification/IClassificationModel.cs
r14327 r14571 20 20 #endregion 21 21 22 using System; 22 23 using System.Collections.Generic; 24 23 25 namespace HeuristicLab.Problems.DataAnalysis { 24 26 /// <summary> … … 29 31 IEnumerable<double> GetEstimatedClassValues(IDataset dataset, IEnumerable<int> rows); 30 32 IClassificationSolution CreateClassificationSolution(IClassificationProblemData problemData); 31 string TargetVariable { get; } 33 string TargetVariable { get; set; } 34 event EventHandler TargetVariableChanged; 32 35 } 33 36 } -
stable/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionModel.cs
r14327 r14571 20 20 #endregion 21 21 22 using System; 22 23 using System.Collections.Generic; 23 24 … … 30 31 IEnumerable<double> GetEstimatedValues(IDataset dataset, IEnumerable<int> rows); 31 32 IRegressionSolution CreateRegressionSolution(IRegressionProblemData problemData); 32 string TargetVariable { get; } 33 string TargetVariable { get; set; } 34 event EventHandler TargetVariableChanged; 33 35 } 34 36 }
Note: See TracChangeset
for help on using the changeset viewer.