The task is to develop different types of recommendation systems, taking as a basis any mathematical solutions and algorithms, not including neural networks. 4 types of recommendation systems have been developed:
- Demographic filtering;
- Content_Based_Filtering;
- k-means_recommend;
- SVD_calloborativ.
Dataset TMDB 5000 Movie Dataset was used. Datasets are in the 'Data' folder, you need to download them. Describe dataset:
The first dataset 'tmdb_5000_credits.csv', and it contains the following:
- movie_id - unique identifier for each movie
- cast - name of lead and supporting actors
- crew - name of director, editor, composer, writer, and more.
The second dataset 'tmdb_5000_movies.csv', and it contains the following:
- budget - the budget in which the movie was made
- genre - genre of movie (action, comedy, thriller, and more)
- id - movie id in the first dataset
- keywords - keywords or tags related to movie
- original_language - language in which movie was made
- original_title - movie title before translation or adaptation
- overview - brief description of movie
- popularity - numeric quantity specifying movie popularity
- production_companies - the production house of movie
- production_countries - country in which movie was produced
- release_data - date of movie release
- revenue - worldwide revenue generated by movie
- runtime - running time of the movie in minutes
- status - "Released" or "Rumored"
- tagline - movie's tagline
- title - title of movie
- vote_average - average ratings of movie recieved
- vote_count - count of votes recieved
In order for the project to be cloned to the current folder, you need to open the command line and run the commandу (git clone https://github.com/edword1996/RecommendEdik.git)
In order to run the program, you must install Python 3.5.6
You can download and install python here https://www.python.org/downloads/
Installation Instructions https://www.howtogeek.com/197947/how-to-install-python-on-windows/ This package installation applies to all files.
Requirements install:
alembic==1.4.2
apyori==1.1.2
attrs==19.3.0
certifi==2020.4.5.1
chardet==3.0.4
cycler==0.10.0
Cython==0.29.19
dataset==1.3.1
feedparser==5.2.1
idna==2.9
joblib==0.14.1
kiwisolver==1.1.0
Mako==1.1.2
MarkupSafe==1.1.1
matplotlib==3.0.3
mlxtend==0.17.2
numpy==1.18.4
pandas==0.24.2
pyfpgrowth==1.0
pyparsing==2.4.7
python-dateutil==2.8.1
python-editor==1.0.4
pytz==2020.1
reader==0.13
requests==2.23.0
scikit-learn==0.22.2.post1
scipy==1.4.1
seaborn==0.9.1
six==1.14.0
SQLAlchemy==1.3.17
urllib3==1.25.9
All the libraries above are installed using (pip install -r requirements.txt
) the command line.
To start a project, open a command prompt in the folder where the project is located.
python demographic.py
Content_Based_Filtering.py
k-means_recommend.py
SVD_calloborativ.py
Before getting started with this:
- we need a metric to score or rate movie
- Calculate the score for every movie
- Sort the scores and recommend the best rated movie to the users.
In this case, I only sorted the columns by popularity rating, and based on the sorting, I selected the best films.
We will compute pairwise similarity scores for all movies based on their plot descriptions and recommend movies based on that similarity score. The plot description is given in the overview feature of our dataset. Let's take a look at the data
In this recommendation system, I will use the recommendation for the similarity of the description of the film. That is, after watching a movie, you will be recommended films according to the previous description of the movie that you watched. In this case, the algorithm is used to the nearest ones, clustering is carried out by similarity, you can see an example of work below.
In this system, we use variables such as 'userid', 'moveid', 'rating', 'timestamp'. It’s important to get 2 approaches used here:
- Item Based Collaborative Filtering ;
- User based filtering;
- Single Value Decomposition.