From 5e6d004e27f75ad53e7dbc7fa14333702e54bdb3 Mon Sep 17 00:00:00 2001 From: Markus Cozowicz Date: Wed, 12 May 2021 16:45:56 +0200 Subject: [PATCH] include fair comparison w/ poisson regression and lightgbm by including all features --- tests/test_cbm.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_cbm.py b/tests/test_cbm.py index 05538e0..bfc0e44 100644 --- a/tests/test_cbm.py +++ b/tests/test_cbm.py @@ -107,6 +107,8 @@ def test_nyc_bicycle(): enc.fit(x) x = enc.transform(x) + x = np.hstack([x.todense(), bic[['HIGH_T', 'LOW_T', 'PRECIP']].values]) + clf = linear_model.PoissonRegressor() clf.fit(x[train_idx, ], y_train) @@ -118,7 +120,7 @@ def test_nyc_bicycle(): #### LightGBM # train_data = lgb.Dataset(x, label=y, categorical_feature=[0, 1]) - x = bic[['Weekday', 'HIGH_T', 'LOW_T']].values + x = bic[['Weekday', 'HIGH_T', 'LOW_T', 'PRECIP']].values train_data = lgb.Dataset(x[train_idx, ], label=y_train, categorical_feature=[0]) model = lgb.train({