Single color (fading to white) colormaps will be generated from the colors in
the list or colors taken from the colormap, and passed to the cmap parameter
of the .
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 or list of such objects
If plot_method is ‘contour’ or ‘contourf’, surface_ is
QuadContourSet. If
plot_method is ‘pcolormesh’, surface_ is
QuadMesh.
Plotting method to call when plotting the response. Please refer
to the following matplotlib documentation for details:
contourf,
contour,
pcolormesh.
ax : Matplotlib axes, default=None
Axes object to plot on. If None, a new figure and axes is
created.
xlabel : str, default=None
Overwrite the x-axis label.
ylabel : str, default=None
Overwrite the y-axis label.
**kwargs : dict
Additional keyword arguments to be passed to the plot_method. For
binary problems, cmap or colors can be set here to specify the
colormap or colors, otherwise the default colormap (‘viridis’) is used. If
not specified by the user, zorder is set to -1 to ensure that the decision
boundary is plotted in the background (in case a scatter plot is added on
top).
Plot the decision surface of decision trees trained on the iris dataset
plot_method
When response_method='predict' and plot_method='contour',
multiclass_colors is ignored and the class boundaries are plotted in black
instead as the boundary lines may overlap and the colors don’t necessarily
correspond to the classes.
For binary problems, multiclass_colors is also ignored and cmap or
colors can be passed as kwargs instead, otherwise, the default colormap
(‘viridis’) is used.
multiclass_colors_
: array of shape (n_classes, 4)
Colors used to plot each class in multiclass problems.
Only defined when n_classes > 2.
Specifies whether to use decision_function,
predict_proba or predict as the target response.
If set to ‘auto’, the response method is tried in the order as
listed above.
class_of_interest : int, float, bool or str, default=None
The class to be plotted. For binary classifiers, if None,
estimator.classes_[1] is considered the positive class. For
multiclass classifiers, if None, all classes will be represented in
the decision boundary plot; when response_method is predict_proba
or decision_function, the class with the highest response value
at each point is plotted. The color of each class can be set via
multiclass_colors.
multiclass_colors : str or list of matplotlib colors, default=None
Specifies how to color each class when plotting multiclass problems
and class_of_interest is None.
Possible inputs are:
None: defaults to list of accessible Petroff colors
if n_classes<=10, otherwise ‘gist_rainbow’ colormap
Single color (fading to white) colormaps will be generated from the colors
in the list or colors taken from the colormap, and passed to the cmap
parameter of the plot_method.
When response_method='predict' and plot_method='contour',
multiclass_colors is ignored and the class boundaries are plotted in black
instead as the boundary lines may overlap and the colors don’t necessarily
correspond to the classes.
For binary problems, multiclass_colors is also ignored and cmap
or colors can be passed as kwargs instead, otherwise, the default colormap
(‘viridis’) is used.
xlabel : str, default=None
The label used for the x-axis. If None, an attempt is made to
extract a label from X if it is a dataframe, otherwise an empty
string is used.
ylabel : str, default=None
The label used for the y-axis. If None, an attempt is made to
extract a label from X if it is a dataframe, otherwise an empty
string is used.
ax : Matplotlib axes, default=None
Axes object to plot on. If None, a new figure and axes is
created.
**kwargs : dict
Additional keyword arguments to be passed to the plot_method.