Dask-XGBoost
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
from dask.distributed import Client
client = Client('scheduler-address:8786') # connect to cluster
import dask.dataframe as dd
df = dd.read_csv('...') # use dask.dataframe to load and
df_train = ... # preprocess data
labels_train = ...
import dask_xgboost as dxgb
params = {'objective': 'binary:logistic', ...} # use normal xgboost params
bst = dxgb.train(client, params, df_train, labels_train)
>>> bst # Get back normal XGBoost result
<xgboost.core.Booster at ... >
predictions = dxgb.predict(client, bst, data_test)
How this works
For more information on using Dask.dataframe for preprocessing see the Dask.dataframe documentation.
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.
Larger Example
For a more serious example see
History
Conversation during development happened at dmlc/xgboost #2032
Metadata
Release files for dask-xgboost 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dask-xgboost-0.2.0.tar.gz | 18.0 kB | Without provenance | Details for dask-xgboost-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dask_xgboost-0.2.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for dask_xgboost-0.2.0-py2.py3-none-any.whl |
Total release size: 32.1 kB
Release files / dask-xgboost-0.2.0.tar.gz
| Download URL | dask-xgboost-0.2.0.tar.gz |
|---|---|
| Size | 18.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6d9c491dc4099f74a0df66c4d439d296c0f1fba97009fe93e21b2350f295b4ca
|
|
BLAKE2b-256 checksum How to use checksums |
74a337471a21f7e13ba23823eb837cee62fd31ba77f489ebe381cd9a6ed764e3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.7.10
|
Release files / dask_xgboost-0.2.0-py2.py3-none-any.whl
| Download URL | dask_xgboost-0.2.0-py2.py3-none-any.whl |
|---|---|
| Size | 14.1 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
47b7d96e981d8d7aa81bd15578f470d80ee92ae5aac122adc3bc7e1c9f941682
|
|
BLAKE2b-256 checksum How to use checksums |
0d3390fec71df94921d9e604c1f3812b7bb9573ce93aec0637df8a319a7ea42b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.7.10
|
Security for dask-xgboost 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.