Spaces:
Build error
Build error
Upload 7 files
Browse files- Recomendations.ipynb +0 -0
- app.py +27 -0
- movie_dict.pkl +3 -0
- movie_list.pkl +3 -0
- movies.pkl +3 -0
- requirements.txt +4 -0
- similarity1.pkl +3 -0
Recomendations.ipynb
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
app.py
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import pickle
|
| 3 |
+
import pandas as pd
|
| 4 |
+
|
| 5 |
+
def recomend(movie):
|
| 6 |
+
movie_index=movies[movies['title']==movie].index[0]
|
| 7 |
+
distences=similarity[movie_index]
|
| 8 |
+
movies_list = sorted(list(enumerate(distences)),reverse=True,key=lambda x:x[1])[1:6]
|
| 9 |
+
recommended_movies=[]
|
| 10 |
+
for i in movies_list:
|
| 11 |
+
recommended_movies.append(movies.iloc[i[0]].title)
|
| 12 |
+
return recommended_movies
|
| 13 |
+
|
| 14 |
+
movie_dict=pickle.load(open('movie_dict.pkl','rb'))
|
| 15 |
+
movies=pd.DataFrame(movie_dict)
|
| 16 |
+
similarity=pickle.load(open('similarity1.pkl','rb'))
|
| 17 |
+
|
| 18 |
+
st.title('Movie Recommender System')
|
| 19 |
+
|
| 20 |
+
selected_movie_name=st.selectbox(
|
| 21 |
+
'How Would you like to br contacted?',movies['title'].values
|
| 22 |
+
)
|
| 23 |
+
|
| 24 |
+
if st.button('Recommend'):
|
| 25 |
+
recommendations=recomend(selected_movie_name)
|
| 26 |
+
for i in recommendations:
|
| 27 |
+
st.write(i)
|
movie_dict.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c8e3a22628c76af439174f9aa4dae385c5c273990ac57549d4673043f949e436
|
| 3 |
+
size 2216683
|
movie_list.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c8e3a22628c76af439174f9aa4dae385c5c273990ac57549d4673043f949e436
|
| 3 |
+
size 2216683
|
movies.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b7eef6c8af9fc759648b9bb71c8c6238f33f7ce0f2c138651581a4af99daaa3e
|
| 3 |
+
size 2235268
|
requirements.txt
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
streamlit
|
| 2 |
+
pandas
|
| 3 |
+
scikit-learn
|
| 4 |
+
numpy
|
similarity1.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:070fc0a0727061cb0c851a40466d54291920455112e9ad5414510ca18b994d3c
|
| 3 |
+
size 184781251
|