Recommendation System using Machine Learning
#1
Hello Everyone, 
I am Shivansh Beohar, currently pursuing B.Tech in Information Technology from IIIT Allahabad, India. I am interested in the project "improve suggestion using ML".
I have successfully built Kodi on my machine (Windows). For this project I have looked into the past year's forum as pointed out by @Razze , following the discussion there, I have doubts regarding this post . Since making (and maintaining) ML models in python is much easier than C++, What should be the right approach to integrate python models into C++? What is the exact problem with add-ons ?
If add-ons are a problem I propose a hybrid solution for this, the input ( or data feeder ) pipelines can be built in C++, with pre-trained python saved locally, we can call the python scripts from C++ code and get the output. These python models can be implemented to be trained further through new data (incremental training, not retraining).


@Razze can you guide me here ?

Currently I am also looking at the graph theory solution suggested by @marko.prcac, It is a really fresh approach towards recsys.
Reply
#2
Hey, I believe we talked about this in irc and this is basically solved?
Reply
#3
Yes it is, shall I post my pre proposal here ?
Reply
#4
Please see my proposal draft here. I have summarized my proposal here:

My main idea is creating a new library for recommendation system, wrapping it with an appropriate language and then using an addon to use the library in the Kodi.

I propose a server based model for the recommendation system, meaning that the library will reside on the server rather than the user device. the reasons for choosing server based recsys are :
  • Cross platform support.
  • Heavy computation can be done easily on servers as compared to mobile devices.
  • Updating the library will not need updating the entire app.
  • Out-of-box prediction can be made, due to the fact that the server will have information what other people are watching, thus can give better out-of-box and “currently trending” type of recommendations.
  • Keeping the recommendation system out of Kodi’s core helps in low maintenance requirements with fewer bugs and easily debuggable code.
I propose some methods to code the library here, I need help in deciding the best one, since every option here have its own pros and cons.
  • Code the recommendation system in python, using the various libraries available in python.
  • Code the recommendation system into C++. For this approach we can use C++ based libraries like Shogun.ml and mlpack.
  • Write a recommendation system from scratch in C++, this way we can avoid many dependencies and the make the library portable.
Apart from the library, which language to choose for coding the wrapper and addon are also a point of discussion here.

The algorithm to code the recommender model I found to be the best fit is using Matrix Factorization, not only its easy to interpret, It is well tested and have been a successful model in the Netflix Prize Competition, I have given a gist of its working in the doc above, here is the original paper. and here is an article I found really helpful and have borrowed the notations from.

Why not deep learning models and embeddings is a debatable topic, these are my thoughts on it:
  1. They are GPU extensive. GPU enabled servers comes with high running cost, the point being, is that worth it?
  2. Deep learning model have less interpretability, they require more fine tuning and thus there maintenance can be a issue.
  3. Mobile device, especially smart TVs are not powerful enough to run these model locally, thus if we choose such model, we have to either drop low-powered devices or change the model.
  4. They take more time then traditional ML algorithms, thus they might slow down the entire system.(maybe)
I have answered the remaining questions in the document above. The above mentioned points are what I feel the crucial points of the project. I will try and give a proof of concept for the algorithm as soon as possible.

Also I need to know does kodi have servers, or we have to rent one for this specific purpose?
Reply
#5
So what is the big differentator for this why are we doing this on OUR server?
Both trakt and themoviedb offer apis that give us recommendations.
https://developers.themoviedb.org/3/movi...mendations
https://trakt.docs.apiary.io/#reference/people/shows
Both need logins.

So will ours work without login with an anonymized id?

What features make this special?
Will it be able to only recommend movies/tv shows I actually have (or have access to?)
Reply
#6
As discussed on IRC, if we choose to ship the model (recsys) with Kodi, it will carry many restrictions with it (mentioned in the doc I shared), thus if we are implementing our own recsys, we have to keep it on some server.

Using API is your choice, I don't have any experience with them, but I do see that they have some restriction on the usage, and they require login separately.

Regarding login, since it is Kodi's own API, I propose that we should have a mechanism such that only valid Kodi installations can use the API, no one outside of Kodi should be able to use it. However users should not be bothered about any "logging in". For the user, it should be like an integrated part of Kodi, just open and use. I dont have any prior knowledge of such security mechanism, I may need guidance here.

The recsys I have proposed will give recommendations of movies ( and TV shows and music ), present in its database ( not only in user's library ). In my opinion it must user's choice whether he wants out-of-box suggestions or not. We can provide such an option in GUI for example. From implementation POV, its just a line of code.

I cannot say what makes server based model special. The API's you listed kind of does solves many problems, if not all. If you ask what make my proposal special in terms of implementation, I think it is the best fit, because it is built for Kodi, we can modify it to meet any kinds of our need.
Reply
#7
You can probably also clarify-
(1) what datasets can be used;
(2) what all types of information regarding watch history, user library (tags like genre, language etc) can you extract from Kodi or otherwise (like using some movieID to get related info from some external source);
(3) and what all from the above extracted information (2) can be used in correspondence with the dataset (1) you are using, i.e. whether the extracted tags are even present in any of the publicly available datasets.
Reply
#8
@mohit-0212  I looked at the movie lens dataset, here are my findings
It contains user id, movie title (with year) , movie id (both IMDB and TMDB), ratings given by a users to the movies, tags (like "twist ending", "courtroom drama" ). It doesn't have labels for movies which means we have to scrap it from internet (easy job).
Now Kodi have labels such as title, genre, parental rating (PG 13 etc) , country of filming , cast, release date, movie id*, movie database - rating, user-rating, set (Matrix series, Thor series etc).
So I think on the dataset part, we may have to do some initial scraping, rest of the data matched with what we already have (pre scraped by Kodi). To reduce data transfer in API calls we can only send the ID and user-rating from Kodi, the rest can be picked up from the dataset.

For songs I am looking at the million song dataset, it is a very large dataset with user taste, song similarity and even beat indexing ( when does a beat occurs, how many beats etc). I think this might serve our purpose, however more work would be needed on it since Kodi have, title, genre, album, artist extracted from files and not scraped from internet. Although I think a 3 tuple (song name, artist, year) can be used to uniquely identify a song.
Reply
#9
@Razze @mohit-0212 After the discussion on IRC, I was thinking that an Interface for recommendation in Kodi can be included as a part of my project. Along with it I can create exemplary add-ons which will use that interface. I have in mind two add-ons, (I am open for suggestion though) First, a local kodi add-on,an Item-Item similarity based simple recsys, which can serve as default recommendations provider for Kodi. It will serve two purposes, first as an example for how to use the interface, second to provide 'some' recommendations to the user. Second add-on I think can be made using the various public APIs available online, they can provide good recommendations and will not require setting up own servers and since they are API based, we can use this add-on anywhere.
Reply
#10
(2019-03-23, 20:08)trancenoid Wrote: @Razze @mohit-0212 After the discussion on IRC, I was thinking that an Interface for recommendation in Kodi can be included as a part of my project. Along with it I can create exemplary add-ons which will use that interface. I have in mind two add-ons, (I am open for suggestion though) First, a local kodi add-on,an Item-Item similarity based simple recsys, which can serve as default recommendations provider for Kodi. It will serve two purposes, first as an example for how to use the interface, second to provide 'some' recommendations to the user. Second add-on I think can be made using the various public APIs available online, they can provide good recommendations and will not require setting up own servers and since they are API based, we can use this add-on anywhere.

did you lay out some milestones and do you feel like you can do the interface, and TWO addons?
Reply
#11
(2019-03-29, 16:58)Razze Wrote:
(2019-03-23, 20:08)trancenoid Wrote: @Razze @mohit-0212 After the discussion on IRC, I was thinking that an Interface for recommendation in Kodi can be included as a part of my project. Along with it I can create exemplary add-ons which will use that interface. I have in mind two add-ons, (I am open for suggestion though) First, a local kodi add-on,an Item-Item similarity based simple recsys, which can serve as default recommendations provider for Kodi. It will serve two purposes, first as an example for how to use the interface, second to provide 'some' recommendations to the user. Second add-on I think can be made using the various public APIs available online, they can provide good recommendations and will not require setting up own servers and since they are API based, we can use this add-on anywhere.

did you lay out some milestones and do you feel like you can do the interface, and TWO addons?  
I did, I am bit unclear on how much is there to learn, I have the design ready, which I am discussing on the IRC, but what I feel is that due to my limited knowledge of Kodi's structure I cannot name and identify the parts clearly. For this I need mentor's help. I have prepared the milestones according to my understanding of the Interface part and I feel with some help I can organize my goals which can help me decide if I can accustom two addons.
Reply

Logout Mark Read Team Forum Stats Members Help
Recommendation System using Machine Learning0