def cross_validation_accuracy(clf, X, labels, k):
"""
Compute the average testing accuracy over k folds of cross-validation. You
can use sklearn's KFold class here (no random seed, and no shuffling
needed).
Params:
clf......A LogisticRegression classifier.
X........A csr_matrix of features.
labels...The true labels for each instance in X
k........The number of cross-validation folds.
Returns:
The average testing accuracy of the classifier
over each fold of cross-validation.
"""
###TODO
pass
评论列表
文章目录