Skip to content

K-Fold Sample Counts

Count larger and smaller validation folds and their training sizes without losing remainder samples or claiming to select an optimal fold count.

Use this result well

Inputs that matter
Total samples, Number of folds
Output to expect
Validation fold sizes
  • Check the units and required inputs before comparing results.
  • Keep the assumptions with a copied result so you can reproduce the calculation later.
Was this tool helpful?

Reference & details

How it works

K-fold sample counts with remainder folds

q = floor(N/k), r = N mod k; r validation folds contain q+1 samples, and k−r contain q. Each training fold contains N minus its validation size Ordinary K-fold counts, following the larger-first remainder convention. GroupKFold, stratified, time-series and repeated validation may use different allocations. This neither chooses k nor estimates validation accuracy or uncertainty. Model selection reuses validation results; a final assessment must respect the chosen evaluation design.

Updated: September 2026

Example Scenarios

Show the larger and smaller fold counts for ordinary K-fold splitting when the sample count is not divisible by the chosen number of folds.

Common Mistakes to Avoid

Applying k-fold sample counts with remainder folds outside its stated assumptions

GroupKFold, stratified, time-series and repeated validation may use different allocations. This neither chooses k nor estimates validation accuracy or uncertainty. Model selection reuses validation results; a final assessment must respect the chosen evaluation design.

FAQ

Whole samples cannot always be divided equally; the remainder goes into one-sample-larger folds.

Once each across one complete ordinary K-fold pass. Each individual training fold excludes its validation rows.

About K-Fold Sample Counts

Count larger and smaller validation folds and their training sizes without losing remainder samples or claiming to select an optimal fold count. Choose the mode that matches your measurements or study design, enter the stated units and keep the method and limits with the result.