[fd0c0d]: / main.py

Download this file

45 lines (36 with data), 1.0 kB

 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
"""This is the main module to run the app"""
# Importing the necessary Python modules.
import streamlit as st
# Import necessary functions from web_functions
from web_functions import load_data
# Import pages
from Tabs import home, data, predict, visualise, about
# Configure the app
st.set_page_config(
page_title = 'Parkinson\'s Disease Prediction',
page_icon = 'raised_hand_with_fingers_splayed',
layout = 'wide',
initial_sidebar_state = 'auto'
)
# Dictionary for pages
Tabs = {
"Home": home,
"Data Info": data,
"Prediction": predict,
"Visualisation": visualise,
"About me": about
}
# Create a sidebar
# Add title to sidear
st.sidebar.title("Navigation")
# Create radio option to select the page
page = st.sidebar.radio("Pages", list(Tabs.keys()))
# Loading the dataset.
df, X, y = load_data()
# Call the app funciton of selected page to run
if page in ["Prediction", "Visualisation"]:
Tabs[page].app(df, X, y)
elif (page == "Data Info"):
Tabs[page].app(df)
else:
Tabs[page].app()