Calculator
Paste numeric data (rows = observations, columns = features), or upload a CSV. Works best up to about 50 features for fast results.
Example data table
This sample contains four features with ten observations. Try extracting components and exporting the scores.
| Height | Weight | Age | Income |
|---|---|---|---|
| 170 | 65 | 28 | 42000 |
| 165 | 59 | 31 | 39000 |
| 180 | 78 | 26 | 52000 |
| 175 | 70 | 29 | 48000 |
| 160 | 55 | 35 | 36000 |
Formula used
Let X be an n × p data matrix. After scaling, we compute the covariance matrix: Σ = (1/(n−1)) · XᵀX.
PCA finds eigenpairs Σvᵢ = λᵢvᵢ. Each vᵢ is a component direction and λᵢ is its variance. Explained variance ratio is λᵢ / Σⱼ λⱼ.
Scores (new features) are computed by projecting data onto the first k eigenvectors: Z = X · Vₖ.
How to use this calculator
- Paste your dataset or upload a CSV file.
- Enable Header row if the first row contains names.
- Choose a missing-value policy, then select a scaling method.
- Pick a variance target or keep a fixed number of components.
- Press Submit to view variance, weights/loadings, and scores.
- Use the export buttons to download CSV or PDF.
How PCA compresses information
Principal component analysis converts many correlated features into a smaller set of orthogonal components. This calculator computes components from your cleaned dataset and returns scores that can replace the original columns. The first component captures the greatest share of variance, and later components capture remaining variance without duplicating earlier directions. When you keep only the top components, you reduce noise, improve stability, and simplify downstream interpretation.
Scaling decisions that matter
PCA is sensitive to feature scale. If height is measured in centimeters and income in dollars, unscaled covariance will emphasize income. Standardization (z-score) makes each feature contribute equally, while center-only preserves original units but favors large-variance variables. Min–max scaling is useful for bounded sensors, and robust scaling using median and IQR can reduce the effect of outliers.
Variance targets and component counts
A variance target selects the smallest number of components whose cumulative explained variance meets your threshold. For exploratory work, targets like 80–95% often provide strong compression while keeping most structure. For strict dimensionality limits, choose a fixed k and compare cumulative variance across runs. The variance table shows eigenvalues, explained percentages, and cumulative percentages for fast decisions.
Reading weights and loadings
Weights are eigenvector entries that define each component as a weighted combination of scaled features. Large absolute weights indicate strong influence on that component’s direction. Loadings multiply weights by the square root of the eigenvalue, aligning magnitude with component variance. Use loadings when you want a variance-aware view of feature contribution, and use weights when you want pure direction.
Using exported scores in practice
Scores are the transformed features used in modeling, clustering, or visualization. Download the scores CSV and join it back to identifiers in your workflow. If you plan to train models, fit scaling and PCA consistently on training data and apply the same parameters to new data. The exported weights or loadings help you document what each component represents and support reproducible reporting. For dashboards, the summary PDF provides a concise snapshot of settings, components kept, and key eigenvalues. Combine it with variance and loading exports to explain dimensionality choices to reviewers and collaborators across iterations very clearly.
FAQs
What kind of input data should I use?
Use a numeric table where rows are observations and columns are features. Include a header row for names. Remove text fields, or place identifiers as row labels using the row-label option.
Should I choose covariance or correlation?
Use covariance when features are already comparable in scale. Use correlation when units differ or scales vary widely, because it standardizes features automatically and emphasizes shared patterns rather than magnitude.
How many components should I keep?
Start with a variance target such as 90–95% for general compression. If you need a strict dimension, choose a fixed k and confirm that cumulative variance remains acceptable for your purpose.
What do weights and loadings mean?
Weights define the direction of each component as a combination of scaled features. Loadings scale those weights by component variance, helping interpretation. Larger absolute values indicate stronger feature influence for that component.
Are the exported scores ready for modeling?
Yes. Scores are the transformed features in component space. Use them in regression, classification, clustering, or plotting. For production use, apply the same scaling and component weights to future data consistently.
Why might my results differ from other tools?
Differences can come from scaling choices, missing-value handling, covariance versus correlation basis, or numerical tolerances. Align these settings across tools to match results more closely.