O'Reilly logo

Mastering Java Machine Learning by Krishna Choppella, Dr. Uday Kamath

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Matrix

A matrix is a two-dimensional array of numbers. Each element can be indexed by its row and column position. Thus, a 3 x 2 matrix:

Matrix

Transpose of a matrix

Swapping columns for rows in a matrix produces the transpose. Thus, the transpose of A is a 2 x 3 matrix:

Transpose of a matrix

Matrix addition

Matrix addition is defined as element-wise summation of two matrices with the same shape. Let A and B be two m x n matrices. Their sum C can be written as follows:

Ci,j = Ai,j + Bi,j

Scalar multiplication

Multiplication with a scalar produces a matrix where each element is scaled ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required