Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated dropdown for 'Region' on the app #3

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ This project is outlined to data inspection, transformation/pre-processing, mode

To run the app locally, you need to initiate the following command from your terminal:

`streamlit run app.py`
```bash
streamlit run app.py
```

To run the app online, click [Malaria Predictor App](https://yusufokunlola-teamflask-notebook-app-c7gl4z.streamlit.app/)
25 changes: 4 additions & 21 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import numpy as np
import pickle

st.set_option('deprecation.showfileUploaderEncoding',False)
#st.set_option('deprecation.showfileUploaderEncoding',False)
model = pickle.load(open('finalized_model.sav','rb'))


Expand All @@ -11,26 +11,9 @@

st.header("")

st.markdown("<h4 style='text-align: center; color: Black;'>Select variables to predict malaria incidence</h4>", unsafe_allow_html=True)
st.text('')

st.markdown('<p> <strong>Region:</strong> \
<ul> \
<li>Central Africa == 0 </li> \
<li>East Africa == 1</li> \
<li>North Africa == 2</li> \
<li>Southern Africa == 3</li> \
<li>West Africa == 4 </li> \
</ul> \
</p>' , unsafe_allow_html=True)

st.text('')
st.text('')
region = st.selectbox(
'Select Region',
('0', '1', '2', '3', '4'))
region = st.selectbox('Region', ('Central Africa', 'East Africa', 'North Africa', 'Southern Africa', 'West Africa'))
region = 0 if region == 'Central Africa' else 1 if region == 'East Africa' else 2 if region == 'North Africa' else 3 if region == 'Southern Africa' else 4

st.write('You selected:', region)

st.text('')

Expand Down Expand Up @@ -64,4 +47,4 @@
st.markdown('`Code:` [GitHub](https://github.com/yusufokunlola/TeamFlask_notebook)')

# Reference: Santiago Víquez (2023). How to Deploy Machine Learning Models with Python & Streamlit.
# Accessed on 29/4/2023. https://365datascience.com/tutorials/machine-learning-tutorials/how-to-deploy-machine-learning-models-with-python-and-streamlit/
# Accessed on 29/4/2023. https://365datascience.com/tutorials/machine-learning-tutorials/how-to-deploy-machine-learning-models-with-python-and-streamlit/
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
streamlit==1.7.0
scikit-learn==1.1.1
numpy==1.22.4
streamlit
scikit-learn
numpy