You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 16, 2021. It is now read-only.
Dask-XGBoost has been deprecated and is no longer maintained. The functionality
of this project has been included directly in XGBoost. To use Dask and XGBoost
together, please use xgboost.dask instead
https://xgboost.readthedocs.io/en/latest/tutorials/dask.html.
Distributed training with XGBoost and Dask.distributed
This repository offers a legacy option to perform distributed training
with XGBoost on Dask.array and Dask.dataframe collections.
pip install dask-xgboost
Please note that XGBoost now includes a Dask API as part of its official Python package.
That API is independent of dask-xgboost and is now the recommended way to use Dask
adn XGBoost together. See
the xgb.dask documentation here https://xgboost.readthedocs.io/en/latest/tutorials/dask.html
for more details on the new API.
Example
fromdask.distributedimportClientclient=Client('scheduler-address:8786') # connect to clusterimportdask.dataframeasdddf=dd.read_csv('...') # use dask.dataframe to load anddf_train= ... # preprocess datalabels_train= ...
importdask_xgboostasdxgbparams= {'objective': 'binary:logistic', ...} # use normal xgboost paramsbst=dxgb.train(client, params, df_train, labels_train)
>>>bst# Get back normal XGBoost result<xgboost.core.Boosterat ... >predictions=dxgb.predict(client, bst, data_test)
Once you have created suitable data and labels we are ready for distributed
training with XGBoost. Every Dask worker sets up an XGBoost slave and gives
them enough information to find each other. Then Dask workers hand their
in-memory Pandas dataframes to XGBoost (one Dask dataframe is just many Pandas
dataframes spread around the memory of many machines). XGBoost handles
distributed training on its own without Dask interference. XGBoost then hands
back a single xgboost.Booster result object.