All problems

Summarizing Cross-Validation Scores

mediumPythonModel Validation

The cross-validation run has finished and Halewood Analytics now holds one accuracy score per fold — one score from each turn a fold spent as the unseen part. A single fold's score on its own is noisy, because that fold may simply have caught an easy slice of the data. The review sheet therefore carries two figures: the level the model scored at across the folds, and how far the individual fold scores sat from that level.

Task: Print the average fold score, then how much the fold scores vary around it.

Input

The first line holds one integer k, the number of folds. The second line holds k accuracy scores separated by single spaces.

Output

Two lines. First mean, a space, and the average score. Then std, a space, and the standard deviation of the fold scores. Use the population standard deviation: the k scores in hand count as the whole collection, not as a sample drawn from a bigger one. Round both to 4 decimal places at printing time.

Example:

Input:
5
0.8 0.82 0.79 0.81 0.83

Output:
mean 0.8100
std 0.0141

Sign in to solve this problem

Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.

Sign in

Discussion

Sign in to join the discussion — reading is open to everyone.

Loading comments…