Problem with C1_W3 ex.5 compute_pca

The unit test case fails, and I can’t figure out what’s wrong with my code because it just look correct and also the final graph confirms it:

I’ve tried all the possibilities:

  • also normalizing using std
  • denormalizing the final result
  • using different options with np.linalg.eigh.

Nothing seams to work.

Anyone having the same issue?

2 Likes

Hi @vballestra

Could you provide more information which and how the test case fails?

Yeah, I figure I can’t post my solution, so I don’t know what else I can provide but here’s the issue:

It looks like I’m not computing it correctly but I’m quite sure it is correct in fact the final picture looks fine, as you can see.

Also, notice that the error message is wrong: the shape is correct but the values do not match with the expected.

1 Like

Could you private message me your Assignment notebook? It’s hard to predict where your mistake is. It’s clear that it is not the number of dimensions but the values are not correct.

For future readers:

If you get the same values - please check the dimension over which you de-mean the data (use Hint 1).