Skip to content

Recommender system for board games based on boardgamegeek data

Notifications You must be signed in to change notification settings

samuelhuerga/bgg_recommender

Repository files navigation

Recommender system for boardgames

A web app for recommending new boardgames that you might like.

https://samuelhuerga.shinyapps.io/bgg_recommender/

Regarding technical details, this project tries to show knowledge in three different fields:

  1. Massive data download through API and webscraping
  2. Recommender models such as Collaborative Filtering and Asociation Rules
  3. Shiny web application to present results to the final user

How to use it

Select the games you like from your collection. You can look for them by typing a few letters of its name:

Score them asigning them hearts and click on Add to collection button to stage changes:

Recommendations for your collection will be shown on your right pane:

You can view specific details of recommended games in boardgamegeek by clicking View in BGG:

Technical details

1. Data source: boardgamegeek

All data have been downloaded from www.boardgamegeek.com, which is the most popular repository for boardgames information with lots of games and users.

Data have been extracted on March 2018, and so new games from that date may not appear.

boardgamegeek API

Data have been collected by using boardgamegeek API (https://boardgamegeek.com/wiki/page/BGG_XML_API2). Main problems encountered were:

  • Limitation on number on requests per second, so sleep time when downloading data was needed.
  • Amount of information on users rating top ranked games. Some of top games had thousands of different ratings and API only allows to download 100 ratings at a time.
  • Encoding of different game names. Non English accents and characters were handled properly when saving this information, but querying them through API in R was very tricky

All data was downloaded, but it is not uploaded to github. You can check scrape_data.R file to see how the process was.

Web scraping

In order to get most popular games, web scraping was used on hot list (http://www.boardgamegeek.com/browse/boardgame/page/1), as the API didn't handle this information.

Only first 1000 games were taken into consideration to build the recommender system.

2. Recommender models

Item Based Collaborative Filtering (IBCF)

With Recommenderlab package, an IBCF was built handling only top 1000 games and user ratings. About 200K users were used to build this recommender.

You can see full details in collaborative_filter.R

Asociation rules

In cases where there are not enough recommendations to provide to the user, asociation rules have been analized, by studing only those ratings which are good, and providing insights like Other users who liked the games in your collection, also liked...

You can see full details in asoc_rules.R

By merging these two techniques, we provide a powerful recommender system.

3. Shiny App

In order to handle the recommendations to a final user, a web application was built using Shiny and shinydashboard packages.

This projects outstands in two ways of customization:

  1. valueBox were modified in order to get custom images as icons. This was extracted from https://gist.github.com/hrbrmstr/605e62c5bf6deadf304d80cf4b1f0239

  2. In selectizeInput box, thumbnail of game image were shown next to title game

The rest is a common shinydashboard application, with no particularities. You can see the code in global.R, server.R and ui.R.

Licencia de Creative Commons
Este obra está bajo una licencia de Creative Commons Reconocimiento-NoComercial-CompartirIgual 4.0 Internacional.

About

Recommender system for board games based on boardgamegeek data

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published