Skip to content

plot_correlation


method plot_correlation(columns=None, method="pearson", title=None, figsize=(8, 7), filename=None, display=True) [source]

Plot the data's correlation matrix.

Parameters:

columns: slice, sequence or None, optional (default=None)
Slice, names or indices of the columns to plot. If None, plot all columns in the dataset. Selected categorical columns are ignored.

method: str, optional (default="pearson")
Method of correlation. Choose from "pearson", "kendall" or "spearman".

title: str or None, optional (default=None)
Plot's title. If None, the title is left empty.

figsize: tuple, optional (default=(8, 7))
Figure's size, format as (x, y).

filename: str or None, optional (default=None)
Name of the file. Use "auto" for automatic naming. If None, the figure is not saved.

display: bool or None, optional (default=True)
Whether to render the plot. If None, it returns the matplotlib figure.

Returns: matplotlib.figure.Figure
Plot object. Only returned if display=None.


Example

from atom import ATOMClassifier

atom = ATOMClassifier(X, y)
atom.plot_correlation()
plot_correlation
Back to top