Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Machine Learning for the Web

You're reading from   Machine Learning for the Web Gaining insight and intelligence from the internet with Python

Arrow left icon
Product type Paperback
Published in Jul 2016
Publisher Packt
ISBN-13 9781785886607
Length 298 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Andrea Isoni Andrea Isoni
Author Profile Icon Andrea Isoni
Andrea Isoni
Steve Essinger Steve Essinger
Author Profile Icon Steve Essinger
Steve Essinger
Arrow right icon
View More author details
Toc

Table of Contents (10) Chapters Close

Preface 1. Introduction to Practical Machine Learning Using Python FREE CHAPTER 2. Unsupervised Machine Learning 3. Supervised Machine Learning 4. Web Mining Techniques 5. Recommendation Systems 6. Getting Started with Django 7. Movie Recommendation System Web Application 8. Sentiment Analyser Application for Movie Reviews Index

Utility matrix

The data used in a recommendation system is divided in two categories: the users and the items. Each user likes certain items, and the rating value rij (from 1 to 5) is the data associated with each user i and item j and represents how much the user appreciates the item. These rating values are collected in matrix, called utility matrix R, in which each row i represents the list of rated items for user i while each column j lists all the users who have rated item j. In our case, the data folder ml-100k contains a file called u.data (and also u.item with the list of movie titles) that has been converted into a Pandas DataFrame (and saved into a csv, utilitymatrix.csv) by the following script:

Utility matrix

The output of the first two lines is as follows:

Utility matrix

Each column name, apart from the first (which is the user id), defines the name of the movie and the ID of the movie in the MovieLens database (separated by a semicolon). The 0 values represent the missing values and we expect to have a...

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 $19.99/month. Cancel anytime
Banner background image