package sklearn

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type t
val of_pyobject : Py.Object.t -> t
val to_pyobject : t -> Py.Object.t
val create : confusion_matrix:Ndarray.t -> display_labels:Ndarray.t -> unit -> t

Confusion Matrix visualization.

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

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

Parameters ---------- confusion_matrix : ndarray of shape (n_classes, n_classes) Confusion matrix.

display_labels : ndarray of shape (n_classes,) Display labels for plot.

Attributes ---------- im_ : matplotlib AxesImage Image representing the confusion matrix.

text_ : ndarray of shape (n_classes, n_classes), dtype=matplotlib Text, or None Array of matplotlib axes. `None` if `include_values` is false.

ax_ : matplotlib Axes Axes with confusion matrix.

figure_ : matplotlib Figure Figure containing the confusion matrix.

val plot : ?include_values:bool -> ?cmap:[ `String of string | `PyObject of Py.Object.t ] -> ?xticks_rotation:[ `Vertical | `Horizontal | `Float of float ] -> ?values_format:string -> ?ax:Py.Object.t -> t -> Py.Object.t

Plot visualization.

Parameters ---------- include_values : bool, default=True Includes values in confusion matrix.

cmap : str or matplotlib Colormap, default='viridis' Colormap recognized by matplotlib.

xticks_rotation : 'vertical', 'horizontal' or float, default='horizontal' Rotation of xtick labels.

values_format : str, default=None Format specification for values in confusion matrix. If `None`, the format specification is '.2g'.

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

Returns ------- display : :class:`~sklearn.metrics.ConfusionMatrixDisplay`

val im_ : t -> Py.Object.t

Attribute im_: see constructor for documentation

val text_ : t -> Py.Object.t

Attribute text_: see constructor for documentation

val ax_ : t -> Py.Object.t

Attribute ax_: see constructor for documentation

val figure_ : t -> Py.Object.t

Attribute figure_: see constructor for documentation

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 : Stdlib.Format.formatter -> t -> unit

Pretty-print the object to a formatter.

OCaml

Innovation. Community. Security.