41da32116d1834958b5cc335c9ec9478b74ef01e,scipy/cluster/vq.py,,_kmeans2,#Any#Any#Any#Any#Any#,729

Before Change


        label = vq(data, code)[0]
        // Update the code by computing centroids using the new code book
        for j in range(nc):
            mbs = np.where(label == j)
            if mbs[0].size > 0:
                code[j] = np.mean(data[mbs], axis=0)
            else:
                missing()

After Change


        label = vq(data, code)[0]
        // Update the code by computing centroids using the new code book
        new_code, has_members = _vq.update(data, label, nc)
        if not has_members.all():
            missing()
            // Set the empty clusters to their previous positions
            new_code[~has_members] = code[~has_members]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: scipy/scipy
Commit Name: 41da32116d1834958b5cc335c9ec9478b74ef01e
Time: 2014-06-15
Author: cairj3@mail2.sysu.edu.cn
File Name: scipy/cluster/vq.py
Class Name:
Method Name: _kmeans2


Project Name: mne-tools/mne-python
Commit Name: beaff02d91a80c2cf12e626d47b3f1678188472d
Time: 2020-04-22
Author: larson.eric.d@gmail.com
File Name: mne/source_space.py
Class Name:
Method Name: _get_volume_label_mask


Project Name: QUANTAXIS/QUANTAXIS
Commit Name: b1ba3bc450b56afb124974fa776e88d89425cde8
Time: 2018-01-31
Author: yutiansut@qq.com
File Name: QUANTAXIS/QAIndicator/QAIndicator_Series.py
Class Name:
Method Name: COUNT