Add predict to custom loss and metric tutorial#10
Open
traderlife8 wants to merge 1 commit intocatboost:masterfrom
Open
Add predict to custom loss and metric tutorial#10traderlife8 wants to merge 1 commit intocatboost:masterfrom
predict to custom loss and metric tutorial#10traderlife8 wants to merge 1 commit intocatboost:masterfrom
Conversation
model2.predict(X_test) File "_catboost.pyx", line 4546, in _catboost._CatBoost._base_predict File "_catboost.pyx", line 1609, in _catboost.transform_predictions File "_catboost.pyx", line 5350, in _catboost._convert_to_visible_labels IndexError: index 0 is out of bounds for axis 0 with size 0
andrey-khropov
approved these changes
Aug 24, 2025
Member
|
Ok, let's add |
predict to custom loss and metric tutorial
Member
|
I've created an issue for the error reported: catboost/catboost#2932 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
model2.predict(X_test)
get IndexError on Python 3.8.8 64-bit, and Python 3.9.7, like this:
Traceback (most recent call last):
File "E:\py\catboost\tutorials\custom_loss\custom_loss_and_metric_tutorial.py", line 187, in
model2.predict(X_test,thread_count=1,prediction_type='Class')
File "C:\ProgramData\Anaconda3\lib\site-packages\catboost\core.py", line 4772, in predict
return self._predict(data, prediction_type, ntree_start, ntree_end, thread_count, verbose, 'predict', task_type)
File "C:\ProgramData\Anaconda3\lib\site-packages\catboost\core.py", line 2220, in _predict
predictions = self._base_predict(data, prediction_type, ntree_start, ntree_end, thread_count, verbose, task_type)
File "C:\ProgramData\Anaconda3\lib\site-packages\catboost\core.py", line 1516, in _base_predict
return self._object._base_predict(pool, prediction_type, ntree_start, ntree_end, thread_count, verbose, task_type)
File "_catboost.pyx", line 4529, in _catboost._CatBoost._base_predict
File "_catboost.pyx", line 4546, in _catboost._CatBoost._base_predict
File "_catboost.pyx", line 1609, in _catboost.transform_predictions
File "_catboost.pyx", line 5350, in _catboost._convert_to_visible_labels
IndexError: index 0 is out of bounds for axis 0 with size 0