# What is the objective that is optimized with Random Search?

I have recently learned about Random Search (or sklearn.model_selection.RandomizedSearchCV in Python) and was thinking about the theory behind the optimization process. In particular my question is, given that one performs Random Search on a certain algorithm (let's say random forest), what are the best hyperparameter based on? More specifically in what sense are they the "best" hyperparameters for the model? Do they maximize accuracy of the model? If not what is the (performance-)criterion that is optimized? Or is it entropy/gini?

According to the documentation, the function RandomizedSearchCV accepts a scoring string that can take any value from this table and you can even implement your own custom scorer depending on what your goal is.
The default parameter is None in which case it uses the models score function that is defined to:
• If you follow my link for the table, you can see that one of the listed scoring classification function choices is called "f1", thus just pass the string 'f1' to RandomizedSearchCV along with the random forest – A Kareem May 2 '20 at 1:26