1
$\begingroup$

How does RandomizedSearchCV form the validation sets, while I also defined an evaluation set for LGBM? Is it formed from the train set I gave or how does the evaluation set comes into the validation?

I splitted my data into a 80% train set and 20% test set.

I use RandomizedSearchCV to optimize the params for LGBM, while defining the test set as an evaluation set for the LGBM. The code look like this:

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=0)
model_LGBM=LGBMClassifier(objective='binary',metric='auc',random_state=0)

distributions = dict(max_depth=range(1,10),
                     num_leaves=[50,100,150],
                     learning_rate=[0.1,0.2,0.3],
                     )

clf = RandomizedSearchCV(model_LGBM, distributions, random_state=0,n_iter=250,verbose=10)
clf.fit(X_train,y_train,eval_set=(X_test,y_test))

RandomizedSearchCV uses 5 set as a default for cv, is it formed from the training set?

$\endgroup$

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.