Spaces:
Sleeping
Sleeping
Update pages/2_🏋️♀️_Model_training.py
Browse files- pages/2_🏋️♀️_Model_training.py +50 -50
pages/2_🏋️♀️_Model_training.py
CHANGED
|
@@ -1,51 +1,51 @@
|
|
| 1 |
-
import streamlit as st
|
| 2 |
-
import pandas as pd
|
| 3 |
-
from persist import persist, load_widget_state
|
| 4 |
-
import numpy as np
|
| 5 |
-
import matplotlib.pyplot as plt
|
| 6 |
-
global variable_output
|
| 7 |
-
|
| 8 |
-
def main():
|
| 9 |
-
|
| 10 |
-
cs_body()
|
| 11 |
-
|
| 12 |
-
def convert_csv():
|
| 13 |
-
d = {'col1': [], 'col2': []}
|
| 14 |
-
df = pd.DataFrame(data=d, columns=['Age', 'Sex'])
|
| 15 |
-
return df.to_csv().encode("utf-8")
|
| 16 |
-
|
| 17 |
-
def cs_body():
|
| 18 |
-
|
| 19 |
-
st.header('Training Data and Methodology')
|
| 20 |
-
st.write("Provide an overview of the Training Data and Training Procedure for this model")
|
| 21 |
-
st.markdown('##### Training dataset')
|
| 22 |
-
left, right = st.columns(2)
|
| 23 |
-
left.number_input("Training set size",value=100)
|
| 24 |
-
right.number_input("Validation set size",value=20)
|
| 25 |
-
st.text("Demographical and clinical characteristics")
|
| 26 |
-
left, right = st.columns(2
|
| 27 |
-
left.download_button("Download Template", data=convert_csv(), file_name='file.csv')
|
| 28 |
-
demo = right.file_uploader("Load template",type=['csv'])
|
| 29 |
-
if demo is not None:
|
| 30 |
-
left, right = st.columns(2
|
| 31 |
-
|
| 32 |
-
fig, ax = plt.subplots()
|
| 33 |
-
ax.set_title("Age distribution")
|
| 34 |
-
ax.hist(np.random.normal(size=500))
|
| 35 |
-
left.pyplot(fig)
|
| 36 |
-
|
| 37 |
-
fig, ax = plt.subplots()
|
| 38 |
-
ax.pie([45,55],labels=["Men","Women"])
|
| 39 |
-
right.pyplot(fig)
|
| 40 |
-
st.text_input("Source",placeholder="Brats challenge/ Clinic ...")
|
| 41 |
-
st.text("Acquisition date")
|
| 42 |
-
left, right = st.columns(2)
|
| 43 |
-
left.date_input("From")
|
| 44 |
-
right.date_input("To")
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
if __name__ == '__main__':
|
| 50 |
-
load_widget_state()
|
| 51 |
main()
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import pandas as pd
|
| 3 |
+
from persist import persist, load_widget_state
|
| 4 |
+
import numpy as np
|
| 5 |
+
import matplotlib.pyplot as plt
|
| 6 |
+
global variable_output
|
| 7 |
+
|
| 8 |
+
def main():
|
| 9 |
+
|
| 10 |
+
cs_body()
|
| 11 |
+
|
| 12 |
+
def convert_csv():
|
| 13 |
+
d = {'col1': [], 'col2': []}
|
| 14 |
+
df = pd.DataFrame(data=d, columns=['Age', 'Sex'])
|
| 15 |
+
return df.to_csv().encode("utf-8")
|
| 16 |
+
|
| 17 |
+
def cs_body():
|
| 18 |
+
|
| 19 |
+
st.header('Training Data and Methodology')
|
| 20 |
+
st.write("Provide an overview of the Training Data and Training Procedure for this model")
|
| 21 |
+
st.markdown('##### Training dataset')
|
| 22 |
+
left, right = st.columns(2)
|
| 23 |
+
left.number_input("Training set size",value=100)
|
| 24 |
+
right.number_input("Validation set size",value=20)
|
| 25 |
+
st.text("Demographical and clinical characteristics")
|
| 26 |
+
left, right = st.columns(2)#, vertical_alignment ="center")
|
| 27 |
+
left.download_button("Download Template", data=convert_csv(), file_name='file.csv')
|
| 28 |
+
demo = right.file_uploader("Load template",type=['csv'])
|
| 29 |
+
if demo is not None:
|
| 30 |
+
left, right = st.columns(2)#, vertical_alignment ="center")
|
| 31 |
+
|
| 32 |
+
fig, ax = plt.subplots()
|
| 33 |
+
ax.set_title("Age distribution")
|
| 34 |
+
ax.hist(np.random.normal(size=500))
|
| 35 |
+
left.pyplot(fig)
|
| 36 |
+
|
| 37 |
+
fig, ax = plt.subplots()
|
| 38 |
+
ax.pie([45,55],labels=["Men","Women"])
|
| 39 |
+
right.pyplot(fig)
|
| 40 |
+
st.text_input("Source",placeholder="Brats challenge/ Clinic ...")
|
| 41 |
+
st.text("Acquisition date")
|
| 42 |
+
left, right = st.columns(2)
|
| 43 |
+
left.date_input("From")
|
| 44 |
+
right.date_input("To")
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
if __name__ == '__main__':
|
| 50 |
+
load_widget_state()
|
| 51 |
main()
|