Latent Dirichlet Allocation (LDA) to classify documents and text into topics

In this recipe, we will explore the Latent Dirichlet Allocation (LDA) algorithm in Spark 2.0. The LDA we use in this recipe is completely different from linear discrimination analysis. Both Latent Dirichlet Allocation and linear discrimination analysis are referred to as LDA, but they are extremely different techniques. In this recipe, when we use the LDA, we refer to Latent Dirichlet Allocation. The chapter on text analytics is also relevant to understanding the LDA.

LDA is often used in natural language processing which tries to classify a large body of document (for example, emails from the Enron fraud case) into a discrete number of topics or themes so it can ...

Get Apache Spark 2.x Machine Learning Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.