All problems

Counting Nested Cross-Validation Fits

easyPythonModel Validation

Halewood Analytics needs an honest score for a model whose settings still have to be chosen. Choosing the settings and scoring the model on the same rows inflates the score, so the work is nested. An outer round of cross-validation holds one fold back for scoring; inside each of those rounds, a second cross-validation is run on the remaining rows to pick the settings, and that inner search tries every candidate setting on every one of its own folds. The bill for all this is machine time, and the desk wants it before the job is booked.

Task: Print how many times a model gets fitted across the whole nested run.

Input

One line holding three integers separated by single spaces: the number of outer folds, then the number of inner folds, then the number of candidate settings being tried.

Output

One line holding the total number of fits. Count one fit for each combination of an outer fold, an inner fold and a candidate setting, and count nothing else — no final refit on the outer training rows is included.

Example:

Input:
5 3 4

Output:
60

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…