- Machine Learning with Spark(Second Edition)
- Rajdeep Dua Manpreet Singh Ghotra Nick Pentreath
- 187字
- 2025-04-04 19:20:52
Matrix
A matrix over a field F is a two-dimensional array whose entries are elements of F. An example of a matrix over the field of real numbers is given as follows:
1 2 3
10 20 30
The previous matrix has two rows and three columns; we call it a 2 × 3 matrix. It is traditional to refer to the rows and columns by numbers. Row 1 is (1 2 3), and row 2 is (10 20 30); column 1 is (1 10) , column 2 is (2 20), and column 3 is (3 30). In general, a matrix with m rows and n columns is called an m × n matrix. For matrix A, the element (i, j) is defined to be the element in the ith row and the jth column, and is indexed using the Ai, j or Aij notation. We will often use the pythonese notation, A[i, j]. Row i is the vector (A[i, 0], A[i, 1], A[i, 2], , A[i, m − 1]) and column j is the vector (A[0, j], A[1, j], A[2, j], , A[n − 1, j]).