Supervised learning
Supervised learning techniques can be used with text as well. We can prepare our text as numeric values and pair each set of features with a target.
The target can be numeric, like a stock price, or categorical, like a budget category for bank transactions. The supervised learning techniques we covered in Chapter 11, Machine Learning for Classification, and Chapter 12, Evaluating Machine Learning Classification Models and Sampling for Classification, can be used. As an example, we'll look at multi-class classification of the 20 newsgroups dataset.
Classification
Classification is often used with text. For example, bank transactions can be categorized for automatic budgeting. We can also categorize social media posts for a number of purposes, like flagging offensive content. Another example is categorizing emails as spam or not spam. Many machine learning algorithms can be used for this, with some of the highest performing algorithms being...