Skip to content
ToolUlkaa Tool
All tools

Machine Learning

TensorFlow PlaygroundConfusion Matrix CalculatorROC Curve and AUC CalculatorK-Means Clustering VisualizerGradient Descent VisualizerDecision Tree BuilderClassifier PlaygroundPCA VisualizerActivation Function Plotter

Categories

AcademicTextMathematicsStatisticsMachine LearningAIData ScienceFile
All tools
Machine Learning

K-Fold Cross-Validation Calculator

Split the data into folds, test each in turn, and read the accuracy per fold.

Algorithm
Try:
View
1 to 50
2 to 10
Class to add when you tap the plot

5-fold cross-validation accuracy

100% ± 0

Each fold is held out once as the test set while the model trains on the rest, so every point is tested exactly once on a model that never saw it. The number after the plus-minus is the spread between folds.

Points
120
Classes
3
Algorithm
k-nearest neighbours

Data and boundary

  • Class 1
  • Class 2
  • Class 3

A new point takes the majority class of its k closest training points. Small k follows the data closely (jagged, can overfit); large k smooths the boundary. Tap the plot to add points (dataset: Three blobs).

Accuracy per fold

FoldTrain rowsTest rowsAccuracy
19624100%
29624100%
39624100%
49624100%
59624100%
Mean100%
Standard deviation0 points
  1. Tools
  2. Machine Learning
  3. Classifier Playground
  4. K-Fold Cross-Validation Calculator

About K-Fold Cross-Validation Calculator

This k-fold cross-validation calculator splits your points into folds with a fixed shuffle, trains the chosen classifier on all but one fold, tests on that fold and repeats for every fold. It is free, needs no sign-up and runs in your browser, so nothing you enter is uploaded.

Each fold is the test set exactly once, so every point is tested on a model that never saw it, and the mean of the fold accuracies is a more honest estimate of future performance than training accuracy. The table lists the train and test sizes and the accuracy of each fold, then the mean and the standard deviation.

The page opens on three blobs with kNN and five folds. Change the folds, algorithm or dataset and compare. A standard deviation that is large relative to the gap between two algorithms means the data cannot tell them apart.

How to use K-Fold Cross-Validation Calculator

  1. 1Choose an algorithm: k-nearest neighbours, logistic regression or Gaussian naive Bayes.
  2. 2Load a dataset (blobs, moons, circles or XOR), or clear the points and tap the plot to add your own. Choose which class a tap adds.
  3. 3Set the algorithm's option: k for nearest neighbours, or the polynomial degree for logistic regression.
  4. 4Look at the coloured regions. Each cell takes the colour of the class the model predicts there.
  5. 5Switch the view to Cross-validation, choose the number of folds, and read the accuracy per fold and the mean.
  6. 6Compare algorithms and settings on the same data using the mean cross-validation accuracy, not the training accuracy.

Features

  • Three classic classifiers written from scratch: kNN, softmax logistic regression and Gaussian naive Bayes.
  • Decision-region canvas that scales to your screen and accepts taps to add points.
  • Polynomial features of degree 1 to 3 for logistic regression, so it can learn curved boundaries.
  • Five datasets, up to three classes and up to 800 points.
  • k-fold cross-validation from 2 to 10 folds with a per-fold accuracy table, mean and standard deviation.
  • Repeatable results: folds are shuffled with a fixed seed.

Cross-validation estimate

The estimate is the mean accuracy over the k folds, and the spread is the sample standard deviation.

CV accuracy = (1 / k) x sum of accuracy_i
sd = sqrt( sum of (accuracy_i - mean)^2 / (k - 1) )

Worked examples

  • kNN (k = 5) on three blobs, 5 folds → gives mean 100%, sd 0 points

    Fold accuracies: 100%, 100%, 100%, 100%, 100%.

Privacy: how it works

  • The points and the models stay in your browser tab. Nothing is sent to Ulkaa or anyone else.

Tips

  • Try k = 1, then k = 15, on the moons data and compare the boundary: small k is jagged, large k is smooth and may cut corners.
  • Add a single stray point of the wrong class inside a cluster and watch kNN with small k carve a tiny island around it.
  • On XOR, naive Bayes and plain logistic regression stay near chance, while kNN and polynomial logistic regression do well.
  • Use at least 10 points per class for cross-validation, or fold accuracies jump in large steps.

Frequently asked questions

Is it really free?

Yes. There is no price, no trial and no credit card. Ulkaa Tool does the work with your own device, so there is no server bill to pass on to you.

Do I need an account?

No. There is no sign-up and no login. Open the page and use it. An Ulkaa account is not needed for anything on this tool.

Does it run in my browser?

Yes. Your points are processed by code running in your browser tab, on your own device.

Is my data uploaded?

No. Your points are never sent to Ulkaa or to anyone else. You can check this yourself by watching the Network tab in your browser developer tools while you use the tool.

What is k-fold cross-validation?

A way to estimate how well a model generalises. The data is split into k folds, and each fold in turn is used as the test set while the model is trained on the others.

Why use cross-validation instead of a single test split?

It uses all the data for both training and testing and averages out the luck of one particular split, which matters when data is scarce.

More Classifier Playground pages

  • Classifier PlaygroundDraw points, pick an algorithm and watch the decision boundary, then check it with cross-validation.
  • KNN Classifier VisualizerWatch the nearest-neighbour decision regions change as you vary k.
  • KNN Overfitting With Small KSet k to 1 on noisy moons and see the jagged boundary and the 100% training score.
  • Logistic Regression VisualizerWatch a straight logistic regression boundary separate two classes.
  • Logistic Regression Decision BoundarySee how polynomial features let logistic regression separate a ring from its core.
  • Naive Bayes Classifier VisualizerSee the smooth regions of a Gaussian naive Bayes model on three clusters.
  • Gaussian Naive Bayes on XORRun naive Bayes on a pattern it cannot learn, and compare it with kNN.
  • Cross-Validation for Logistic RegressionCheck a polynomial logistic regression on unseen folds of the two moons data.

Ulkaa Apps

  • Ulkaa
  • Calendar
  • Task
  • Note
  • Disk
  • Call
  • Contact
  • Mail
  • Finance
  • Health
  • Office
  • Work
  • Workspace
  • Halum
  • Jaal
  • Islam
  • Game
  • Weather
  • Campus
  • News
  • Developer
  • Help
  • Account
About·Privacy·Terms·© 2026 Ulkaa

What is Ulkaa Tool?

Ulkaa Tool is a free collection of fast, privacy-friendly online tools from Ulkaa Network. Calculate your GPA and CGPA, edit rich text, count words and characters, replace text and more — all in your browser.

Every tool runs entirely in your browser — no sign-up, and your data never leaves your device.

Academic

  • GPA Calculator
  • CGPA Calculator
  • Citation Generator
  • Quiz Maker

Text

  • Rich Text Editor
  • Word Counter
  • Character Counter
  • Text Replacement

Ulkaa

  • Ulkaa
  • Ulkaa News
  • Ulkaa Campus
  • Ulkaa Tool
  • Ulkaa Game
  • Ulkaa Weather
  • Ulkaa Islam

Company

  • About Ulkaa
  • Careers
  • Support
  • Help
  • Privacy Policy
  • Terms of Service
  • Disclaimer
  • Sitemap

© 2015-26, Ulkaa. All rights reserved.
Facebook PageLinkedIn CompanyX (Twitter) ProfileInstagram ProfileGitHub Account