Scikit-learn

Compute Metric

Compute metrics for predictions. This recipe supports following metrics: Accuracy, ROC AUC, F1, Precision, Recall, LogLoss, MCC, MSE, RMSE, MAE, R2. Please use advanced settings to provide sample weights for metric function.

metricaccuracy

Required packages

You need below packages to use the code generated by recipe. All packages are automatically installed in MLJAR Studio.

scikit-learn>=1.5.0

Interactive recipe

You can use below interactive recipe to generate code. This recipe is available in MLJAR Studio.

In the below recipe, we assume that you have following variables available in your notebook:

  • predicted (type DataFrame)
  • y (type Series)

Python code

# Python code will be here

Code explanation

  1. Compute metric to assess performance between true and predicted values.
  2. Print computed score.