Skip to content

Commit

Permalink
minisom.py
Browse files Browse the repository at this point in the history
Update test_pca_weights_init. Redefine expected array.
  • Loading branch information
emeeubc authored Nov 14, 2023
1 parent 530206d commit b3a680f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions minisom.py
Original file line number Diff line number Diff line change
Expand Up @@ -864,10 +864,10 @@ def test_random_weights_init(self):
def test_pca_weights_init(self):
som = MiniSom(2, 2, 2)
som.pca_weights_init(array([[1., 0.], [0., 1.], [1., 0.], [0., 1.]]))
expected = array([[[-1.41421356, 0.],
[0., 1.41421356]],
[[0., -1.41421356],
[1.41421356, 0.]]])
expected = array([[[1.57735027, -0.42264973],
[0.42264973, -1.57735027]],
[[-0.42264973, 1.57735027],
[-1.57735027, 0.42264973]]])
assert_array_almost_equal(som._weights, expected)

def test_distance_map(self):
Expand Down

0 comments on commit b3a680f

Please sign in to comment.