MCPcopy Create free account
hub / github.com/lazyprogrammer/machine_learning_examples / visualize

Function visualize

svm_class/svm_spam.py:56–65  ·  view source on GitHub ↗
(label)

Source from the content-addressed store, hash-verified

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

Callers 1

svm_spam.pyFile · 0.70

Calls 1

generateMethod · 0.45

Tested by

no test coverage detected