Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -29,7 +29,7 @@ app.add_middleware(
|
|
29 |
def train_the_model(data,page):
|
30 |
if str(page) == "2":
|
31 |
|
32 |
-
new_data =
|
33 |
encoders = load('transexpress_encoders.joblib')
|
34 |
xgb_model = load('transexpress_xgb_model.joblib')
|
35 |
|
@@ -48,8 +48,8 @@ def train_the_model(data,page):
|
|
48 |
new_data_filled[col] = encoder.transform(new_data_filled[col])
|
49 |
else:
|
50 |
new_data_filled[col] = encoder.transform(new_data_filled[col])
|
51 |
-
X_new = new_data_filled.drop('
|
52 |
-
y_new = new_data_filled['
|
53 |
X_train, X_test, y_train, y_test = train_test_split(X_new, y_new, test_size=0.2, random_state=42)
|
54 |
|
55 |
|
@@ -66,7 +66,7 @@ def train_the_model(data,page):
|
|
66 |
#xgb = XGBClassifier(use_label_encoder=False, eval_metric='logloss')
|
67 |
|
68 |
# Setup GridSearchCV
|
69 |
-
grid_search = GridSearchCV(xgb_model, param_grid, cv=
|
70 |
|
71 |
# Fit the grid search to the data
|
72 |
grid_search.fit(X_train, y_train)
|
@@ -117,7 +117,7 @@ def train_the_model(data,page):
|
|
117 |
xgb = XGBClassifier(use_label_encoder=False, eval_metric='logloss')
|
118 |
|
119 |
# Setup GridSearchCV
|
120 |
-
grid_search = GridSearchCV(xgb, param_grid, cv=
|
121 |
|
122 |
# Fit the grid search to the data
|
123 |
grid_search.fit(X_train, y_train)
|
|
|
29 |
def train_the_model(data,page):
|
30 |
if str(page) == "2":
|
31 |
|
32 |
+
new_data = da
|
33 |
encoders = load('transexpress_encoders.joblib')
|
34 |
xgb_model = load('transexpress_xgb_model.joblib')
|
35 |
|
|
|
48 |
new_data_filled[col] = encoder.transform(new_data_filled[col])
|
49 |
else:
|
50 |
new_data_filled[col] = encoder.transform(new_data_filled[col])
|
51 |
+
X_new = new_data_filled.drop('status_name', axis=1)
|
52 |
+
y_new = new_data_filled['status_name']
|
53 |
X_train, X_test, y_train, y_test = train_test_split(X_new, y_new, test_size=0.2, random_state=42)
|
54 |
|
55 |
|
|
|
66 |
#xgb = XGBClassifier(use_label_encoder=False, eval_metric='logloss')
|
67 |
|
68 |
# Setup GridSearchCV
|
69 |
+
grid_search = GridSearchCV(xgb_model, param_grid, cv=40, n_jobs=-1, scoring='accuracy')
|
70 |
|
71 |
# Fit the grid search to the data
|
72 |
grid_search.fit(X_train, y_train)
|
|
|
117 |
xgb = XGBClassifier(use_label_encoder=False, eval_metric='logloss')
|
118 |
|
119 |
# Setup GridSearchCV
|
120 |
+
grid_search = GridSearchCV(xgb, param_grid, cv=40, n_jobs=-1, scoring='accuracy')
|
121 |
|
122 |
# Fit the grid search to the data
|
123 |
grid_search.fit(X_train, y_train)
|