Changeset 17246 for branches/2925_AutoDiffForDynamicalModels/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees
- Timestamp:
- 09/11/19 14:06:25 (5 years ago)
- Location:
- branches/2925_AutoDiffForDynamicalModels
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2925_AutoDiffForDynamicalModels
-
branches/2925_AutoDiffForDynamicalModels/HeuristicLab.Algorithms.DataAnalysis
- Property svn:mergeinfo changed
-
branches/2925_AutoDiffForDynamicalModels/HeuristicLab.Algorithms.DataAnalysis/3.4
- Property svn:mergeinfo changed
-
branches/2925_AutoDiffForDynamicalModels/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesAlgorithm.cs
r17035 r17246 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-2019Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * and the BEACON Center for the Study of Evolution in Action. 5 5 * … … 196 196 Parameters.Add(new FixedValueParameter<EnumValue<ModelCreation>>(ModelCreationParameterName, "Defines the results produced at the end of the run (Surrogate => Less disk space, lazy recalculation of model)", new EnumValue<ModelCreation>(value))); 197 197 Parameters[ModelCreationParameterName].Hidden = true; 198 } else if (!Parameters.ContainsKey(ModelCreationParameterName)) { 199 // very old version contains neither ModelCreationParameter nor CreateSolutionParameter 200 Parameters.Add(new FixedValueParameter<EnumValue<ModelCreation>>(ModelCreationParameterName, "Defines the results produced at the end of the run (Surrogate => Less disk space, lazy recalculation of model)", new EnumValue<ModelCreation>(ModelCreation.Model))); 201 Parameters[ModelCreationParameterName].Hidden = true; 198 202 } 199 203 #endregion … … 269 273 270 274 if (ModelCreation == ModelCreation.SurrogateModel) { 271 model = new GradientBoostedTreesModelSurrogate( problemData, (uint)Seed, lossFunction, Iterations, MaxSize, R, M, Nu, (GradientBoostedTreesModel)model);275 model = new GradientBoostedTreesModelSurrogate((GradientBoostedTreesModel)model, problemData, (uint)Seed, lossFunction, Iterations, MaxSize, R, M, Nu); 272 276 } 273 277 -
branches/2925_AutoDiffForDynamicalModels/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesAlgorithmStatic.cs
r17035 r17246 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-2019Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * and the BEACON Center for the Study of Evolution in Action. 5 5 * -
branches/2925_AutoDiffForDynamicalModels/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesModel.cs
r17035 r17246 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-2019Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * and the BEACON Center for the Study of Evolution in Action. 5 5 * … … 34 34 // this is essentially a collection of weighted regression models 35 35 public sealed class GradientBoostedTreesModel : RegressionModel, IGradientBoostedTreesModel { 36 // BackwardsCompatibility3.4 for allowing deserialization & serialization of old models37 #region Backwards compatible code, remove with 3.538 39 36 [Storable(Name = "models")] 40 37 private IList<IRegressionModel> __persistedModels { … … 53 50 get { return weights; } 54 51 } 55 #endregion56 52 57 53 public override IEnumerable<string> VariablesUsedForPrediction { -
branches/2925_AutoDiffForDynamicalModels/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesModelSurrogate.cs
r16662 r17246 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-2019Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * and the BEACON Center for the Study of Evolution in Action. 5 5 * … … 75 75 : base(original, cloner) { 76 76 IGradientBoostedTreesModel clonedModel = null; 77 if (original. ActualModel != null) clonedModel = cloner.Clone(original.ActualModel);77 if (original.actualModel.IsValueCreated) clonedModel = cloner.Clone(original.ActualModel); 78 78 actualModel = new Lazy<IGradientBoostedTreesModel>(CreateLazyInitFunc(clonedModel)); // only capture clonedModel in the closure 79 79 … … 90 90 private Func<IGradientBoostedTreesModel> CreateLazyInitFunc(IGradientBoostedTreesModel clonedModel) { 91 91 return () => { 92 return clonedModel == null ? RecalculateModel() : clonedModel;92 return clonedModel ?? RecalculateModel(); 93 93 }; 94 94 } 95 95 96 96 // create only the surrogate model without an actual model 97 p ublicGradientBoostedTreesModelSurrogate(IRegressionProblemData trainingProblemData, uint seed,97 private GradientBoostedTreesModelSurrogate(IRegressionProblemData trainingProblemData, uint seed, 98 98 ILossFunction lossFunction, int iterations, int maxSize, double r, double m, double nu) 99 99 : base(trainingProblemData.TargetVariable, "Gradient boosted tree model", string.Empty) { … … 106 106 this.m = m; 107 107 this.nu = nu; 108 109 actualModel = new Lazy<IGradientBoostedTreesModel>(() => RecalculateModel()); 108 110 } 109 111 110 112 // wrap an actual model in a surrograte 111 public GradientBoostedTreesModelSurrogate(IRegressionProblemData trainingProblemData, uint seed, 112 ILossFunction lossFunction, int iterations, int maxSize, double r, double m, double nu, 113 IGradientBoostedTreesModel model) 113 public GradientBoostedTreesModelSurrogate(IGradientBoostedTreesModel model, IRegressionProblemData trainingProblemData, uint seed, 114 ILossFunction lossFunction, int iterations, int maxSize, double r, double m, double nu) 114 115 : this(trainingProblemData, seed, lossFunction, iterations, maxSize, r, m, nu) { 115 116 actualModel = new Lazy<IGradientBoostedTreesModel>(() => model); -
branches/2925_AutoDiffForDynamicalModels/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesSolution.cs
r16662 r17246 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-2019Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2925_AutoDiffForDynamicalModels/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/IGradientBoostedTreesModel.cs
r16662 r17246 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-2019Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * and the BEACON Center for the Study of Evolution in Action. 5 5 * -
branches/2925_AutoDiffForDynamicalModels/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/LossFunctions/AbsoluteErrorLoss.cs
r16662 r17246 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-2019Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * and the BEACON Center for the Study of Evolution in Action. 5 5 * -
branches/2925_AutoDiffForDynamicalModels/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/LossFunctions/ILossFunction.cs
r16662 r17246 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-2019Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * and the BEACON Center for the Study of Evolution in Action. 5 5 * -
branches/2925_AutoDiffForDynamicalModels/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/LossFunctions/LogisticRegressionLoss.cs
r16662 r17246 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-2019Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * and the BEACON Center for the Study of Evolution in Action. 5 5 * -
branches/2925_AutoDiffForDynamicalModels/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/LossFunctions/QuantileRegressionLoss.cs
r16662 r17246 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-2019Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * and the BEACON Center for the Study of Evolution in Action. 5 5 * -
branches/2925_AutoDiffForDynamicalModels/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/LossFunctions/RelativeErrorLoss.cs
r16662 r17246 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-2019Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * and the BEACON Center for the Study of Evolution in Action. 5 5 * -
branches/2925_AutoDiffForDynamicalModels/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/LossFunctions/SquaredErrorLoss.cs
r16662 r17246 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-2019Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * and the BEACON Center for the Study of Evolution in Action. 5 5 * -
branches/2925_AutoDiffForDynamicalModels/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/ModelCreation.cs
r17035 r17246 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-2018Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * and the BEACON Center for the Study of Evolution in Action. 5 5 * -
branches/2925_AutoDiffForDynamicalModels/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/RegressionTreeBuilder.cs
r16662 r17246 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-2019Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * and the BEACON Center for the Study of Evolution in Action. 5 5 * -
branches/2925_AutoDiffForDynamicalModels/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/RegressionTreeModel.cs
r16892 r17246 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-2019Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * and the BEACON Center for the Study of Evolution in Action. 5 5 *
Note: See TracChangeset
for help on using the changeset viewer.