Skip to main content

Table of Contents


1. Introduction

Statistics is the science of collecting, organizing, analyzing, interpreting, and presenting data. In AI and Machine Learning, statistics helps to:
  • Understand datasets
  • Discover patterns
  • Build predictive models
  • Evaluate model performance
  • Make data-driven decisions

2. Population vs Sample

Example

Population
Sample

3. Types of Data

Numerical Data

Numeric values used for calculations. Examples
  • Age
  • Height
  • Weight
  • Salary

Continuous Data

Can take any value. Example

Discrete Data

Countable values. Example

Categorical Data

Represents categories. Examples
  • Gender
  • Department
  • Blood Group
  • Country

4. Levels of Measurement


5. Descriptive Statistics

Descriptive statistics summarize a dataset. Common measures include:
  • Mean
  • Median
  • Mode
  • Variance
  • Standard Deviation
  • Range
  • Quartiles

6. Measures of Central Tendency

Mean

Average of all observations.

Formula

xˉ=xin\bar{x}=\frac{\sum x_i}{n}

Python


Median

Middle value after sorting. Python

Mode

Most frequently occurring value. Python

7. Measures of Dispersion

Shows how spread out the data is.

Range

Formula Range=MaximumMinimumRange = Maximum - Minimum Python

Variance

Average squared deviation from the mean. Population Variance σ2=(xμ)2N\sigma^2=\frac{\sum(x-\mu)^2}{N} Sample Variance s2=(xxˉ)2n1s^2=\frac{\sum(x-\bar{x})^2}{n-1} Python

Standard Deviation

Square root of variance. Formula σ=σ2\sigma=\sqrt{\sigma^2} Python
Interpretation
  • High SD → More variation
  • Low SD → Less variation

8. Percentiles and Quartiles

Percentile

Indicates the percentage of observations below a value. Example
means
Python

Quartiles

Interquartile Range (IQR)

IQR=Q3Q1IQR = Q3 - Q1 Python

9. Outliers

Outliers are observations that are significantly different from the rest.

IQR Rule

Lower Bound Q11.5(IQR)Q1-1.5(IQR) Upper Bound Q3+1.5(IQR)Q3+1.5(IQR) Values outside these limits are considered outliers.

10. Skewness

Measures asymmetry of data. Python

11. Kurtosis

Measures tail heaviness.
  • High Kurtosis → More Outliers
  • Low Kurtosis → Fewer Outliers
Python

12. Covariance

Measures whether two variables move together. Positive Covariance
Negative Covariance
Formula Cov(X,Y)Cov(X,Y) Python

13. Correlation

Measures strength and direction of a relationship. Range 1r1-1 \le r \le 1 Python

14. Sampling

Sampling is selecting a subset from a population. Methods
  • Simple Random Sampling
  • Stratified Sampling
  • Cluster Sampling
  • Systematic Sampling

15. Sampling Distribution

Distribution of a sample statistic. Used in
  • Confidence Interval
  • Hypothesis Testing

16. Central Limit Theorem

If sample size is sufficiently large, n30n \ge 30 then the sampling distribution of the mean becomes approximately normal. Why important?
  • Enables hypothesis testing
  • Basis for confidence intervals
  • Foundation of statistical inference

17. Confidence Interval

Range likely to contain the population parameter. 95% Confidence Interval xˉ±zσn\bar{x}\pm z\frac{\sigma}{\sqrt n} Interpretation

18. Statistical Inference

Drawing conclusions about a population using sample data. Includes
  • Confidence Interval
  • Hypothesis Testing

19. Hypothesis Testing

Null Hypothesis

Alternative Hypothesis

Example

20. P-value

Probability of obtaining the observed result assuming H₀ is true. Decision Rule

21. Type I & Type II Errors

Type I Error

False Positive Reject a true null hypothesis.

Type II Error

False Negative Fail to reject a false null hypothesis.

22. Statistical Tests


23. Feature Scaling

Scaling ensures features have comparable ranges. Example Benefits
  • Faster convergence
  • Better optimization
  • Improved ML accuracy

24. Standardization

Transforms data to
  • Mean = 0
  • Standard Deviation = 1
Formula z=xμσz=\frac{x-\mu}{\sigma} Python

25. Normalization

Scales values between 0 and 1. Formula x=xminmaxminx'=\frac{x-min}{max-min} Python

26. Z-Score

Measures distance from the mean. Formula z=xμσz=\frac{x-\mu}{\sigma} Interpretation Python

27. Missing Data

Common approaches
  • Remove Rows
  • Remove Columns
  • Mean Imputation
  • Median Imputation
  • Mode Imputation
Python

Statistics Libraries


28. Cheat Sheet