MCPcopy Index your code
hub / github.com/lazyprogrammer/machine_learning_examples / visualize

Function visualize

nlp_class/spam2.py:61–69  ·  view source on GitHub ↗
(label)

Source from the content-addressed store, hash-verified

59
60# visualize the data
61def visualize(label):
62 words = ''
63 for msg in df[df['labels'] == label]['data']:
64 msg = msg.lower()
65 words += msg + ' '
66 wordcloud = WordCloud(width=600, height=400).generate(words)
67 plt.imshow(wordcloud)
68 plt.axis('off')
69 plt.show()
70
71visualize('spam')
72visualize('ham')

Callers 1

spam2.pyFile · 0.70

Calls 1

generateMethod · 0.45

Tested by

no test coverage detected