Skip to content

[dask] Support init_model #4063

Closed
Closed

Description

Summary

LightGBM allows you to provide initial model for continued training.

This option should be supported in the Dask interface.

Motivation

This change would bring the Dask interface closer to full feature parity with the non-Dask interface, so that users who'd otherwise like to use Dask don't have to avoid it because init_model is missing.

References

init_model : string, Booster, LGBMModel or None, optional (default=None)
Filename of LightGBM model, Booster instance or LGBMModel instance used for continue training.

if isinstance(init_model, str):
predictor = _InnerPredictor(model_file=init_model, pred_parameter=params)
elif isinstance(init_model, Booster):
predictor = init_model._to_predictor(dict(init_model.params, **params))
else:
predictor = None

# DaskLGBMRegressor support for callbacks and init_model is not tested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions