O'Reilly logo

Effective Amazon Machine Learning by Alexis Perrier

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Coupling variables

The Cartesian product transformation combines two categorical or text variables into one. Consider, for instance, a dataset of books and for each book, their title and genre. We could imagine that the title of a book has some correlation with its genre, and creating a new title_genre variable would bring forth that relation.

Consider the following four books, their titles, and genres. Coupling the words in the title with the genre of the book adds extra information to the words in the title. Information that the model could use effectively. This is illustrated in the title_genre column in the following table:

Title Genre title_genre
All the Birds in the Sky scifi {all_scifi, birds_scifi, sky_scifi}
Robots and Empire ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required