Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

week 1 pca #1

Open
sean-flanagan opened this issue Jan 14, 2021 · 1 comment
Open

week 1 pca #1

sean-flanagan opened this issue Jan 14, 2021 · 1 comment

Comments

@sean-flanagan
Copy link

for some reason your week 1 pca ipynb file is throwing the following errors:

======================================================================
FAIL: test_cov (week1_tests.Test)

Traceback (most recent call last):
File "/tmp/autograde_hgp2oj5j/week1_tests.py", line 32, in test_cov
np.testing.assert_allclose(result, cov(X))
File "/opt/conda/lib/python3.7/site-packages/numpy/testing/_private/utils.py", line 1533, in assert_allclose
verbose=verbose, header=header, equal_nan=equal_nan)
File "/opt/conda/lib/python3.7/site-packages/numpy/testing/_private/utils.py", line 765, in assert_array_compare
raise AssertionError(msg)
AssertionError:
Not equal to tolerance rtol=1e-07, atol=0

(shapes (10, 10), (2, 2) mismatch)
x: array([[ 1.007994e-01, -1.389557e-01, -2.606233e-06, 1.288654e-01,
-1.606550e-01, 3.670272e-04, 3.421331e-01, -1.845613e-01,
-2.106666e-01, 8.005167e-02],...
y: array([[0.819312, 0.33251 ],
[0.33251 , 0.931471]])

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/tmp/autograde_hgp2oj5j/week1_tests.py", line 40, in test_cov
np.testing.assert_allclose(result, cov(X))
File "/opt/conda/lib/python3.7/site-packages/numpy/testing/_private/utils.py", line 1533, in assert_allclose
verbose=verbose, header=header, equal_nan=equal_nan)
File "/opt/conda/lib/python3.7/site-packages/numpy/testing/_private/utils.py", line 765, in assert_array_compare
raise AssertionError(msg)
AssertionError:
Not equal to tolerance rtol=1e-07, atol=0

(shapes (10, 10), (2, 2) mismatch)
x: array([[ 1.007994e-01, -1.389557e-01, -2.606233e-06, 1.288654e-01,
-1.606550e-01, 3.670272e-04, 3.421331e-01, -1.845613e-01,
-2.106666e-01, 8.005167e-02],...
y: array([[0.910347, 0.369456],
[0.369456, 1.034968]])

======================================================================
FAIL: test_mean (week1_tests.Test)

Traceback (most recent call last):
File "/tmp/autograde_hgp2oj5j/week1_tests.py", line 19, in test_mean
np.testing.assert_allclose(result, expected, rtol=1e-5)
File "/opt/conda/lib/python3.7/site-packages/numpy/testing/_private/utils.py", line 1533, in assert_allclose
verbose=verbose, header=header, equal_nan=equal_nan)
File "/opt/conda/lib/python3.7/site-packages/numpy/testing/_private/utils.py", line 765, in assert_array_compare
raise AssertionError(msg)
AssertionError:
Not equal to tolerance rtol=1e-05, atol=0

(shapes (10, 1), (2,) mismatch)
x: array([[ 0.179225],
[ 1.085359],
[-0.234145],...
y: array([-0.184724, -0.157873])


Ran 4 tests in 0.551s

FAILED (failures=2)

Do you know how to fix them?

@HaoES
Copy link

HaoES commented Aug 21, 2021

you should remove keepdims = true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants