Do you know what a transposed matrix is and how to identify it? In this article we will teach you what this concept refers to, which becomes relevant in the world of computing when we combine it with machine learning.
Transposed matrix
Given a matrix A of mxnthe transpose of A is the matrix nxmdenoted by ATwhose columns are formed from the corresponding rows of A. In summary, The transposed matrix is the one obtained by transforming the rows into columns and the columns into rows.. This is done as follows:
Transposed matrix
We have here an example with 2 rows by 3 columns (2×3). Your transposed matrix is to take the first row and turn it into a column. That is, the first row [5, 1, 7] would be converted into a column [5, 1, 7]. The same would be done with the second row. [3, -2, 5]which would become a column of the same type.
We can do this in Python using np.transpose() to calculate the transpose of a matrix A:
#Transposed array A = np.array ([[5, 1, 7],
[3, -2, 5]]) At = np.transpose (A) print (At)
[[5 3]
[1 -2]
[7 5]]
What happens if we do the transposition again?
#Transposed matrix att = np.transpose(At) print(Att)
[[5, 1, 7]
[3, -2, 5]]
We obtain matrix A again, as expected. Here what we have done is transform the first row [5 3]the second row [1 -2] and the third row [7 5] in columns, respectively.
square matrix
A square matrix will be symmetric if AT= A, that is, if A is equal to its own transposed matrix. For example:
#Square matrix/transposed matrix C = np.array ([[126, -66, 88],
[-66, 58, -50],
[88, -50, 46]]) Ct = np.transpose (C) Ct
array (
[[126, -66, 88],
[-66, 58, -50],
[88, -50, 46]])
Do you want to continue learning?
Now that you know how to identify transposed matrices, you can continue learning about Big Data to become an expert in the IT sector. You will be able to access one of the most in-demand and best-paid disciplines in the labor market in a few months thanks to the Big Data, Artificial Intelligence & Machine Learning Full Stack Bootcamp. It is a comprehensive and high-intensity training in which you will acquire all the theoretical and practical knowledge that will help you obtain the job of your dreams. Enter now to request information and be encouraged to change your future!