File size: 1,120 Bytes
94c11bc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ba3f15b
94c11bc
 
 
 
2eb71f4
94c11bc
 
 
 
 
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
import streamlit as st
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import plotly.express as px


def run():
    #membuat judul
    st.title('Fraud Transaction Prediction')

    #membuat subheader
    st.subheader('EDA Page')

    #buat garis
    st.markdown('---')

    #show dataframe
    df = pd.read_csv('Fraud_data_filtered.csv')
    st.dataframe(df)

    #membuat histogram
    st.write('#### Histogram Plot')
    option = st.selectbox('Choose column: ', (
    'amount', 'old_balance_ori', 'new_balance_ori', 'old_balance_dest', 'new_balance_dest', 'type', 'isFraud'))
    fig = plt.figure(figsize=(15, 5))
    sns.histplot(df[option], bins=30, kde=True)
    st.pyplot(fig)

    #membuat plotly plot
    st.write('#### Plotly Plot - type and isFraud')
    fig = px.histogram(df, x='type', color='isFraud', title='Type and isFraud')
    st.plotly_chart(fig)

    #membuat plotly plot
    st.write('#### Plotly Plot - amount and isFraud')
    fig = px.scatter(df, x='amount', y='isFraud', hover_data=['amount', 'isFraud'])
    st.plotly_chart(fig)


if __name__ == '__main__':
    run()