April 2017
Beginner to intermediate
358 pages
9h 30m
English
Now we set our sights on the clusters in an attempt to discover the topics in each.
We first extract the term list from our feature extraction step:
terms = pipeline.named_steps['feature_extraction'].get_feature_names()
We also set up another counter for counting the size of each of our classes:
c = Counter(labels)
Iterating over each cluster, we print the size of the cluster as before.
Next (and still in the loop), we iterate over the most important terms for this cluster. To do this, we take the five largest ...
Read now
Unlock full access