10.11.2016 Views

Learning Data Mining with Python

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Recommending Movies<br />

Using Affinity Analysis<br />

In this chapter, we will look at affinity analysis that determines when objects occur<br />

frequently together. This is colloquially called market basket analysis, after one of<br />

the use cases of determining when items are purchased together frequently.<br />

In Chapter 3, Predicting Sports Winners <strong>with</strong> Decision Trees, we looked at an object<br />

as a focus and used features to describe that object. In this chapter, the data has a<br />

different form. We have transactions where the objects of interest (movies, in this<br />

chapter) are used <strong>with</strong>in those transactions in some way. The aim is to discover<br />

when objects occur simultaneously. In this example, we wish to work out when<br />

two movies are recommended by the same reviewers.<br />

The key concepts of this chapter are as follows:<br />

• Affinity analysis<br />

• Feature association mining using the Apriori algorithm<br />

• Movie recommendations<br />

• Sparse data formats<br />

Affinity analysis<br />

Affinity analysis is the task of determining when objects are used in similar<br />

ways. In the previous chapter, we focused on whether the objects themselves<br />

are similar. The data for affinity analysis is often described in the form of a<br />

transaction. Intuitively, this comes from a transaction at a store—determining<br />

when objects are purchased together.<br />

[ 61 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!