Bagging for Regression
The same panel of models at Ardwick Mutual is put to a different question. Instead of routing a claim, each model estimates what the repair will cost in pounds. Every model was trained on its own random resample of the past claims, so the estimates come back close but not identical, and the desk needs one number to put on the file. Nothing here says which model is the better one, so none of them is favoured.
Task: Print the single cost figure the panel settles on.
Input
The first line holds one integer m, the number of models on the panel. The second line holds m cost estimates separated by single spaces, one per model.
Output
One line holding the panel's figure rounded to 2 decimal places. It is the arithmetic mean of the m estimates: every estimate counts once and counts equally, including estimates that repeat and estimates that sit far away from the rest.
Example:
Input:
3
10 12 11
Output:
11.00
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