suvradeepp commited on
Commit
855cca9
·
verified ·
1 Parent(s): aa870ce

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -15
app.py CHANGED
@@ -1,35 +1,33 @@
1
- # homepage.py
2
  import streamlit as st
3
  import runpy
4
 
5
  # 1. Page config & title
6
- st.set_page_config(page_title="Machine Learning Models Visualization tools")
7
- st.title("Machine Learning Models Visualization tools")
8
 
9
  # 2. Map display names → filenames
10
  APPS = {
11
- "Gradient Descent Visualization": "gd_sgd_app.py",
12
- "Decision Tree (each step)": "decision_tree_steps.py",
13
- "Bagging Classifier Visualization": "bagging_classifier_viz.py",
14
- "Bagging Regressor Visualization": "bagging_regressor_viz.py",
15
- "Voting Classifier Visualization": "voting_classifier_viz.py",
16
- "Voting Regressor Visualization": "voting_regressor_viz.py",
17
- "Decision Tree Visualization": "decision_tree_viz.py",
18
  }
19
 
20
- # 3. See if the user clicked into one of the apps already
21
  params = st.experimental_get_query_params()
22
  selected = params.get("app", [None])[0]
23
 
24
  if selected in APPS.values():
25
- # rerun the selected app
26
  runpy.run_path(selected, run_name="__main__")
27
  else:
28
- # 4. Otherwise show the grid of buttons
29
  cols = st.columns(2)
30
  for idx, (label, fname) in enumerate(APPS.items()):
31
  col = cols[idx % 2]
32
- # style each button like a “box”
33
  if col.button(label, key=label):
34
- # set query‑param and trigger rerun
35
  st.experimental_set_query_params(app=fname)
 
1
+ # app.py
2
  import streamlit as st
3
  import runpy
4
 
5
  # 1. Page config & title
6
+ st.set_page_config(page_title="Machine Learning Models Visualization Hub")
7
+ st.title("Machine Learning Models Visualization Tools")
8
 
9
  # 2. Map display names → filenames
10
  APPS = {
11
+ "Gradient Descent Visualization": "gd_sgd_app.py",
12
+ "Decision Tree (step-by-step)": "decision_tree_steps.py",
13
+ "Bagging Classifier Visualization": "bagging_classifier_viz.py",
14
+ "Bagging Regressor Visualization": "bagging_regressor_viz.py",
15
+ "Voting Classifier Visualization": "voting_classifier_viz.py",
16
+ "Voting Regressor Visualization": "voting_regressor_viz.py",
 
17
  }
18
 
19
+ # 3. Check for query‑param to run one of the apps
20
  params = st.experimental_get_query_params()
21
  selected = params.get("app", [None])[0]
22
 
23
  if selected in APPS.values():
24
+ # Run the selected Streamlit app in this process
25
  runpy.run_path(selected, run_name="__main__")
26
  else:
27
+ # 4. Otherwise show a grid of buttons
28
  cols = st.columns(2)
29
  for idx, (label, fname) in enumerate(APPS.items()):
30
  col = cols[idx % 2]
 
31
  if col.button(label, key=label):
32
+ # set the query‑param and rerun
33
  st.experimental_set_query_params(app=fname)