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.7.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

dask_xgboost-0.1.7-py2.py3-none-any.whl (11.9 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: dask-xgboost-0.1.7.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.19.1 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.27.0 CPython/3.7.3

File hashes

Hashes for dask-xgboost-0.1.7.tar.gz
Algorithm Hash digest
SHA256 c4eb7989e0b4bcab956c5ab5f89c3419016615ad1ca8f6596ca471e402aae43b
MD5 efb0b4c99961a8385b4330fe83aed1c4
BLAKE2b-256 2a6ed072c0ab938ae46ce5e3d196f33cc5492e98302c1ccc16661da1557fe1b3

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: dask_xgboost-0.1.7-py2.py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.19.1 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.27.0 CPython/3.7.3

File hashes

Hashes for dask_xgboost-0.1.7-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8b122c15d3180dd318afe4ddf0862d93add71c34c12ad87853c87f92067e990d
MD5 cf28ba4560c484ecd3d801728520a27f
BLAKE2b-256 9f0a717a74df509093abffca80bdae0b1f23c8728172598ea406d54a2667aaea

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