现在通过 kaggle 教程,虽然我从查看输出和阅读文档中了解了它的基本概念,但我想我需要确认这里发生了什么:
predictors = ["Pclass", "Sex", "Age", "SibSp", "Parch", "Fare", "Embarked"]
kf = KFold(titanic.shape[0], n_folds=3, random_state=1)
predictions = []
for train, test in kf:
train_predictors = (titanic[predictors].iloc[train,:])
我的主要问题是iloc
函数的最后一行。其余的只是为了上下文。它只是将训练数据拆分?