From 23c24c6185b7645dddbae538885f43548c41754c Mon Sep 17 00:00:00 2001 From: Roy Chan Date: Wed, 6 Nov 2024 10:07:28 -0800 Subject: [PATCH] Fix kats:kats-type-checking Summary: As the new LightGBM library version was rolled out, the test was failed at https://www.internalfb.com/intern/test/562950130862286. This diff fixes the test. Differential Revision: D65520929 fbshipit-source-id: 884f78aa9ce548f0fa168876720cfe49d53f9c18 --- kats/models/ml_ar.py | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/kats/models/ml_ar.py b/kats/models/ml_ar.py index 09449620..7f9c3aa5 100644 --- a/kats/models/ml_ar.py +++ b/kats/models/ml_ar.py @@ -1091,23 +1091,21 @@ def _train( self.train_data_in = in_data[train_index, :] self.train_data = meta_and_out_data.loc[train_index] normalized_train_y = meta_and_out_data["output"].loc[train_index] - lgb_params = { - "n_jobs": self.params.n_jobs, - "max_depth": self.params.max_depth, - "min_data_in_leaf": self.params.min_data_in_leaf, - "num_leaves": self.params.num_leaves, - "subsample": self.params.subsample, - "n_estimators": self.params.n_estimators, - "learning_rate": self.params.learning_rate, - "colsample_bytree": self.params.colsample_bytree, - "boosting_type": self.params.boosting_type, - "alpha": self.params.alpha, - "random_state": self.params.random_state, - "verbose": self.params.verbose, - } + regr = gbm.LGBMRegressor( objective=self.params.objective, - **lgb_params, + n_jobs=self.params.n_jobs, + max_depth=self.params.max_depth, + min_data_in_leaf=self.params.min_data_in_leaf, + num_leaves=self.params.num_leaves, + subsample=self.params.subsample, + n_estimators=self.params.n_estimators, + learning_rate=self.params.learning_rate, + colsample_bytree=self.params.colsample_bytree, + boosting_type=self.params.boosting_type, + alpha=self.params.alpha, + random_state=self.params.random_state, + verbose=self.params.verbose, ) train_rows = self.train_data_in.shape[0]