Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -41,15 +41,14 @@ def predict(age, bmi, children, sex, smoker, region):
|
|
41 |
'region': region}
|
42 |
|
43 |
df = pd.DataFrame(data, index=[0])
|
44 |
-
prediction = model.predict(df)[0]
|
45 |
-
prediction = float(prediction)
|
46 |
|
47 |
# Apply the same transformations used in training
|
48 |
-
|
49 |
#print("Transformed DataFrame:", transformed_df) # Debug transformed data
|
|
|
|
|
50 |
|
51 |
-
|
52 |
-
#p rediction = model.predict(df)[0]
|
53 |
|
54 |
|
55 |
# Prepare the log entry
|
|
|
41 |
'region': region}
|
42 |
|
43 |
df = pd.DataFrame(data, index=[0])
|
|
|
|
|
44 |
|
45 |
# Apply the same transformations used in training
|
46 |
+
transformed_df = model.named_steps['columntransformer'].transform(df)
|
47 |
#print("Transformed DataFrame:", transformed_df) # Debug transformed data
|
48 |
+
prediction = model.predict(df)[0]
|
49 |
+
prediction = float(prediction)
|
50 |
|
51 |
+
|
|
|
52 |
|
53 |
|
54 |
# Prepare the log entry
|