91db788cc3fa60962a159e9002a20b8930b6e314,dask_xgboost/tests/test_core.py,,test_synchronous_api,#Any#,31
Before Change
def test_synchronous_api(loop):
param = {"max_depth":2, "eta":1, "silent":1, "objective":"binary:logistic"}
x = np.random.random((1000, 10))
y = np.random.random(1000)
dtrain = xgb.DMatrix(x, label=y)
bst = xgb.train(param, dtrain)
After Change
bst = xgb.train(param, dtrain)
ddf = dd.from_pandas(df, npartitions=4)
dlabels = dd.from_pandas(labels, npartitions=4)
with cluster() as (s, [a, b]):
with Client(s["address"], loop=loop) as c:
dbst = dxgb.train(c, param, ddf, dlabels)
result = bst.predict(dtrain)
dresult = dbst.predict(dtrain)
correct = (result > 0.5) == labels
dcorrect = (dresult > 0.5) == labels
assert dcorrect.sum() >= correct.sum()
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: dask/dask-xgboost
Commit Name: 91db788cc3fa60962a159e9002a20b8930b6e314
Time: 2017-02-18
Author: mrocklin@gmail.com
File Name: dask_xgboost/tests/test_core.py
Class Name:
Method Name: test_synchronous_api
Project Name: dask/dask-xgboost
Commit Name: 91db788cc3fa60962a159e9002a20b8930b6e314
Time: 2017-02-18
Author: mrocklin@gmail.com
File Name: dask_xgboost/tests/test_core.py
Class Name:
Method Name: test_dask
Project Name: osmr/imgclsmob
Commit Name: 09e4a76102ff4a06a835180237ea171eb475985c
Time: 2018-09-19
Author: osemery@gmail.com
File Name: keras_/models/mobilenet.py
Class Name:
Method Name: _test