File size: 1,766 Bytes
28b9906
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# streamlit
import streamlit as st
# pandas
import pandas as pd
# visualisasi
import seaborn as sns
import matplotlib.pyplot as plt
import plotly.express as px
from PIL import Image

st.set_page_config(
    page_title = 'Predict Credit Card Default',
    layout =  'wide',
    initial_sidebar_state='expanded'
)

def run():
    
    st.title('Predict Credit Card')

    st.subheader('EDA untuk analisis dataset default credit card')

    st.image('https://image.cermati.com/v1536918930/kcqxfjxwseh5e6kyrrpv.jpg',
             caption= 'CREDIT CARD')
    
    st.write('This page is made by badriahnursakinah')
    st.write('# Hello')

    st.markdown('---')

    '''
    Pada page kali ini, penulis akan melakukan
    eksplorasi sederhana untuk memprediksi kemungkinan default pada pembayaran kartu kredit
    Dataset yg digunakan adalah dataset predict default payment next month
    Dataset ini berasal dari website Big Query
    '''
            
    data = pd.read_csv('P1G5_Set_1_badriah_nursakinah.csv')
    st.dataframe(data)

    st.write('#### Plot education_level')
    fig = plt.figure(figsize=(15,5))
    sns.countplot(x='education_level', data= data)
    st.pyplot(fig)

    st.write('### Histogram')
    options = st.selectbox('Pilih kolom:',
                            ('sex',
                            'education_level', 'marital_status',
                            'age'))
    fig = plt.figure(figsize=(15,5))
    sns.histplot(data[options], bins=30,kde=True)
    st.pyplot(fig)

    st.write('#### Plotly Plot - limit_balance dengan Overall')
    fig = px.scatter(data,x='limit_balance',y='default_payment_next_month', hover_data=['pay_0','pay_2','pay_3','pay_4','pay_5','pay_6',])
    st.plotly_chart(fig)

if __name__ == '__main__':
    run()