code_1.py 261 字节
Newer Older
ToTensor's avatar
ToTensor 已提交
1 2 3 4
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() # 随机森林模型