We present a small example from Steorts, R., Ventura, S., Sadinle, M., and Fienberg, S. (2014). "Blocking Comparisons for Record Linkage." Privacy in Statistical Databases (Lecture Notes in Computer Science 8744), ed. J Domingo-Ferrer, Springer, 252-268, \doi{10.1007/978-3-319-11257-2_20}. We will be using the blink package in R and the RLdata500 data set, which was previously available in the Record Linkage package (but has been deprecated). Here, we illustrate transitive LSH.
In a record linkage task one wants to remove duplicate entries from multiple databases. However, before performing this task, one needs to perform a means of dimension reduction so that the record linkage task is computationally scalable.
Using the TLSH algorithm, we illustrate an example of using this package using a German dataset comprised of first and last name and full date of birth.
Our goals include
The RLdata500 dataset exists already in the blink package in R. We review this data set for the user.
The RLdata500 data consists of 500 records with 10 percent duplication. Thus, there are 450 unique individuals. There is full information on each record containing first name, last name, and full date of birth.
We first load the blink package and load the RLdata500 data set. We also, provide the first few lines of the data. We also remove missing values (they are all missing in this data set).
library(blink) library(plyr) library(tlsh) data(RLdata500) head(RLdata500) data.500 <- RLdata500[-c(2,4)] head(data.500)
We now explain how to run TLSH on the RLdata500 data set, piece by piece.
The function that find the blocks is called **block_setup_v2.
blocks <- block_setup_v2(RLdata500, b=22, k=2) summary(blocks)
where b is the number of buckets and k is the shingle size.
Observe that the blocks are roughly about the same size, however, this does not have to be the case.
The function that allows us to find the recall is eval.blocksetup.
eval.blocksetup(RLdata500, b=26, key=identity.RLdata500)
The function that allows us to find the reduction ratio is reduction.ratio.from.blocking.
(rr <- reduction.ratio.from.blocking(blocks))
To summarize, we have reduced the entire space by roughly 66 percent and the recall is 0.90, which means we are only splitting records across blocks 10 percent of the time.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.