Skip to content
C

Problem 1: Perform Basic 5-Fold Cross-Validation

Easypython

Problem Description

Write a Python program that performs 5-Fold Cross-Validation on a Logistic Regression model, printing the scores for each fold and their mean.

Input

A labeled dataset.

Output

The 5 fold scores and their mean.

Constraints

  • At least 10 labeled examples.

Example Input

text
(A labeled binary classification dataset with 10+ examples)

Example Output

text
Fold scores: [0.9, 1.0, 0.8, 0.9, 1.0] Mean accuracy: 0.92

Concepts Covered

cross_val_score(), cv=5.

Input (stdin)

Output

Run your code to see output here...