Free cookie consent management tool by TermsFeed Policy Generator

Changeset 12591


Ignore:
Timestamp:
07/05/15 19:41:18 (9 years ago)
Author:
gkronber
Message:

#2261 fixed slow evaluation, even when results are already cached

Location:
branches/GBT-trunkintegration/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/GBT-trunkintegration/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesAlgorithm.cs

    r12590 r12591  
    187187      // init
    188188      var problemData = Problem.ProblemData;
    189       var lossFunction = ApplicationManager.Manager.GetInstances<ILossFunction>().Single(l => l.ToString() == LossFunctionParameter.Value.Value);
     189      var lossFunction = ApplicationManager.Manager.GetInstances<ILossFunction>()
     190        .Single(l => l.ToString() == LossFunctionParameter.Value.Value);
    190191      var state = GradientBoostedTreesAlgorithmStatic.CreateGbmState(problemData, lossFunction, (uint)Seed, MaxDepth, R, M, Nu);
    191192
     
    213214
    214215      // produce variable relevance
    215       // update variable impacts matrix
    216216      var orderedImpacts = state.GetVariableRelevance().Select(t => new { name = t.Key, impact = t.Value }).ToList();
    217217
  • branches/GBT-trunkintegration/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesModel.cs

    r12590 r12591  
    6464      // allocate target array go over all models and add up weighted estimation for each row
    6565      var res = new double[rows.Count()];
     66      if (res.Length == 0) return res; // return immediately if rows is empty. This prevents multiple iteration over lazy rows enumerable.
     67                                       // (which essentially looks up indexes in a dictionary)
    6668      for (int i = 0; i < models.Count; i++) {
    6769        var w = weights[i];
Note: See TracChangeset for help on using the changeset viewer.