
"The word vector scared me more than Linear Algebra itself. I thought it was some advanced mathematical concept. It turned out I'd been working with vectors long before I even knew what they were."
In my previous article, I talked about why I decided to learn Linear Algebra before diving deep into Machine Learning. When reading about the subject, I noticed something interesting. No matter which topic I explored—Linear Regression, Neural Networks, Computer Vision, or even Large Language Models—the same word kept appearing.
Vector.
At first, I ignored it.
I assumed it was one of those mathematical terms that would make sense later. My plan was simple: learn the basics first and come back to vectors once I felt more confident.
But the more I learned, the more I realized that wasn't going to work.
Almost every Machine Learning algorithm begins with vectors. Research papers mention feature vectors. Tutorials talk about vector operations. Recommendation systems compare vectors. Even ChatGPT converts words into vectors before understanding them.
After seeing the same concept everywhere, I became curious. If vectors are so important, why not understand them now instead of postponing them?
So I spent a few days learning what a vector actually is.
The funny part is that after all that reading, I couldn't help but laugh.
The concept wasn't difficult at all.
The name made it sound much scarier than it really is.
Before talking about vectors, let's think about something much simpler.
Imagine someone asks you to describe yourself using only numbers.
You might say you're 22 years old, 172 centimeters tall, and weigh 68 kilograms.
Those three numbers already tell us quite a bit about you. They don't describe your personality, your interests, or your experiences, but they do describe some measurable characteristics.
Now imagine writing those values together like this:
[22, 172, 68]
Believe it or not, that's a vector.
That's all a vector really is.
It's simply an ordered collection of related numbers.
Nothing more.
When I first discovered this, I wondered why textbooks made it sound so complicated. The mathematical notation looked intimidating, but the underlying idea was something I'd already been using in programming without realizing it.
That was the first question that came to my mind.
If we already have variables in programming, why do we even need vectors?
After all, writing something like this seems perfectly reasonable.
age = 22
height = 172
weight = 68
For a small program, there's absolutely nothing wrong with this approach.
But Machine Learning doesn't usually deal with one person or one object.
Imagine you're building a model using data from one hundred thousand people. Every person has dozens of features such as age, height, weight, income, education, years of experience, and many more.
Would you create separate variables for every single value?
Of course not.
It would quickly become impossible to manage.
Instead, we group all the information describing one person into a single collection.
A person who is 22 years old, 172 centimeters tall, and weighs 68 kilograms can simply be represented as [22, 172, 68].
Another person might become [18, 165, 55].
Someone else might be represented as [31, 180, 75].
Instead of dealing with dozens of independent variables, every person is now represented by a single vector.
This makes the data much easier to organize, process, and analyze.
More importantly, it's exactly how Machine Learning models expect data to be presented.
Let's imagine we're building a model that predicts house prices.
As humans, we naturally describe a house using words.
We might say it has three bedrooms, two bathrooms, 1,800 square feet of living space, and that it was built five years ago.
A computer, however, doesn't understand words like bedroom or bathroom.
It only understands numbers.
So instead of storing the information as sentences, we convert everything into numerical values.
The same house can now be represented as:
[3, 2, 1800, 5]
Each number represents one feature of the house.
Three bedrooms.
Two bathrooms.
One thousand eight hundred square feet.
Five years old.
Now imagine repeating this process for ten thousand different houses.
Every house becomes one vector.
Together, those vectors become the dataset that the Machine Learning model learns from.
This was one of those moments where everything started making sense to me.
I had always wondered what people meant when they said that Machine Learning models "learn from data."
Now I realized that, in reality, the model isn't learning from houses, students, customers, or images.
It's learning from vectors.
Every real-world object is first converted into numbers, and those numbers are grouped together into vectors before the algorithm ever sees them.
By this point, you already know what a vector is. The good news is that creating one in Python is just as simple as understanding the concept itself.
If you've been learning Python, you've probably heard of NumPy, one of the most popular libraries for scientific computing and Machine Learning. NumPy provides a data structure called an array, which is how vectors are commonly represented in Python.
Here's a simple example:
import numpy as np
student = np.array([22, 172, 68])
print(student)
The output is:
[22 172 68]
At first glance, this doesn't look very different from a regular Python list. That's because both store values in a sequence. The real difference appears when we start performing mathematical operations.
We can also access each value using its position, just like we do with lists.
print(student[0])
print(student[1])
print(student[2])
This gives the following output:
22
172
68
The first value represents the student's age, the second represents height, and the third represents weight. Whether your vector contains three values or three thousand, the idea remains exactly the same.
This was one of the questions that confused me the most.
If both NumPy arrays and Python lists look almost identical, why do Machine Learning engineers always recommend using NumPy?
For example, we can store the same information using a normal list.
student = [22, 172, 68]
Nothing looks different.
In fact, if your goal is simply to store values, a Python list works perfectly well.
The difference becomes obvious when mathematics enters the picture.
Let's create two NumPy arrays.
import numpy as np
a = np.array([1, 2, 3])
b = np.array([4, 5, 6])
print(a + b)
The output is:
[5 7 9]
Instead of joining the arrays together, NumPy adds the corresponding elements one by one. The first value is added to the first value, the second to the second, and the third to the third.
Now let's try exactly the same thing using regular Python lists.
a = [1, 2, 3]
b = [4, 5, 6]
print(a + b)
This time the output is completely different.
[1, 2, 3, 4, 5, 6]
Python doesn't perform addition here. It simply combines the two lists into one larger list.
When I saw this for the first time, I finally understood why Machine Learning libraries depend so heavily on NumPy. Algorithms constantly perform mathematical operations on vectors, and NumPy is built specifically for that purpose.
One of the most interesting things happened after I understood what a vector was.
I started noticing vectors in almost every AI application I used.
Take Spotify, for example.
When you listen to a song, Spotify isn't just looking at its title or artist. Every song is represented using numerical features such as tempo, danceability, energy, loudness, acousticness, and many other characteristics. Together, those numbers form a vector. When Spotify recommends similar songs, it's actually comparing these vectors to measure how similar two songs are.
Netflix works in a similar way.
Instead of thinking of a movie as simply an action film or a comedy, Netflix represents every movie using numerical information such as genre, runtime, popularity, user ratings, release year, and many other features. Recommendation algorithms compare these vectors to suggest movies you might enjoy watching next.
Face recognition is another great example.
When you unlock your phone using your face, your device isn't comparing photographs pixel by pixel. Instead, it converts your facial features into a long vector containing hundreds of numerical values. Every time you look at your phone, it creates another vector and compares it with the one stored during setup. If the vectors are similar enough, your phone unlocks.
Then there's ChatGPT.
This example fascinated me the most.
When we type a sentence like:
"Machine Learning is fun."
the model doesn't immediately understand those words the way humans do.
Before any processing begins, every word is converted into a numerical representation known as an embedding vector.
The model doesn't think in English.
It thinks in numbers.
That realization completely changed the way I look at Artificial Intelligence.
No matter whether it's text, music, images, videos, or recommendations, almost everything eventually becomes a collection of vectors.
As I continued learning, I realized that vectors aren't just another topic in Linear Algebra.
They are the standard way computers represent data.
Think about almost any Machine Learning problem.
A customer can be represented by age, income, and purchase history.
A student can be represented by marks, attendance, and study hours.
A house can be represented by bedrooms, bathrooms, area, and age.
An image can be represented by millions of pixel values.
Even a sentence can be represented by numerical embeddings.
Although these examples seem completely different, they all follow exactly the same idea.
Take a real-world object.
Convert its characteristics into numbers.
Group those numbers together.
The result is a vector.
That's why you'll often hear phrases like feature vector while learning Machine Learning.
When I first heard that term, it sounded incredibly technical.
Now it feels surprisingly simple.
A feature vector is nothing more than the list of numbers that describes one piece of data.
Once I understood this idea, reading Machine Learning tutorials became much easier because I finally knew what people meant when they talked about feeding vectors into a model.
Now we've answered one important question.
How do we represent a single object?
The answer is simple.
We use a vector.
But Machine Learning models don't train on one student, one customer, or one house.
They learn from thousands or even millions of them.
So another question naturally follows.
How do we organize millions of vectors together?
That's where the next building block of Linear Algebra comes in.
Matrices.
In the next article, we'll learn what a matrix is, how it's different from a vector, and why almost every Machine Learning dataset is stored as a matrix before training begins.