Changeset 15910 for branches/2886_SymRegGrammarEnumeration/HeuristicLab.Algorithms.DataAnalysis.SymRegGrammarEnumeration/Analysis
- Timestamp:
- 04/17/18 16:59:57 (7 years ago)
- Location:
- branches/2886_SymRegGrammarEnumeration/HeuristicLab.Algorithms.DataAnalysis.SymRegGrammarEnumeration/Analysis
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2886_SymRegGrammarEnumeration/HeuristicLab.Algorithms.DataAnalysis.SymRegGrammarEnumeration/Analysis/RSquaredEvaluator.cs
r15883 r15910 23 23 public RSquaredEvaluator() { } 24 24 25 protected RSquaredEvaluator(RSquaredEvaluator original, Cloner cloner) {25 protected RSquaredEvaluator(RSquaredEvaluator original, Cloner cloner) : base(original, cloner) { 26 26 this.OptimizeConstants = original.OptimizeConstants; 27 27 } … … 52 52 private void OnStarted(object sender, EventArgs eventArgs) { 53 53 GrammarEnumerationAlgorithm algorithm = (GrammarEnumerationAlgorithm)sender; 54 algorithm.Results.Add(new Result(BestTrainingQualityResultName, new DoubleValue(-1.0)));55 54 56 55 algorithm.BestTrainingSentence = null; … … 75 74 double r2 = Evaluate(problemData, tree, OptimizeConstants); 76 75 77 var bestR2Result = (DoubleValue)algorithm.Results[BestTrainingQualityResultName].Value; 78 bool better = r2 > bestR2Result.Value; 79 bool equallyGood = r2.IsAlmost(bestR2Result.Value); 76 double bestR2 = 0.0; 77 if (algorithm.Results.ContainsKey(BestTrainingQualityResultName)) 78 bestR2 = ((DoubleValue)algorithm.Results[BestTrainingQualityResultName].Value).Value; 79 bool better = r2 > bestR2; 80 bool equallyGood = r2.IsAlmost(bestR2); 80 81 bool shorter = false; 81 82 … … 85 86 } 86 87 if (better || (equallyGood && shorter)) { 87 bestR2Result.Value = r2;88 algorithm.Results.AddOrUpdateResult(BestTrainingQualityResultName, new DoubleValue(r2)); 88 89 89 90 SymbolicRegressionModel model = new SymbolicRegressionModel( -
branches/2886_SymRegGrammarEnumeration/HeuristicLab.Algorithms.DataAnalysis.SymRegGrammarEnumeration/Analysis/SearchGraphVisualizer.cs
r15832 r15910 14 14 public SearchGraphVisualizer() { } 15 15 16 protected SearchGraphVisualizer(SearchGraphVisualizer original, Cloner cloner) { }16 protected SearchGraphVisualizer(SearchGraphVisualizer original, Cloner cloner) : base(original, cloner) { } 17 17 18 18 public override IDeepCloneable Clone(Cloner cloner) { -
branches/2886_SymRegGrammarEnumeration/HeuristicLab.Algorithms.DataAnalysis.SymRegGrammarEnumeration/Analysis/SentenceLogger.cs
r15860 r15910 20 20 public SentenceLogger() { } 21 21 22 protected SentenceLogger(SentenceLogger original, Cloner cloner) { }22 protected SentenceLogger(SentenceLogger original, Cloner cloner) : base(original, cloner) { } 23 23 24 24 public override IDeepCloneable Clone(Cloner cloner) {
Note: See TracChangeset
for help on using the changeset viewer.