O'Reilly logo

Machine Learning with Spark - Second Edition by Nick Pentreath, Manpreet Singh Ghotra, Rajdeep Dua

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

Determinant

The tr M denotes the trace of a matrix M; it is the sum of the elements along the diagonal. The trace of a matrix is normally used as a measure of the "size" of a matrix. The determinant is known as the product of the elements along its diagonal.

The determinant is majorly used in the system of linear equations; it indicates if the columns are linearly related, and it also helps to find the inverse of a matrix. For large matrices, the determinant is calculated using laplace expansion.

val detm: Matrix = Matrices.dense(3, 3, Array(1.0, 3.0, 5.0, 2.0,   4.0, 6.0, 2.0, 4.0, 5.0)) print(det(detm)) 

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