![](https://crypto4nerd.com/wp-content/uploads/2023/07/10T8zRJ9K5MdQd_KiUQhTxw-1024x974.png)
I performed GridSearch, which is arguably the most basic type of hyper-param methods, but hey, just wait for the result.
Initially, there was an error with CatBoostError in GridSearch:
WHAT? WHY? I yelped.
CatBoostError: only one of the parameters iterations, n_estimators, num_boost_round, num_trees should be initialized.)
After some digging, I realized that the error is related to the CatBoost library, where you can only initialize one of the params when creating a CatBoostClassifier.
That’s right. Tune your stuff correctly. Here’s how to do it correctly:
Here’s what we got from running the GridSearch successfully:
Best parameters for CatBoost: {'iterations': 90, 'learning_rate': 0.04, 'max_depth': 5}
Accuracy for CatBoost: 0.9915254237288136
Training Random Forest...
Best parameters for Random Forest: {'bootstrap': True, 'max_depth': 110, 'max_features': 3, 'min_samples_leaf': 3, 'min_samples_split': 8, 'n_estimators': 300}
Accuracy for Random Forest: 0.9830508474576272
Training XGBoost...
Best parameters for XGBoost: {'learning_rate': 0.01, 'max_depth': 3, 'n_estimators': 200}
Accuracy for XGBoost: 1.0
Amazing, wonderful. Do you feel bonita?