In the previous chapter, we established that vectors are structured collections of numbers used to represent data points or features. Now, we shift our focus from what vectors are to what you can do with them. This chapter covers the essential arithmetic of vectors, which forms the basis for many machine learning techniques.
We will begin with the basics of vector addition, subtraction, and multiplication by a scalar. You will see how these operations have both an algebraic and a geometric interpretation, changing a vector's position or scale in space. From there, we will move to one of the most useful operations in linear algebra: the dot product. You will learn how the dot product relates to the angle between two vectors and how it is used to measure similarity.
This chapter covers the following topics:
For each operation, we will first build the mathematical intuition and then implement it using Python and NumPy. By the end of this chapter, you will be able to perform these computations and understand their significance in practical applications.
2.1 Vector Addition and Subtraction
2.2 Scalar Multiplication
2.3 The Dot Product
2.4 Vector Norms: Measuring Length
2.5 Orthogonal Vectors
2.6 Hands-On Practical: Vector Operations in NumPy
© 2026 ApX Machine LearningEngineered with