Hands-On Recommendation Systems with Python - Rounak Banik - E-Book

Hands-On Recommendation Systems with Python E-Book

Rounak Banik

0,0
28,14 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

With Hands-On Recommendation Systems with Python, learn the tools and techniques required in building various kinds of powerful recommendation systems (collaborative, knowledge and content based) and deploying them to the web




Key Features



  • Build industry-standard recommender systems


  • Only familiarity with Python is required


  • No need to wade through complicated machine learning theory to use this book





Book Description



Recommendation systems are at the heart of almost every internet business today; from Facebook to Net?ix to Amazon. Providing good recommendations, whether it's friends, movies, or groceries, goes a long way in defining user experience and enticing your customers to use your platform.







This book shows you how to do just that. You will learn about the different kinds of recommenders used in the industry and see how to build them from scratch using Python. No need to wade through tons of machine learning theory—you'll get started with building and learning about recommenders as quickly as possible..







In this book, you will build an IMDB Top 250 clone, a content-based engine that works on movie metadata. You'll use collaborative filters to make use of customer behavior data, and a Hybrid Recommender that incorporates content based and collaborative filtering techniques







With this book, all you need to get started with building recommendation systems is a familiarity with Python, and by the time you're fnished, you will have a great grasp of how recommenders work and be in a strong position to apply the techniques that you will learn to your own problem domains.




What you will learn



  • Get to grips with the different kinds of recommender systems


  • Master data-wrangling techniques using the pandas library


  • Building an IMDB Top 250 Clone


  • Build a content based engine to recommend movies based on movie metadata


  • Employ data-mining techniques used in building recommenders


  • Build industry-standard collaborative filters using powerful algorithms


  • Building Hybrid Recommenders that incorporate content based and collaborative fltering





Who this book is for



If you are a Python developer and want to develop applications for social networking, news personalization or smart advertising, this is the book for you. Basic knowledge of machine learning techniques will be helpful, but not mandatory.

Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:

EPUB

Seitenzahl: 147

Veröffentlichungsjahr: 2018

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Hands-On Recommendation Systems with Python

 

 

 

 

Start building powerful and personalized, recommendation engines with Python

 

 

 

 

Rounak Banik

 

 

 

 

 

 

 

 

 

BIRMINGHAM - MUMBAI

Hands-On Recommendation Systems with Python

Copyright © 2018 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

Commissioning Editor:Pravin DhandreAcquisition Editor: Noyonika DasContent Development Editor: Mohammed Yusuf ImaratwaleTechnical Editor: Jinesh TopiwalaCopy Editor: Safis EditingProject Coordinator: Hardik BhindeProofreader: Safis EditingIndexer: Priyanka DhadkeGraphics: Jason MonteiroProduction Coordinator: Nilesh Mohite

First published: July 2018

Production reference: 2310718

Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK.

ISBN 978-1-78899-375-3

www.packtpub.com

To my mentor, Baran Toppare, and my friend, Utkarsh Bajpai, for their encouragement and support.

                                                                                                                                                                                                                                                                    – Rounak Banik
mapt.io

Mapt is an online digital library that gives you full access to over 5,000 books and videos, as well as industry leading tools to help you plan your personal development and advance your career. For more information, please visit our website.

Why subscribe?

Spend less time learning and more time coding with practical eBooks and Videos from over 4,000 industry professionals

Improve your learning with Skill Plans built especially for you

Get a free eBook or video every month

Mapt is fully searchable

Copy and paste, print, and bookmark content

PacktPub.com

Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details.

At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks.

Contributors

About the author

Rounak Banik is a Young India Fellow and an ECE graduate from IIT Roorkee. He has worked as a software engineer at Parceed, a New York start-up, and Springboard, an EdTech start-up based in San Francisco and Bangalore. He has also served as a backend development instructor at Acadview, teaching Python and Django to around 35 college students from Delhi and Dehradun.

He is an alumni of Springboard's data science career track. He has given talks at the SciPy India Conference and published popular tutorials on Kaggle and DataCamp.

I would like to thank Baran Toppare, my mentor for introducing and guiding me through the wonderfully exciting world of data science (and recommendation systems). I am also grateful to Parul Gupta and Indrajit Rajtilak, my former colleagues at Springboard. Without their support, I would not have pursued the Data Science Career Track and therefore, this book would never have been a reality.  Finally, I'd like to thank my family and all my friends in college for being a constant source of motivation, inspiration and support that enabled me to complete this book.

About the reviewer

Dr. S. Gowrishankar is currently working as associate professor in the department of computer science and engineering at Dr. Ambedkar Institute of Technology, Bengaluru, Karnataka, India. His current research interests are mainly focused on data science, including its technical aspects as well as its applications and implications. Specifically, he is interested in the applications of machine learning, data mining, and big data analytics in healthcare.

Image credits

Some of the images in the book are for illustrative purposes only. For more information refer to the links as follows:

Support Vector Machines Explained

, Tristan Fletcher (

https://static1.squarespace.com/static/58851af9ebbd1a30e98fb283/t/58902fbae4fcb5398aeb7505/1485844411772/SVM+Explained.pdf

How Are Principal Component Analysis And Singular Value Decomposition Related?

, Andre Perunicic (

https://intoli.com/blog/pca-and-svd/

Random Forest Classifier – Machine Learning

,

Balazs Holczer

(

http://www.globalsoftwaresupport.com/random-forest-classifier-bagging-machine-learning/

)

Machine Learning for Recommendation

,  Dr. Rana Forsati (

http://www.cse.msu.edu/~forsati/

)

Approaches to analyse and interpret biological profile data

, Matthias Scholz (

http://phdthesis-bioinformatics-maxplanckinstitute-molecularplantphys.matthias-scholz.de/

)

K Means

, Image Courtesy of Michael Jordan (

http://stanford.edu/~cpiech/cs221/handouts/kmeans.html

)

Packt is searching for authors like you

If you're interested in becoming an author for Packt, please visit authors.packtpub.com and apply today. We have worked with thousands of developers and tech professionals, just like you, to help them share their insight with the global tech community. You can make a general application, apply for a specific hot topic that we are recruiting an author for, or submit your own idea.

Table of Contents

Title Page

Copyright and Credits

Hands-On Recommendation Systems with Python

Dedication

Packt Upsell

Why subscribe?

PacktPub.com

Contributors

About the author

About the reviewer

Image credits

Packt is searching for authors like you

Preface

Who this book is for

What this book covers

To get the most out of this book

Download the example code files

Download the color images

Code in action

Conventions used

Get in touch

Reviews

Getting Started with Recommender Systems

Technical requirements

What is a recommender system?

The prediction problem

The ranking problem

Types of recommender systems

Collaborative filtering

User-based filtering

Item-based filtering

Shortcomings

Content-based systems

Knowledge-based recommenders

Hybrid recommenders

Summary

Manipulating Data with the Pandas Library

Technical requirements

Setting up the environment

The Pandas library

The Pandas DataFrame

The Pandas Series

Summary

Building an IMDB Top 250 Clone with Pandas

Technical requirements

The simple recommender

The metric

The prerequisties

Calculating the score

Sorting and output

The knowledge-based recommender

Genres

The build_chart function

Summary

Building Content-Based Recommenders

Technical requirements

Exporting the clean DataFrame

Document vectors

CountVectorizer

TF-IDFVectorizer

The cosine similarity score

Plot description-based recommender

Preparing the data

Creating the TF-IDF matrix

Computing the cosine similarity score

Building the recommender function

Metadata-based recommender

Preparing the data

The keywords and credits datasets

Wrangling keywords, cast, and crew

Creating the metadata soup

Generating the recommendations

Suggestions for improvements

Summary

Getting Started with Data Mining Techniques

Problem statement

Similarity measures

Euclidean distance

Pearson correlation

Cosine similarity 

Clustering

k-means clustering

Choosing k

Other clustering algorithms

Dimensionality reduction

Principal component analysis

Other dimensionality reduction techniques

Linear-discriminant analysis

Singular value decomposition

Supervised learning

k-nearest neighbors

Classification

Regression

Support vector machines

Decision trees

Ensembling

Bagging and random forests

Boosting

Evaluation metrics

Accuracy

Root mean square error

Binary classification metrics

Precision

Recall

F1 score

Summary

Building Collaborative Filters

Technical requirements

The framework

The MovieLens dataset

Downloading the dataset

Exploring the data

Training and test data

Evaluation

User-based collaborative filtering

Mean

Weighted mean

User demographics

Item-based collaborative filtering

Model-based approaches

Clustering

Supervised learning and dimensionality reduction

Singular-value decomposition

Summary

Hybrid Recommenders

Technical requirements

Introduction

Case study – Building a hybrid model

Summary

Other Books You May Enjoy

Leave a review - let other readers know what you think

Preface

Recommendation systems are at the heart of almost every internet business today, from Facebook to Netflix to Amazon. Providing good recommendations, whether it's friends, movies, or groceries, goes a long way in defining user experience and enticing your customers to use and buy from your platform.

This book shows you how to do just that. You will learn about different kinds of recommenders used in the industry and see how to build them from scratch using Python. No need to wade through tons of linear algebra and machine learning theory, you'll get started with building and learning about recommenders as quickly as possible.

In this book, you will build an IMDB Top 250 clone, a content-based engine that works on movie metadata, collaborative filters that make use of customer behavior data, and a hybrid recommender that incorporates content-based and collaborative filtering techniques.

With this book, all you need to get started with building recommendation systems is familiarity with Python, and by the time you're finished, you will have a great grasp of how recommenders work, and you will be in a strong position to apply the techniques learned to your own problem domains.

Who this book is for

If you are a Python developer and want to develop applications for social networking, news personalization, or smart advertising, this is the book for you. Basic knowledge of machine learning techniques will be helpful, but it's not mandatory.

What this book covers

Chapter 1, Getting Started with Recommender Systems, introduces the recommendation problem and the models popularly used to solve it.

Chapter 2, Manipulating Data with the Pandas Library, illustrates various data wrangling techniques using the Pandas library.

Chapter 3, Building an IMDB Top 250 Clone with Pandas, walks through the process of building a top movies chart and a knowledge-based recommender that explicitly takes in user preferences.

Chapter 4, Building Content-Based Recommenders, describes the process of building models that make use of movie plot lines and other metadata to offer recommendations.

Chapter 5, Getting Started with Data Mining Techniques, covers various similarity scores, machine learning techniques, and evaluation metrics used to build and gauge performances of collaborative recommender models.

Chapter 6, Building Collaborative Filters, walks through the building of various collaborative filters that leverage user rating data to offer recommendations.

Chapter 7, Hybrid Recommenders, outlines various kinds of hybrid recommenders used in practice and walks you through the process of building a model that incorporates both content and collaborative-based filtering.

To get the most out of this book

This book will give you maximum benefit if you have some experience with Python development, or simply someone who wants to develop applications for social networking, news personalization, or smart advertising, this is the book for you. Having some knowledge of machine learning (ML) techniques will be helpful, but it is not mandatory.

Download the example code files

You can download the example code files for this book from your account at www.packtpub.com. If you purchased this book elsewhere, you can visit www.packtpub.com/support and register to have the files emailed directly to you.

You can download the code files by following these steps:

Log in or register at

www.packtpub.com

.

Select the

SUPPORT

tab.

Click on

Code Downloads & Errata

.

Enter the name of the book in the

Search

box and follow the onscreen instructions.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

WinRAR/7-Zip for Windows

Zipeg/iZip/UnRarX for Mac

7-Zip/PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Hands-On-Recommendation-Systems-with-Python. In case there's an update to the code, it will be updated on the existing GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Download the color images

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: http://www.packtpub.com/sites/default/files/downloads/HandsOnRecommendationSystemswithPython_ColorImages.pdf.

Code in action

Visit the following link to check out videos of the code being run:

http://bit.ly/2JV4oeu.

Get in touch

Feedback from our readers is always welcome.

General feedback: Email [email protected] and mention the book title in the subject of your message. If you have questions about any aspect of this book, please email us at [email protected].

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details.

Piracy: If you come across any illegal copies of our works in any form on the Internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected] with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Reviews

Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions, we at Packt can understand what you think about our products, and our authors can see your feedback on their book. Thank you!

For more information about Packt, please visit packtpub.com.

Getting Started with Recommender Systems

Almost everything we buy or consume today is influenced by some form of recommendation; whether that's from friends, family, external reviews, and, more recently, from the sources selling you the product. When you log on to Netflix or Amazon Prime, for example, you will see a list of movies and television shows the service thinks you will like based on your past watching (and rating) history. Facebook suggests people it thinks you may know and would probably like to add. It also curates a News Feed for you based on the posts you've liked, the people you've be-friended, and the pages you've followed. Amazon recommends items to you as you browse for a particular product. It shows you similar products from a competing source and suggests auxiliary items frequently bought together with the product.

So, it goes without saying that providing a good recommendation is at the core of successful business for these companies. It is in Netflix's best interests to engage you with content that you love so that you continue to subscribe to its service; the more relevant the items Amazon shows you, the greater your chances – and volume – of purchases will be, which directly translates to greater profits. Equally, establishing friendship is key to Facebook's power and influence as an almost omnipotent social network, which it then uses to churn money out of advertising. 

In this introductory chapter, we will acquaint ourselves with the world of recommender systems, covering the following topics:

What is a recommender system? What can it do and not do?

The different types of recommender systems