Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_modify_weight_matrix_online(n_rows, n_columns, random_state,
n_iter_unsupervised, X, learningrate,
neighborhood_func, bmu_pos, dp, expected):
som_clustering = susi.SOMClustering(
n_rows=n_rows, n_columns=n_columns,
n_iter_unsupervised=n_iter_unsupervised, random_state=random_state)
som_clustering.fit(X)
assert np.allclose(susi.modify_weight_matrix_online(
som_array=som_clustering.unsuper_som_,
learningrate=learningrate,
dist_weight_matrix=som_clustering.get_nbh_distance_weight_matrix(
neighborhood_func, bmu_pos),
true_vector=som_clustering.X_[dp]), expected, atol=1e-8)