Spaces:
Runtime error
Runtime error
danielritchie
commited on
Commit
•
55a248d
1
Parent(s):
a6d130c
Update app.py
Browse files
app.py
CHANGED
@@ -41,7 +41,10 @@ X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_
|
|
41 |
model = xgb.XGBClassifier()
|
42 |
model.fit(X_train, y_train)
|
43 |
|
44 |
-
def predict(
|
|
|
|
|
|
|
45 |
# Handle missing values or intentionally omitted fields
|
46 |
for col in X.columns:
|
47 |
if input_data.get(col) is None:
|
@@ -57,6 +60,7 @@ def predict(input_data):
|
|
57 |
|
58 |
|
59 |
|
|
|
60 |
# Set up Gradio interface for data exploration
|
61 |
def explore_data(row_number):
|
62 |
return df.iloc[row_number].to_dict()
|
|
|
41 |
model = xgb.XGBClassifier()
|
42 |
model.fit(X_train, y_train)
|
43 |
|
44 |
+
def predict(*inputs):
|
45 |
+
# Convert the list of inputs into a dictionary
|
46 |
+
input_data = {col: val for col, val in zip(X.columns, inputs)}
|
47 |
+
|
48 |
# Handle missing values or intentionally omitted fields
|
49 |
for col in X.columns:
|
50 |
if input_data.get(col) is None:
|
|
|
60 |
|
61 |
|
62 |
|
63 |
+
|
64 |
# Set up Gradio interface for data exploration
|
65 |
def explore_data(row_number):
|
66 |
return df.iloc[row_number].to_dict()
|