In my PCA implementation, I’m getting the correct eigenvectors, however it is not matching the grader output because the sign is opposite
Wrong accuracy output.
Expected: [[ 0.43437323 0.49820384]
[ 0.42077249 -0.50351448]
[-0.85514571 0.00531064]].
Got: [[-0.43437323 -0.49820384]
[-0.42077249 0.50351448]
[ 0.85514571 -0.00531064]].
Wrong accuracy output.
Expected: [[-0.32462796 0.01881248 -0.51389463]
[-0.36781354 0.88364184 0.05985815]
[-0.75767901 -0.69452194 0.12223214]
[ 1.01698298 -0.17990871 -0.33555475]
[ 0.43313753 -0.02802368 0.66735909]].
Got: [[-0.32462796 -0.01881248 -0.51389463]
[-0.36781353 -0.88364184 0.05985815]
[-0.75767901 0.69452193 0.12223214]
[ 1.01698297 0.17990872 -0.33555475]
[ 0.43313753 0.02802368 0.66735909]].
e[92m 4 Tests passed
e[91m 2 Tests failed
That was the case on my local file, but on the cloud it worked. Why is that?
The test example you used may not be in the default test cases. Can you share the test examples and a code snippet?
Hi @jamesftw
Please make sure not to post any code snippet here in the public post, rather send DM to the mentor who has asked you for codes as posting codes or any notebook is against community guidelines
Also you mentioned you are getting this output on your local system and not on course provided environment, so confirm if you have downloaded all the files and running the codes in the same version, the course environment was run down.
@SNaveenMathew kindly ask for codes by personal DM only.
Regards
DP
Yep, definitely the same thing, I downloaded all the files, and was really frustrated when it keeps on not passing the test cases. But as soon as I copied the exact same code to the online version, it worked. The environment is my own Python 3.11 though, is that the reason?
Also thanks @SNaveenMathew, I just DMed you my code snippet!
@jamesftw
when codes are run down in course environment, it comes with metadata(which you said you downloaded) but also comes with various modules with their version and dependencies, and that is were probably its giving this failed test in your local system.
Check if there is any requirement.txt file which provides you module version information.
Yes python version should also match, and not to forget if tf or keras was used, that version discrepancies again can throw variables different outputs.
Regards
DP