import joblib
import xgboost
import os
import sys
# This thing relies heavily on reusing AISUP; if you don't have it, I, er, apologize
AISUP_DIR = '/home/mrkun/PycharmProjects/AISUP/main'
os.chdir(AISUP_DIR)
sys.path.append(AISUP_DIR)
from cfg import *
X_train_vec_1 = joblib.load('X_train_vec_1.pkl')
X_test_vec_1 = joblib.load('X_test_vec_1.pkl')
X_train_vec_2 = joblib.load('X_train_vec_2.pkl')
X_test_vec_2 = joblib.load('X_test_vec_2.pkl')
y_train = joblib.load('y_train.pkl')
y_test = joblib.load('y_test.pkl')
assert not (X_test_vec_1 != X_test_vec_2).toarray().any()
assert not (X_train_vec_1 != X_train_vec_2).toarray().any()
xgb_clf_test_1 = xgboost.XGBClassifier(updater='grow_gpu_hist')
eval_set = [(X_test_vec_1, y_test)]
xgb_clf_test_1.fit(X_train_vec_1, y_train,
eval_set=eval_set, eval_metric=["merror",],
early_stopping_rounds=1)
print(xgb_clf_test_1.best_score)
xgb_clf_test_2 = xgboost.XGBClassifier(updater='grow_gpu_hist')
eval_set = [(X_test_vec_2, y_test)]
xgb_clf_test_2.fit(X_train_vec_2, y_train,
eval_set=eval_set, eval_metric=["merror",],
early_stopping_rounds=1)
print(xgb_clf_test_2.best_score)