I'm trying to split the data set using the stratified k-fold and multinomial logistic regression but I got the mentioned error when I use this code:
i=1
for train_set,test_set in skf.split(x,y):
print('{} of SKFold {}'.format(i,skf.n_splits))
xtr,xvl = x.iloc[train_set],x.iloc[test_set]
ytr,yvl = y.iloc[train_set],y.iloc[test_set]
#model
model.fit(xtr,ytr)
score = roc_auc_score(yvl, model.predict(xvl), multi_class='ovr')
print('ROC AUC score:',score)
cv_score.append(score)
pred_test = model.predict_proba(x_test)[:,1]
pred_test_full +=pred_test
i+=1
The value 'model' is as follows:
model = LogisticRegression(random_state=0, multi_class='multinomial',
penalty='none', solver='newton-cg').fit(x_train, y_train)
What should I do to fix this?