I realized that, contrary to scikit learn, setting a fixed value for random_state does not guarantee that the model will output the same results everytime.
Hence I'm not able to get reproducible results from XGBoostRegressor, even by setting seed, random_state, colsample_bytree and subsample.
Is this a bug? Is this somewhat by design? If so, why?
If you have a solution or a workaround that always works, please share.
Here's the code:
model = XGBRegressor(n_estimators=1000, learning_rate=0.05,
subsample=0.8, colsample_bytree= 0.8, seed=42)
model.fit(X_train_trf,y_train,
early_stopping_rounds=5,
eval_set=[(X_train_trf, y_train), (X_valid_trf, y_valid)],
verbose=False)
preds = model.predict(X_valid_trf)