Skip to main content

Interactions between Dask and XGBoost

Project description

Distributed training with XGBoost and Dask.distributed

This repository enables you to perform distributed training with XGBoost on Dask.array and Dask.dataframe collections.

pip install dask-xgboost

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, bsg, 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dask-xgboost-0.1.2.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

dask_xgboost-0.1.2-py2.py3-none-any.whl (11.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file dask-xgboost-0.1.2.tar.gz.

File metadata

File hashes

Hashes for dask-xgboost-0.1.2.tar.gz
Algorithm Hash digest
SHA256 2df70c9bf70a287f26c7a69b82959d078b2f661af46876a9b3b43c0f939f2938
MD5 23a41ea8cbb734a71607dd6c1f10f357
BLAKE2b-256 8adf737413c5aef1e3cf69db57882098635b93d72656bfa80ee33625238a46fe

See more details on using hashes here.

Provenance

File details

Details for the file dask_xgboost-0.1.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for dask_xgboost-0.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f5f69a6d0ba8ec2c116e09e785b618d5e71757c5801c8f1e8783149dea22071b
MD5 01df044f8b647c2b76b7632707120315
BLAKE2b-256 5a585259a559ec776ce69cb7b4d95dca3c0af5a1d0931f3eab6f142d995e0b33

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page