-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Consider data locality in distributing data. * New interface that looks similar to the one with single node.
- Loading branch information
1 parent
52d44e0
commit b46bb59
Showing
9 changed files
with
278 additions
and
253 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import xgboost as xgb | ||
from xgboost.distributed import DaskDMatrix | ||
from dask.distributed import Client | ||
from dask.distributed import LocalCluster | ||
from dask import dataframe as dd | ||
|
||
|
||
if __name__ == '__main__': | ||
cluster = LocalCluster(n_workers=4) # or use any other clusters | ||
client = Client(cluster) | ||
|
||
train_csv = dd.read_csv('./train.csv') | ||
ad_feature = dd.read_csv('./adFeature.csv') | ||
train_csv = train_csv.merge(ad_feature, how='left', on=['aid']) | ||
|
||
label = train_csv['label'] | ||
train_csv = train_csv.drop(labels=['label'], axis=1) | ||
|
||
dtrain = DaskDMatrix(train_csv, label) | ||
|
||
bst = xgb.train({'verbosity': 3}, dtrain) | ||
|
||
with open('result', 'w') as fd: | ||
fd.write(str(bst)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.