Custom Metrics
Monitoring Models with Custom Metrics
Monitoring Models with Custom Metrics
NannyML offers some standard metrics to monitor your classification and regression models. But sometimes you need something more customized to ensure your model performs adequately. The Custom Metrics functionality solves this issue. You can create custom metrics to monitor your machine learning models in ways better suited to your particular circumstances.
NannyML allows you to both calculate the performance of your model using your custom metric but also estimate the performance according to that custom metric. Let's see how this works!
You can access the Custom Metrics settings on the top left of your screen, as you can see below:
There are three types of custom metrics supported. Binary Classification, Multiclass Classification, and Regression. They are organized separately on the Custom Metrics settings page shown below:
It is straightforward to add a new custom metric. Let's go through the process for each metric type.
We click the appropriate Add new metric button as seen below:
We are then greeted with a new screen where we have to enter the information related to the new metric:
As shown we need to fill in the following information:
A name for the metric.
A short description of the metric.
A function that calculates the metric.
A function that estimates the metric
The numerical limits of the metric, if they exist.
Developing the code for the required functions is described here for the f_beta score. The required calculation function is:
while the required estimation function is:
The default metric limits still apply, so we can leave those as they are. These metric limits ensure that the metric thresholds are constrained to these theoretical limits. We then fill all this information on the new binary classification metric screen:
This results in the new metric now being visible in the Binary Classification section of the Custom Metrics screen.
The metric can now be selected for use by any binary classification model from the Model Settings page.
Note that once custom metrics are added they can be selected during the Add new model wizard. You can see the relevant step for binary classification in the screenshot below:
Custom metrics can also be selected from a model's settings page