DaniAcosta04 commited on
Commit
1ce8a40
·
verified ·
1 Parent(s): 4df7f41

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -14
app.py CHANGED
@@ -39,13 +39,13 @@ model_output = gr.Label(label='Charges')
39
  # the functions runs when 'Submit' is clicked or when a API request is made
40
  def predict_charges(age, bmi, children, sex, smoker, region, prediction):
41
  sample = {
42
- 'Age': age,
43
- 'BMI': bmi,
44
- 'Children': children,
45
- 'Sex': sex,
46
- 'Smoker': smoker,
47
- 'Region': region,
48
- 'Prediction': prediction
49
  }
50
  data_point = pd.DataFrame([sample])
51
  print('data point: ', data_point)
@@ -56,13 +56,13 @@ def predict_charges(age, bmi, children, sex, smoker, region, prediction):
56
  with log_file.open("a") as f:
57
  f.write(json.dumps(
58
  {
59
- 'Age': age,
60
- 'BMI': bmi,
61
- 'Children': children,
62
- 'Sex': sex,
63
- 'Smoker': smoker,
64
- 'Region': region,
65
- 'Prediction': prediction[0]
66
  }
67
  ))
68
  f.write("\n")
 
39
  # the functions runs when 'Submit' is clicked or when a API request is made
40
  def predict_charges(age, bmi, children, sex, smoker, region, prediction):
41
  sample = {
42
+ 'age': age,
43
+ 'bmi': bmi,
44
+ 'children': children,
45
+ 'sex': sex,
46
+ 'smoker': smoker,
47
+ 'region': region,
48
+ 'prediction': prediction
49
  }
50
  data_point = pd.DataFrame([sample])
51
  print('data point: ', data_point)
 
56
  with log_file.open("a") as f:
57
  f.write(json.dumps(
58
  {
59
+ 'age': age,
60
+ 'bmi': bmi,
61
+ 'children': children,
62
+ 'sex': sex,
63
+ 'smoker': smoker,
64
+ 'region': region,
65
+ 'prediction': prediction[0]
66
  }
67
  ))
68
  f.write("\n")