If you read my last post, Back to the Matrix, you know I’m currently on a mission to rebuild my machine learning foundations from the ground up. No rushing, no cutting corners—just pure, intentional understanding.

And if we are talking about foundations, we have to talk about the elephant in the room: Linear Algebra.

When I first encountered linear algebra in university, it felt like an endless barrage of dry rules. Multiply this row by that column. Cross out this row to find the determinant. It felt abstract, sterile, and detached from reality.

But as I dive back into AI, I’ve realized something profound: Math only feels abstract when it’s taught without its spatial reality.

Linear algebra isn’t just a tool for crunching numbers; it is the language of space, vision, and movement. Once you stop lookin at matrices as grids of numbers and start seeing them as geometric transformations, everything changes.

Let’s break it down together, step-by-step, and see how artificial intelligence actually “sees” the world.

1. Vectors and Matrices: Mapping Our Reality into Space

We are taught that a vector is just a list of numbers, like [28, 120, 1]. In Python, it’s a simple NumPy array. Boring, right?

But in the realm of data science, that vector is an anchor in a hidden universe. Let’s say we are building a model to analyze health data.

  • 2828 is the patient’s age.
  • 120120 is their systolic blood pressure.
  • 11 indicates whether they are a smoker.

Geometrically, this vector is an arrow pointing to a specific coordinate in a 3-dimensional “Patient Space.”

Age (Y)
^
| . (28, 120, 1)
| /
| / <- The Vector
+--------> Blood Pressure (X)
/
v Smoker (Z)

A Matrix, then, is nothing more than a collection of these vectors. It’s a multi-dimensional room where our data points hang out. When an AI system looks at a dataset of 10,000 patients, it isn’t reading a spreadsheet; it is visualizing a cloud of 10,000 arrows floating in a highly complex, multi-dimensional space.

2. Dot Product and Matrix Multiplication: The Art of Bending Space

This is where the magic happens. In almost every machine learning paper, you will see the famous equation for a neural network layer:

y=W⋅x+by = W \cdot x + b

We know xx is our input vector, WW is the weight matrix, and bb is the bias. But what is actually happening geometrically?

The Dot Product (W⋅x) (W \cdot x)

The dot product is essentially a similarity tester. When you take the dot product of two vectors, you are asking: “How much do these two arrows point in the same direction?”

  • If they point the exact same way, the output is high.
  • If they are perpendicular (90∘)(90^\circ), the output is zero (they have nothing in common).

A neural network uses the dot product to see how well your input data aligns with what it has already learned.

Matrix Multiplication

If a vector is a point in space, multiplying it by a matrix is an action. Matrices are verbs.

When you multiply a vector by a matrix, you are transforming that space. You are rotating it, stretching it, squeezing it, or flipping it upside down.

The AI Insight: When a neural network passes data through its layers, it uses its weight matrices (W) (W) to warp, bend, and twist the data space. Why? To line up the data points so perfectly that a simple straight line can separate “healthy patients” from “at-risk patients.”

Learning in AI is just the process of finding the exact matrix that bends space in the most useful way.

3. Eigenvalues and Eigenvectors: The Unshakable Skeleton of Data

If matrices bend and rotate space, you might wonder: is there anything that stays put?

Imagine you are stretching a rubber sheet diagonally. Most points on the sheet move to brand new directions. But there are a few special lines where the points move, but their direction remains completely unchanged. They just get longer or shorter.

  • The directions that don’t change are Eigenvectors (German for “characteristic vectors”).
  • The factor by which they stretch or shrink is the Eigenvalue.
𝐀𝐯=λ𝐯\mathbf{A}\mathbf{v} = \lambda\mathbf{v}

Where 𝐀\mathbf{A} is our matrix transformation, 𝐯\mathbf{v} is the eigenvector, and λ\lambda is the eigenvalue.

Before Transformation:
^
| / (Vector A)
| /
+-----> (Vector B)
After Transformation (Stretched Horizontally):
^
| / (Vector A changed direction!)
| /
+---------> (Vector B only stretched!)
Vector B is an Eigenvector!

Why does AI care about this? (Enter PCA)

When dealing with massive datasets (like images with thousands of pixels), we face the “curse of dimensionality.” There is too much noise. We need to simplify the data without losing the core information.

This is where Principal Component Analysis (PCA) comes in. PCA calculates the covariance matrix of your data and extracts its eigenvectors.

Because eigenvectors represent the axes where the data stretches the most, they represent the true skeleton of your dataset. By keeping only the eigenvectors with the largest eigenvalues, you can crush a 100-dimensional problem down to 2 dimensions, losing almost no critical information.

Moving From Text to Code

Reading about geometry is great, but watching a matrix physically rotate a vector inside a Python environment is where it truly clicks.

To bridge that final gap between theory and code, I’ve put together a lightweight NumPy notebook. In it, we visualize these exact concepts—vectors, dot products, and spatial transformations—using simple code.

👉 Check out my NumPy Geometry Notebook on GitHub

Final Thougths

Linear algebra used to feel like a wall of numbers designed to keep me out. Now, returning to it with a clear purpose, I see it as a map. It’s the lens that allows us to turn abstract concepts like “patient health,” “credit risk,” or “image recognition” into physical, manipulable geometry.

We aren’t just coding algorithms; we are architects of data space.

What part of linear algebra clicked for you first? Did you view it as numbers or as geometry when you first learned it? Let’s chat in the comments below!


Eda AYDIN sitesinden daha fazla şey keşfedin

Son gönderilerin e-postanıza gönderilmesi için abone olun.

4 responses to “The Geometry of Data: Why Linear Algebra is the Foundation of Every AI System”

  1. Really enjoyed this perspective. The way you connect data, geometry, and intelligence makes complex ideas feel intuitive. Excited to see where this series goes. 😉

    1. Thank you so much! It means a lot to hear that the connection between those concepts resonated with you. I’m really looking forward to sharing the next parts of the series—stay tuned! 😉

  2. Matrices are verbs” might be the coolest way anyone has ever explained linear algebra! 🤯 I love how you took something that felt so abstract in university and gave it a ‘spatial reality.’ Your journey of rebuilding your foundations is so inspiring to watch, and you’re making it look beautiful. Proud of you, my favorite researcher! 🚀

    1. Thank you so much! 🚀 Rebuilding these foundations has been a fun challenge, and I’m really glad you’re enjoying the process!

Leave a Reply