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
3k stars 401 forks source link

Catboost error: out of range treeEnd #323

Closed pplonski closed 3 years ago

pplonski commented 3 years ago

While training AutoML on small datasets:

catboost/private/libs/algo/apply.cpp:42: Out of range treeEnd=155
Traceback (most recent call last):
  File "/home/piotr/sandbox/mljar-supervised/supervised/base_automl.py", line 1039, in _fit
    trained = self.train_model(params)
  File "/home/piotr/sandbox/mljar-supervised/supervised/base_automl.py", line 354, in train_model
    mf.train(results_path, model_subpath)
  File "/home/piotr/sandbox/mljar-supervised/supervised/model_framework.py", line 206, in train
    sample_weight_validation,
  File "/home/piotr/sandbox/mljar-supervised/supervised/model_framework.py", line 88, in predictions
    y_train_predicted = learner.predict(X_train)
  File "/home/piotr/sandbox/mljar-supervised/supervised/algorithms/catboost.py", line 183, in predict
    return self.model.predict_proba(X, ntree_end=self.best_ntree_limit)
  File "/home/piotr/sandbox/ml_compare/SmallDataBenchmarks/venv/lib/python3.7/site-packages/catboost/core.py", line 4396, in predict_proba
    return self._predict(data, 'Probability', ntree_start, ntree_end, thread_count, verbose, 'predict_proba')
  File "/home/piotr/sandbox/ml_compare/SmallDataBenchmarks/venv/lib/python3.7/site-packages/catboost/core.py", line 1981, in _predict
    predictions = self._base_predict(data, prediction_type, ntree_start, ntree_end, thread_count, verbose)
  File "/home/piotr/sandbox/ml_compare/SmallDataBenchmarks/venv/lib/python3.7/site-packages/catboost/core.py", line 1310, in _base_predict
    return self._object._base_predict(pool, prediction_type, ntree_start, ntree_end, thread_count, verbose)
  File "_catboost.pyx", line 4308, in _catboost._CatBoost._base_predict
  File "_catboost.pyx", line 4313, in _catboost._CatBoost._base_predict
_catboost.CatBoostError: catboost/private/libs/algo/apply.cpp:42: Out of range treeEnd=155
pplonski commented 3 years ago

The initial model not always have the 20 trees, that's why the error.