6f32626effedfaeba3c51debb39d556302922728,Python/phate/phate.py,,calculate_kernel,#,35

Before Change


    if knn_dist != "precomputed" and ndim < data.shape[1]:
        if verbose:
            print("Calculating PCA...")
            start = time.time()
        if sparse.issparse(data):
            _, _, VT = randomized_svd(data, ndim,
                                      random_state=random_state)
            data = data.dot(VT.T)
        else:
            pca = PCA(ndim, svd_solver="randomized",
                      random_state=random_state)
            data = pca.fit_transform(data)
            if verbose:
                print("PCA complete in {:.2f} seconds".format(
                    time.time() - start))
    if verbose:
        start = time.time()
        print("Calculating KNN...")
    // kernel includes self as connection but not in k

After Change


            knn = NearestNeighbors(n_neighbors=k,
                                   n_jobs=n_jobs).fit(data)
            kernel = knn.kneighbors_graph(data, mode="connectivity")
    log_complete("KNN search")
    kernel = kernel + kernel.T  // symmetrization
    return kernel

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 10

Instances


Project Name: KrishnaswamyLab/PHATE
Commit Name: 6f32626effedfaeba3c51debb39d556302922728
Time: 2018-05-22
Author: scottgigante@gmail.com
File Name: Python/phate/phate.py
Class Name:
Method Name: calculate_kernel


Project Name: KrishnaswamyLab/PHATE
Commit Name: 6f32626effedfaeba3c51debb39d556302922728
Time: 2018-05-22
Author: scottgigante@gmail.com
File Name: Python/phate/phate.py
Class Name:
Method Name: calculate_landmark_operator


Project Name: KrishnaswamyLab/PHATE
Commit Name: 6f32626effedfaeba3c51debb39d556302922728
Time: 2018-05-22
Author: scottgigante@gmail.com
File Name: Python/phate/phate.py
Class Name: PHATE
Method Name: fit_transform


Project Name: KrishnaswamyLab/PHATE
Commit Name: 6f32626effedfaeba3c51debb39d556302922728
Time: 2018-05-22
Author: scottgigante@gmail.com
File Name: Python/phate/phate.py
Class Name:
Method Name: calculate_kernel


Project Name: KrishnaswamyLab/PHATE
Commit Name: be95ff167e1ea0195e32beb0618228d18a4098eb
Time: 2018-05-28
Author: scottgigante@gmail.com
File Name: Python/phate/phate.py
Class Name: PHATE
Method Name: calculate_potential