Is there easy way to grid search without cross validation in python?

后端 未结 4 1246
梦如初夏
梦如初夏 2020-12-13 14:06

There is absolutely helpful class GridSearchCV in scikit-learn to do grid search and cross validation, but I don\'t want to do cross validataion. I want to do grid search wi

4条回答
  •  抹茶落季
    2020-12-13 14:47

    One method is to use ParameterGrid to make a iterator of the parameters you want and loop over it.

    Another thing you could do is actually configure the GridSearchCV to do what you want. I wouldn't recommend this much because it's unnecessarily complicated.
    What you would need to do is:

    • Use the arg cv from the docs and give it a generator which yields a tuple with all indices (so that train and test are same)
    • Change the scoring arg to use the oob given out from the Random forest.

提交回复
热议问题