First, how are you comparing models without tuning hyperparameters? Seeing your code would be helpful.
There is an early stopping parameter in pycaret, but I'm not sure what it's doing. It's also only available for the tune_model
function. If you allow pycaret to auto-search hyperparameters for xgboost and catboost, they should no longer overfit. This is because they will be tuning the regularization hyperparameter (L1 and/or L2 regularizations on the leaf weights) and will be comparing scores across the validation sets.
With catboost (or xgboost or lightgbm), you can set the early_stopping_rounds
parameter to enable early stopping:
import catboost
cb = catboost.CatBoostClassifier(n_estimators=1000)
cb.fit(x_train, y_train, eval_set=(x_test, y_test), early_stopping_rounds=10, plot=True)
You need to provide the eval_set
, otherwise, it will have nothing to evaluate for early stopping. I don't think it's possible at the moment to add early_stopping_rounds
as a parameter to any of the relevant pycaret functions you are probably using.