🎉 75% of content is free forever — Unlock Premium from $10/mo →
CW
💼 Servicesℹ️ About✉️ ContactView Pricing Plansfrom $10

Statistics 101: Mean, Median, Variance and Distributions

Module 4: Statistics and ProbabilityDescriptive Statistics🟢 Free Lesson

Advertisement

Statistics 101: Mean, Median, Variance and Distributions

Why Statistics Matters for Data Science

Statistics is the mathematical foundation of machine learning. Every ML algorithm is essentially a statistical model optimizing some objective function. Without understanding statistics, you cannot truly understand why models work or fail.

The Statistics → ML Pipeline

DescriptiveStatisticsInferentialStatisticsProbabilityTheoryStatisticalLearningMachineLearningDeepLearning

1. Measures of Central Tendency

Central tendency describes the "center" or "typical value" of a dataset.

Mean (Arithmetic Average)

Formula:

Mean: Balance Point of Data2571012141619Mean = 11.5x̞ = (2+5+7+10+12+14+16+19) / 8 = 11.5

Median (Middle Value)

The median is the value separating the higher half from the lower half of a data sample.

Formula:

Median: The Middle Value2x₍15x₍27x₍310x₍412x₍514x₍616x₍719x₍8Median = (10+12)/2 = 11n=8 (even), so average the 4th and 5th values

Mode (Most Frequent)

Mode: Most Frequent ValueCat3Dog7Bird2Fish5Rabbit7Snake1Mode = Dog and Rabbit (bimodal, frequency = 7)

2. Measures of Spread (Dispersion)

Variance and Standard Deviation

Population Variance:

Sample Variance (Bessel's Correction):

Standard Deviation:

Variance: Average Squared Deviation from Meanμ = 10616841001241416100

σ² = (16 + 4 + 0 + 4 + 16 + 0) / 6 = 40/6 = 6.67

σ = ⇚6.67 = 2.58

Negative deviationPositive deviationOn the mean

3. The Normal Distribution (Gaussian)

The most important probability distribution in statistics and ML.

Probability Density Function (PDF):

Where:

  • = mean (location parameter)
  • = standard deviation (scale parameter)
  • = variance
Normal Distribution: The Bell Curveμμ - σμ + σ68.27%within ±1σ95.45%within ±2σ99.73%within ±3σμ-3σμ-2σμ-σμμ+σμ+2σμ+3σ

Standard Normal Distribution (Z-Score)

Z-Score Transformation:

This transforms any normal distribution to the standard normal with and .

Z-Score: How Many Standard Deviations from Mean?IQ Scores: N(100, 15²)10070130Z = (X-μ)/σStandard Normal: N(0, 1)0-2+2IQ = 130 → Z = (130-100)/15 = +2.0 (top 2.3%)

4. Central Limit Theorem (CLT)

The most important theorem in statistics – explains why the normal distribution appears everywhere.

Central Limit Theorem:

Given a population with mean and standard deviation , the sampling distribution of the sample mean approaches a normal distribution as sample size increases:

Standard Error:

Central Limit Theorem in ActionPopulation(any shape)Take n samplescompute x̞n = 5n = 30n = 100

Key Insight: As n increases, the sampling distribution becomes more normal

σ̞ = σ/⇚n → Standard error decreases with ⇚n

Practical Impactn=1SE = σn=4SE = σ/2n=16SE = σ/4n=100SE = σ/10

5. Skewness and Kurtosis

Skewness (Asymmetry)

Skewness: Measuring Distribution AsymmetrySymmetricSkew = 0Right SkewedSkew > 0Left SkewedSkew < 0

Mean > Median → Right Skewed | Mean < Median → Left Skewed

Kurtosis (Tail Weight)

Fisher's Kurtosis:

  • Mesokurtic (γ₂ = 0): Normal distribution
  • Leptokurtic (γ₂ > 0): Heavy tails, sharp peak
  • Platykurtic (γ₂ < 0): Light tails, flat peak
Kurtosis: Comparing Tail BehaviorPlatykurtic (μ₞=2)Normal (μ₞=3)Leptokurtic (μ₞=8)Heavy tails →⅐ Heavy tails

Higher kurtosis = more outliers, fatter tails, sharper peak


6. Covariance and Correlation

Covariance

Covariance:

  • Cov > 0: Variables move together (positive)
  • Cov < 0: Variables move opposite (negative)
  • Cov = 0: No linear relationship

Pearson Correlation Coefficient

Pearson's r:

Correlation: Different Values of rr = -1 (Perfect)r = -0.5r = 0 (None)r = +1 (Perfect)r = +0.7 (Strong Positive)

Note: Correlation measures LINEAR relationship only. Non-linear patterns need other metrics.


7. Confidence Intervals

Confidence Interval for Mean:

Common Confidence Levels:

Levelz-scoreArea in Tails
90%1.6455% each side
95%1.9602.5% each side
99%2.5760.5% each side
95% Confidence Interval Visualizationx̞ = 50386295%2.5%2.5%

We are 95% confident that the true mean lies between 38 and 62


Key Takeaways

  1. Mean, Median, Mode describe central tendency – choose based on data shape
  2. Variance/Standard Deviation quantify spread – foundation of all ML loss functions
  3. Normal Distribution – the bell curve underlies hypothesis testing and CLT
  4. CLT – sample means are normal regardless of population shape (n ≈¥ 30)
  5. Correlation ≈  Causation – always consider confounding variables
  6. Confidence Intervals – quantify uncertainty in estimates

Next: Probability, Bayes' Theorem and PDF/CDF

Build on these foundations with probability theory and Bayesian inference.

Need Expert Data Science Help?

Get personalized tutoring, project support, or professional consulting.

Advertisement