class_docstr: Decisions boundary visualization.
  
  It is recommended to use
  :func:`~sklearn.inspection.DecisionBoundaryDisplay.from_estimator`
  to create a :class:`DecisionBoundaryDisplay`. All parameters are stored as
  attributes.
  
  Read more in the :ref:`User Guide <visualizations>`.
  
  .. versionadded:: 1.1
  
  Parameters
  ----------
  xx0 : ndarray of shape (grid_resolution, grid_resolution)
      First output of :func:`meshgrid <numpy.meshgrid>`.
  
  xx1 : ndarray of shape (grid_resolution, grid_resolution)
      Second output of :func:`meshgrid <numpy.meshgrid>`.
  
  response : ndarray of shape (grid_resolution, grid_resolution)
      Values of the response function.
  
  xlabel : str, default=None
      Default label to place on x axis.
  
  ylabel : str, default=None
      Default label to place on y axis.
  
  Attributes
  ----------
  surface_ : matplotlib `QuadContourSet` or `QuadMesh`
      If `plot_method` is 'contour' or 'contourf', `surface_` is a
      :class:`QuadContourSet <matplotlib.contour.QuadContourSet>`. If
      `plot_method` is 'pcolormesh', `surface_` is a
      :class:`QuadMesh <matplotlib.collections.QuadMesh>`.
  
  ax_ : matplotlib Axes
      Axes with decision boundary.
  
  figure_ : matplotlib Figure
      Figure containing the decision boundary.
  
  See Also
  --------
  DecisionBoundaryDisplay.from_estimator : Plot decision boundary given an estimator.
  
  Examples
  --------
  >>> import matplotlib.pyplot as plt
  >>> import numpy as np
  >>> from sklearn.datasets import load_iris
  >>> from sklearn.inspection import DecisionBoundaryDisplay
  >>> from sklearn.tree import DecisionTreeClassifier
  >>> iris = load_iris()
  >>> feature_1, feature_2 = np.meshgrid(
  ...     np.linspace(iris.data[:, 0].min(), iris.data[:, 0].max()),
  ...     np.linspace(iris.data[:, 1].min(), iris.data[:, 1].max())
  ... )
  >>> grid = np.vstack([feature_1.ravel(), feature_2.ravel()]).T
  >>> tree = DecisionTreeClassifier().fit(iris.data[:, :2], iris.target)
  >>> y_pred = np.reshape(tree.predict(grid), feature_1.shape)
  >>> display = DecisionBoundaryDisplay(
  ...     xx0=feature_1, xx1=feature_2, response=y_pred
  ... )
  >>> display.plot()
  <...>
  >>> display.ax_.scatter(
  ...     iris.data[:, 0], iris.data[:, 1], c=iris.target, edgecolor="black"
  ... )
  <...>
  >>> plt.show()
class_docstr_tok: ["Decisions","boundary","visualization",".","It","is","recommended","to","use",":","func",":","`","~sklearn.inspection.DecisionBoundaryDisplay.from_estimator","`","to","create","a",":","class",":","`","DecisionBoundaryDisplay","`",".","All","parameters","are","stored","as","attributes",".","Read","more","in","the",":","ref",":","`","User","Guide","<","visualizations",">","`",".","..","versionadded",":",":","1.1","Parameters","--","--","--","--","--","xx0",":","ndarray","of","shape","(","grid_resolution",",","grid_resolution",")","First","output","of",":","func",":","`","meshgrid","<","numpy.meshgrid",">","`",".","xx1",":","ndarray","of","shape","(","grid_resolution",",","grid_resolution",")","Second","output","of",":","func",":","`","meshgrid","<","numpy.meshgrid",">","`",".","response",":","ndarray","of","shape","(","grid_resolution",",","grid_resolution",")","Values","of","the","response","function",".","xlabel",":","str",",","default=None","Default","label","to","place","on","x","axis",".","ylabel",":","str",",","default=None","Default","label","to","place","on","y","axis",".","Attributes","--","--","--","--","--","surface_",":","matplotlib","`","QuadContourSet","`","or","`","QuadMesh","`","If","`","plot_method","`","is","'contour","'","or","'contourf","'",",","`","surface_","`","is","a",":","class",":","`","QuadContourSet","<","matplotlib.contour.QuadContourSet",">","`",".","If","`","plot_method","`","is","'pcolormesh","'",",","`","surface_","`","is","a",":","class",":","`","QuadMesh","<","matplotlib.collections.QuadMesh",">","`",".","ax_",":","matplotlib","Axes","Axes","with","decision","boundary",".","figure_",":","matplotlib","Figure","Figure","containing","the","decision","boundary",".","See","Also","--","--","--","--","DecisionBoundaryDisplay.from_estimator",":","Plot","decision","boundary","given","an","estimator",".","Examples","--","--","--","--",">",">",">","import","matplotlib.pyplot","as","plt",">",">",">","import","numpy","as","np",">",">",">","from","sklearn.datasets","import","load_iris",">",">",">","from","sklearn.inspection","import","DecisionBoundaryDisplay",">",">",">","from","sklearn.tree","import","DecisionTreeClassifier",">",">",">","iris","=","load_iris","(",")",">",">",">","feature_1",",","feature_2","=","np.meshgrid","(","...","np.linspace","(","iris.data","[",":",",","0","]",".min","(",")",",","iris.data","[",":",",","0","]",".max","(",")",")",",","...","np.linspace","(","iris.data","[",":",",","1","]",".min","(",")",",","iris.data","[",":",",","1","]",".max","(",")",")","...",")",">",">",">","grid","=","np.vstack","(","[","feature_1.ravel","(",")",",","feature_2.ravel","(",")","]",")",".T",">",">",">","tree","=","DecisionTreeClassifier","(",")",".fit","(","iris.data","[",":",",",":2","]",",","iris.target",")",">",">",">","y_pred","=","np.reshape","(","tree.predict","(","grid",")",",","feature_1.shape",")",">",">",">","display","=","DecisionBoundaryDisplay","(","...","xx0=feature_1",",","xx1=feature_2",",","response=y_pred","...",")",">",">",">","display.plot","(",")","<","...",">",">",">",">","display.ax_.scatter","(","...","iris.data","[",":",",","0","]",",","iris.data","[",":",",","1","]",",","c=iris.target",",","edgecolor=","''","black","''","...",")","<","...",">",">",">",">","plt.show","(",")"]
code: def __init__(self, *, xx0, xx1, response, xlabel=None, ylabel=None):
      self.xx0 = xx0
      self.xx1 = xx1
      self.response = response
      self.xlabel = xlabel
      self.ylabel = ylabel
  
file_path: scikit-learn/sklearn/inspection/_plot/decision_boundary.py
imports: import numpy
  from ...base import is_regressor
  from ...preprocessing import LabelEncoder
  from ...utils import _safe_indexing, check_matplotlib_support
  from ...utils._response import _get_response_values
  from ...utils.validation import _is_arraylike_not_scalar, _num_features, check_is_fitted
label_desc: Use image node_id 1 to create a new DecisionBoundaryDisplay object  with example: obj = DecisionBoundaryDisplay()