Skip to content

Commit

Permalink
Remove modification on demo.
Browse files Browse the repository at this point in the history
  • Loading branch information
trivialfis committed Mar 14, 2020
1 parent cd03dd5 commit bc49eca
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions demo/dask/cpu_training.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,13 @@ def main(client):
history = output['history']

# you can pass output directly into `predict` too.
prediction = xgb.dask.predict(client, bst, dtrain).compute()

inplace_prediction = xgb.dask.inplace_predict(
client, bst, X).compute()

single_predt = bst.predict(xgb.DMatrix(X.compute()))

import numpy
numpy.testing.assert_allclose(inplace_prediction, prediction)
numpy.testing.assert_allclose(inplace_prediction, single_predt)
prediction = xgb.dask.predict(client, bst, dtrain)
print('Evaluation history:', history)
return prediction


if __name__ == '__main__':
# or use other clusters for scaling
with LocalCluster(n_workers=7, threads_per_worker=12) as cluster:
with LocalCluster(n_workers=7, threads_per_worker=1) as cluster:
with Client(cluster) as client:
main(client)

0 comments on commit bc49eca

Please sign in to comment.