Created
June 21, 2019 14:39
-
-
Save Harshit1694/a8d79d564b0edea276857e15e0ae62e0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Grouping movie_id with mean rating | |
popularity_rec<-aggregate(data_train[, 3], list(data_train$movie_id), mean) | |
head(popularity_rec) | |
#Arranging the mean rating in descending order by expanding the selection with movie_id | |
popularity_rec<- popularity_rec[order(-popularity_rec$x),] | |
colnames(popularity_rec)<-c("movie_id","rating") | |
#Recommended movies with top ratings | |
head(popularity_rec,20) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment