70fcd3094baba3139afcda727683d58c2928261f,lexos/processors/analyze/similarity.py,,similarity_maker,#,8

Before Change


    docs_score = np.round(sorted_docs_np[:, 1].astype(float), decimals=4)

    // pack the scores and names in data_frame
    score_name_data_frame = pd.DataFrame(docs_score.reshape(
        docs_score.size, 1), index=docs_name, columns=["Cosine similarity"])

    return score_name_data_frame

After Change


    dist = 1 - cosine_similarity(final_matrix)

    // get an array of file index in filemanager.files
    num_row = len(dtm_data_frame.index)
    other_file_indexes = np.asarray([file_index for file_index in range(
        num_row)if file_index != comp_file_index])

    // construct an array of scores
    docs_score_array = np.asarray([dist[file_index, comp_file_index]
                                   for file_index in other_file_indexes])
    // construct an array of names
    docs_name_array = np.asarray([temp_labels[i] for i in other_file_indexes])

    // sort the score array
    sorted_score_array = np.sort(docs_score_array)

    // round the score array to 4 decimals
    final_score_array = np.round(sorted_score_array, decimals=4)

    // sort the
    final_name_array = docs_name_array[docs_score_array.argsort()]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: WheatonCS/Lexos
Commit Name: 70fcd3094baba3139afcda727683d58c2928261f
Time: 2017-08-04
Author: liu_xinru@wheatoncollege.edu
File Name: lexos/processors/analyze/similarity.py
Class Name:
Method Name: similarity_maker


Project Name: WheatonCS/Lexos
Commit Name: ce5da48b8586d7cfdb392b8cad1988e6bfdd17d5
Time: 2017-08-03
Author: liu_xinru@wheatoncollege.edu
File Name: lexos/processors/analyze/similarity.py
Class Name:
Method Name: similarity_maker


Project Name: robertmartin8/PyPortfolioOpt
Commit Name: 9cf7514b2e13eba47d78e2965220aabe6804d183
Time: 2020-06-07
Author: martin.robertandrew@gmail.com
File Name: pypfopt/black_litterman.py
Class Name: BlackLittermanModel
Method Name: _parse_views