Recommender System for Movielens Datasets using an Item-based Collaborative Filtering in Python
Abstract
Everyone likes movies irrespective of color, gender, age, location, and race. The most important thing is how the users are getting our unique combinations of choices concerning the preferences of the movies. This article focuses on the creation of a movie recommendation system using item-based collaborative filtering.
1. Introduction
2. Movie Recommendation System
The movie recommendation system recommends the top movies using item-based collaborative filtering (CF) [1, 2]. The dataset applied is the Movielens small dataset as shown in Table 1. The movie dataset has movie id and genre columns. The rating dataset has the columns: user id, movie id, and rating as shown in Table 2 [3, 4, 5, 6, 7].
The steps in the proposed model using Python are as follows:
- Import the required libraries.
- Specify the CSV file path and import the dataset.
- Search the files using the command: dataframe.head() to print the dataset rows.
- Construct a new data frame with user id and movie id columns.
- Remove the movies with minimal ratings. Assume that at least 15 votes per movie and the user should vote for at least 50 movies.
- Apply the function csr_matrix to reduce the sparsity.
- Apply the KNN method to calculate the cosine similarity measure.
- Find similar movies and sort them out.
- Identify the top movies.
3. Conclusions & Future Work
References
- Dataset: https://grouplens.org/datasets/movielens/
- Dataset: https://www.themoviedb.org/documentation/api
- Harper, F.M.; Konstan, J.A. The MovieLens datasets: History and context. ACM Trans. Interact. Intell. Syst. 2015, 5, 19:1–19:19, doi: 10. 1145/2827872.[CrossRef]
- Marappan, R., & Bhaskaran, S. (2022). Movie Recommendation System Modeling Using Machine Learning. International Journal of Mathematical, Engineering, Biological and Applied Computing 2022, 1(1), 12-16. DOI: 10.31586/ijmebac.2022.291[CrossRef]
- Raja Marappan, S Bhaskaran. Datasets Finders and Best Public Datasets for Machine Learning and Data Science Applications. COJ Rob Artificial Intel. 2(1). COJRA. 000530. 2022.[CrossRef]
- Bhaskaran, S.; Marappan, R.; Santhi, B. Design and Comparative Analysis of New Personalized Recommender Algorithms with Specific Features for Large Scale Datasets. Mathematics 2020, 8, 1106. https://doi.org/10.3390/math8071106[CrossRef]
- Bhaskaran, S.; Marappan, R.; Santhi, B. Design and Analysis of a Cluster-Based Intelligent Hybrid Recommendation System for E-Learning Applications. Mathematics 2021, 9, 197. https://doi.org/10.3390/math9020197[CrossRef]
- Marappan, R., Sethumadhavan, G. Solving Graph Coloring Problem Using Divide and Conquer-Based Turbulent Particle Swarm Optimization. Arab J Sci Eng (2021). https://doi.org/10.1007/s13369-021-06323-x[CrossRef]
- Marappan, R.; Sethumadhavan, G. Complexity Analysis and Stochastic Convergence of Some Well-known Evolutionary Operators for Solving Graph Coloring Problem. Mathematics 2020, 8, 303. https://doi.org/10.3390/math8030303[CrossRef]
- Marappan, R., Sethumadhavan, G. Solution to Graph Coloring Using Genetic and Tabu Search Procedures. Arab J Sci Eng 43, 525–542 (2018). https://doi.org/10.1007/s13369-017-2686-9[CrossRef]
- R. Marappan and G. Sethumadhavan, "A New Genetic Algorithm for Graph Coloring," 2013 Fifth International Conference on Computational Intelligence, Modelling and Simulation, 2013, pp. 49-54, doi: 10.1109/CIMSim.2013.17.[CrossRef]
- G. Sethumadhavan and R. Marappan, "A genetic algorithm for graph coloring using single parent conflict gene crossover and mutation with conflict gene removal procedure," 2013 IEEE International Conference on Computational Intelligence and Computing Research, 2013, pp. 1-6, doi: 10.1109/ICCIC.2013.6724190.[CrossRef]
Copyright
© 2025 by author and Scientific Publications. This is an open access article and the related PDF distributed under the Creative Commons Attribution License which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
Article Metrics
If you find this article cited by other articles, please click the button to add a citation.