Create readme.md
Browse files- Week 1/readme.md +88 -0
Week 1/readme.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Perfect! Here's a polished, **world-class README.md** for your Week 1 of MLZoomCamp, ready for GitHub:
|
| 2 |
+
|
| 3 |
+
````markdown
|
| 4 |
+
# Machine Learning Zoomcamp β Week 1: Linear Algebra Foundations
|
| 5 |
+
|
| 6 |
+
[](https://www.python.org/)
|
| 7 |
+
[](https://jupyter.org/)
|
| 8 |
+
[](https://numpy.org/)
|
| 9 |
+
|
| 10 |
+
This repository documents my journey through **Week 1** of the **Machine Learning Zoomcamp**, a comprehensive 4-month course offered by **DataTalksClub**. Week 1 focuses on building the **mathematical foundation** required for machine learning, including linear algebra and matrix operations.
|
| 11 |
+
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
## π Week 1 Overview
|
| 15 |
+
|
| 16 |
+
The goal of this week was to understand the mathematical underpinnings of machine learning algorithms. Key topics included:
|
| 17 |
+
|
| 18 |
+
- **Matrix Operations**: Matrix multiplication, transposition, and inversion.
|
| 19 |
+
- **Linear Algebra Fundamentals**: Dot products, matrix shapes, and their relevance in ML.
|
| 20 |
+
- **Practical Applications**: Implementing linear algebra concepts using Python and NumPy.
|
| 21 |
+
|
| 22 |
+
---
|
| 23 |
+
|
| 24 |
+
## π§ Exercises and Implementations
|
| 25 |
+
|
| 26 |
+
The exercises involved:
|
| 27 |
+
|
| 28 |
+
- Computing the transpose of a matrix `X` and performing `X.T @ X`.
|
| 29 |
+
- Inverting the resulting matrix `(X.T @ X)^(-1)`.
|
| 30 |
+
- Using the inverse to solve linear equations, a fundamental step in linear regression.
|
| 31 |
+
|
| 32 |
+
---
|
| 33 |
+
|
| 34 |
+
## π§ͺ Example Problem
|
| 35 |
+
|
| 36 |
+
One of the exercises included:
|
| 37 |
+
|
| 38 |
+
1. Creating a dataset:
|
| 39 |
+
|
| 40 |
+
```python
|
| 41 |
+
y = [1100, 1300, 800, 900, 1000, 1100, 1200]
|
| 42 |
+
````
|
| 43 |
+
|
| 44 |
+
2. Computing `X.T @ X`, inverting it, multiplying by `X.T`, and then multiplying by `y` to get the weight vector `w`.
|
| 45 |
+
|
| 46 |
+
```python
|
| 47 |
+
import numpy as np
|
| 48 |
+
|
| 49 |
+
# Example steps
|
| 50 |
+
XTX = X.T @ X
|
| 51 |
+
XTX_inv = np.linalg.inv(XTX)
|
| 52 |
+
w = XTX_inv @ X.T @ y
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+
3. Summing all elements of `w` to analyze the result:
|
| 56 |
+
|
| 57 |
+
```python
|
| 58 |
+
total_weight = np.sum(w)
|
| 59 |
+
print("Sum of weights:", total_weight)
|
| 60 |
+
```
|
| 61 |
+
|
| 62 |
+
---
|
| 63 |
+
|
| 64 |
+
## π οΈ Technologies Used
|
| 65 |
+
|
| 66 |
+
* **Python** β Programming language for implementation
|
| 67 |
+
* **NumPy** β Efficient numerical computations and linear algebra
|
| 68 |
+
* **Jupyter Notebooks** β Interactive environment for running exercises
|
| 69 |
+
|
| 70 |
+
---
|
| 71 |
+
|
| 72 |
+
## π Key Takeaways
|
| 73 |
+
|
| 74 |
+
* Mastering linear algebra is essential for understanding machine learning algorithms.
|
| 75 |
+
* Operations like matrix multiplication and inversion form the core of regression and many ML models.
|
| 76 |
+
* Hands-on exercises help translate theoretical concepts into practical applications.
|
| 77 |
+
|
| 78 |
+
---
|
| 79 |
+
|
| 80 |
+
## π Resources
|
| 81 |
+
|
| 82 |
+
* [Machine Learning Zoomcamp](https://github.com/DataTalksClub/mlzoomcamp) β Official course repository
|
| 83 |
+
* [NumPy Documentation](https://numpy.org/doc/) β For matrix operations and linear algebra
|
| 84 |
+
* [Jupyter Notebooks](https://jupyter.org/) β Interactive coding environment
|
| 85 |
+
|
| 86 |
+
```
|
| 87 |
+
o you want me to do that next?
|
| 88 |
+
```
|