Add test (#17)
* update submodule LightGBM to latest commit * fix test about valid data * upgrade version to 3.3.2 * install sklearn in ci setup
This commit is contained in:
Родитель
fce3633937
Коммит
ce07a4cfc2
|
@ -12,5 +12,6 @@ cp ./external_libs/LightGBM/lib_lightgbm.so ${lgb_python_pkg_dir}/lightgbm || ex
|
|||
# modify `basic.py` to load all libs first, or cannot find them when calling python interfaces.
|
||||
cp ${lgb_python_pkg_dir}/lightgbm/basic.py raw && cat ./scripts/load_precompiled_libs.py ${lgb_python_pkg_dir}/lightgbm/basic.py > tmp && cp tmp ${lgb_python_pkg_dir}/lightgbm/basic.py || exit -1
|
||||
# install python package
|
||||
pip install pytest numpy scipy pandas
|
||||
# install sklearn to avoid error "ImportError: cannot import name '_LGBMBaseCrossValidator' from 'lightgbm.compat'"
|
||||
pip install pytest numpy scipy pandas sklearn
|
||||
pip list
|
||||
|
|
|
@ -1 +1 @@
|
|||
3.3.1.post1
|
||||
3.3.2
|
|
@ -1 +1 @@
|
|||
Subproject commit b0137debe6e9cc92b65ec71b0fe8a56ea213c143
|
||||
Subproject commit 865c126a1e3ccdd77ec205b9dde46e5f3c5b6b21
|
|
@ -1,4 +1,4 @@
|
|||
12 12 12 2 18 7 16 5 11 14 1
|
||||
:12 12 12 2 18 7 16 5 11 14 1
|
||||
3 12 10 11 10 8 5 0 7 8 0
|
||||
9 3 18 4 8 18 12 14 3 4 1
|
||||
15 15 14 17 0 10 2 5 2 8 0
|
||||
|
|
|
|
@ -99,10 +99,9 @@ def test_e2e(params, trained_model_path):
|
|||
np.testing.assert_allclose(pred[:5], np.array([0.83267298, 0.388454, 0.35369267, 0.60330376, -1.24218415]))
|
||||
|
||||
|
||||
def test_train_data_no_header(binary_params, simple_ds_with_header, trained_model_path):
|
||||
def test_train_data_no_header(binary_params, simple_ds_with_header):
|
||||
train_data = lgb.Dataset(simple_ds.data, params={"parser_config_file": simple_ds.parser_config})
|
||||
valid_data = lgb.Dataset(simple_ds_with_header.data, params={
|
||||
"parser_config_file": simple_ds_with_header.parser_config, "header": True})
|
||||
valid_data = lgb.Dataset(simple_ds_with_header.data, params={"header": True})
|
||||
bst = lgb.train(binary_params, train_data, valid_sets=[valid_data])
|
||||
expected_pred = 0.4894574
|
||||
# predict data with no header.
|
||||
|
|
Загрузка…
Ссылка в новой задаче