Bagusaja/Machine_Learning_concept_Milestone_2
0
1import streamlit as st
2import pandas as pd
3import seaborn as sns
4import matplotlib.pyplot as plt
5import plotly.express as px
6from PIL import Image
7
8def run():
9 #membuat judul
10 st.title('LEAGUE LEGENDS ')
11
12 #membuat sub header
13 st.subheader('Evaluation Gameplay')
14
15 #tambahkan gambar
16 image = Image.open('kdalol.jpg')
17 st.image(image, caption = 'Analysis League Legends Rank Diamond')
18
19 #menambahkan deskripsi
20 st.write('This Page made by bagus')
21
22 # #font size
23 # #font terbesar
24 # st.write('# Halo')
25 # st.write('## Halo')
26 # #bold
27 st.write('**Machine Learning**')
28 # #italic
29 st.write('*This machine learning was created to evaluate the Machine Learning concept in Phase 1 learning in the supervised learning model. apply Classification with the selected Dataset being high_diamond_ranked_10min, here I will evaluate one of the League Legends games with the multiplayer Online Battle Arena (MOBA) game type. In the first 10 minutes of the initial game statistics on one of the tiers/rankings, namely Diamond Rank, with the aim of helping the Game Developers RIOT to improve Arena Battle which is more balanced between the Blue Team and the Red Team, where the victory between these 2 teams affects the game scheme that should be there can be more balance between the abilities of player 1 and the others. by taking the pov game from the Blue Team with 1 game containing 10, blue team 5 players as well as the read team.*')
30
31 #mmebuat batas dengan garis lurus
32 st.markdown('---')
33
34 #show dataframe
35 data = pd.read_csv('high_diamond_ranked_10min.csv')
36 st.dataframe(data)
37
38 #membuat bar plot
39 st.write('#### Blue Wins')
40 fig = plt.figure(figsize=(15,5))
41 sns.countplot(x='blueWins', data = data)
42 st.pyplot(fig)
43 st.write('*as you can see here from the 3000 data obtained, the victory of the blue team itself and the defeat they received can be said to be balanced but it does not rule out the possibility that there will be an absolute defeat, the cause of which must be known.*')
44 #membuat plotly plot
45 #membandingkan ratingpemain bola dengan proce nya
46 st.write('#### Plotly plot - Blue Kills vs blue Total Exp ')
47 fig = px.scatter(data, x = 'blueKills', y = 'blueTotalExperience', hover_data = ['blueKills', 'blueTotalExperience'])
48 st.plotly_chart(fig)
49 st.write('*Blue Kills vs blue Total Exp, this will affect what if the blue team gets a kill with the final result of the match getting the total exp*')
50
51 #membuat histogram
52 st.write('#### Total Minions Killed by Blue Team')
53 fig = plt.figure(figsize=(15,5))
54 sns.histplot(data['blueTotalMinionsKilled'], bins = 30, kde = True)
55 st.pyplot(fig)
56 st.write('*By looking at the Total Minions Killed by Blue Team, you can see that killing minions in the battle arena is necessary to achieve victory for the Blue Team itself.*')
57
58 #membuat plotly plot
59 #membandingkan gold diff dengan bluedeaths dengan proce nya
60 st.write('#### Plotly plot - Blue Deaths vs blueGoldDiff')
61 fig = px.scatter(data, x = 'blueDeaths', y = 'blueGoldDiff', hover_data = ['blueDeaths', 'blueGoldDiff'])
62 st.plotly_chart(fig)
63 st.write('*with the large number of deaths experienced by the blue team it will also affect the difference in gold they will receive*')
64
65 #membuat histogram berdasarkan input user
66 st.write('#### Histogram input by user')
67 option = st.selectbox('Pilih column : ', ('blueAssists', 'blueTotalGold', 'blueAvgLevel', 'blueTotalMinionsKilled'))
68 fig = plt.figure(figsize=(15,5))
69 sns.histplot(data[option], bins = 30, kde = True)
70 st.pyplot(fig)
71 st.write('*You can also see assists, total gold, avg level, blueTotalMinionsKilled, on the blue team where this will also affect the blue teams from teh winning*')
72
73 # #membuat plotly plot
74 # #membandingkan ratingpemain bola dengan proce nya
75 # st.write('#### Plotly plot - ')
76 # fig = px.scatter(data, x = 'limit_balance', y = 'default_payment_next_month', hover_data = ['Name', 'Age'])
77 # st.plotly_chart(fig)
78 #tambahkan gambar
79 image = Image.open('depan.jpg')
80 st.image(image, caption = 'Analysis League Legends Rank Diamond')
81if __name__ == '__main__':
82 run()
83 