3
$\begingroup$

I'm using the movielens dataset to give recommendations to a user based on genre of the movies.

I have two matrices, one contains the genre the user likes. We are considering user3 for now

enter image description here

I also have a Matrix where every movie is represented as a row and the columns are the genres.

enter image description here

Here, movie 1 belongs to Adventure, 5 belongs to Action and a movie can belong to one or more genres (This is a small subset of all the movies and genres available)

Now based on the user's genre preference we want to recommend movies to him/her. How do I go about doing that? I'm new to machine learning and this is a learning exercise. Do I need to compute similarity? The approach I was thinking of was to bind both these matrices and then compute the Jaccard similarity but the results are not so accurate in that case. Something like this,

sim_mat <- rbind.data.frame(ruser2, genre_matrix)
library(proxy)
sim_results <- dist(sim_mat, method = "Jaccard")
sim_results <- as.data.frame(as.matrix(sim_results[1:8552]))
rows <- which(sim_results == min(sim_results))
#Recommended movies
movies[rows,]

I'm using R but I just need a general overview of what kind of approach, I can code it myself. Any insight would be helpful.

$\endgroup$
  • $\begingroup$ Please include the code for the library & dataset. The figures will be of limited use for people. $\endgroup$ – gung - Reinstate Monica Mar 13 '16 at 21:11
  • $\begingroup$ @gung, thank you for commenting, what kind code should I include? I just want a suggestion on how I should proceed to implement the algorithm on this. I'm new to stats.stackexchange so am not aware of all the rules. $\endgroup$ – damien hawks Mar 13 '16 at 21:19
  • 1
    $\begingroup$ Please register &/or merge your accounts (you can find information on how to do this in the My Account section of our help center), then you will be able to edit & comment on your own question. $\endgroup$ – Silverfish Mar 13 '16 at 21:34
  • $\begingroup$ Just library(<name>); data(<name>), so people can reproduce what you're doing here. $\endgroup$ – gung - Reinstate Monica Mar 13 '16 at 22:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.