Search code examples
pythonscikit-learnxgboostcatboost

difference between custom_loss and custom_metric in catboost CatBoostClassifier


I am trying to learn catboost, and I see two confusing terms with CatBoostClassifier:

custom_loss and custom_metric.

I have browsed here which says: https://catboost.ai/docs/concepts/python-reference_parameters-list.html#python-reference_parameters-list

custom_metric: Metric values to output during training. These functions are not optimized and are displayed for informational purposes only. Some metrics support optional parameters (see the Objectives and metrics section for details on each metric).

but then what is custom_loss?

I see custom_loss defined in the R documentation: https://catboost.ai/docs/features/loss-functions-desc.html - but not in the python one.

yet. on the python tutorial, they have defined a custom_loss like so:

model = CatBoostClassifier(
    custom_loss=['Accuracy'],
    random_seed=42,
    logging_level='Silent'
)

Am I missing something here? Infact, custom_loss does not seem to be defined as a property anywhere in the python docs: https://catboost.ai/docs/concepts/python-reference_parameters-list.html#python-reference_parameters-list


Solution

  • I infer the following from this link in the documentation.

    I am almost certain that they refer to the same parameter, but custom_loss is the R name while custom_metric is for Python. Apparently they can be used interchangeably as long as they don't cause name collisions.