8. Comparison

8.1 Introduction

We’ll start with a useful collection of algorithms that are also used as elements of other algorithms. Comparison algorithms take a pair of objects and say how similar they are to each other.

Some example use cases might be finding articles about similar subjects or audiences for news recommendations, finding songs or movies with similar descriptors, or finding documents that are similar to a search query. We’ll only scratch the surface of this class of algorithms, but we’ll present some nice pedagogical development for simple implementations.

Which is the best comparison algorithm to use depends on the context. From the ones you’ll see here, many of them are simple heuristics or just natural, easy solutions ...

Get Machine Learning in Production: Developing and Optimizing Data Science Workflows and Applications 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.