Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Building a Recommendation System with R

You're reading from  Building a Recommendation System with R

Product type Book
Published in Sep 2015
Publisher
ISBN-13 9781783554492
Pages 158 pages
Edition 1st Edition
Languages
Toc

Evaluating and optimizing the model


This section will show you how to evaluate the performance of our recommender. Starting from the evaluation, we can try some parameter configurations and choose the one performing the best. For more details, see Chapter 4, Evaluating the Recommender Systems.

The following are the steps to evaluate and optimize the model:

  • Build a function that evaluates the model given a parameter configuration

  • Use the function to test different parameter configurations and pick the best one

Let's go through these steps in detail.

Building a function to evaluate the model

This section will show you how to define a function that:

  1. Sets up cross validation using the k-fold.

  2. Builds a hybrid IBCF.

  3. Recommends the items to the users in the test sets.

  4. Evaluates the recommendation.

The inputs of our function are as follows:

  • Data: This is the rating matrix table with the item description

  • k-fold parameters: This is the number of folds, the number of items to keep in the test set

  • Model parameters...

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 €14.99/month. Cancel anytime}