Train a decision tree, logistic regression, k-NN or k-means model on your CSV, in your browser

Train a small machine-learning model on a CSV or Excel table: a decision tree (drawn for you), logistic regression, k-nearest neighbours or k-means clustering with an elbow plot. See train and test accuracy, a confusion matrix and per-class scores. Matches scikit-learn. Nothing is uploaded.

Keep it one tap away for everyday use.

Bookmark Small model trainer?

Press Ctrl + D now. Your browser opens its own bookmark box, where you choose the name and folder.

  1. Open data
  2. Model
  3. Train
  4. Test
Nothing is uploadedWorks offline once open

Your data

The example of 150 seedlings of three varieties is made up.

Model

Features

Text columns become one 0/1 column per value (up to 30 values). Rows with a gap in a used column are left out.

What it does

Try machine learning on your own table without installing anything. Open a CSV or Excel file, pick the column to predict, and train one of four classic models in a background worker, so the page stays responsive:

  • Decision tree (CART): a tree of yes/no questions, split by Gini impurity or entropy, with a maximum depth and a minimum number of rows per leaf. The tree is drawn for you, with each feature’s importance.
  • Logistic regression with L2 regularisation (strength set by C): two classes or more (softmax). The weights are listed per class.
  • k-nearest neighbours: Euclidean or Manhattan distance, equal or distance-weighted votes, with a chart of test accuracy for k from 1 to 30.
  • k-means clustering: no class needed. k-means++ starts with a seed, the best of 10 runs, an elbow plot of inertia for k = 1 to 10, the silhouette score, the cluster centres and a scatter plot of the clusters on any two features.

For the three classifiers the rows are split into training and test sets (stratified by class, with a seed), and you get training and test accuracy, the test accuracy’s 95 % interval, balanced accuracy, macro F1, Cohen’s kappa, the test confusion matrix and precision, recall and F1 per class.

How to use it

  1. Paste a table or open a CSV, TSV or Excel file (up to 20,000 rows and 40 columns).
  2. Choose the model and the class to predict.
  3. Tick the feature columns to use. Text columns become one 0/1 column per value; ID columns are left out by default.
  4. Set the test share and the seed, and the model’s own settings. Leave scale features on for logistic regression, k-NN and k-means: it turns every feature into z-scores (using the training rows; all rows for k-means), so a feature measured in large numbers does not dominate.
  5. Download the table with the predictions (or cluster numbers) as CSV, or the report as an image, PDF or Word file.

Worked example

The made-up example has 150 seedlings of three varieties (Amber, Birch and Cedar), with leaf length, leaf width, height and soil. With seed 42, 112 rows train and 38 test.

  • A decision tree of depth 3 has 7 leaves and splits first on leaf length (57.8 mm). Test accuracy is 78.9 % against 92.0 % on the training rows: a sign of overfitting, which the page points out.
  • Logistic regression with C = 1 scores 94.7 % on the test rows (89.3 % training). Leaf length has the largest weights: −1.921 for Amber and 1.481 for Cedar.
  • k-NN with k = 5 scores 84.2 %.
  • k-means with k = 3 on all five features gives clusters of 41, 64 and 45 rows, inertia 282.8 and silhouette 0.419. Untick the soil columns and the clusters follow the varieties more closely.

How it was checked

Each model follows scikit-learn’s definitions, and was compared with scikit-learn 1.9 on the example and two generated data sets: tree splits, thresholds, feature importances and predictions; logistic regression weights (to six decimal places); k-NN predictions for 12 settings; k-means inertia, silhouette and clusters. Where two splits of a tree are exactly as good, scikit-learn picks one at random and this tool takes the first feature, so a deep tree can differ from scikit-learn’s while being just as good.

What it does not do

No regression (predicting a number), no hyper-parameter search or cross-validation, no neural networks, and no saving of the model. For honest scores, set the settings by cross-validation on the training rows (see the train/test splitter) and use the test rows once.

Frequently asked questions

Is my data uploaded? No. The model is trained in your browser, in a worker, and nothing is stored or sent anywhere.

Why is training accuracy higher than test accuracy? The model has learnt some noise of the training rows. Lower the tree depth, lower C, or raise k.

Where the numbers come from

  • Algorithms as defined in scikit-learn (DecisionTreeClassifier, LogisticRegression, KNeighborsClassifier, KMeans with greedy k-means++, silhouette_score, StandardScaler); checked against scikit-learn 1.9 on the example and two make_classification data sets.
  • The example of 150 seedlings of three varieties is made up for this tool.

Standard scientific values, such as constants, atomic weights and melting points, are facts found in every textbook; we name where ours were checked. If you are an author or publisher and want a value, a credit or a table changed or removed, tell us and we will act quickly.

Last updated 2026-11-09.

Related tools

CSV and Excel data profiler #568 Open a CSV or Excel file and see every column at a glance: its type, missing values, unique values, mean, median, SD, quartiles, outliers, histogram or most common values, plus a correlation heatmap. Download the report as a web page, PDF or Word file. Nothing is uploaded. Confusion matrix and metrics calculator #570 Type four counts, paste a confusion matrix, or open a file of actual and predicted classes. Get accuracy, precision, recall, F1 (macro, micro and weighted), specificity, balanced accuracy, MCC and Cohen's kappa, with 95 % confidence intervals. Matches scikit-learn. Nothing is uploaded. Dataset train/test splitter and stratifier #571 Split a CSV or Excel table into training, test and validation sets: random, stratified by class, grouped (whole patients or sites together) or by time, or give every row a k-fold number. Set a seed, check the class balance and download each part as CSV. Nothing is uploaded. Embedding visualiser (PCA and t-SNE) #572 Turn a table of numbers (up to 2,000 rows) into a two-dimensional map with PCA and exact t-SNE, coloured by a label column. See the explained variance, loadings, scree plot, KL divergence and how well neighbours are kept. Matches scikit-learn. Nothing is uploaded. CSV profiler and SQL playground #38 Open CSV, TSV or Excel files and get a profile of every column: type, missing values, distinct values, range and most common values. Then query them with SQL (SQLite), join files, and download the result. Nothing is uploaded. 1D Schrödinger solver #923 Choose a textbook potential, type a formula or draw your own, and get the lowest energy levels and wavefunctions of the one-dimensional Schrödinger equation by the matrix (finite-difference) method, with the exact levels alongside for the box, harmonic oscillator, finite well, Morse, linear and Pöschl–Teller potentials.