Formula Used
Population variance: σ² = Σ(xᵢ − μ)² / N
Sample variance: s² = Σ(xᵢ − x̄)² / (n − 1)
Standard deviation: σ = √σ² or s = √s²
Variance measures squared spread around a feature mean. Population variance divides by N. Sample variance divides by n minus one.
How to Use This Calculator
- Paste numeric feature columns or upload a dataset.
- Select headers, delimiters, and missing-value handling.
- Choose preprocessing and the filtering variance basis.
- Enter a global or feature-specific threshold.
- Calculate, inspect charts, and export the results.
Example Dataset
| Feature_A | Feature_B | Feature_C | Feature_D |
|---|---|---|---|
| 10 | 1 | 100 | 5 |
| 12 | 1 | 105 | 6 |
| 9 | 1 | 110 | 5 |
| 11 | 1 | 98 | 7 |
Feature_B is constant and has zero variance. It is usually removable before model training. Other features require model-aware evaluation.
Understanding Feature Variance
Low variance means a feature changes very little. Constant features provide no separation between observations. Near-constant features may offer limited information.
Variance filtering does not use the target variable. It is an unsupervised feature-selection method. Predictive value still requires supervised validation.
Scaling directly changes variance values. Standardized nonconstant features approach variance one. Apply thresholds after choosing a consistent preprocessing method.
Frequently Asked Questions
1. What is feature variance?
Feature variance measures numerical spread around the mean. Larger values indicate wider dispersion. It does not prove predictive importance.
2. Why remove zero-variance features?
Zero-variance features contain one repeated value. They cannot distinguish observations. Removing them reduces unnecessary model inputs.
3. What is near-zero variance?
Near-zero variance describes very limited feature movement. A threshold defines what counts as limited. Domain context should guide removal.
4. Should I use sample or population variance?
Use population variance for the complete working dataset. Use sample variance for sampled observations. Sample variance applies Bessel's correction.
5. Does scaling affect variance?
Yes, scaling changes numerical spread. Z-score scaling makes nonconstant population variance near one. Thresholds must match preprocessing choices.
6. Can high variance mean high importance?
No, high variance only describes spread. A noisy feature can vary greatly. Validate importance using model performance and target relationships.
7. How are missing values handled?
You can ignore, reject, or replace them. Available replacements include mean, median, zero, and custom values. Each choice affects variance.
8. Can categorical features be analyzed?
Categorical values require suitable numerical encoding first. Variance on arbitrary labels can mislead. Use encoding aligned with feature meaning.
9. When should variance filtering be used?
Use it during early preprocessing and data audits. It quickly removes constant columns. Follow it with supervised feature evaluation.