from sklearn.model_selection import Stratified KFold # 导入K折验证工具 from sklearn.model_selection import Grid Search CV # 导入网格搜索工具 kfold = Stratified KFold(n_splits=10) # 10折验证 rf = Random Forest Classifier() # 随机森林模型