class_docstr: Calibration curve (also known as reliability diagram) visualization.
  
  It is recommended to use
  :func:`~sklearn.calibration.CalibrationDisplay.from_estimator` or
  :func:`~sklearn.calibration.CalibrationDisplay.from_predictions`
  to create a `CalibrationDisplay`. All parameters are stored as attributes.
  
  Read more about calibration in the :ref:`User Guide <calibration>` and
  more about the scikit-learn visualization API in :ref:`visualizations`.
  
  .. versionadded:: 1.0
  
  Parameters
  ----------
  prob_true : ndarray of shape (n_bins,)
      The proportion of samples whose class is the positive class (fraction
      of positives), in each bin.
  
  prob_pred : ndarray of shape (n_bins,)
      The mean predicted probability in each bin.
  
  y_prob : ndarray of shape (n_samples,)
      Probability estimates for the positive class, for each sample.
  
  estimator_name : str, default=None
      Name of estimator. If None, the estimator name is not shown.
  
  pos_label : int, float, bool or str, default=None
      The positive class when computing the calibration curve.
      By default, `estimators.classes_[1]` is considered as the
      positive class.
  
      .. versionadded:: 1.1
  
  Attributes
  ----------
  line_ : matplotlib Artist
      Calibration curve.
  
  ax_ : matplotlib Axes
      Axes with calibration curve.
  
  figure_ : matplotlib Figure
      Figure containing the curve.
  
  See Also
  --------
  calibration_curve : Compute true and predicted probabilities for a
      calibration curve.
  CalibrationDisplay.from_predictions : Plot calibration curve using true
      and predicted labels.
  CalibrationDisplay.from_estimator : Plot calibration curve using an
      estimator and data.
  
  Examples
  --------
  >>> from sklearn.datasets import make_classification
  >>> from sklearn.model_selection import train_test_split
  >>> from sklearn.linear_model import LogisticRegression
  >>> from sklearn.calibration import calibration_curve, CalibrationDisplay
  >>> X, y = make_classification(random_state=0)
  >>> X_train, X_test, y_train, y_test = train_test_split(
  ...     X, y, random_state=0)
  >>> clf = LogisticRegression(random_state=0)
  >>> clf.fit(X_train, y_train)
  LogisticRegression(random_state=0)
  >>> y_prob = clf.predict_proba(X_test)[:, 1]
  >>> prob_true, prob_pred = calibration_curve(y_test, y_prob, n_bins=10)
  >>> disp = CalibrationDisplay(prob_true, prob_pred, y_prob)
  >>> disp.plot()
  <...>
docstr: Plot calibration curve using a binary classifier and data.
  
  A calibration curve, also known as a reliability diagram, uses inputs
  from a binary classifier and plots the average predicted probability
  for each bin against the fraction of positive classes, on the
  y-axis.
  
  Extra keyword arguments will be passed to
  :func:`matplotlib.pyplot.plot`.
  
  Read more about calibration in the :ref:`User Guide <calibration>` and
  more about the scikit-learn visualization API in :ref:`visualizations`.
  
  .. versionadded:: 1.0
  
  Parameters
  ----------
  estimator : estimator instance
      Fitted classifier or a fitted :class:`~sklearn.pipeline.Pipeline`
      in which the last estimator is a classifier. The classifier must
      have a :term:`predict_proba` method.
  
  X : {array-like, sparse matrix} of shape (n_samples, n_features)
      Input values.
  
  y : array-like of shape (n_samples,)
      Binary target values.
  
  n_bins : int, default=5
      Number of bins to discretize the [0, 1] interval into when
      calculating the calibration curve. A bigger number requires more
      data.
  
  strategy : {'uniform', 'quantile'}, default='uniform'
      Strategy used to define the widths of the bins.
  
      - `'uniform'`: The bins have identical widths.
      - `'quantile'`: The bins have the same number of samples and depend
        on predicted probabilities.
  
  pos_label : int, float, bool or str, default=None
      The positive class when computing the calibration curve.
      By default, `estimators.classes_[1]` is considered as the
      positive class.
  
      .. versionadded:: 1.1
  
  name : str, default=None
      Name for labeling curve. If `None`, the name of the estimator is
      used.
  
  ref_line : bool, default=True
      If `True`, plots a reference line representing a perfectly
      calibrated classifier.
  
  ax : matplotlib axes, default=None
      Axes object to plot on. If `None`, a new figure and axes is
      created.
  
  **kwargs : dict
      Keyword arguments to be passed to :func:`matplotlib.pyplot.plot`.
  
  Returns
  -------
  display : :class:`~sklearn.calibration.CalibrationDisplay`.
      Object that stores computed values.
  
  See Also
  --------
  CalibrationDisplay.from_predictions : Plot calibration curve using true
      and predicted labels.
  
  Examples
  --------
  >>> import matplotlib.pyplot as plt
  >>> from sklearn.datasets import make_classification
  >>> from sklearn.model_selection import train_test_split
  >>> from sklearn.linear_model import LogisticRegression
  >>> from sklearn.calibration import CalibrationDisplay
  >>> X, y = make_classification(random_state=0)
  >>> X_train, X_test, y_train, y_test = train_test_split(
  ...     X, y, random_state=0)
  >>> clf = LogisticRegression(random_state=0)
  >>> clf.fit(X_train, y_train)
  LogisticRegression(random_state=0)
  >>> disp = CalibrationDisplay.from_estimator(clf, X_test, y_test)
  >>> plt.show()
docstr_tok: ["Plot","calibration","curve","using","a","binary","classifier","and","data",".","A","calibration","curve",",","also","known","as","a","reliability","diagram",",","uses","inputs","from","a","binary","classifier","and","plots","the","average","predicted","probability","for","each","bin","against","the","fraction","of","positive","classes",",","on","the","y-axis",".","Extra","keyword","arguments","will","be","passed","to",":","func",":","`","matplotlib.pyplot.plot","`",".","Read","more","about","calibration","in","the",":","ref",":","`","User","Guide","<","calibration",">","`","and","more","about","the","scikit-learn","visualization","API","in",":","ref",":","`","visualizations","`",".","..","versionadded",":",":","1.0","Parameters","--","--","--","--","--","estimator",":","estimator","instance","Fitted","classifier","or","a","fitted",":","class",":","`","~sklearn.pipeline.Pipeline","`","in","which","the","last","estimator","is","a","classifier",".","The","classifier","must","have","a",":","term",":","`","predict_proba","`","method",".","X",":","{","array-like",",","sparse","matrix","}","of","shape","(","n_samples",",","n_features",")","Input","values",".","y",":","array-like","of","shape","(","n_samples",",",")","Binary","target","values",".","n_bins",":","int",",","default=5","Number","of","bins","to","discretize","the","[","0",",","1","]","interval","into","when","calculating","the","calibration","curve",".","A","bigger","number","requires","more","data",".","strategy",":","{","'uniform","'",",","'quantile","'","}",",","default='uniform'","Strategy","used","to","define","the","widths","of","the","bins",".","-","`","'uniform","'","`",":","The","bins","have","identical","widths",".","-","`","'quantile","'","`",":","The","bins","have","the","same","number","of","samples","and","depend","on","predicted","probabilities",".","pos_label",":","int",",","float",",","bool","or","str",",","default=None","The","positive","class","when","computing","the","calibration","curve",".","By","default",",","`","estimators.classes_","[","1","]","`","is","considered","as","the","positive","class",".","..","versionadded",":",":","1.1","name",":","str",",","default=None","Name","for","labeling","curve",".","If","`","None","`",",","the","name","of","the","estimator","is","used",".","ref_line",":","bool",",","default=True","If","`","True","`",",","plots","a","reference","line","representing","a","perfectly","calibrated","classifier",".","ax",":","matplotlib","axes",",","default=None","Axes","object","to","plot","on",".","If","`","None","`",",","a","new","figure","and","axes","is","created",".","*","*","kwargs",":","dict","Keyword","arguments","to","be","passed","to",":","func",":","`","matplotlib.pyplot.plot","`",".","Returns","--","--","--","-","display",":",":","class",":","`","~sklearn.calibration.CalibrationDisplay","`",".","Object","that","stores","computed","values",".","See","Also","--","--","--","--","CalibrationDisplay.from_predictions",":","Plot","calibration","curve","using","true","and","predicted","labels",".","Examples","--","--","--","--",">",">",">","import","matplotlib.pyplot","as","plt",">",">",">","from","sklearn.datasets","import","make_classification",">",">",">","from","sklearn.model_selection","import","train_test_split",">",">",">","from","sklearn.linear_model","import","LogisticRegression",">",">",">","from","sklearn.calibration","import","CalibrationDisplay",">",">",">","X",",","y","=","make_classification","(","random_state=0",")",">",">",">","X_train",",","X_test",",","y_train",",","y_test","=","train_test_split","(","...","X",",","y",",","random_state=0",")",">",">",">","clf","=","LogisticRegression","(","random_state=0",")",">",">",">","clf.fit","(","X_train",",","y_train",")","LogisticRegression","(","random_state=0",")",">",">",">","disp","=","CalibrationDisplay.from_estimator","(","clf",",","X_test",",","y_test",")",">",">",">","plt.show","(",")"]
code: def from_estimator(
      cls,
      estimator,
      X,
      y,
      *,
      n_bins=5,
      strategy="uniform",
      pos_label=None,
      name=None,
      ref_line=True,
      ax=None,
      **kwargs,
  ):
      """Plot calibration curve using a binary classifier and data.
  
      A calibration curve, also known as a reliability diagram, uses inputs
      from a binary classifier and plots the average predicted probability
      for each bin against the fraction of positive classes, on the
      y-axis.
  
      Extra keyword arguments will be passed to
      :func:`matplotlib.pyplot.plot`.
  
      Read more about calibration in the :ref:`User Guide <calibration>` and
      more about the scikit-learn visualization API in :ref:`visualizations`.
  
      .. versionadded:: 1.0
  
      Parameters
      ----------
      estimator : estimator instance
          Fitted classifier or a fitted :class:`~sklearn.pipeline.Pipeline`
          in which the last estimator is a classifier. The classifier must
          have a :term:`predict_proba` method.
  
      X : {array-like, sparse matrix} of shape (n_samples, n_features)
          Input values.
  
      y : array-like of shape (n_samples,)
          Binary target values.
  
      n_bins : int, default=5
          Number of bins to discretize the [0, 1] interval into when
          calculating the calibration curve. A bigger number requires more
          data.
  
      strategy : {'uniform', 'quantile'}, default='uniform'
          Strategy used to define the widths of the bins.
  
          - `'uniform'`: The bins have identical widths.
          - `'quantile'`: The bins have the same number of samples and depend
            on predicted probabilities.
  
      pos_label : int, float, bool or str, default=None
          The positive class when computing the calibration curve.
          By default, `estimators.classes_[1]` is considered as the
          positive class.
  
          .. versionadded:: 1.1
  
      name : str, default=None
          Name for labeling curve. If `None`, the name of the estimator is
          used.
  
      ref_line : bool, default=True
          If `True`, plots a reference line representing a perfectly
          calibrated classifier.
  
      ax : matplotlib axes, default=None
          Axes object to plot on. If `None`, a new figure and axes is
          created.
  
      **kwargs : dict
          Keyword arguments to be passed to :func:`matplotlib.pyplot.plot`.
  
      Returns
      -------
      display : :class:`~sklearn.calibration.CalibrationDisplay`.
          Object that stores computed values.
  
      See Also
      --------
      CalibrationDisplay.from_predictions : Plot calibration curve using true
          and predicted labels.
  
      Examples
      --------
      >>> import matplotlib.pyplot as plt
      >>> from sklearn.datasets import make_classification
      >>> from sklearn.model_selection import train_test_split
      >>> from sklearn.linear_model import LogisticRegression
      >>> from sklearn.calibration import CalibrationDisplay
      >>> X, y = make_classification(random_state=0)
      >>> X_train, X_test, y_train, y_test = train_test_split(
      ...     X, y, random_state=0)
      >>> clf = LogisticRegression(random_state=0)
      >>> clf.fit(X_train, y_train)
      LogisticRegression(random_state=0)
      >>> disp = CalibrationDisplay.from_estimator(clf, X_test, y_test)
      >>> plt.show()
      """
      y_prob, pos_label, name = cls._validate_and_get_response_values(
          estimator,
          X,
          y,
          response_method="predict_proba",
          pos_label=pos_label,
          name=name,
      )
  
      return cls.from_predictions(
          y,
          y_prob,
          n_bins=n_bins,
          strategy=strategy,
          pos_label=pos_label,
          name=name,
          ref_line=ref_line,
          ax=ax,
          **kwargs,
      )
  
imports: import warnings
  from functools import partial
  from inspect import signature
  from math import log
  from numbers import Integral, Real
  import numpy
  from scipy.optimize import fmin_bfgs
  from scipy.special import expit, xlogy
  from sklearn.utils import Bunch
  from .base import BaseEstimator, ClassifierMixin, MetaEstimatorMixin, RegressorMixin, _fit_context, clone
  from .isotonic import IsotonicRegression
  from .model_selection import check_cv, cross_val_predict
  from .preprocessing import LabelEncoder, label_binarize
  from .svm import LinearSVC
  from .utils import _safe_indexing, column_or_1d, indexable
  from .utils._param_validation import HasMethods, Hidden, Interval, StrOptions, validate_params
  from .utils._plotting import _BinaryClassifierCurveDisplayMixin
  from .utils.metadata_routing import MetadataRouter, MethodMapping, _routing_enabled, process_routing
  from .utils.multiclass import check_classification_targets
  from .utils.parallel import Parallel, delayed
  from .utils.validation import _check_fit_params, _check_pos_label_consistency, _check_sample_weight, _num_samples, check_consistent_length, check_is_fitted
label_desc: Use image node_id 3 for calling the CalibrationDisplay obj's underlying member method code with example usage: obj.from_estimator(cls, estimator, X, y) and returns: cls