49ee99e3cb3d175fa96371194824ac010da78649,lexos/processors/analyze/topword.py,,analyze_all_to_para,#,96
Before Change
// calculation
for row in count_matrix:
word_z_score_dict = _z_test_word_list_(word_list_i=row,
word_list_j=count_matrix)
sorted_list = sorted(
list(word_z_score_dict.items()),
key=lambda item: abs(item[1]),
reverse=True
After Change
assert np.size(count_matrix) > 0, EMPTY_LIST_MESSAGE
// initialize
all_results = [] // the value to return
total_sum = np.sum(count_matrix).item()
count_matrix_sum = np.sum(count_matrix, axis=0)
// Generate data
for row in count_matrix:
word_z_score_dict = _z_test_word_list_(
count_list_i=row, count_list_j=count_matrix_sum,
row_sum=np.sum(row).item(), total_sum=total_sum, words=words)
sorted_list = sorted(list(word_z_score_dict.items()),
key=lambda item: abs(item[1]),
reverse=True)
all_results.append(sorted_list)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances
Project Name: WheatonCS/Lexos
Commit Name: 49ee99e3cb3d175fa96371194824ac010da78649
Time: 2017-08-01
Author: weltch1997@gmail.com
File Name: lexos/processors/analyze/topword.py
Class Name:
Method Name: analyze_all_to_para
Project Name: WheatonCS/Lexos
Commit Name: d3fd161765b9c9652fab403bcc59fcbc8e40cfe9
Time: 2017-08-07
Author: weltch1997@gmail.com
File Name: lexos/processors/analyze/topword.py
Class Name:
Method Name: analyze_group_to_group
Project Name: WheatonCS/Lexos
Commit Name: 1a8e10d0a88e25aa8b3ca9d7ea31225439d348a7
Time: 2017-08-07
Author: weltch1997@gmail.com
File Name: lexos/processors/analyze/topword.py
Class Name:
Method Name: analyze_para_to_group