Skip to content
Plotly templates

Precision-Recall Curve

PR curve — better than ROC when classes are imbalanced.

Template previewPlotly
Rendering…

Make it your own.

{
  "data": [
    { "type":"scatter","mode":"lines","name":"Model",
      "x":[0,0.1,0.2,0.3,0.45,0.6,0.75,0.85,0.92,1.0],
      "y":[0.98,0.95,0.91,0.85,0.78,0.7,0.6,0.5,0.4,0.3],
      "line":{"color":"#3666ff","width":3} },
    { "type":"scatter","mode":"lines","name":"Baseline",
      "x":[0,1],"y":[0.15,0.15],
      "line":{"color":"#94a3b8","dash":"dash"} }
  ],
  "layout": {
    "title":"Precision-Recall (AP = 0.82)",
    "xaxis":{"title":"Recall","range":[0,1]},
    "yaxis":{"title":"Precision","range":[0,1]},
    "width":520,"height":420
  }
}