Skip to content

plot_wordcloud


method plot_wordcloud(index=None, title=None, figsize=(10, 6), filename=None, display=True, **kwargs) [source]

Plot a wordcloud from the corpus. The text for the plot is extracted from the column named Corpus. If there is no column with that name, an exception is raised.

Parameters:

index: int, str, sequence or None, optional (default=None)
Index names or positions of the documents in the corpus to include in the wordcloud. If None, it selects all documents in the dataset.

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

figsize: tuple, optional (default=(10, 6)))
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.

**kwargs
Additional keyword arguments for the WordCloud class.

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


Example

from atom import ATOMClassifier

atom = ATOMClassifier(X_text, y_text)
atom.plot_wordcloud()
plot_wordcloud
Back to top