Sitemap
NS Academy

NS Academy

What is the difference between variance and standard deviation?

1 min readJun 5, 2025

--

Press enter or click to view image in full size
What is the difference between variance and standard deviation?

1.Understanding Data Distribution

  • Helps to know how consistent or spread out the values are in a dataset.
  • For example, a high variance in user age could indicate a diverse user base.

2. Feature Selection

  • Features with very low variance might not be useful for machine learning models.
  • Data scientists often remove low-variance features during preprocessing.

3. Model Evaluation

  • In regression tasks, variance of residuals (errors) shows how well the model fits the data.
  • A high variance in residuals means the model has poor accuracy.

4. Normalization & Standardization

  • Standardization (z-score) uses mean and standard deviation to scale data.
  • z=x−μσz = \frac{x — \mu}{\sigma}z=σx−μ​
  • This is important for algorithms like KNN, SVM, and logistic regression.

Example in Python
import numpy as np

Get NS Academy’s stories in your inbox

Join Medium for free to get updates from this writer.

# Sample dataset: ages of users
data = [20, 22, 25, 30, 40, 100]

# Variance
variance = np.var(data)
print(“Variance:”, variance)

# Standard Deviation
std_dev = np.std(data)
print(“Standard Deviation:”, std_dev)

Output:
Variance: 674.166…
Standard Deviation: 25.96…

--

--