diff options
Diffstat (limited to 'lib/parameters.py')
-rw-r--r-- | lib/parameters.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/parameters.py b/lib/parameters.py index 0b0da81..8c7c9cb 100644 --- a/lib/parameters.py +++ b/lib/parameters.py @@ -990,6 +990,24 @@ class ModelAttribute: ) return False + def build_lgbm(self): + mf = df.LightGBMFunction( + np.mean(self.data), + n_samples=len(self.data), + param_names=self.param_names, + arg_count=self.arg_count, + ).fit(self.param_values, self.data) + + if mf.fit_success: + self.model_function = mf + return True + else: + logger.warning(f"LightGBM generation for {self.name} {self.attr} faled") + self.model_function = df.StaticFunction( + np.mean(self.data), n_samples=len(self.data) + ) + return False + def build_xgb(self): mf = df.XGBoostFunction( np.mean(self.data), |