Diff of /main.py [000000] .. [fd0c0d]

Switch to unified view

a b/main.py
1
"""This is the main module to run the app"""
2
3
# Importing the necessary Python modules.
4
import streamlit as st
5
6
# Import necessary functions from web_functions
7
from web_functions import load_data
8
9
# Import pages
10
from Tabs import home, data, predict, visualise, about
11
12
# Configure the app
13
st.set_page_config(
14
    page_title = 'Parkinson\'s Disease Prediction',
15
    page_icon = 'raised_hand_with_fingers_splayed',
16
    layout = 'wide',
17
    initial_sidebar_state = 'auto'
18
)
19
20
# Dictionary for pages
21
Tabs = {
22
    "Home": home,
23
    "Data Info": data,
24
    "Prediction": predict,
25
    "Visualisation": visualise,
26
    "About me": about
27
}
28
29
# Create a sidebar
30
# Add title to sidear
31
st.sidebar.title("Navigation")
32
33
# Create radio option to select the page
34
page = st.sidebar.radio("Pages", list(Tabs.keys()))
35
36
# Loading the dataset.
37
df, X, y = load_data()
38
39
# Call the app funciton of selected page to run
40
if page in ["Prediction", "Visualisation"]:
41
    Tabs[page].app(df, X, y)
42
elif (page == "Data Info"):
43
    Tabs[page].app(df)
44
else:
45
    Tabs[page].app()