Sklearn make_scorer tutoriel : Créer vos propres métriques.

Sklearn make_scorer tutoriel : Créer vos propres métriques.

🎙 Guillaume Saint-Cirgue 👥 204K 📅 December 11, 2019 ⏱ 13 min 👁 32K 📄 tutorial 🧭 2026-08-17
Available in: English (current) Français

Keywords

make_scorercustom metricscross-validationgrid searchscikit-learn

Summary

This tutorial by Machine Learnia explains how to create custom evaluation metrics in scikit-learn using the make_scorer function. The instructor begins by motivating the need for custom metrics in real-world projects, where clients often have specific performance criteria beyond standard metrics like R² or MSE. He illustrates this with an example where predictions must fall within a 20% tolerance of true values. He then shows how to define a custom metric function that calculates the proportion of predictions within this tolerance. The key step is wrapping this function with make_scorer, specifying whether higher scores are better. This scorer can then be used in cross-validation and grid search. The tutorial demonstrates using the custom scorer with cross_val_score and GridSearchCV to optimize an SVR model. Finally, the instructor provides an exercise for viewers to create their own RMSE scorer. The video is practical and hands-on, with code examples shown on screen.

149 words

Critical Evaluation

Value of the Information & Strength of the Argument

The video provides valuable practical knowledge on a specific but important aspect of machine learning workflow: creating custom metrics. The argumentation is clear and logical, building from a real-world problem to a solution. The instructor explains not only the ‘how’ but also the ‘why’, emphasizing the importance of custom metrics in professional settings. The demonstration is effective, showing the process step-by-step and even including an error case to highlight the need for make_scorer. The tutorial is well-paced and easy to follow for viewers with basic knowledge of scikit-learn.

Scientific Rigor, Source Quality, Title Accuracy

The scientific rigor is adequate for a tutorial. The instructor does not cite external sources, but the content is based on standard scikit-learn documentation and practices. The tutorial is consistent with official scikit-learn usage. The title accurately describes the content. No comments were provided for analysis.

149 words

Title / Content Match

The title accurately reflects the content: a tutorial on using make_scorer to create custom metrics in sklearn.

Quality & Reliability

8/10

The tutorial is clear, well-structured, and provides a practical example. The author demonstrates expertise in the subject. However, the video lacks formal citations and references, and the code is not shown in full detail.

Key Moments

Cited Sources

  • Machine Learnia GitHub — Repository with code examples and resources.
  • Machine Learnia Website — Official website with additional tutorials and resources.
  • Free Book: Learn Machine Learning in One Week — Free book offered by the channel.

Concurring Sources

Contribution & Novelties

The video provides a clear, practical guide to creating custom metrics in scikit-learn, a topic often overlooked in introductory tutorials. It bridges the gap between standard metrics and real-world requirements, showing how to integrate custom scorers into cross-validation and hyperparameter tuning. The tutorial is original in its focus on the make_scorer function and its application to a realistic scenario.

Pour aller plus loin :

90 words

Radar Profile

The radar profile shows high scores in quality of information and reliability, with moderate scores in quantity and technical level. This indicates a focused, well-explained tutorial that may not cover all aspects of the topic but provides solid, reliable content.

Reliability 8/10