ashudevcodes/Steam-game-Recommendation-System
1
1import pickle2import streamlit as st3import pandas as pd4 5st.set_page_config(6 page_title="Steam Game's Recommender",7 page_icon="๐ผ",8 layout="wide",9 initial_sidebar_state="expanded",10)11 12with st.sidebar:13 st.title("Contact Me")14 st.divider()15 st.write("Instagram: https://www.instagram.com/ashishprasad__/")16 st.write("LinkedIn: https://www.linkedin.com/in/ashudevcodes/")17 st.write("Email: ashishprasd949@gamil.com")18 19 20def recommend(game):21 index = new_df[new_df['Name'] == game].index[0]22 distances = sorted(list(enumerate(similarity[index])),reverse=True,key = lambda x: x[1])23 game_lists=[]24 game_image_list=[]25 for i in distances[1:7]:26 game_lists.append(new_df.iloc[i[0]].Name)27 game_image_list.append(game_image.iloc[i[0]].Headerimage)28 return game_lists,game_image_list29 30# uplode data 31new_df=pickle.load(open("game_data.pkl",'rb'))32similarity=pickle.load(open("similarity.pkl",'rb'))33game_image=pd.read_csv("image_data.csv")34game_name = new_df['Name'].values35 36st.title("Steam Game's Recommendation System by Ashish ๐ผ")37st.warning('There was only New Game Data Since 2021 to 2023')38 39st.divider()40 41option = st.selectbox(42 'Select or type The Game Name: โฌ๏ธ',43 game_name)44 45st.write('You selected:', option)46if st.button('๐ Find!'):47 st.toast("๐ Enjoy!")48 st.balloons()49 st.header("Here are The Top 6 Game You also like ๐ฎ:")50 rec,img=recommend(option)51 col1, col2, col3 = st.columns(3)52 with col1:53 st.image(img[0])54 st.subheader(rec[0])55 with col2:56 st.image(img[1])57 st.subheader(rec[1])58 with col3:59 st.image(img[2])60 st.subheader(rec[2])61 62 col4,col5,col6 =st.columns(3)63 with col4:64 st.image(img[3])65 st.subheader(rec[3])66 with col5:67 st.image(img[4])68 st.subheader(rec[4])69 with col6:70 st.image(img[5])71 st.subheader(rec[5])72 st.success("๐ฐ Match Found!")73 74 