Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -94,7 +94,7 @@ def train_the_model(data):
|
|
94 |
xgb = XGBClassifier(use_label_encoder=False, eval_metric='logloss')
|
95 |
|
96 |
# Setup GridSearchCV
|
97 |
-
grid_search = GridSearchCV(xgb, param_grid, cv=
|
98 |
|
99 |
# Fit the grid search to the data
|
100 |
grid_search.fit(X_train, y_train)
|
@@ -196,8 +196,8 @@ def predict(
|
|
196 |
|
197 |
try:
|
198 |
# Load your trained model and encoders
|
199 |
-
xgb_model = load('
|
200 |
-
encoders = load('
|
201 |
except:
|
202 |
return {"no model found so first trained the model using data fecther"}
|
203 |
|
|
|
94 |
xgb = XGBClassifier(use_label_encoder=False, eval_metric='logloss')
|
95 |
|
96 |
# Setup GridSearchCV
|
97 |
+
grid_search = GridSearchCV(xgb, param_grid, cv=40, n_jobs=-1, scoring='accuracy')
|
98 |
|
99 |
# Fit the grid search to the data
|
100 |
grid_search.fit(X_train, y_train)
|
|
|
196 |
|
197 |
try:
|
198 |
# Load your trained model and encoders
|
199 |
+
xgb_model = load('transexpress_xgb_model.joblib')
|
200 |
+
encoders = load('transexpress_encoders.joblib')
|
201 |
except:
|
202 |
return {"no model found so first trained the model using data fecther"}
|
203 |
|