mljar / mljar-supervised

Python package for AutoML on Tabular Data with Feature Engineering, Hyper-Parameters Tuning, Explanations and Automatic Documentation
https://mljar.com
MIT License
2.97k stars 392 forks source link

trained error #703

Open jungjongho opened 5 months ago

jungjongho commented 5 months ago

automl = AutoML( algorithms=["CatBoost", "Xgboost", "LightGBM"], mode="Compete", ml_task="multiclass_classification", eval_metric='f1', random_state=42, total_time_limit=14400, model_time_limit=None, )

모델 학습

automl.fit(df_preprocess, df_y_data_encoded)

df_preprocess => (96294,15) df_y_data_encoded.distinct() => 0,1,2,3,4,5,6

cannot reshape array of size 606648 into shape (12380,7) Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/supervised/base_automl.py", line 1195, in fit trained = self.train_model(params) File "/usr/local/lib/python3.10/dist-packages/supervised/base_automl.py", line 401, in train_model mf.train(results_path, model_subpath) File "/usr/local/lib/python3.10/dist-packages/supervised/model_framework.py", line 254, in train learner.fit( File "/usr/local/lib/python3.10/dist-packages/supervised/algorithms/lightgbm.py", line 237, in fit self.model = lgb.train( File "/usr/local/lib/python3.10/dist-packages/lightgbm/engine.py", line 282, in train evaluation_result_list.extend(booster.eval_train(feval)) File "/usr/local/lib/python3.10/dist-packages/lightgbm/basic.py", line 3892, in eval_train return self.inner_eval(self._train_data_name, 0, feval) File "/usr/local/lib/python3.10/dist-packages/lightgbm/basic.py", line 4635, in __inner_eval feval_ret = eval_function(self.inner_predict(data_idx), cur_data) File "/usr/local/lib/python3.10/dist-packages/supervised/utils/metric.py", line 214, in lightgbm_eval_metric_f1 preds = np.reshape(preds, (rows, cols), order="F") File "<_array_function internals>", line 180, in reshape File "/usr/local/lib/python3.10/dist-packages/numpy/core/fromnumeric.py", line 298, in reshape return _wrapfunc(a, 'reshape', newshape, order=order) File "/usr/local/lib/python3.10/dist-packages/numpy/core/fromnumeric.py", line 57, in _wrapfunc return bound(args, *kwds) ValueError: cannot reshape array of size 606648 into shape (12380,7)

pplonski commented 4 months ago

Thank you @jungjongho for reporting. I

sumantabasak commented 1 month ago

I'm having same issue. @pplonski can you please look into this? The issue seems to be for 'LightGBM'.

pplonski commented 4 weeks ago

Hi @sumantabasak,

thanks for reporting, could you please provide example code to reproduce issue?