Python记录链接多核

Python记录链接多核,python,duplicates,record-linkage,Python,Duplicates,Record Linkage,有没有人有使用记录链接工具包处理超大数据集的经验?我有几个问题。就气候而言,我需要将其部署到EC2实例,但目前,我正试图找出如何利用并行处理的优势——我希望在EC2上也这样做 当指定核心数(njob)时,代码实际运行速度要比不指定多个核心时慢得多 compare_dupes = rl.Compare(n_jobs=12) 与此相关-我正在处理一个记录集,其中有1200万条客户记录需要重复数据消除。目前我正在封锁的名字,姓氏和邮政编码 然而,潜在记录对索引的数量仍然很大,导致内存故障。我试过达斯

有没有人有使用记录链接工具包处理超大数据集的经验?我有几个问题。就气候而言,我需要将其部署到EC2实例,但目前,我正试图找出如何利用并行处理的优势——我希望在EC2上也这样做

当指定核心数(njob)时,代码实际运行速度要比不指定多个核心时慢得多

compare_dupes = rl.Compare(n_jobs=12)
与此相关-我正在处理一个记录集,其中有1200万条客户记录需要重复数据消除。目前我正在封锁的名字,姓氏和邮政编码

然而,潜在记录对索引的数量仍然很大,导致内存故障。我试过达斯克-运气不好。我不知道还能尝试什么。有人有什么建议吗?我的代码如下所示:

# this section creates a huge multi-index, which causes memory failures
dupe_indexer = rl.Index()
dupe_indexer.block(['first_name_clean','last_name_clean','zip_clean'])
dupe_candidate_links = dupe_indexer.index(df_c)


# I can put n_jobs=12 (the number of cores) in the Compare function below, 
# but for some reason it actually performs worse

compare_dupes = rl.Compare()
compare_dupes.string('first_name_clean','first_name_clean', method='jarowinkler', threshold=0.85, label='first_name_cl')
compare_dupes.string('last_name_clean','last_name_clean', method='jarowinkler', threshold=0.85, label='last_name_cl')
compare_dupes.string('email', 'email', method='jarowinkler', threshold=0.90, label='email_cl')
compare_dupes.string('address_clean','address_clean', method='damerau_levenshtein', threshold=0.6, label='address_cl')

compare_dupes.string('zip_clean','zip_clean', method='jarowinkler',threshold=0.90, label='zip_cl'
dupe_features = compare_dupes.compute(dupe_candidate_links, df_c).reset_index()
我还尝试了“索引分割”方法:

它适用于大小合理小于200万的数据集,但当数据集的大小超过5、8、10、15、2000万时,甚至索引也无法放入内存


谢谢你的支持

你解决了你的问题吗,我也有同样的问题。你解决了你的问题吗,我也有同样的问题。
indexer = recordlinkage.Index()
#Create indexing object
indexer = rl.SortedNeighbourhoodIndex(on='X')
# Create pandas MultiIndex containing candidate links
candidate_links = indexer.index(A, B)


%%time
comp = recordlinkage.Compare()
comp.string('X', 'X', method='jarowinkler', threshold=0.60)
mymatchestwonew = comp.compute(candidate_links, A, B)
indexer = recordlinkage.Index()
#Create indexing object
indexer = rl.SortedNeighbourhoodIndex(on='X')
# Create pandas MultiIndex containing candidate links
candidate_links = indexer.index(A, B)


%%time
comp = recordlinkage.Compare()
comp.string('X', 'X', method='jarowinkler', threshold=0.60)
mymatchestwonew = comp.compute(candidate_links, A, B)