Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/23/19 20:20:35 (5 years ago)
Author:
gkronber
Message:

#2883: merged r17030, r17032, r17033, r17043, r17044, r17137 from trunk to stable

Location:
stable
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Algorithms.DataAnalysis

  • stable/HeuristicLab.Algorithms.DataAnalysis/3.4

  • stable/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesModel.cs

    r17097 r17156  
    3434  // this is essentially a collection of weighted regression models
    3535  public sealed class GradientBoostedTreesModel : RegressionModel, IGradientBoostedTreesModel {
    36     // BackwardsCompatibility3.4 for allowing deserialization & serialization of old models
    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 format
    39 
    4036    [Storable(Name = "models")]
    4137    private IList<IRegressionModel> __persistedModels {
    4238      set {
    43         this.isCompatibilityLoaded = true;
    4439        this.models.Clear();
    4540        foreach (var m in value) this.models.Add(m);
    4641      }
    47       get { if (this.isCompatibilityLoaded) return models; else return null; }
     42      get { return models; }
    4843    }
    4944    [Storable(Name = "weights")]
    5045    private IList<double> __persistedWeights {
    5146      set {
    52         this.isCompatibilityLoaded = true;
    5347        this.weights.Clear();
    5448        foreach (var w in value) this.weights.Add(w);
    5549      }
    56       get { if (this.isCompatibilityLoaded) return weights; else return null; }
     50      get { return weights; }
    5751    }
    58     #endregion
    5952
    6053    public override IEnumerable<string> VariablesUsedForPrediction {
     
    7770      this.weights = new List<double>(original.weights);
    7871      this.models = new List<IRegressionModel>(original.models.Select(m => cloner.Clone(m)));
    79       this.isCompatibilityLoaded = original.isCompatibilityLoaded;
    8072    }
    81     [Obsolete("The constructor of GBTModel should not be used directly anymore (use GBTModelSurrogate instead)")]
     73
    8274    internal GradientBoostedTreesModel(IEnumerable<IRegressionModel> models, IEnumerable<double> weights)
    8375      : base(string.Empty, "Gradient boosted tree model", string.Empty) {
Note: See TracChangeset for help on using the changeset viewer.