Changeset 17156 for stable/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesModel.cs
- Timestamp:
- 07/23/19 20:20:35 (5 years ago)
- Location:
- stable
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk merged: 17030,17032-17033,17043-17044,17137
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Algorithms.DataAnalysis
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Algorithms.DataAnalysis merged: 17030,17032,17043-17044,17137
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Algorithms.DataAnalysis/3.4
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Algorithms.DataAnalysis/3.4 merged: 17030,17032,17043-17044,17137
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesModel.cs
r17097 r17156 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 private bool isCompatibilityLoaded = false; // only set to true if the model is deserialized from the old format, needed to make sure that information is serialized again if it was loaded from the old format39 40 36 [Storable(Name = "models")] 41 37 private IList<IRegressionModel> __persistedModels { 42 38 set { 43 this.isCompatibilityLoaded = true;44 39 this.models.Clear(); 45 40 foreach (var m in value) this.models.Add(m); 46 41 } 47 get { if (this.isCompatibilityLoaded) return models; else return null; }42 get { return models; } 48 43 } 49 44 [Storable(Name = "weights")] 50 45 private IList<double> __persistedWeights { 51 46 set { 52 this.isCompatibilityLoaded = true;53 47 this.weights.Clear(); 54 48 foreach (var w in value) this.weights.Add(w); 55 49 } 56 get { if (this.isCompatibilityLoaded) return weights; else return null; }50 get { return weights; } 57 51 } 58 #endregion59 52 60 53 public override IEnumerable<string> VariablesUsedForPrediction { … … 77 70 this.weights = new List<double>(original.weights); 78 71 this.models = new List<IRegressionModel>(original.models.Select(m => cloner.Clone(m))); 79 this.isCompatibilityLoaded = original.isCompatibilityLoaded;80 72 } 81 [Obsolete("The constructor of GBTModel should not be used directly anymore (use GBTModelSurrogate instead)")] 73 82 74 internal GradientBoostedTreesModel(IEnumerable<IRegressionModel> models, IEnumerable<double> weights) 83 75 : base(string.Empty, "Gradient boosted tree model", string.Empty) {
Note: See TracChangeset
for help on using the changeset viewer.