epalvarez commited on
Commit
4da0f00
·
verified ·
1 Parent(s): 8649673

modifying names of keys for sample and scheduler to start with lowercase exactly as the names in the columns in the DataFrame

Browse files
Files changed (1) hide show
  1. app.py +12 -12
app.py CHANGED
@@ -57,12 +57,12 @@ scheduler = CommitScheduler(
57
  #-------------------------------------------------------------------------------------------------------------------------------------------------------------
58
  def predict_insurance_charge(age, bmi, children, sex, smoker, region):
59
  sample = {
60
- 'Age': age,
61
- 'BMI': bmi,
62
- 'Children': children,
63
- 'Sex': sex,
64
- 'Smoker': smoker,
65
- 'Region': region
66
  }
67
  data_point = pd.DataFrame([sample])
68
  prediction = insurance_charge_predictor.predict(data_point).tolist() # use the model_ic.joblib retrieved above to make the prediction
@@ -75,12 +75,12 @@ def predict_insurance_charge(age, bmi, children, sex, smoker, region):
75
  with log_file.open("a") as f:
76
  f.write(json.dumps(
77
  {
78
- 'Age': age,
79
- 'BMI': bmi,
80
- 'Children': children,
81
- 'Sex': sex,
82
- 'Smoker': smoker,
83
- 'Region': region,
84
  'prediction': prediction[0]
85
  }
86
  ))
 
57
  #-------------------------------------------------------------------------------------------------------------------------------------------------------------
58
  def predict_insurance_charge(age, bmi, children, sex, smoker, region):
59
  sample = {
60
+ 'age': age,
61
+ 'bmi': bmi,
62
+ 'children': children,
63
+ 'sex': sex,
64
+ 'smoker': smoker,
65
+ 'region': region
66
  }
67
  data_point = pd.DataFrame([sample])
68
  prediction = insurance_charge_predictor.predict(data_point).tolist() # use the model_ic.joblib retrieved above to make the prediction
 
75
  with log_file.open("a") as f:
76
  f.write(json.dumps(
77
  {
78
+ 'age': age,
79
+ 'bmi': bmi,
80
+ 'children': children,
81
+ 'sex': sex,
82
+ 'smoker': smoker,
83
+ 'region': region,
84
  'prediction': prediction[0]
85
  }
86
  ))