I am trying to train XGBOOST model.
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=43, stratify=y)
when I'm using train_test_split and pass the model X_train, Y_train and for eval_set X_test, Y_test, The model seems to be a very good one.
But when I manually split the Dataset :
splitValidationIndex = round(dataset.shape*0.6) splitTestIndex = round(dataset.shape*0.8) X_train = X[:splitValidationIndex] y_train = y[:splitValidationIndex]
Pass it to fit
X_val = X[splitValidationIndex:splitTestIndex] y_val = y[splitValidationIndex:splitTestIndex]
Pass it to eval_set
X_test = X[splitTestIndex:] y_test = y[splitTestIndex:]
Check the model prediction on that
that produced a much worse model
What am I missing/doing wrong?