Rathapoom commited on
Commit
20ec65f
·
verified ·
1 Parent(s): 2f95965

Update appbackup.py

Browse files
Files changed (1) hide show
  1. appbackup.py +14 -5
appbackup.py CHANGED
@@ -6,9 +6,18 @@ import plotly.graph_objs as go
6
 
7
  # Constants from linear regression
8
  REGRESSION_CONSTANTS = {
9
- 'Femoral Neck': {'mu': 0.916852, 'sigma': 0.120754},
10
- 'Total Hip': {'mu': 0.955439, 'sigma': 0.125406},
11
- 'Lumbar spine (L1-L4)': {'mu': 1.131649, 'sigma': 0.139618},
 
 
 
 
 
 
 
 
 
12
  }
13
 
14
  # Load medication data
@@ -182,7 +191,7 @@ def main():
182
  dexa_machine = st.selectbox("DEXA Machine", ["LUNAR"])
183
 
184
  # Gender Selection
185
- gender = st.selectbox("Gender", ["Female"])
186
 
187
  # Location (Site) Selection with Mapping
188
  site_mapping = {
@@ -207,7 +216,7 @@ def main():
207
 
208
  # Load constants and medication data
209
  medication_data = load_medication_data()
210
- constants = REGRESSION_CONSTANTS.get(selected_site, {})
211
 
212
  # Generate and display predictions for selected medications
213
  if st.button("Predict"):
 
6
 
7
  # Constants from linear regression
8
  REGRESSION_CONSTANTS = {
9
+ 'Femoral Neck': {
10
+ 'Female': {'mu': 0.916852, 'sigma': 0.120754},
11
+ 'Male': {'mu': 0.9687385325352573, 'sigma': 0.121870698023835}
12
+ },
13
+ 'Total Hip': {
14
+ 'Female': {'mu': 0.955439, 'sigma': 0.125406},
15
+ 'Male': {'mu': 0.967924895046735, 'sigma': 0.13081439619361657}
16
+ },
17
+ 'Lumbar spine (L1-L4)': {
18
+ 'Female': {'mu': 1.131649, 'sigma': 0.139618},
19
+ 'Male': {'mu': 1.1309707991669353, 'sigma': 0.1201836924980611}
20
+ }
21
  }
22
 
23
  # Load medication data
 
191
  dexa_machine = st.selectbox("DEXA Machine", ["LUNAR"])
192
 
193
  # Gender Selection
194
+ gender = st.selectbox("Gender", ["Female", "Male"])
195
 
196
  # Location (Site) Selection with Mapping
197
  site_mapping = {
 
216
 
217
  # Load constants and medication data
218
  medication_data = load_medication_data()
219
+ constants = REGRESSION_CONSTANTS[selected_site][gender]
220
 
221
  # Generate and display predictions for selected medications
222
  if st.button("Predict"):