Steps to replicate problem:
- Go to main app website - https://liraweb.azurewebsites.net/
- Select “Gradient Descent” as the linear regression method in step 4 and press “Predict” Button
Note: "Predict" st.button works fine for all the other options in the dropdown
- Once you’re in Gradient Descent, you can update the sliders as you wish and select Plotting/Animation method.
- PROBLEM STARTS HERE - Once you select any of the options in the 2nd st.select and hit Go, it brings you back to step 3 without anything else happening
Checked-in code in Github here - https://github.com/etzimopoulos/LiRA-Web-App/blob/master/pages/homepage.py (see
elif lira_method == "Gradient Descent": which essentially implements the Gradient Descent dropdown in Step 3.
In my local sandpit, I’ve also tried removing the st.button(Go) and strangely this happens:
- Code runs straight-through for the first option in the st.select:
mode = st.selectbox("Select Plotting Library",('Skip Animation','Matplotlib','Plotly','Altair'))
- If I re-arrange the options and set, say,
Matplotlibfirst, it will run the animation without any issues. The same with
Altair. If they’re first in the st.selectbox statement code runs and I get the correct error message.
- But if I select any other method other than the first one in the st.selectbox statement, it takes me to Step 3.
I hope it’s not a schoolboy error with the if/elif statements but any help would be appreciated as I’m stuck for days.