Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
R Machine Learning By Example

You're reading from  R Machine Learning By Example

Product type Book
Published in Mar 2016
Publisher
ISBN-13 9781784390846
Pages 340 pages
Edition 1st Edition
Languages
Author (1):
Raghav Bali Raghav Bali

Table of Contents (15) Chapters

R Machine Learning By Example
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Preface
Getting Started with R and Machine Learning Let's Help Machines Learn Predicting Customer Shopping Trends with Market Basket Analysis Building a Product Recommendation System Credit Risk Detection and Prediction – Descriptive Analytics Credit Risk Detection and Prediction – Predictive Analytics Social Media Analysis – Analyzing Twitter Data Sentiment Analysis of Twitter Data Index

Evaluating a product contingency matrix


We will be doing a couple of things here. First, we will analyze a small toy dataset belonging to a supermarket, by using a product contingency matrix of product pair purchases based on their frequency. Then we will move on to contingency matrices based on other metrics such as support, lift, and so on by using another dataset.

The data for our first matrix consists of the six most popular products sold at the supermarket and also the number of times each product was sold by itself and in combination with the other products. We have the data in the form of a data table captured in a csv file, as you can see in the following figure:

To analyze this data, we first need to understand what it depicts. Basically, each cell value denotes the number of times that product combination was sold. Thus, the cell combination (1, A) denotes the product combination (milk, milk), which is basically the number of times milk was bought. Another example is the cell combination...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}