Update app.py
Browse files
app.py
CHANGED
|
@@ -15,7 +15,13 @@ numerical_cols = ["Price", "Size"]
|
|
| 15 |
scaler = MinMaxScaler()
|
| 16 |
property_df[numerical_cols] = scaler.fit_transform(property_df[numerical_cols])
|
| 17 |
|
| 18 |
-
property_df["Bedrooms"] = property_df["Bedrooms"].astype(int)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
categorical_cols = ["Location", "Condition", "Type"]
|
| 21 |
label_encoders = {}
|
|
|
|
| 15 |
scaler = MinMaxScaler()
|
| 16 |
property_df[numerical_cols] = scaler.fit_transform(property_df[numerical_cols])
|
| 17 |
|
| 18 |
+
# property_df["Bedrooms"] = property_df["Bedrooms"].astype(int)
|
| 19 |
+
# Handle missing Bedrooms BEFORE casting
|
| 20 |
+
property_df["Bedrooms"] = (
|
| 21 |
+
property_df["Bedrooms"]
|
| 22 |
+
.fillna(property_df["Bedrooms"].median())
|
| 23 |
+
.astype(int)
|
| 24 |
+
)
|
| 25 |
|
| 26 |
categorical_cols = ["Location", "Condition", "Type"]
|
| 27 |
label_encoders = {}
|