TensorFlow Playground: train a neural network on your CSV online

Watch a neural network learn, step by step, on your own data. This free TensorFlow playground runs a real TensorFlow.js network in your browser: upload a spreadsheet saved as CSV, choose the column to predict, set the layers and learning rate, and see the loss, accuracy and decision boundary change with every epoch.

Then try predictions, export the model, or copy the matching Keras code. No install, no account, and your data never leaves your browser.

Try an example:

1Data

or or drop a CSV file on this box
ColumnUse asTypeValuesMissing

Data

×

Network

positive weightnegative weightthicker = larger

What the model learned

2Train

Loading TensorFlow.js…
Epoch0
Train loss–
Validation loss–
Validation accuracy–
Baseline–
Loss lower is better
Accuracy higher is better
training rowsvalidation rows

3Results

on validation rows

Train a model to see how well it does on rows it never saw.

4Try it

After training, type values here to get a prediction.

Same column names as the training file; a prediction column is added and the file downloads.

5Export


Your CSV is read and the model is trained inside this browser tab: nothing is uploaded. The only download is TensorFlow.js itself, once, from jsDelivr.

About the TensorFlow Playground

A neural network learns a pattern from examples. Give it rows where the answer is known, and it adjusts thousands of internal weights until its own answers match. This playground lets you do that with a real TensorFlow.js network on your own spreadsheet, and see each part: how the columns become numbers, what the network looks like, how the loss falls, and what the model ends up believing.

Start with a sample. Two moons, Circle and XOR show how hidden layers bend the decision boundary; Spiral needs a bigger network; Customer churn and House prices are ordinary tables with numbers and categories, like your own files.

How training a model on a CSV works

  1. Open a CSVOr pick a sample. Each row is one example; the first row holds the column names.
  2. Choose what to predictSet one column to “Predict this”. Text or a few whole numbers make it classification; other numbers make it regression.
  3. Choose the inputsEvery other useful column is an input. ID columns and constant columns are left out for you.
  4. Turn rows into numbersNumbers are scaled to mean 0 and spread 1; each category becomes its own 0/1 input; missing numbers get the average. All of it is learned from the training rows only.
  5. Build the networkHidden layers of neurons, an activation function, and an output: one sigmoid for yes/no, softmax for several classes, or a single number.
  6. TrainTensorFlow.js shows the rows to the network in small batches and nudges every weight downhill on the loss, epoch after epoch.
  7. Check on unseen rowsValidation rows were never trained on, so their loss and accuracy show how the model will do on new data.

What your CSV should look like

Header rowThe first row holds the column names. A file without names works too: if the first row is all numbers, the columns are called column_1, column_2 and so on.
SeparatorsComma, semicolon, tab or | between values, detected for you. Values containing the separator go in double quotes, as Excel and Google Sheets save them.
NumbersPlain numbers with a dot for decimals: 1234.5, -3, 2e-4. Values such as 1,234 or ₹500 are read as text; clean them first.
Missing valuesAn empty cell, NA, N/A, null, NaN, None or ? counts as missing. Numbers get the training average; in categories, missing becomes its own value.
SizeFiles up to 200 MB and 500,000 rows are read; up to 200,000 rows are used for training. Very wide one-hot data (hundreds of inputs) trains more slowly.
tenure_months,monthly_charges,contract,support_calls,churned
3,89.50,month-to-month,4,yes
41,55.20,two year,0,no
12,,one year,1,no

What the settings do

Hidden layers and neuronsMore neurons and layers can learn more complicated patterns, but train slower and overfit small datasets sooner. Start small: one or two layers of 8 to 16.
ActivationWhat each neuron does with its sum. ReLU is the usual default; Tanh gives smoother curves, good for small regression problems; Linear (none) turns the whole network into a straight line or plane.
Learning rateHow big each weight update is. Too low and the loss falls slowly; too high and it jumps around or grows. With Adam, 0.001 to 0.03 usually works.
OptimizerHow updates are made from the gradients. Adam adapts the step size for each weight and is the safe default; SGD is the plain method; RMSprop sits in between.
EpochsHow many times the whole training set is passed through. Stop when the validation loss stops falling.
Batch sizeRows used for each update. Small batches give noisy but frequent updates; large batches are smoother and faster per epoch.
L2 penaltyAdds the size of the weights to the loss, which keeps them small and the boundary smoother. Use it when training accuracy is far above validation accuracy.
DropoutSwitches off a share of hidden neurons at random in each training step, so the network cannot depend on any single one. Another cure for overfitting.
Validation rows and seedThe share of rows kept aside for checking, and the seed that decides which rows those are and the starting weights. Same seed, same split.

Reading the charts

Common mistakes

Machine learning glossary

Feature (input)
A column the model reads to make its prediction.
Target (label)
The column the model learns to predict.
Classification
Predicting one of a fixed set of values: yes/no, a species, a product category.
Regression
Predicting a number: a price, a temperature, a duration.
Loss
One number for how wrong the predictions are. Cross-entropy for classification, mean squared error for regression. Training makes it smaller.
Epoch
One pass over all the training rows.
Overfitting
The model learns the training rows by heart, noise included, and does worse on new rows. Seen as validation loss rising while training loss keeps falling.
Underfitting
The model is too simple or trained too little to capture the pattern: both training and validation scores stay poor.
Decision boundary
The line or curve where the model’s answer changes from one class to another.
One-hot encoding
Turning a category column into one 0/1 input per value, so that “Pune” is not treated as bigger than “Jaipur”.
Standardisation
Shifting and scaling a number column to mean 0 and spread 1, so that columns in large units do not drown out small ones.
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.
R²
For regression: 1 is perfect, 0 is no better than always predicting the average, below 0 is worse than that.

Questions

Is this the real TensorFlow?

Yes. The page uses TensorFlow.js 4.22, Google’s official JavaScript version of TensorFlow, loaded from jsDelivr. The network, the optimizer, backpropagation and the loss are TensorFlow’s own; the page builds a tf.sequential model of dense layers and calls model.fit, exactly as you would in your own code.

How is this different from playground.tensorflow.org?

The classic TensorFlow Playground by Daniel Smilkov and Shan Carter is a wonderful teaching tool on four built-in 2-D datasets, with its own small neural network library. This playground trains a real TensorFlow.js model on your own CSV file: many columns, numbers and categories, classification or regression, validation rows, a confusion matrix, predictions on new rows and a model you can download.

Is my CSV uploaded anywhere?

No. The file is read by your browser, and the model trains in this tab on your CPU or graphics card. Nothing is sent to TinyPDF or anyone else. The only download is TensorFlow.js itself, once.

How do I train a neural network on my CSV file?

Open the CSV with Open CSV…, or drop it on the Data box. Check that the column you want to predict says “Predict this” and that the inputs look right, then press Train. Loss and accuracy update after every epoch, and Results shows how the model does on rows it never saw.

Classification or regression: which do I need?

Classification when the answer is one of a few values (yes/no, a category, a grade); regression when it is a number on a scale (a price, a weight, a time). Auto picks classification for text columns and whole numbers with up to 10 values, and regression for other numbers. You can override it.

Why is my accuracy no better than the baseline?

Either the inputs do not say much about the target, or the network has not learned yet. Try more epochs, a higher learning rate, a larger network, and check that useful columns are set to Input. If the classes are very unbalanced, accuracy is a poor guide: look at recall per class in Results.

What does the decision boundary show?

The colour of each point in the background is what the model would predict for an example at that place. It is drawn for two number columns; other inputs are held at their average or most common value, so with many inputs it is one slice of the model.

Can I use the model in my own app?

Yes. Export downloads the model (model.json and a weights file) for tf.loadLayersModel, and preprocessing.json with the scaling and categories. “Use in JavaScript” shows the code that turns a row into inputs and gets a prediction. “Train in Python” gives the same network in Keras.

How do I get predictions for many rows?

After training, use Predict a whole CSV… under Try it. Give it a file with the same column names (the target column may be missing); it downloads the file with a prediction column, and a probability per class for classification.

Would a random forest or gradient boosting do better?

Often, on spreadsheet-style data. The scikit-learn Playground compares logistic regression, a decision tree and gradient boosting on the same CSV in one click, with cross-validation, so you can see whether a neural network is worth it.

How big a dataset can it handle?

Hundreds of thousands of rows of a few dozen columns train fine on a laptop, more slowly on a phone. Small networks are often faster on CPU than on the graphics card; Auto picks between them, and you can switch under Backend.

Built on TensorFlow.js (Apache-2.0). TensorFlow is a trademark of Google; this page is not made by or affiliated with Google. See open-source licences.