nvflare.app_opt.xgboost.tree_based.bagging_aggregator module

class XGBBaggingAggregator[source]

Bases: Aggregator

Perform bagging aggregation for XGBoost trees.

The trees are pre-weighted during training. Bagging aggregation simply add the new trees to existing global model.

accept(shareable: Shareable, fl_ctx: FLContext) bool[source]

Store shareable and update aggregator’s internal state

Parameters:
  • shareable – information from contributor

  • fl_ctx – context provided by workflow

Returns:

The first boolean indicates if this shareable is accepted. The second boolean indicates if aggregate can be called.

aggregate(fl_ctx: FLContext) Shareable[source]

Called when workflow determines to generate shareable to send back to contributors

Parameters:

fl_ctx (FLContext) – context provided by workflow

Returns:

the weighted mean of accepted shareables from contributors

Return type:

Shareable