-
Notifications
You must be signed in to change notification settings - Fork 3
/
join_function.py
46 lines (39 loc) · 1.82 KB
/
join_function.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
class JoinFunction(object):
"""Customized join function must have an unique name attribute and a method named
compute_distance as below. The constructor can be overwritten"""
def __init__(self):
self.name = "jf_example"
pass
def compute_distance(self, left, right, LL_blocked, LR_blocked,
cache_dir=None):
"""Compute the distance of each tuple pair in the LL and LR blocked table.
Parameters
----------
left: pd.DataFrame
A subset of the left table that contains the id column and the
column to be processed. The id column is named as autofj_id.
The column to be processed is named as value.
right: pd.DataFrame
A subset of the right table that contains the id column and the
column to be processed. The id column is named as autofj_id.
The column to be processed is named as value.
LL_blocked: pd.DataFrame
The LL blocked table that consists of the id columns and
the columns to be processed. The id columns are named as
autofj_id_l and autofj_id_r. The column to be processed is named as
value_l and value_r.
LR_blocked: pd.DataFrame
The LR blocked table that consists of the id columns and
the columns to be processed. The id columns are named as
autofj_id_l and autofj_id_r. The column to be processed is named as
value_l and value_r.
Returns
-------
LL_distance: pd.Series
Distance of each tuple pair in the LL blocked table.
LR_distance: pd.Series
Distance of each tuple pair in the LR blocked table.
"""
LL_distance = None
LR_distance = None
return LL_distance, LR_distance