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
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Geospatial Data Science Quick Start Guide

You're reading from   Geospatial Data Science Quick Start Guide Effective techniques for performing smarter geospatial analysis using location intelligence

Arrow left icon
Product type Paperback
Published in May 2019
Publisher Packt
ISBN-13 9781789809411
Length 170 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Abdishakur Hassan Abdishakur Hassan
Author Profile Icon Abdishakur Hassan
Abdishakur Hassan
Jayakrishnan Vijayaraghavan Jayakrishnan Vijayaraghavan
Author Profile Icon Jayakrishnan Vijayaraghavan
Jayakrishnan Vijayaraghavan
Arrow right icon
View More author details
Toc

Recommender systems

Recommender systems are one of the most commonly used practical systems in data science. In this section, we will focus on collaborative filtering, where the focus is on similarities between users. Depending on the past preference of users, this type of recommender system recommends items that users have liked or rated highly in the past. For this task, we will use Surprise, a Python scikit-learn library for building and analyzing recommender systems.

We first need to read the merged df into Surprise, set the rating scale of the dataset, and load data from df into Surprise data:

# Set rating scale of the dataset
reader = Reader(rating_scale=(0, 2))

# Load the dataframe with ratings.
data = Dataset.load_from_df(df[['userID', 'placeID', 'rating']], reader)

Now, we are set and can use the Surprise library functionalities. First, we will...

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