Machine learning:-stratified K fold cross_validation

crossvalidation

#1

can anyone help me to find the error in below code:-

from sklearn.model_selection import StratifiedKFold
kfold = StratifiedKFold(y = y_train,n_folds = 5, random_state = 2017)

the error I am getting is:-

TypeError                                 Traceback (most recent call last)
<ipython-input-131-11a7246aa12f> in <module>()
      1 from sklearn.model_selection import StratifiedKFold
----> 2 kfold = StratifiedKFold(y = y_train,n_folds = 5, random_state = 2017)

TypeError: __init__() got an unexpected keyword argument 'n_folds'

#2

Use n_splits instead of n_folds.

from sklearn.model_selection import StratifiedKFold
kfold = StratifiedKFold(y = y_train,n_splits = 5, random_state = 2017)

Let me know if the issue if resolved.