Skip to content
ml-recall

#model-instances

1 question from Learning Theory

Timed test

1 question · 1 min · score and explanations at the end

Take a test
Q 1 / 1Score 0 / 0

Question 1: Single choice

mediumAI-checkedLearning Theory

What is wrong with this 5-fold cross-validation of a PyTorch network? (train runs some epochs of SGD on the given data, starting from the model's current weights.)

model = make_model()
scores = []
for train_idx, val_idx in KFold(n_splits=5, shuffle=True).split(X):
    train(model, X[train_idx], y[train_idx])
    scores.append(evaluate(model, X[val_idx], y[val_idx]))
print(sum(scores) / len(scores))
Choose one option