# Optimize custom model metrics with hyperparameter tuning

> Optimize custom model metrics with hyperparameter tuning - Improve DataRobot models using custom
> loss functions and advanced hyperparameter tuning.

This Markdown file sits beside the HTML page at the same path (with a `.md` suffix). It summarizes the topic and lists links for tools and LLM context.

Companion generated at `2026-05-06T18:17:09.575729+00:00` (UTC).

## Primary page

- [Optimize custom model metrics with hyperparameter tuning](https://docs.datarobot.com/en/docs/api/dev-learning/accelerators/custom-model-dev/opt-custom-metric.html): Full documentation for this topic (HTML).

## Related documentation

- [Developer documentation](https://docs.datarobot.com/en/docs/api/index.html): Linked from this page.
- [Developer learning](https://docs.datarobot.com/en/docs/api/dev-learning/index.html): Linked from this page.
- [AI accelerators](https://docs.datarobot.com/en/docs/api/dev-learning/accelerators/index.html): Linked from this page.
- [Custom model development](https://docs.datarobot.com/en/docs/api/dev-learning/accelerators/custom-model-dev/index.html): Linked from this page.

## Documentation content

[Access this AI accelerator on GitHub](https://github.com/datarobot-community/ai-accelerators/blob/main/advanced_ml_and_api_approaches/Custom_Metrics_Model_Optimization/Custom_Metrics_Model_Optimization.ipynb)

This accelerator demonstrates how to improve DataRobot models using custom loss functions and advanced hyperparameter tuning.

In many real-world business problems, standard metrics like RMSE or Accuracy do not fully represent the true business cost. For example, in CLV prediction, overpredicting loss-making customers or underpredicting high-value customers can directly impact revenue and retention strategy. Similarly, classification models often need custom objectives such as maximizing recall at specific thresholds or minimizing false negatives.

By creating a custom metric and tuning models using that metric, you ensure the model is optimized for business value, not just statistical performance. This approach is essential when:

- Business costs are not symmetrical (overprediction and underprediction have different impacts)
- False negatives and false positives carry different risk levels
- Revenue-driven metrics matter more than standard ML scores
- Domain rules must be incorporated into optimization
