Home / Science / Maths, statistics and computing / Data science and machine learning / Embedding visualiser (PCA and t-SNE)Tool #572

PCA and t-SNE plot maker: see your data in two dimensions, coloured by a label, in your browser

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.

Keep it one tap away for everyday use.

Bookmark Embedding visualiser (PCA and t-SNE)?

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

  1. Open data
  2. Settings
  3. Map
  4. Download
Nothing is uploadedWorks offline once open

Your data

The example of 120 readings from four machines is made up.

Settings

Number columns to use

PCA finds the straight directions with the most spread. t-SNE places similar rows near each other; perplexity is roughly how many neighbours each row pays attention to (5 to 50; it must be below the number of rows).

What it does

A table with many number columns is hard to picture. This tool draws it as a two-dimensional map, so you can see groups, gradients and odd rows at a glance, coloured by a label column such as a species, a machine or a diagnosis. It runs two classic methods in a background worker:

  • PCA (principal component analysis) finds the straight directions along which the rows spread most. You get the share of the variance each component explains (scree plot), the loadings (how much each column counts in each component) and a scatter plot of any two components.
  • t-SNE (exact, as in scikit-learn) places rows that are similar in the data close together on the map. It is often better than PCA at separating groups, at the cost of distances that are not to scale. You get the KL divergence it reached and two checks of how faithful the map is: trustworthiness and the share of each row’s 10 nearest neighbours that stay among its 10 nearest on the map.

How to use it

  1. Paste a table or open a CSV, TSV or Excel file of up to 2,000 rows.
  2. Pick the label column to colour by (or none) and tick the number columns to use.
  3. Keep standardise on unless all columns share the same units; otherwise the column with the biggest numbers dominates.
  4. For t-SNE, set the perplexity (roughly how many neighbours each row pays attention to: 5 to 50, below the number of rows) and the number of steps. Starting from PCA gives the same map every time; a random start uses the seed.
  5. Download the coordinates as CSV, or the report as an image, PDF or Word file.

A t-SNE of 2,000 rows takes about half a minute; the progress and the KL divergence are shown as it runs, and Stop cancels it.

Worked example

The made-up example has 120 readings from four machines (two presses, a lathe and a pump), each with temperature, vibration, current, noise, pressure and speed. Standardised, PC1 and PC2 explain 93.9 % of the variance (74.2 % and 19.6 %). PC1 weighs vibration, current, noise and pressure about equally (loadings 0.43 to 0.45) against speed (−0.378): it separates the fast lathe from the pump. The t-SNE map, at perplexity 30, ends with a KL divergence of 0.057 after 1,000 steps and a trustworthiness of 0.981. It keeps 77.1 % of each reading’s 10 nearest neighbours, against 67.3 % for the PCA map, and shows the four machines as four groups, the two similar presses side by side.

Reading the maps

  • In PCA, distances and directions mean something: rows far apart along PC1 differ in the columns with large PC1 loadings.
  • In t-SNE, only who sits next to whom matters. The size of a cluster and the gaps between clusters mean little, and different perplexities can give different-looking maps of the same data.
  • Neither method uses the label column: if the colours form clean groups, the number columns really do tell the labels apart.

How it was checked

PCA components, signs, explained variance and scores match scikit-learn exactly. For t-SNE, the neighbour probabilities, the KL divergence and its gradient match scikit-learn’s own functions, and a full run on the example and on generated clusters ends within 10 % of scikit-learn’s KL divergence with the same trustworthiness (scikit-learn computes in single precision, so the maps are not identical point by point).

What it does not do

No Barnes-Hut or UMAP (so no more than 2,000 rows), no 3-D maps, and no placing of new rows on an existing t-SNE map.

Frequently asked questions

Is my data uploaded? No. Everything is worked out in your browser, and nothing is stored or sent anywhere.

Why does the t-SNE map change when I change the perplexity? Perplexity sets how local the map is: small values stress tiny groups, large values the overall shape. Try two or three values.

Where the numbers come from

  • Methods as in scikit-learn: PCA (explained variance with n − 1, svd_flip signs) and TSNE(method='exact') with its perplexity search, early exaggeration, momentum and gains; trustworthiness as sklearn.manifold.trustworthiness. Checked against scikit-learn 1.9.
  • The example of 120 readings from four machines 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

Publication plot maker #27 Paste columns or open a CSV or Excel file and get a clean scientific figure with error bars, sized for a journal column. Download vector SVG or PDF, or PNG at 300 or 600 dpi. Your data stays in your browser. 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. Small model trainer #569 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. 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. 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.