I have two matrices:
target = np.array([[1, 1, 1, 1, 1],
[2, 2, 2, 2, 2],
[3, 3, 3, 3, 3]])
source = np.array([[11, 11, 11, 11, 11],
[22, 22, 22, 22, 22],
[33, 33, 33, 33, 33]])
and I want to create a transformation matrix to project the source matrix to the target one.
I found that Scipy library provides a function to do it:
from scipy.spatial import procrustes
mtx1, mtx2, disparity = procrustes(target, source)
based on the documentation, it says that:
Thus, mtx2
is the projected matrix.
What if I have another data and I want to project them to the target matrix using the "learned transformation matrix" that Scipy used to project the source matrix to the target one?
How can I do it using Scipy?