Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -52,7 +52,12 @@ def run_all_models(file):
|
|
52 |
|
53 |
# Handle missing values
|
54 |
model_features = model_features.fillna(0)
|
55 |
-
|
|
|
|
|
|
|
|
|
|
|
56 |
# 1. BANKRUPTCY CLASSIFICATION
|
57 |
bankruptcy_preds = xgb_clf.predict(model_features)
|
58 |
bankruptcy_probs = xgb_clf.predict_proba(model_features)
|
|
|
52 |
|
53 |
# Handle missing values
|
54 |
model_features = model_features.fillna(0)
|
55 |
+
|
56 |
+
for col in model_features.select_dtypes(include=['object']).columns:
|
57 |
+
model_features[col] = model_features[col].astype(str)
|
58 |
+
model_features[col] = model_features[col].fillna("Unknown")
|
59 |
+
model_features[col] = model_features[col].astype("category").cat.codes
|
60 |
+
|
61 |
# 1. BANKRUPTCY CLASSIFICATION
|
62 |
bankruptcy_preds = xgb_clf.predict(model_features)
|
63 |
bankruptcy_probs = xgb_clf.predict_proba(model_features)
|