In the previous chapter, you learned how to work with vectors, which are useful for representing single data points or features. We now scale up to matrices, which are collections of vectors organized into a rectangular grid. This structure allows us to represent an entire dataset, where rows might be individual samples and columns represent different features. A dataset with m examples and n features can be compactly stored in an m×n matrix.
This chapter introduces the core operations for manipulating these data structures. We will cover element-wise arithmetic, such as matrix addition and scalar multiplication. You will then learn the mechanics of matrix-vector and matrix-matrix multiplication, which are used to apply transformations and combine information. We will also discuss the matrix transpose and examine properties of special matrices you will frequently encounter, including identity, diagonal, and symmetric matrices.
3.1 Matrix Addition and Subtraction
3.2 Matrix-Scalar Multiplication
3.3 Matrix-Vector Multiplication
3.4 Matrix-Matrix Multiplication
3.5 The Matrix Transpose
3.6 Special Types of Matrices
3.7 Hands-On Practical: Matrix Operations in NumPy
© 2026 ApX Machine LearningEngineered with