Chapter 3. Classification Models

The machine learning model featured in the previous chapter used various forms of regression to predict taxi fares based on distance to travel, the day of the week, and the time of day. Regression models predict numerical outcomes and are widely used in industry to forecast sales, prices, demand, and other numbers that drive business decisions. Equally important are classification models, which predict categorical outcomes such as whether a credit card transaction is fraudulent or which letter of the alphabet a handwritten character represents.

Most classification models fall into two categories: binary classification models, in which there are just two possible outcomes, and multiclass classification models, in which there are more than two possible outcomes. In both instances, the model assigns a single class, or class label, to an input. Less common are multilabel classification models, which can classify a single input as belonging to several classes—for example, predicting that a document is both a paper on machine learning and a paper on genomics. Some can predict that an input belongs to none of the possible classes too.

Much of what you know about regression models also applies to classification models. For example, many of the learning algorithms that power regression models work equally well with classification models. One substantive difference between regression and classification is how you measure a model’s accuracy. There’s no such ...

Get Applied Machine Learning and AI for Engineers 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.