C1_W4 Assignment Exercise 1

Hello, I am having an error with the first exercise in the course of Math for ML (C1_W4). I defined the the vectors like follow but I am having an error:

Define transformation matrix A_reflection_yaxis as a numpy array.

A_reflection_yaxis = np.array([[-2,-3], [2,1]])

Find eigenvalues and eigenvectors or matrix A_reflection_yaxis.

A_reflection_yaxis_eig = np.linalg.eig(A_reflection_yaxis)

END CODE HERE

–Error—
TypeError: Cannot cast array data from dtype(‘complex128’) to dtype(‘float64’) according to the rule ‘safe’

Please Can you help me understand the problem??

Hello Alex_Eponon
Here He asked You the reflection of y_{axis}
and he didn’t asked to apply matrix multiplication
so here your matrix after multiplication = \begin{bmatrix} -2 && -3 \\ 2 && 1 \end{bmatrix}
He didn’t asked you to do this, he asked just for reflection of y_axis
I wish It helped
Dear Atef,

Yes, Thank you very much I understand now. I know what to do.

1 Like

I am stuck with exercise 1. What should be the matrix A_reflection_yaxis? Please help

I’m getting same error … can you pls explain how to resolve this ?

tia!

Hello @willtse - were you able to resolve the issue ?
I’m getting similar issue, pls let me know.

thanks!

Hi, I have fixed it. The matrix A_reflection_yaxis has nothing to do with the matrix A. Imagine y-axis as a mirror and A_reflection_yaxis is the reflection of the usual basis vectors np.array([[1,0],[0,1]]) using y-axis. Good luck!