Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/30/18 16:39:01 (6 years ago)
Author:
fholzing
Message:

#2883: Implemented third option for complete storage

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2883_GBTModelStorage/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesAlgorithmStatic.cs

    r15583 r15678  
    3333
    3434    public interface IGbmState {
    35       IRegressionModel GetModel();
     35      IRegressionModel GetModel(bool shallow = true);
    3636      double GetTrainLoss();
    3737      double GetTestLoss();
     
    100100      }
    101101
    102       public IRegressionModel GetModel() {
     102      public IRegressionModel GetModel(bool shallow = true) {
    103103#pragma warning disable 618
    104104        var model = new GradientBoostedTreesModel(models, weights);
     
    107107        // to the number of iterations + 1 (for the constant model)
    108108        // wrap the actual model in a surrogate that enables persistence and lazy recalculation of the model if necessary
    109         return new GradientBoostedTreesModelSurrogate(problemData, randSeed, lossFunction, weights.Count - 1, maxSize, r, m, nu, model);
     109        if (shallow) {
     110          return new GradientBoostedTreesModelSurrogate(problemData, randSeed, lossFunction, weights.Count - 1, maxSize, r, m, nu, model);
     111        } else {
     112          return model;
     113        }
    110114      }
    111115      public IEnumerable<KeyValuePair<string, double>> GetVariableRelevance() {
Note: See TracChangeset for help on using the changeset viewer.