nvflare.app_opt.xgboost.tree_based.model_persistor module

class XGBModelPersistor(save_name='xgboost_model.json', load_as_dict=True)[source]

Bases: ModelPersistor

Init FLComponent.

The FLComponent is the base class of all FL Components. (executors, controllers, responders, filters, aggregators, and widgets are all FLComponents)

FLComponents have the capability to handle and fire events and contain various methods for logging.

handle_event(event: str, fl_ctx: FLContext)[source]

Handles events.

Parameters
  • event_type (str) – event type fired by workflow.

  • fl_ctx (FLContext) – FLContext information.

load_model(fl_ctx: FLContext) Learnable[source]

Initialize and load the Model.

Parameters

fl_ctx – FLContext

Returns

ModelLearnable object

save_model(model_learnable: Learnable, fl_ctx: FLContext)[source]

Persists the Model object.

Parameters
  • model_learnable – ModelLearnable object

  • fl_ctx – FLContext