In final Programming assignment for Eigenvalues and Eigenvectors, I happened to meet a weird error after running test case

w4_unittest.test_matrix(P, X0, X1)

The error is as follow:
Wrong vector X1. Check if matrix multiplication was performed correctly.
6 Tests passed
1 Tests failed

I believe the code I write for matrix multiplication has no error because it’s very simple:

X1 = P@X0

Is there any error with the test package?

2 Likes

I am having the exact same issue. I have tried different values for the P-matrix.

I made the same step after checking the python file used for testing the output. If the P-matrix is too much different from their test P-matrix, it will results in error.

Hi all!

We have updated this assignment to perform some fixes, could you guys please try to refresh your workspace ?

Please tell me if this works.
Thanks,
Lucas

1 Like

droz
February 17, 2023, 2:34pm
5
is that solved? Because I have same error as well.
Wrong vector X1. Check if matrix multiplication was performed correctly.
6 Tests passed
1 Tests failed

PS. I did what you have suggested

I tried different matrixes and finally one got accepted. So I’m not sure if the test package has been updated.

If it seems impossible to get your answer accepted, one dirty trick is to check the test file and see how they create or test the final matrix.

START CODE HERE
P = np.array([
[0, 0.75, 0.35, 0.22, 0.85],
[0.15, 0, 0.25, 0.28, 0.04],
[0.30, 0.10, 0, 0.30, 0.10],
[0.50, 0.05, 0.10, 0, 0.01],
[0.05, 0.10, 0.30, 0.20, 0]
])
X0 = np.array([[0], [0], [0], [1], [0]])

Multiply matrix P and X_0 (matrix multiplication).
X1 = P @ X0

6 accepted
1 failed

can you show me your inputs of P matrix of your code

I’ve the same error like you and I didn’t solve it yet. I don’t think the problem from us

Unfortunately, I don’t think it worked I refreshed my workspace, and the problem is still there

Wrong vector X1. Check if matrix multiplication was performed correctly.
6 Tests passed
1 Tests failed

And also me my friend but I submitted the assignment
You have to do so as the problem hasn’t been solved yet.

Agreed - the bad test didn’t affect my grade at all, so that’s nice

1 Like

Hi all, thanks for your comments. Our team is already looking at it. As you all noticed, it won’t affect your grade, but the unittest fails for 1 case.