def printing_Kfold_scores(x_train_data,y_train_data):
fold = KFold(5,shuffle=False)
print(fold)
#C——正则化强度
c_param_range = [0.01,0.1,1,10,100]
results_table = pd.DataFrame(index = range(len(c_param_range),2), columns = ['C_parameter','Mean recall score'])
results_table['C_parameter'] = c_param_range
j = 0
for c_param in c_param_range:
print('-----------------------------------')
print('C parameter: ', c_param)
print('-----------------------------------')
print('')
recall_accs = []
for iteration, indices in enumerate(fold,start=1):
提示报错:
<ipython-input-36-a4982f6777fc> in printing_Kfold_scores(x_train_data, y_train_data)
16
17 recall_accs = []
---> 18 for iteration, indices in enumerate(fold,start=1):
19
20 #逻辑回归模型TypeError: 'KFold' object is not iterable
添加回答
举报
0/150
提交
取消