get_obj_fn: A factory-esque arrangement (not sure if there is an actual...

Description Usage Arguments Value

Description

A factory-esque arrangement (not sure if there is an actual name for this pattern) to manufacture an objective function with needed quantities accessible in its parent environment. We do this because there's no way to use the info attribute of the dtrain object to store the component model log scores (as would be standard in the xgboost package). But we need to ensure that the objective function has access to these log scores when called in parallel.

Usage

1
get_obj_fn(component_model_log_scores)

Arguments

component_model_log_scores

N by M matrix where entry [i, m] has the log-score for observation i obtained from component model m

Value

a function that takes two arguments (preds and dtrain) and computes the log-score objective function for the stacked model. i.e., it converts preds to model weights for each component model m at each observation i and then combines the component model log scores with those weights to obtain stacked model log scores


reichlab/xgbstack documentation built on May 27, 2019, 4:54 a.m.