Mining the 20 Newsgroups Dataset with Clustering and Topic Modeling Algorithms

In the previous chapter, we went through a text visualization using t-SNE. T-SNE, or any dimensionality reduction algorithm, is a type of unsupervised learning. Moving forward in this chapter, we will be continuing our unsupervised learning journey, specifically focusing specifically on clustering and topic modeling. We will start with how unsupervised learning learns without guidance and how it is good at discovering hidden information underneath data. Then we will talk about clustering as an important branch of unsupervised learning, which identifies different groups of observations from data. For instance, clustering is useful for market segmentation where consumers of similar behaviors are grouped into one segment for marketing purposes. We will perform clustering on the 20 newsgroups text dataset and see what clusters will be produced. Another unsupervised learning route we take is topic modeling, which is the process of extracting themes hidden in the dataset. You will be amused by how many interesting themes we are able to mine from the 20 newsgroups dataset.

We will cover the following topics:

  • What is unsupervised learning?
  • Types of unsupervised learning
  • What is k-means clustering and how does it work?
  • Implementing k-means clustering from scratch
  • Implementing k-means with scikit-learn
  • Optimizing k-means clustering models
  • Term frequency-inverse document frequency
  • Clustering newsgroups data using k-means
  • What is topic modeling?
  • Non-negative matrix factorization for topic modeling
  • latent Dirichlet allocation for topic modeling
  • Topic modeling on newsgroups data
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.20.68