File size: 1,992 Bytes
eb481da
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4be390a
 
eb481da
 
 
 
 
 
 
e6ed470
eb481da
 
 
 
 
 
c70607e
eb481da
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import pickle
import streamlit as st
import pandas as pd

st.set_page_config(
    page_title="Steam Game's Recommender",
    page_icon="๐Ÿผ",
    layout="wide",
    initial_sidebar_state="expanded",
)

with st.sidebar:
    st.title("Contact Me")
    st.divider()
    st.write("Instagram: https://www.instagram.com/ashishprasad__/")
    st.write("LinkedIn: https://www.linkedin.com/in/ashudevcodes/")
    st.write("Email: ashishprasd949@gamil.com")


def recommend(game):
    index = new_df[new_df['Name'] == game].index[0]
    distances = sorted(list(enumerate(similarity[index])),reverse=True,key = lambda x: x[1])
    game_lists=[]
    game_image_list=[]
    for i in distances[1:7]:
        game_lists.append(new_df.iloc[i[0]].Name)
        game_image_list.append(game_image.iloc[i[0]].Headerimage)
    return game_lists,game_image_list
        
# uplode data 
new_df=pickle.load(open("game_data.pkl",'rb'))
similarity=pickle.load(open("similarity.pkl",'rb'))
game_image=pd.read_csv("image_data.csv")
game_name = new_df['Name'].values

st.title("Steam Game's Recommendation System by Ashish ๐Ÿผ")
st.warning('There was only New Game Data Since 2021 to 2023')

st.divider()

option = st.selectbox(
    'Select or type The Game Name: โฌ‡๏ธ',
    game_name)

st.write('You selected:', option)
if st.button('๐Ÿ” Find!'):
    st.toast("๐Ÿ™ƒ Enjoy!")
    st.balloons()
    st.header("Here are The Top 6 Game You also like ๐ŸŽฎ:")
    rec,img=recommend(option)
    col1, col2, col3 = st.columns(3)
    with col1:
        st.image(img[0])
        st.subheader(rec[0])
    with col2:
        st.image(img[1])
        st.subheader(rec[1])
    with col3:
        st.image(img[2])
        st.subheader(rec[2])
        
    col4,col5,col6 =st.columns(3)
    with col4:
        st.image(img[3])
        st.subheader(rec[3])
    with col5:
        st.image(img[4])
        st.subheader(rec[4])
    with col6:
        st.image(img[5])
        st.subheader(rec[5])
    st.success("๐Ÿฐ Match Found!")