Appendix C. A primer on linear algebra

This appendix presents the basic linear algebra operations. They’re important for understanding much of the math behind most machine-learning algorithms. In case you skipped your linear algebra classes, this is your chance to come to grips with it.

Matrices and vectors

A matrix is a set of elements arranged in rows and columns (we’ll only use matrices whose elements are numbers). This is a matrix with two rows and three columns, so it’s called a 2 × 3 matrix:

Usually, the number of rows in a matrix is denoted by the letter m and the number of columns by the letter n. m and n are the matrix’s dimensions, ...

Get Spark in Action now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.