You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem:
I don't fully understand how to use the log_cout parameter of the CatBoostClassifier.fit method.
The doc says that this parameter should take as input the "Output stream or callback for logging".
I tried to pass a custom logger in order to log the training details on a specific handler, but it seems that either I am doing it wrong, or the log_cout doesn't work as it should. Here is a minimal script to reproduce the error:
Starting training...
Traceback (most recent call last):
File "_catboost.pyx", line 5950, in _catboost._WriteLog
File "_catboost.pyx", line 5950, in _catboost._WriteLog
File "_catboost.pyx", line 5950, in _catboost._WriteLog
[Previous line repeated 997 more times]
AttributeError: '_GeneratorContextManager' object has no attribute 'write'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/francesco*/Documents/sample_script.py", line 20, in <module>
model.fit(x, y, log_cout=logging.info)
File "/home/francesco*/miniconda3/lib/python3.9/site-packages/catboost/core.py", line 5128, in fit
self._fit(X, y, cat_features, text_features, embedding_features, None, sample_weight, None, None, None, None, baseline, use_best_model,
File "/home/francesco*/miniconda3/lib/python3.9/site-packages/catboost/core.py", line 2355, in _fit
self._train(
File "/home/francesco*/miniconda3/lib/python3.9/site-packages/catboost/core.py", line 1759, in _train
self._object._train(train_pool, test_pool, params, allow_clear_pool, init_model._object if init_model else None)
SystemError: <method '_train' of '_catboost._CatBoost' objects> returned a result with an error set
The tests that can be found in the catboost/python-package/ut/medium/test.py file only mention the case where the log_cout implements the write() method, what about a logger?
catboost version: 1.1.1 Operating System: Ubuntu 22.04.1 LTS CPU: 11th Gen Intel® Core™ i7-1165G7 @ 2.80GHz × 8 GPU: x
The text was updated successfully, but these errors were encountered:
Problem:
I don't fully understand how to use the
log_cout
parameter of theCatBoostClassifier.fit
method.The doc says that this parameter should take as input the "Output stream or callback for logging".
I tried to pass a custom logger in order to log the training details on a specific handler, but it seems that either I am doing it wrong, or the
log_cout
doesn't work as it should. Here is a minimal script to reproduce the error:This code outputs:
The tests that can be found in the catboost/python-package/ut/medium/test.py file only mention the case where the
log_cout
implements thewrite()
method, what about a logger?catboost version: 1.1.1
Operating System: Ubuntu 22.04.1 LTS
CPU: 11th Gen Intel® Core™ i7-1165G7 @ 2.80GHz × 8
GPU: x
The text was updated successfully, but these errors were encountered: