91db788cc3fa60962a159e9002a20b8930b6e314,dask_xgboost/tests/test_core.py,,test_dask,#Any#Any#Any#Any#,16

Before Change



@gen_cluster(client=True, Worker=Nanny)
def test_dask(c, s, a, b):
    x = np.random.random((1000, 10))
    y = np.random.random(1000)

    dtrain = xgb.DMatrix(x, label=y)

After Change


    dtrain = xgb.DMatrix(df, label=labels)
    bst = xgb.train(param, dtrain)

    ddf = dd.from_pandas(df, npartitions=4)
    dlabels = dd.from_pandas(labels, npartitions=4)
    dbst = yield 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()


def test_synchronous_api(loop):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

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


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