Changeset 17034 for branches/2435-alglib_3_15/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesModel.cs
- Timestamp:
- 06/25/19 23:14:06 (5 years ago)
- Location:
- branches/2435-alglib_3_15
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2435-alglib_3_15
- Property svn:mergeinfo changed
-
branches/2435-alglib_3_15/HeuristicLab.Algorithms.DataAnalysis
- Property svn:mergeinfo changed
-
branches/2435-alglib_3_15/HeuristicLab.Algorithms.DataAnalysis/3.4
- Property svn:mergeinfo changed
-
branches/2435-alglib_3_15/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesModel.cs
r16565 r17034 36 36 // BackwardsCompatibility3.4 for allowing deserialization & serialization of old models 37 37 #region Backwards compatible code, remove with 3.5 38 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 38 40 39 [Storable(Name = "models")] 41 40 private IList<IRegressionModel> __persistedModels { 42 41 set { 43 this.isCompatibilityLoaded = true;44 42 this.models.Clear(); 45 43 foreach (var m in value) this.models.Add(m); 46 44 } 47 get { if (this.isCompatibilityLoaded) return models; else return null; }45 get { return models; } 48 46 } 49 47 [Storable(Name = "weights")] 50 48 private IList<double> __persistedWeights { 51 49 set { 52 this.isCompatibilityLoaded = true;53 50 this.weights.Clear(); 54 51 foreach (var w in value) this.weights.Add(w); 55 52 } 56 get { if (this.isCompatibilityLoaded) return weights; else return null; }53 get { return weights; } 57 54 } 58 55 #endregion … … 77 74 this.weights = new List<double>(original.weights); 78 75 this.models = new List<IRegressionModel>(original.models.Select(m => cloner.Clone(m))); 79 this.isCompatibilityLoaded = original.isCompatibilityLoaded;80 76 } 81 [Obsolete("The constructor of GBTModel should not be used directly anymore (use GBTModelSurrogate instead)")] 77 82 78 internal GradientBoostedTreesModel(IEnumerable<IRegressionModel> models, IEnumerable<double> weights) 83 79 : base(string.Empty, "Gradient boosted tree model", string.Empty) {
Note: See TracChangeset
for help on using the changeset viewer.