I am trying to understand the concepts of stacking and blending in ensemble methods.I came across the below attached piece of code in python used for one of the Kaggle competitions:
I have a few questions:
1.The StratifiedFold function is creating a k-fold cross validation?
2.The clfs are storing all the classifiers to be applied??
3.In the part
for i, (train, test) in enumerate(skf):they are trying each classifier on each fold?So,if I have k_fold = 10 and number of classifiers as 4 then this loop runs 40 times??
4.I understand that in the last box:
clf.fit(X_train, y_train)fits the model.Do the results of each model for each iteration get saved in clf.fit??What is happening in the last 4 lines in the box.
I am sorry if these are very basic questions but I am new to ML(& python) and the thing is that I want to implement this in R.So any help is greatly appreciated.