Vectors and What They Represent
You'll learn to
- -Understand a vector as a list of numbers representing a point in space
- -See how vectors let ML systems represent things that are not naturally numeric
- -Compute dot product, magnitude, and cosine similarity by hand and in code
Nearly everything in machine learning is, underneath, a vector: a list of numbers. That is not a mathematical curiosity. It is the entire trick that lets ML handle things that are not naturally numeric, like words, images, or user preferences.
A Vector Is Just Coordinates
A vector like [5.2, 3.1, 0.8] is nothing more than a point in space, described by its coordinates along each dimension. Two dimensions is a point on a map. Three dimensions is a point in physical space. Machine learning routinely works with vectors of hundreds or thousands of dimensions. You cannot picture that directly, but mathematically it works exactly the same way.
Turning "Things" Into Vectors
A house can become a vector: [square_footage, bedrooms, distance_to_city_center, year_built]. A customer can become one too: [total_purchases, average_order_value, days_since_last_purchase]. Even a word or a sentence can become a vector, through a technique called an embedding that Phase 2 covers in depth. Once something is represented as a vector, every standard mathematical tool in ML (distance, similarity, averaging) becomes available to apply to it.
Three Operations You Will See Constantly
Almost every "similar things are nearby" idea in ML reduces to three specific operations on vectors. Know all three cold, not just the words. Interviewers expect it.
You do not need to be fast at vector math by hand to be a good ML engineer. You do need to write dot, magnitude, and cosine_similarity from memory in an interview. They come up constantly, especially once Phase 2 reaches embeddings and vector search.
In practice, this entire chapter is what numpy exists for. numpy.dot(a, b) and numpy.linalg.norm(a) turn into one-liners operating on arrays of millions of numbers at once, far faster than the pure Python loops above. Those loops exist so you understand exactly what those one-liners are doing underneath.
Interview Signal is part of Pro
See a real weak answer next to a real strong one for this exact topic.
Quiz is part of Pro
Test what you just read with a short quiz, and bank the XP.