Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/29/17 11:28:16 (7 years ago)
Author:
bwerth
Message:

#2745 added discretized EGO-version for use with IntegerVectors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/Operators/ModelBuilder.cs

    r15338 r15343  
    3232using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3333using HeuristicLab.Problems.DataAnalysis;
    34 using HeuristicLab.Problems.SurrogateProblem;
    3534
    3635namespace HeuristicLab.Algorithms.EGO {
    37   /// <summary>
    38   /// A base class for operators that manipulate real-valued vectors.
    39   /// </summary>
    4036  [Item("ModelBuilder", "Builds a model from a dataset and a given RegressionAlgorithm")]
    4137  [StorableClass]
     
    120116        solution = SanitizeGaussianProcess(oldSolution as GaussianProcessRegressionSolution, solution as GaussianProcessRegressionSolution, Cancellation);
    121117
    122       if (regressionAlgorithm is M5RegressionTree && oldSolution != null)
    123         solution = SanitizeM5Regression(oldSolution.Model as M5Model, solution, random, Cancellation);
     118      //if (regressionAlgorithm is M5RegressionTree && oldSolution != null) solution = SanitizeM5Regression(oldSolution.Model as M5Model, solution, random, Cancellation);
    124119
    125120
     
    129124    }
    130125
    131     private static IRegressionSolution SanitizeM5Regression(M5Model oldmodel, IRegressionSolution newSolution, IRandom random, CancellationToken cancellation) {
    132       var problemdata = newSolution.ProblemData;
    133       oldmodel.UpdateLeafModels(problemdata, problemdata.AllIndices, random, cancellation);
    134       var oldSolution = oldmodel.CreateRegressionSolution(problemdata);
    135       var magicDecision = newSolution.TrainingRSquared < oldSolution.TrainingRSquared - 0.05;
    136       return magicDecision ? newSolution : oldmodel.CreateRegressionSolution(problemdata);
    137     }
     126    //private static IRegressionSolution SanitizeM5Regression(M5Model oldmodel, IRegressionSolution newSolution, IRandom random, CancellationToken cancellation) {
     127    //  var problemdata = newSolution.ProblemData;
     128    //  oldmodel.UpdateLeafModels(problemdata, problemdata.AllIndices, random, cancellation);
     129    //  var oldSolution = oldmodel.CreateRegressionSolution(problemdata);
     130    //  var magicDecision = newSolution.TrainingRSquared < oldSolution.TrainingRSquared - 0.05;
     131    //  return magicDecision ? newSolution : oldmodel.CreateRegressionSolution(problemdata);
     132    //}
    138133
    139134    //try creating a model with old hyperparameters and new dataset;
     
    150145          newSolution = sol;
    151146        }
    152       } catch (ArgumentException) { }
     147      }
     148      catch (ArgumentException) { }
    153149      return newSolution;
    154150    }
Note: See TracChangeset for help on using the changeset viewer.