gilangw commited on
Commit
0de4504
·
1 Parent(s): 9a45216

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +70 -0
app.py ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from streamlit_option_menu import option_menu
3
+ import home
4
+ import eda
5
+ import prediction
6
+ from PIL import Image
7
+
8
+ # navigation = st.sidebar.selectbox('Select Page :', ('EDA', 'Predict Credit Card Default'))
9
+
10
+ # if navigation == 'EDA':
11
+ # eda.runEDA()
12
+ # else:
13
+ # prediction.runPredictor()
14
+
15
+ # Set page title and icon
16
+ # st.set_page_config(page_title='Final Project', page_icon='⭐')
17
+
18
+ # Create sidebar navigation
19
+
20
+ # st.markdown(
21
+ # f"""
22
+ # <style>
23
+ # [data-testid="stSidebar"] {{
24
+ # background-image: url(https://raw.githubusercontent.com/FTDS-assignment-bay/main/assets/ChurnGuardian-Logo-Transparants.png);
25
+ # background-repeat: no-repeat;
26
+ # padding-top: 20px;
27
+ # background-position: 10px 50px;
28
+ # background-size: 310px 85px;
29
+ # }}
30
+ # </style>
31
+ # """,
32
+ # unsafe_allow_html=True,
33
+ # )
34
+
35
+ st.set_page_config(
36
+ page_title='Telco Customer Churn and Segmentation',
37
+ layout='centered', #wide
38
+ initial_sidebar_state='expanded'
39
+ )
40
+
41
+ # st.title('Telco Customer Churn and Segmentation')
42
+ # image = Image.open('images\logo_crop_clean.png')
43
+ # image = Image.open('images\logo_grey_clean.png')
44
+ col1, col2, col3 = st.columns([10, 1, 5])
45
+ image_url = 'https://raw.githubusercontent.com/FTDS-assignment-bay/p2-final-project-ftds-001-sby-group-001/main/images/logo_crop_clean.png'
46
+ # qr_url = 'https://raw.githubusercontent.com/FTDS-assignment-bay/p2-final-project-ftds-001-sby-group-001/main/images/qr_link.png'
47
+ col1.image(image_url, width=450)
48
+ # col2.write('')
49
+ # col3.image(qr_url, width=150)
50
+ st.write('# Customer Churn and Segmentation')
51
+ st.subheader('Predict churn and retain your customer!')
52
+ st.markdown('---')
53
+
54
+ selected = option_menu(None, ["About", "EDA", "Predict"],
55
+ icons=['house', 'file-earmark-bar-graph', 'search'],
56
+ menu_icon="cast", default_index=0, orientation="horizontal",
57
+ styles={
58
+ "icon": {"color": "orange", "font-size": "15px"},
59
+ "nav-link": {"font-size": "15px", "text-align": "left", "margin":"1px", "--hover-color": "#eee"},
60
+ "nav-link-selected": {"background-color": "grey"},
61
+ }
62
+ )
63
+
64
+ if selected == 'About':
65
+ home.run()
66
+ elif selected == 'EDA':
67
+ eda.run()
68
+ else:
69
+ prediction.run()
70
+ #streamlit run app.py