I am using RandomizedSearchcv for hyperparameter optimization. When I run the model, it shows the scores for each model training. The problem is, it trains way more than 10 models when in fact I expect it to train just 10 models by specifying n_iters to 10. Why is that? What should I do to limit the total runs to 10?
here is my code
from catboost import CatBoostRegressor
from sklearn.model_selection import RandomizedSearchCV
from scipy.stats import randint
params = {
'iterations': randint(100, 1000),
'depth': randint(3, 10),
'learning_rate': [0.01, 0.02, 0.03, 0.04, 0.05],
'l2_leaf_reg': randint(1, 10),
'border_count': randint(32, 255),
'bagging_temperature': [0.0, 0.2, 0.4, 0.6, 0.8, 1.0],
}
model = CatBoostRegressor(loss_function='RMSE', od_type='Iter', cat_features=[0, 1, 2, 3, 4], task_type='GPU')
search = RandomizedSearchCV(model, param_distributions=params, n_iter=10, scoring='neg_root_mean_squared_error')
# Fit the model
search.fit(X_train, y_train, eval_set=(X_val, y_val), plot=True)