About PCA Visualizer
This PCA visualizer is free, needs no sign-up and runs in your browser, so your data is never uploaded. Paste a CSV with a header row, choose whether to standardise the columns, and the tool computes the covariance (or correlation) matrix, finds its eigenvalues and eigenvectors with the Jacobi method, and shows how much of the variance each principal component explains.
You get a scree chart with cumulative variance, a scatter plot of the rows projected onto any two components (coloured by a text column such as species when there is one), a table of eigenvectors and a table of loadings. Iris, a two-variable example and a made-up marks table are built in.
Principal component analysis finds the directions along which your data varies most, and re-expresses the data along them. It is used to reduce many correlated columns to a few, to visualise high-dimensional data in two dimensions, and to remove redundancy before another model. The tool shows each stage so that the method is not a black box.
How to use PCA Visualizer
- Pick a sample dataset, or paste your own CSV with a header row and at least two numeric columns.
- Decide on standardising. Turn it on when the columns are in different units, off when they share one.
- Read the variance explained by PC1 and the scree chart to see how many components matter.
- Choose which two components to plot, if you have more than two, and look at the projection.
- Open the covariance matrix, eigenvector and loading tables to see how each variable contributes to each component.
- Copy the component scores to use in a spreadsheet or another tool.
Features
- Covariance matrix, or correlation matrix when columns are standardised.
- Eigenvalues and eigenvectors by the Jacobi rotation method, sorted from largest to smallest.
- Explained and cumulative variance as a chart and a table.
- A projection scatter on any two components, coloured by a text column when one is present.
- Eigenvector and loading tables, with a stable sign convention.
- Component scores for every row, copyable as tab-separated text.
- Up to 5,000 rows and 30 numeric columns, with iris, a two-variable example and a marks table built in.
How PCA is computed
Subtract each column's mean (and divide by its standard deviation if standardising). Form the sample covariance matrix, dividing by n - 1. Its eigenvectors are the principal directions and its eigenvalues are the variances along them. The share of total variance explained by component i is its eigenvalue divided by the sum of all eigenvalues.
The score of a row on component i is the dot product of the centred row with the eigenvector. A loading is the eigenvector scaled by the square root of its eigenvalue; for standardised columns it equals the correlation between the variable and the component.
Sigma = (1 / (n - 1)) X^T X (X centred)
Sigma v_i = lambda_i v_i
explained_i = lambda_i / sum of lambda
loading_ji = v_ji sqrt(lambda_i)
score = X v_iWorked examples
Ten points of two variables, x and y gives eigenvalues 1.284 and 0.0491
PC1 explains 96.3% of the variance. Its eigenvector is (0.6779, 0.7352), pointing along the line the points lie close to.
Iris, four measurements, standardised gives PC1 73%, PC2 22.9%
Two components keep 95.8% of the variance. Without standardising, PC1 is 92.5%, because petal length has the largest raw spread.
Standardise or not
| Situation | Choose | Why |
|---|---|---|
| Columns in different units (cm, kg, years) | Standardise | Otherwise the column with the biggest numbers dominates |
| All columns in the same unit and scale | Do not standardise | Real differences in spread carry meaning |
| Columns of very different variance you want to keep | Do not standardise | Standardising would erase that signal |
| Unsure | Standardise | It is the safer default |
Good to know
Signs and rotations of components are arbitrary
If v is an eigenvector then so is minus v, so different tools can show the same component with the opposite sign. This tool makes the largest entry of each eigenvector positive so that results are stable from run to run. When you compare with another package, compare the explained variance and the shape of the plot, and expect an occasional flipped axis.
What PCA can and cannot do
PCA is linear: it finds straight directions of maximum variance, and it ignores any class labels. A direction with high variance is not necessarily the one that separates your groups. It is also sensitive to outliers, because variance is. The coloured projection here shows labels only for display; they are not used in the computation.
The Jacobi method is accurate and simple for the small symmetric matrices that PCA produces, here up to 30 by 30. For very wide data a library based on the singular value decomposition would be used instead.
Privacy: how it works
- Your table is parsed and analysed in your browser tab. Nothing is sent to Ulkaa or anyone else.
Tips
- A common rule of thumb is to keep enough components to explain 90 to 95% of the variance. The note under the result card tells you how many that is.
- Look for an elbow in the scree chart: components after it add little.
- Large loadings of the same sign mean the variables move together on that component; opposite signs mean a contrast between them.
- Remove ID columns and anything that is not a measurement before running PCA.
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 table are processed by code running in your browser tab, on your own device.
Is my data uploaded?
No. Your table 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 principal component analysis?
A method that rotates your data to new axes, the principal components, ordered by how much of the variance each captures. The first component is the direction of greatest spread.
How do I calculate PCA by hand?
Centre the data, compute the covariance matrix, find its eigenvalues and eigenvectors, sort by eigenvalue, and project the data onto the leading eigenvectors. This tool shows each of those results.
What is explained variance?
The share of the total variance that one component captures: its eigenvalue divided by the sum of all eigenvalues.
What is the difference between eigenvectors and loadings?
An eigenvector has length 1 and gives a direction. A loading is the eigenvector multiplied by the square root of its eigenvalue; for standardised data it is the correlation between a variable and the component.
Should I standardise my data before PCA?
Yes when columns have different units or scales, so no variable dominates just because its numbers are larger. Skip it when all columns share a unit.
Why is my first component not the one that separates my groups?
PCA maximises variance, not class separation. The best direction for separating groups may be a later component. A supervised method such as linear discriminant analysis targets separation.
What format does my CSV need?
A header row, then rows of values separated by commas, tabs or semicolons. Numeric columns are used. One text column, if present, colours the plot. Up to 5,000 rows and 30 numeric columns.
Why might my signs differ from another program?
An eigenvector and its negative describe the same direction. This tool makes the largest entry positive, other programs may not.
Popular PCA Visualizer pages
- PCA Covariance Matrix CalculatorSee the covariance matrix that PCA starts from, with its eigenvalues and eigenvector.
- Eigenvalue and Eigenvector Calculator for PCAGet the eigenvalues and unit eigenvectors of the covariance matrix of your data.
- PCA Explained Variance CalculatorSee how much variance each principal component explains, and how many you need.
- PCA With StandardizationRun PCA on standardised columns, so every variable has the same weight.
- PCA: PC2 vs PC3 PlotChoose any two components for the scatter, here the second and third.
- PCA on Two VariablesSee PCA at its simplest, with two variables and the correlation matrix.