costaspinto commited on
Commit
a528ee4
·
verified ·
1 Parent(s): a7573b1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -120,8 +120,8 @@ def predict(data: OneHotPatientData):
120
  logger.info(f"Incoming data: {input_dict}")
121
 
122
  feature_order = [
123
- 'age', 'bmi', 'cholesterol_level', 'hypertension', 'asthma',
124
- 'cirrhosis', 'other_cancer', 'gender_Male',
125
  'country_Belgium','country_Bulgaria','country_Croatia','country_Cyprus',
126
  'country_Czech_Republic','country_Denmark','country_Estonia','country_Finland',
127
  'country_France','country_Germany','country_Greece','country_Hungary',
@@ -131,7 +131,7 @@ def predict(data: OneHotPatientData):
131
  'country_Spain','country_Sweden',
132
  'cancer_stage_Stage_II','cancer_stage_Stage_III','cancer_stage_Stage_IV',
133
  'family_history_Yes',
134
- 'smoking_status_Former_Smoker','smoking_status_Never_Smoked','smoking_status_Passive_Smoker',
135
  'treatment_type_Combined','treatment_type_Radiation','treatment_type_Surgery'
136
  ]
137
 
@@ -152,4 +152,4 @@ def predict(data: OneHotPatientData):
152
 
153
  except Exception as e:
154
  logger.error(f"Prediction error: {str(e)}")
155
- return {"error": str(e), "input_data_received": data.dict()}
 
120
  logger.info(f"Incoming data: {input_dict}")
121
 
122
  feature_order = [
123
+ 'age', 'bmi', 'cholesterol_level', 'hypertension', 'asthma',
124
+ 'cirrhosis', 'other_cancer', 'gender_Male',
125
  'country_Belgium','country_Bulgaria','country_Croatia','country_Cyprus',
126
  'country_Czech_Republic','country_Denmark','country_Estonia','country_Finland',
127
  'country_France','country_Germany','country_Greece','country_Hungary',
 
131
  'country_Spain','country_Sweden',
132
  'cancer_stage_Stage_II','cancer_stage_Stage_III','cancer_stage_Stage_IV',
133
  'family_history_Yes',
134
+ 'smoking_status_Former_Smoker','smoking_status_Never_Smoker','smoking_status_Passive_Smoker',
135
  'treatment_type_Combined','treatment_type_Radiation','treatment_type_Surgery'
136
  ]
137
 
 
152
 
153
  except Exception as e:
154
  logger.error(f"Prediction error: {str(e)}")
155
+ return {"error": str(e), "input_data_received": data.dict()}