Free cookie consent management tool by TermsFeed Policy Generator

Opened 5 years ago

Last modified 4 years ago

#3030 closed defect

RF/GBT SurrogateModel triggers unnecessary recalculation — at Version 1

Reported by: pfleck Owned by:
Priority: medium Milestone: HeuristicLab 3.3.17
Component: Algorithms.DataAnalysis Version: trunk
Keywords: Cc:

Description (last modified by pfleck)

When the surrogate-storage mechanism is used for RFs and GBTs, the full model is still created after a run and passed to the surrogate model for immediate use. It currently is stored as a Lazy object: actualModel = new Lazy<IRandomForestModel>(() => model);

When a surrogate model is cloned, it checks whether the Lazy object is initialized and clones the full model if it is available:

IRandomForestModel clonedModel = null;
if (original.actualModel.IsValueCreated) clonedModel = cloner.Clone(original.ActualModel);
  actualModel = new Lazy<IRandomForestModel>(() => clonedModel ?? RecalculateModel());

In case the cloning constructor is called immediately after creation of the surrogate Model, IsValueCreated is actually returning false since the Lazy object itself has not yet accessed its Value property. Thus the full model gets lost, and an unnecessary recalculation of the model is required later.

Change History (1)

comment:1 Changed 5 years ago by pfleck

  • Description modified (diff)
Note: See TracTickets for help on using tickets.