d01c5b805e49346914b3b5ace081cae8cbb2a99a,modAL/density.py,,information_density,#Any#Any#,32

Before Change


    Returns:
        The information density for each sample.
    
    inf_density = np.zeros(shape=(X.shape[0],))
    for X_idx, X_inst in enumerate(X):
        inf_density[X_idx] = sum(similarity_measure(X_inst, X_j) for X_j in X)

After Change


    //
    // return inf_density/X.shape[0]

    similarity_mtx = 1/(1+pairwise_distances(X, X, metric=metric))

    return similarity_mtx.mean(axis=1)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: modAL-python/modAL
Commit Name: d01c5b805e49346914b3b5ace081cae8cbb2a99a
Time: 2018-10-01
Author: theodore.danka@gmail.com
File Name: modAL/density.py
Class Name:
Method Name: information_density


Project Name: scikit-learn/scikit-learn
Commit Name: e52e9c8d7536b6315da655164951060642a52707
Time: 2019-09-18
Author: tom.dupre-la-tour@m4x.org
File Name: sklearn/manifold/tests/test_t_sne.py
Class Name:
Method Name: test_barnes_hut_angle


Project Name: theislab/scanpy
Commit Name: 6d063540a8220e8eef4415e488dfdcef71bb3566
Time: 2018-08-28
Author: ivirshup@gmail.com
File Name: scanpy/neighbors/__init__.py
Class Name: Neighbors
Method Name: compute_neighbors