MCPcopy Create free account
hub / github.com/BIT-DataLab/LakeBench / cal_precise_unionablity

Function cal_precise_unionablity

union/TUS/Uset.py:350–368  ·  view source on GitHub ↗
(type, values_of_this_column, lsh_result, folder_path, model)

Source from the content-addressed store, hash-verified

348
349
350def cal_precise_unionablity(type, values_of_this_column, lsh_result, folder_path, model):
351 #计算values_of_this_column与候选列的精确可并行分数
352 #后面加上u_NL的分数
353 col_dict = {}
354 for r in lsh_result:
355 file_name, column_name = r.split(maxsplit=1)
356 file_path = os.path.join(folder_path, file_name)
357 df_query = pd.read_csv(file_path)
358 if type == 'Uset' or type == 'Usem':
359 unionablity = u_set_or_sem(type, values_of_this_column, df_query[column_name].to_list())
360 else:
361 unionablity = u_nl(values_of_this_column, df_query[column_name], model)
362 if file_name in col_dict:
363 if unionablity > col_dict[file_name]:
364 col_dict[file_name] = unionablity
365 else:
366 col_dict[file_name] = unionablity
367
368 return col_dict
369
370
371#save_dict_to_json(u_set_distribution(u_set_Lsh()), 'result/uset_lsh.json')

Callers 2

get_candidateFunction · 0.90
get_candidateFunction · 0.90

Calls 2

u_nlFunction · 0.90
u_set_or_semFunction · 0.70

Tested by

no test coverage detected