4f496868c6aa7f50db99229847285efbe50040c2,sklearn/cluster/tests/test_k_means.py,,test_n_init,#,657
Before Change
random_state=j).fit(X)
inertia[i, j] = km.inertia_
inertia = inertia.mean(axis=1)
failure_msg = ("Inertia %r should be decreasing"
" when n_init is increasing.") % list(inertia)
for i in range(len(n_init_range) - 1):
assert inertia[i] >= inertia[i + 1], failure_msg
After Change
// inertia each time
km = KMeans(n_clusters=n_clusters, init="random", n_init=n_init,
random_state=0, max_iter=1).fit(X)
assert km.inertia_ <= previous_inertia
def test_k_means_function():
// test calling the k_means function directly
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 3
Instances Project Name: scikit-learn/scikit-learn
Commit Name: 4f496868c6aa7f50db99229847285efbe50040c2
Time: 2020-08-03
Author: 34657725+jeremiedbb@users.noreply.github.com
File Name: sklearn/cluster/tests/test_k_means.py
Class Name:
Method Name: test_n_init
Project Name: HsinYingLee/DRIT
Commit Name: 8a04fa2c91f52a9c551849812d450079e667b16a
Time: 2018-07-28
Author: hytseng0509@gmail.com
File Name: src/networks.py
Class Name: LayerNorm
Method Name: forward
Project Name: tensorflow/models
Commit Name: 8da4857396fcedb1abd19a08cd4de40d16c7bc50
Time: 2020-08-17
Author: 30733558+plakal@users.noreply.github.com
File Name: research/audioset/yamnet/yamnet_test.py
Class Name: YAMNetTest
Method Name: clip_test
Project Name: fgnt/nara_wpe
Commit Name: 9c86a02d038dba72cd95ddce112d2492b5a5cb5c
Time: 2018-05-16
Author: cbj@mail.uni-paderborn.de
File Name: nara_wpe/wpe.py
Class Name:
Method Name: get_power_inverse