package sklearn

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type tag = [
  1. | `RocCurveDisplay
]
type t = [ `Object | `RocCurveDisplay ] Obj.t
val of_pyobject : Py.Object.t -> t
val to_pyobject : [> tag ] Obj.t -> Py.Object.t
val create : ?roc_auc:float -> ?estimator_name:string -> fpr:[> `ArrayLike ] Np.Obj.t -> tpr:[> `ArrayLike ] Np.Obj.t -> unit -> t

ROC Curve visualization.

It is recommend to use :func:`~sklearn.metrics.plot_roc_curve` to create a visualizer. All parameters are stored as attributes.

Read more in the :ref:`User Guide <visualizations>`.

Parameters ---------- fpr : ndarray False positive rate.

tpr : ndarray True positive rate.

roc_auc : float, default=None Area under ROC curve. If None, the roc_auc score is not shown.

estimator_name : str, default=None Name of estimator. If None, the estimator name is not shown.

Attributes ---------- line_ : matplotlib Artist ROC Curve.

ax_ : matplotlib Axes Axes with ROC Curve.

figure_ : matplotlib Figure Figure containing the curve.

Examples -------- >>> import matplotlib.pyplot as plt # doctest: +SKIP >>> import numpy as np >>> from sklearn import metrics >>> y = np.array(0, 0, 1, 1) >>> pred = np.array(0.1, 0.4, 0.35, 0.8) >>> fpr, tpr, thresholds = metrics.roc_curve(y, pred) >>> roc_auc = metrics.auc(fpr, tpr) >>> display = metrics.RocCurveDisplay(fpr=fpr, tpr=tpr, roc_auc=roc_auc, estimator_name='example estimator') >>> display.plot() # doctest: +SKIP >>> plt.show() # doctest: +SKIP

val plot : ?ax:Py.Object.t -> ?name:string -> ?kwargs:(string * Py.Object.t) list -> [> tag ] Obj.t -> Py.Object.t

Plot visualization

Extra keyword arguments will be passed to matplotlib's ``plot``.

Parameters ---------- ax : matplotlib axes, default=None Axes object to plot on. If `None`, a new figure and axes is created.

name : str, default=None Name of ROC Curve for labeling. If `None`, use the name of the estimator.

Returns ------- display : :class:`~sklearn.metrics.plot.RocCurveDisplay` Object that stores computed values.

val line_ : t -> Py.Object.t

Attribute line_: get value or raise Not_found if None.

val line_opt : t -> Py.Object.t option

Attribute line_: get value as an option.

val ax_ : t -> Py.Object.t

Attribute ax_: get value or raise Not_found if None.

val ax_opt : t -> Py.Object.t option

Attribute ax_: get value as an option.

val figure_ : t -> Py.Object.t

Attribute figure_: get value or raise Not_found if None.

val figure_opt : t -> Py.Object.t option

Attribute figure_: get value as an option.

val to_string : t -> string

Print the object to a human-readable representation.

val show : t -> string

Print the object to a human-readable representation.

val pp : Format.formatter -> t -> unit

Pretty-print the object to a formatter.

OCaml

Innovation. Community. Security.