Scikit-learn

Precision-Recall Curve

Plot Precision-Recall curve.

Precision measures the proportion of true positives out of all positive predictions made by the model.

Precision = TP / (TP + FP)

Recall, also known as Sensitivity, measures the proportion of true positives out of all actual positive instances.

Recall = TP / (TP + FN)
precision-recallclassification

Required packages

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

mljar-scikit-plot>=0.3.11

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:

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

Python code

# Python code will be here

Code explanation

Plot Precision-Recall curve.

« Previous
ROC Curve