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

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

Uploaded Source

Built Distribution

dask_xgboost-0.1.11-py2.py3-none-any.whl (13.6 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: dask-xgboost-0.1.11.tar.gz
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1.post20200604 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.7

File hashes

Hashes for dask-xgboost-0.1.11.tar.gz
Algorithm Hash digest
SHA256 3fbe1bf4344dc74edfbe9f928c7e3e6acc26dc57cefd8da8ae56a15469c6941c
MD5 c3ab0b066953e7ec2ee0e24f4aa4406e
BLAKE2b-256 60641a95ab8a00137b6b6bc47bcc622385fcfd214bb249ce1e3da825f8a50a13

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: dask_xgboost-0.1.11-py2.py3-none-any.whl
  • Upload date:
  • Size: 13.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1.post20200604 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.7

File hashes

Hashes for dask_xgboost-0.1.11-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 903609b5ace44c25f021cae53964ce913eec34e73c449dca64755dae5a26efd9
MD5 0a3f7908bd5aaf315d242d874da32d26
BLAKE2b-256 38cd7ee92d372176068f7f445f062e1748d0d75491e5d14902bbe48da78df636

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