Let's see how we can create a custom metric for each machine learning problem type. To make things more structured, we have created a separate page for each problem type. The key to creating a custom metric is to write the code for its required functions.