Train Test Performance#
This notebooks provides an overview for using and understanding train test performance check.
What is the purpose of the check?#
This check helps you compare your model’s performance between the train and test datasets based on multiple scorers.
Scorers are a convention of sklearn to evaluate a model, it is a function which accepts (model, X, y_true) and returns a float result which is the score. A sklearn convention is that higher scores are better than lower scores. For additional details see scorers documentation.
The default scorers that are used are F1, Percision, and Recall for Classification and Negative Root Mean Square Error, Negative Mean Absolute Error, and R2 for Regression.
Generate data & model#
Run the check#
You can select which scorers to use by passing either a list or a dict of scorers to the check, the full list of possible scorers can be seen at scorers.py.
Define a condition#
We can define on our check a condition that will validate that our model doesn’t degrade on new data.
Let’s add a condition to the check and see what happens when it fails:
We detected that for class “2” the Recall score result is degraded by more than 15%
Using a custom scorer#
In addition to the built-in scorers, we can define our own scorer based on sklearn api and run it using the check alongside other scorers:
Total running time of the script: ( 0 minutes 3.077 seconds)