This project focuses on the mathematical foundations of machine learning using NumPy.
The goal is to practice:
- Matrix multiplication (basis of neural networks)
- Vector operations
- Statistical measures (mean, variance, std dev)
- Data visualization (normal vs uniform distributions)
By the end, you’ll have a stronger grasp of the math that powers AI/ML.
- Synthetic Data generated using NumPy
- Normal distribution (
np.random.randn) - Uniform distribution (
np.random.rand) - Random integers for matrix practice (
np.random.randint)
No external dataset was required.
-
Matrix Multiplication
- Practiced multiplying matrices with compatible dimensions.
- Verified shape rules: (m × n) × (n × p) → (m × p).
-
Vector Operations
- Element-wise operations (addition, subtraction, multiplication).
- Dot product.
- Normalization of vectors.
-
Statistics
- Manually computed mean, variance, and std dev.
- Compared manual results with NumPy’s built-in functions.
-
Visualizations
- Plotted histograms of:
- Normal distribution (bell curve).
- Uniform distribution (flat distribution).
- Added vertical lines for the mean to interpret results.
- Plotted histograms of:
- Matrix multiplication underpins neural networks (weights × inputs).
- Statistics (mean, variance, std dev) are critical for feature scaling and data preprocessing.
- Normal distribution shows clustered data around the mean, while uniform distribution spreads values evenly.
- Understanding distributions helps in data analysis and detecting anomalies.
Below is the comparison between a Normal distribution and a Uniform distribution:
Install the following dependencies before running the notebook:
numpy
matplotlib