Skip to content

plot_components


method plot_components(show=None, title=None, figsize=None, filename=None, display=True) [source]

Plot the explained variance ratio per component. Only available if PCA was applied on the data.

Parameters:

show: int or None, optional (default=None)
Number of components to show. None to show all.

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

figsize: tuple or None, optional (default=None)
Figure's size, format as (x, y). If None, it adapts the size to the number of components shown.

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: fig: matplotlib.figure.Figure
Plot object. Only returned if display=None.


Example

from atom import ATOMClassifier

atom = ATOMClassifier(X, y)
atom.feature_selection(strategy="PCA", n_features=11)
atom.plot_components()
plot_components
Back to top