'generator'类型的对象没有len()StratifiedKFold和GridSearchCV

时间:2017-12-04 09:47:17

标签: python machine-learning

    param_grid = { 

        'kernel' : ['linear', 'poly', 'rbf', 'sigmoid'],
        #'decision_function_shape': [ 'ovo', 'ovr' ],
        'C':[0.1,0.5,0.6, 0.7,1]
    }

    rfc = svm.SVC() 

    kfolds = StratifiedKFold(5)
    clf = GridSearchCV(rfc, param_grid, cv=kfolds.split(X,y))
    clf.fit(X, y)

我收到错误

  

'generator'类型的对象没有len()

请帮助我,问题是什么?

0 个答案:

没有答案