This is an implementation of Apriori Algorithm using Python. Here we have used python libraries like pandas,mlxtend
The proceedure of the code is as follows:
- First we will import the libraries and the two dataset files Movies.tsv, ratings.tsv.
- Then we are going to create a mapping between movieId and title.
- We will now sort the highrated movies > 4 ratings .
- We will perform data preprocessing converting the transactions to a binary representation by using TransactionEncoder from mlextend.preprocessing. If an item is present in the transaction, it will be tagged as 1 ,otherwise 0.
- Now by using the apriori algorithm we will find the optimal solution by min_support=0.2,max_len=2,metric="lift",min_threshold=2
- Hence we get the result as ancedents -> consequents
i.e we can recommend a person who watched 12 Angryman to watch fargo and vice versa
reference site: https://levelup.gitconnected.com/create-a-recommendation-system-in-python-d7a95b2837ab