This chapter introduces the fundamental objects of linear algebra. Before we can perform complex operations or build machine learning models, we must first understand how to represent data mathematically. The primary tools for this are scalars, vectors, and matrices.
We will begin by defining these three components. You will learn that a scalar is a single number, a vector is an ordered list of numbers representing a point in space, and a matrix is a grid of numbers used to organize entire datasets. For instance, a single data sample with multiple features is often represented as a vector, such as x=[x1,x2,x3]. An entire collection of these samples forms a data matrix.
After establishing this foundation, we will prepare for the practical work ahead by setting up a Python environment with the NumPy library, the standard tool for numerical computation. The chapter concludes with a hands-on exercise where you will apply what you have learned to create your first vectors and matrices in code. By the end of this chapter, you will be able to represent simple datasets using the core structures of linear algebra.
1.1 Why Linear Algebra for Machine Learning?
1.2 Scalars: The Simplest Objects
1.3 Vectors: Points in Space
1.4 Matrices: Organizing Data in Grids
1.5 Setting Up Your Python Environment
1.6 Hands-On Practical: Creating Vectors and Matrices with NumPy
© 2026 ApX Machine LearningEngineered with