# Approach to find similarity between two different types of matrices

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

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

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.

• Please include the code for the library & dataset. The figures will be of limited use for people. Mar 13 '16 at 21:11
• @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. Mar 13 '16 at 21:19
• 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. Mar 13 '16 at 21:34
• Just library(<name>); data(<name>), so people can reproduce what you're doing here. Mar 13 '16 at 22:26