scikit-learn Playground: compare machine learning models on your CSV online
Find out which machine learning model predicts your data best, in about a minute and without writing code. Upload a spreadsheet saved as CSV, choose the column you want to predict, and this free scikit-learn (sklearn) playground trains logistic regression, a decision tree and gradient boosting side by side, scores each one fairly and shows which columns drive the result.
Then predict single rows or a whole file, or copy ready-to-run Python code. Your data never leaves your browser.
Try an example:
1Data
| Column | Use as | Type | Values | Missing |
|---|
2Compare models
Starting Python…| Model | Cross-validated | Check rows | Training rows | Time |
|---|
3One model up close
Settings
Which columns matter
After training: how much the score drops when each column is shuffled.
Results on the check rows
Compare the models to see how each does on rows it never saw.
The tree's rules
4Try it
After training, type values here to get a prediction.
5Take it to Python
Your CSV is read and every model is trained inside this browser tab. Nothing is uploaded.
About the scikit-learn Playground
scikit-learn is the most widely used Python library for machine learning on tables. This playground runs it in your browser, so you can find out which kind of model suits your CSV without installing Python or writing code, and then take the matching code with you.
What you can do with it
- Predict a yes/no outcome from a spreadsheet: customer churn, lead conversion, loan default, pass or fail.
- Estimate a number: house prices, delivery times, monthly sales.
- Find which columns matter most for an outcome before building anything bigger.
- See whether a simple, explainable model is good enough, or whether gradient boosting is worth it.
- Teach or learn machine learning: cross-validation, baselines and overfitting on real data.
- Start a Python project with scikit-learn code that already matches your columns.
Start with a sample: Customer churn and House prices are ordinary tables with numbers and categories; Two moons, Circle and Spiral show where a straight line fails and trees do well.
How to compare machine learning models on a CSV
- Open a CSVOr pick a sample. Each row is one example; the first row holds the column names.
- Choose what to predictSet one column to “Predict this”. Text or a few whole numbers make it classification; other numbers make it regression.
- Compare three modelsLogistic (or linear) regression, a decision tree and gradient boosting are each trained on the same rows, with the same cleaning.
- Cross-validateThe training rows are split into folds; each fold is scored by a model trained on the others, so the score is not luck of one split.
- Check on unseen rowsRows kept aside from the start give the final score, next to a “no model” baseline.
- Look closerPick a model to see its confusion matrix, which columns it relies on, and for the tree, its rules.
- Take it to PythonCopy the matching pandas + scikit-learn code, or download the fitted model.
The three models
| Model | How it works | Good for | Settings |
|---|---|---|---|
| Logistic regression / ridge | A weighted sum of the inputs, squeezed into a probability for classification. | A fast baseline that is easy to explain; works when the effect of each column is roughly steady. | Regularisation C (or alpha) |
| Decision tree | A chain of yes/no questions such as “plan = basic?” and “age ≤ 31?”. | Rules you can read and check; handles interactions between columns. Overfits easily if it grows deep. | Max depth, min rows per leaf |
| Gradient boosting | Hundreds of small trees, each correcting the errors of the ones before (HistGradientBoosting). | Usually the most accurate model on spreadsheet-style data, and fast. | Learning rate, max trees, tree depth |
How your columns are prepared
- Number columns: missing values and stray text (“unknown”, “n/a”) become the median of the training rows; for logistic regression they are also scaled.
- Category columns: each value becomes its own 0/1 input (one-hot), up to 50 values; missing is its own value; values never seen in training are ignored.
- ID columns and columns with one value are left out for you; you can change any column’s role or type in the table.
- All of it is learned from the training rows only, inside the pipeline, so cross-validation and check scores are honest.
Glossary
- Accuracy
- The share of rows whose class is predicted correctly.
- R²
- For numbers: 1 is perfect, 0 is no better than always predicting the average, below 0 is worse.
- Mean absolute error
- The average size of a miss, in the units of the column you predict.
- Confusion matrix
- A table of true values against predicted values: the diagonal is right, everything else shows which classes get mixed up.
- Precision and recall
- For one class: precision is how many of the rows predicted as that class really are; recall is how many of the rows of that class were found.
- Permutation importance
- How much the score drops when one column’s values are shuffled. A big drop means the model relies on that column.
- Overfitting
- Learning the training rows by heart: a high training score and a much lower check score.
- Pipeline
- The cleaning steps and the model as one object, so new rows get exactly the same treatment.
Questions
How can I run scikit-learn online without installing Python?
Open this page: scikit-learn is ready in your browser after a few seconds, with nothing to install and no account. Load a CSV, choose the column to predict and press Compare. When you want to continue in your own Python, copy the generated code.
Can I do machine learning on a CSV file without coding?
Yes. Everything here works with clicks: choose which columns are inputs and which one to predict, compare three models, try predictions and download predictions for a whole file. The code is there only if you want it.
Why does it take a few seconds to start?
The machine learning libraries load into your browser when the page opens: around ten seconds on a laptop, a little longer on a phone, and quicker on later visits. You can look at your data meanwhile.
Is my CSV uploaded anywhere?
No. The file is read by your browser and every model is trained in this tab. Nothing is sent to TinyPDF or anyone else.
Decision tree, gradient boosting or logistic regression: which is best?
Use the one with the best score on the check rows, unless a simpler one is nearly as good: a decision tree or logistic regression you can explain beats a slightly more accurate black box in many settings. Gradient boosting usually wins on accuracy.
What is cross-validation?
A fairer score. The training rows are cut into, say, 5 parts; the model is trained 5 times, each time on 4 parts and scored on the fifth. The average says how the model does on rows it did not see, and the ± shows how much it varies.
What do the check rows add?
They are kept out of everything, cross-validation included, and scored once at the end, like brand-new data. If the check score is far below the cross-validated score, the data may be small or uneven.
How is this different from the TensorFlow Playground?
The TensorFlow Playground trains one neural network and shows how it learns, epoch by epoch. This page compares three classic models in one click. On spreadsheet-style data, gradient boosting here is often more accurate than a small neural network, and the decision tree is easier to explain.
Can I use the model in my own Python code?
Yes. Download the model as a .pkl file and load it with pickle in the same scikit-learn version, or copy the generated code, which rebuilds the same pipeline with pandas and scikit-learn.
How big a file can it handle?
Up to 100,000 rows. Gradient boosting on tens of thousands of rows takes seconds; larger files and 10-fold cross-validation take longer. Stop cancels a run at any time.
Built on scikit-learn (BSD-3-Clause) and other open-source software; not made by or affiliated with the scikit-learn project. See open-source licences.
