<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Address Clustering for e-Commerce Applications</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Vishal Kakkar</string-name>
          <email>vishal.kakkar@flipkart.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>T. Ravindra Babu</string-name>
          <email>ravindra.bt@flipkart.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Flipkart Internet Private Limited</institution>
          ,
          <addr-line>Bangalore</addr-line>
          ,
          <country country="IN">India</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2018</year>
      </pub-date>
      <abstract>
        <p>The customer addresses are important in e-Commerce for eficient shipment delivery. A predefined structure in addresses is not usually followed in developing countries. Further, some customer addresses are found to be noisy as they contain avoidable additional details such as directions to reach the place. In the presence of such challenges, understanding and equivalence mapping of the addresses becomes necessary for eficient shipment delivery as well as customer linking. We discuss the challenges with actual address data in Indian context. We propose efective methods for eficient large scale address clustering using conventional as well as deep learning approaches. We demonstrate efectiveness of these approaches through elaborate experimentation with real address dataset of an Indian e-commerce company. We further discuss efectiveness of such solution in fraud prediction models.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>INTRODUCTION</title>
      <p>
        Geographical addresses form basic references for delivering
shipments ordered online with an e-Commerce organisation. These
organisations focus on machine learning models for faster and
accurate delivery of the orders. As the organisations expand to serve
diferent business verticals such as perishable grocery, the need of
delivering shipments within hours of the order placement becomes
pivotal. The geographical addresses form basic building block for
each of these services. Address is formally defined as the one that
specifies a location by reference to a thoroughfare or a landmark; or it
specifies a point of postal delivery [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. Addresses and associated
location information have multiple utilities such as linkage to legacy
systems, dispatching aid for emergencies by governmental agencies,
and many applications of geographical information systems [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ].
      </p>
      <p>In the online retail, customers at the time of their user
registration specify one or more of their addresses. In reality, these
Permission to make digital or hard copies of part or all of this work for personal or
classroom use is granted without fee provided that copies are not made or distributed
for profit or commercial advantage and that copies bear this notice and the full citation
on the first page. Copyrights for third-party components of this work must be honored.
For all other uses, contact the owner/author(s).</p>
      <p>SIGIR 2018 eCom, July 2018, Ann Arbor, Michigan, USA
© 2018 Copyright held by the owner/author(s).</p>
      <p>ACM ISBN 978-x-xxxx-xxxx-x/YY/MM.
https://doi.org/10.1145/nnnnnnn.nnnnnnn
addresses in developing countries contain following interesting
challenges.</p>
      <p>
        • Unlike places in Europe, US, Japan and North Korea, the
written addresses in developing countries do not follow a
prescribed structure [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ].
• Every address does not readily have an attached geographical
location.
• With multiple ethnic groups within a country like India,
the names of the areas, groups of houses and the structure
change from region to region.
• Members of same household write their common house
address diferently.
• The number of words of a typical address range from 2 to
20 words. In some cases, users in their eagerness to ensure
that an ordered shipment properly reaches the address, they
would add additional text like directions to reach a place,
landmarks, times of their availability, phone numbers etc.
There are many samples where an address would take around
50-150 words.
• Another interesting challenge is with postal codes known
as postal index number or PIN code in India [
        <xref ref-type="bibr" rid="ref19">19</xref>
        ]. Due to
limited literacy levels and rapid growth of localities within
a city region, there is ambiguity about geographical zones
corresponding to each PIN code. Thus, albeit PIN code forms
unique reference a to broad locality, in practice, the number
mentioned by the customers is not always accurate.
      </p>
      <p>
        Such depiction of addresses pose challenges for a machine
learning based automated solutions such as address classification [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ],
address clustering, fraud address identification or monkey typed
address classification [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], partial or incomplete address classification,
etc.
      </p>
      <p>E-Commerce companies face a number of frauds such as
reseller fraud, and fraudulent claims related to missing items or
mis-shipments. The resellers are those customers who exploit
online discounts or ofers, and sell the items ofline for profit. The
e-Commerce companies limit the number of purchases made by a
single customer in order to reach out to larger customer base. Under
this constraint, resellers would vary their address patterns to
register as a new user for making another purchase. The reseller fraud
relates to an online fraud where some fraudulent customers buy
items by making use of ofers and discounts and selling them ofline
for profit. Such fraud reduces opportunity for genuine customers to
make purchases. Machine learning models are built to identify of
fraudulent transactions, such as, reseller fraud as discussed above,
missing item fraud where a buyer claims that delivered package did
not contain an ordered item, etc. The customer addresses written
diferently with fraud intent but belonging to the same customer
form an important signal in such models. Similarly, identification
of those addresses of the customers belonging to same household
but registered diferently is another important application where
similar addresses need identification.</p>
      <p>In the presence of above challenges in our current work, we
examine ways of clustering the same addresses that are written
diferently either as non-standard sequencing of words or as large
set of additional words. An example for non-standard sequencing
of words in addresses of same location but written diferently is,
House No.xxx, 2nd Main, ISRO Layout, Bikasipura, Bangalore vs.
House No.xxx, Bikasipura, ISRO Layout, 2nd Main, Bangalore. Such
addresses are very common in the current problem. Another
important challenge is the massive address dataset that spans across
the country, which needs to be clustered. Thus, in the presence of
these challenges, the choice of clustering approach is important.</p>
      <p>We examine multiple clustering schemes. After relative
evaluation, we consider one base clustering scheme that requires single
database pass to generate clusters. Its distinct advantage as
noniterative algorithm is ideally suited for mining large datasets. In
terms of features, we consider two approaches. In Approach-1, we
consider words directly as features. In Approach-2, we consider
address word embeddings computed using huge address corpus.
We provide interesting insights on word embedding in
clustering addresses, in the presence of avoidable additional words such
as directions to reach a place. The word embedding on address
corpus is more suitable for the present application than using a
generic pre-trained embeddings. We also examine afinity
propagation approach to clustering using word embeddings. We carry out
experimentation. We demonstrate efectiveness and eficiency of
such approaches. We integrate following aspects in the paper.
• A discussion of eficient clustering approaches
• Clustering using text similarity
• Word embedding of addresses
• Clustering using word embedding
• Experiments on large datasets
• Cluster evaluation</p>
      <p>We organise the paper in the following manner. Section 2
contains motivation for solving the proposed problem and a discussion
on related work. The data challenges and preprocessing are
discussed in Section 3. Section 4 contains a discussion on proposed
solutions. The proposed algorithms are tested on a huge corpus
of actual Indian addresses. The results are discussed in Section 5.
The application usecases are presented in Section 6. A summary of
contributions of the work and outline of future work are provided
in Section 7.
2</p>
    </sec>
    <sec id="sec-2">
      <title>MOTIVATION AND RELATED WORK</title>
      <p>
        The clustering of addresses is essential to identify groups of users
that have same address but written diferently. It helps to identify
groups of same or similar users for reaching out to them with
possible business initiatives as well as to identify potential fraudsters.
The variability in addresses arises due to inadvertent entries,
nonexistence or non-conformance of address standards, and the nature
of users who provide avoidable additional details. Apart from these
sources, the user entered addresses contain many challenges in
terms of spell variants, abbreviations, monkey typed addresses
containing jumbled alphanumeric characters [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], and incomplete or
partial addresses and wrong PIN codes. These aspects motivate us
to identify an efective and eficient clustering algorithm that is
suitable for clustering large address dataset.
      </p>
      <p>
        We did not come across any work related to clustering of
customer or postal addresses in the literature. We discuss works on
related topics. The objective of clustering is to separate patterns
into groups such that the patterns within a group are similar with
reference to a chosen criterion than to those patterns in the other
groups [
        <xref ref-type="bibr" rid="ref18">18</xref>
        ]. In data mining, clustering helps to discover groups
and identify interesting hidden patterns [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. The clustering can be
broadly categorised into partitional, hierarchical, density based and
grid based [
        <xref ref-type="bibr" rid="ref10 ref13">10, 13</xref>
        ]. These works further divide the cluster approach
taxonomy as agglomerative vs divisive, monothetic vs polythetic
and in terms of feature usage as hard vs fuzzy, deterministic vs
stochastic, and incremental vs non-incremental. Addresses that we
consider contain alphanumeric terms. Clustering such addresses
is related to text clustering. The text documents for clustering can
broadly be classified into words, sentences, short-text messages,
paragraphs and large documents [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. The work further discusses
approaches to text feature selection and feature extraction with
their relative advantages and disadvantages, distance and phrase
based clustering, online algorithms for text streams, and overview
on semi-supervised text clustering. The addresses are distinct from
conventional text documents, which usually have large
vocabulary. Thus some of the text clustering approaches are not directly
applicable.
      </p>
      <p>
        Address could be considered as short text documents in terms of
length. In clustering short text documents, exact keyword matching
is not found to be suficient and text representation is expanded by
making use of larger related documents [
        <xref ref-type="bibr" rid="ref20">20</xref>
        ]. Some approaches to
ifnd similarity are by query expansion based on related documents,
not with the conventional focus of creating new query for
information retrieval but to achieve pair-wise comparisons between
short text snippets [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ]. The work is based on measuring semantic
similarities of short text in terms of novel kernel functions. Since
the objective of current work is to find similarly written addresses,
we examine one approach where we use text words directly for
their similarity.
      </p>
      <p>
        For large datasets, the choice of clustering algorithm needs to be
eficient. Ideally, such algorithms should be able to cluster a large
dataset with a single or two passes of the dataset since iterative
algorithms seek multiple passes through the dataset which are
prohibitively expensive. In view of this, we consider leader clustering
algorithm [
        <xref ref-type="bibr" rid="ref18">18</xref>
        ] which generates clusters through a single pass.
Earlier studies [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] demonstrated that the prototype selection by the
algorithm is better than k-medoids. We discuss the leader algorithm
in more detail in Section 4. For a general discussion on clustering
approaches we refer the readers to [
        <xref ref-type="bibr" rid="ref10 ref13">10, 13</xref>
        ].
      </p>
      <p>
        As discussed previously, the addresses contain a number of spell
variations, variable sequence of keywords and additional text that
indicate description of reaching the place, phone numbers, etc. Thus
a word based matching can be challenging. For example, word based
matching of words like ‘apartment’ and ‘apartmnts’ would be
successful depending on threshold of number of characters, whereas
the words ‘apartment’ and ‘apt.’ do not match although they
represent the same. In view of this, we also consider word embeddings
as bag of words for generating equivalent sets of words [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ]. We
shall discuss its usage and method of combining multiple keywords
in address in Section 4.
      </p>
      <p>
        Another important related area is evaluating the clusters. If the
objective of clustering is data reduction through prototype selection,
the clustering can be evaluated by labelling large enough sample
of patterns and evaluate the clustering based prototype selection
through conventional supervised learning metrics [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. But in the
present problem, there are a large set of same addresses that are
written diferently. Thus the number of clusters is very large which
makes supervised learning based evaluation unwieldy. We discuss
some approaches of evaluating the clusters [
        <xref ref-type="bibr" rid="ref10 ref12 ref13 ref16 ref6">6, 10, 12, 13, 16</xref>
        ]. A
clustering structure is said to be valid if the clusters are not chance
occurring or not occurred due to the choice of clustering algorithm.
Three criteria to evaluate cluster validity are known as external,
internal and relative. The external criteria refers to comparison
of ‘identified structure’, as obtained through clustering, with an ‘a
priori structure’. The internal criteria examines whether identified
structure is inherently appropriate for the data. The relative
criteria compares two identified structures and computes their relative
merit. The validation approaches to external criteria include
statistical tests and Monte Carlo techniques to test whether the given
dataset is random. We list out some statistics [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] such as rand
statistic, Jaccard coeficient, Folkes and Mellows index, Huberts Γ
statistic, and normalised Γ statistic. The Cophenetic Correlation
Coeficient and Monte Carlo techniques are used for internal criteria
validation. For relative criteria validity, Dunn index based statistics,
and Davies-Bouldin index are used. Depending on nature of
clustering algorithm, statistics for cluster validity difer. For detailed
discussion on the statistics, we refer the reader to [
        <xref ref-type="bibr" rid="ref10 ref12">10, 12</xref>
        ].
Additionally we briefly discuss two frequently used statistics known
as Silhoutte coeficient [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ] and Calinski-Harabasz [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] index. The
Silhoutte coeficient is bounded between -1 and 1, and it is based
on mean distance of the objects to the objects in the same
cluster and mean distance to objects in the nearest cluster. The score
around zero indicates overlapping clusters. The score is higher for
dense and well separated clusters. The disadvantages are that is
has higher computational complexity and is higher for convex
clusters. The Calinski-Harabasz index is based on within cluster and
between cluster covariances. The score has higher when clusters
are dense and well separated but favours convex clusters. In the
present work, we consider silhoutte and Calinski-Harabasz scores
in the evaluation of address clusters.
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>DATA DESCRIPTION AND PREPROCESSING</title>
      <p>We consider address data of over a million of Indian addresses. It is
observed that rural addresses are short. The urban addresses are
usually long. Table 1 contains average length of addresses across
India at five representative states in the East, West, North, South
and Central part of India. It can be observed from the table that
average number of words per address is about 9, across the country.
But the maximum number of words vary from 50 to 166 which is
much larger than average number of words per address over any
region. Such large number of words indicates avoidable additional
details. As discussed earlier, examples of such details are the text
on directions to reach a location, times of customer availability,
etc. They pose challenges to the address clustering algorithms.</p>
      <sec id="sec-3-1">
        <title>Location</title>
      </sec>
      <sec id="sec-3-2">
        <title>India</title>
      </sec>
      <sec id="sec-3-3">
        <title>Southern India (Karnataka) Northern India (Punjab)</title>
      </sec>
      <sec id="sec-3-4">
        <title>Eastern India (West Bengal)</title>
      </sec>
      <sec id="sec-3-5">
        <title>Western India (Gujarat)</title>
      </sec>
      <sec id="sec-3-6">
        <title>Central India (Madhya Pradesh) Max 166</title>
        <p>90
58
65
92
53</p>
      </sec>
      <sec id="sec-3-7">
        <title>Hyderabad Bangalore Mumbai Pune</title>
        <p>Surat
Ahmedabad
Chennai
Kolkata
Delhi
The discussion on address data in Section 3 provides insights on the
data challenges. We need to cluster the same and similar addresses.
In this context, we briefly discuss about Indian address system.</p>
        <p>
          The postal index number or PIN code [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ] is associated with each
Indian address. India is divided into nine PINCODE zones [
          <xref ref-type="bibr" rid="ref11 ref19">11, 19</xref>
          ],
eight of them are used for civilian use. The number of addresses
across PINCODES is not uniform. Further, since the dataset
considered for study is based on customers of an Indian e-commerce
company, Flipkart, the set is unlikely to contain entire address
database of the country. However they could be proportionately
representative in view of Flipkart’s e-commerce penetration in the
country. The number of addresses per PINCODE ranges from few
hundreds to hundreds of thousands. We experiment clustering
algorithms on each PINCODE as the addresses are similar within a
PINCODE zone.
        </p>
        <p>
          We consider a number of clustering algorithms. The objective is
to obtain clustering of similar addresses. The data under
consideration is text, and the number of candidate addresses is large. We look
for representative patterns. These considerations eliminate popular
k-means algorithm as number of clusters can not be predefined,
and secondly the centroid is unlikely to be a pattern in the original
dataset. As we cannot predetermine the number of clusters, and
also based on earlier study comparing k-medoids to leader for
prototype selection [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ], k-medoids and its variants like PAM, CLARA
and, CLARANS [
          <xref ref-type="bibr" rid="ref14">14</xref>
          ] are not considered. Based on these aspects, and
its ability to identify efective prototypes [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ], we consider leader
clustering algorithm. A description of the algorithm is presented in
Section 4.1.
        </p>
        <p>In the Leader algorithm, we have the flexibility of defining the
similarity threshold and the number of clusters is determined by
that threshold. Further, prototypes generated by the leader
algorithm will be the patterns from the original dataset. Another
advantage of the algorithm is that it requires single pass through
the large database to generate clusters. For pattern similarity we
consider conventional text similarity approach as well as word
embedding vectors. We discuss the algorithms, ways of combining
words, and algorithm complexity in this section. We discuss leader
algorithm in Section 4.1, afinity propagation in Section 4.2, leader
with conventional text comparison in Section 4.3 and leader with
word embeddings in Section 4.4.
4.1</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Leader Clustering</title>
      <p>The leader algorithm is presented in Algorithm 1. It is based on a
predefined similarity threshold, ξ . Initially, a random pattern among
the input patterns is selected as leader. Subsequently, similarity
of every other pattern is compared with that of selected leaders.
If the similarity of new pattern is more than the threshold, the
corresponding pattern falls in the cluster with the initial leader.
Otherwise, the pattern is identified as a new leader. The
computation of leaders is continued till all the patterns are considered. We
can tune the similarity threshold according to the task in hand. The
number of leaders is directly proportional to the selected
threshold. Therefore, smaller the similarity threshold, smaller will be the
number of clusters, but it may afect intra-cluster distance of the
clustering and high the threshold, more will be number of clusters,
but it may afect inter-cluster distance of clustering.</p>
      <sec id="sec-4-1">
        <title>Algorithm 1 Leader Clustering</title>
        <p>
          Input: patterns: P [1, ..., n] , similarity threshold: ξ
Output: ldrpat [1, ..., k] , leaders which are cluster
representatives
ldrpat [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ] ← P [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]
noo f leaders ← 1
for i=1 to n do
for j=1 to noo f leaders do
if Similarity (P [i], ldrpat [j])under ξ then
noo f leaders ← noo f leaders + 1
ldrpat [noo f leaders] = P [i]
break
else
        </p>
        <p>ldrpat [j] = P [i]
end if
end for
end for
4.2</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>Afinity Propagation</title>
      <p>
        Similar flexibility of having a representative pattern or
prototype from the original dataset and avoid pre-specifying number
of clusters a priori can be obtained by the Afinity propagation
algorithm [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] as well. Afinity propagation creates clusters by
exchanging messages between pairs of samples until a set of
exemplars emerges, with each exemplar corresponding to a cluster. The
Afinity Propagation algorithm takes as input a real number s (k, k )
for each data point k, referred to as a preference. Data points with
large values for s(k,k) are more likely to be exemplars. If we don’t
have information about the preferences among the data points, the
algorithm will treat each data point as potential exemplar.
      </p>
      <p>The messages sent between pairs represent the suitability for
one sample to be the exemplar of the other, which is updated in
response to the values from other pairs. This updating happens
iteratively until convergence, at which point the final exemplars are
chosen, and hence the final clustering is given. Afinity Propagation
does not require the number of clusters to be suggested a priori or
estimated before running the algorithm and chooses the number of
clusters based on the data provided. The main drawback of Afinity
Propagation is its complexity. The algorithm has a time complexity
of the order O (n2 ∗ d ∗ T ), where n is the number of samples, d
is maximum number of words in address and T is the number of
iterations until convergence. Therefore, scalability is the concern
for this algorithm.</p>
      <p>We discuss following two address clustering approaches that
uses Leader as base clustering algorithm.</p>
    </sec>
    <sec id="sec-6">
      <title>4.3 Leader Clustering with Edit Distance</title>
      <p>In case of address data, we need to find similarity between the
addresses. Since the objective is to group similar addresses, the
addresses are expected to have terms that are similar but variant
in position, spelling and number of terms. In view of this, we
consider actual term matching. We use edit distance with appropriate
threshold.</p>
      <sec id="sec-6-1">
        <title>Algorithm 2 Similarity</title>
        <p>Input: patterns: p1, p2, similarity threshold: ξ , edit distance
threshold: ϵ
count = 0
for word1 in p1 do
for word2 in p2 do
if editdistance (word1, word2) ≤ ϵ then</p>
        <p>count ← count + 1
end if
end for
end for
if count ≥ ξ ∗ min(no_o f _words_p1, no_o f _words_p2) then
return YES
else</p>
        <p>return NO
end if</p>
        <p>Leader clustering algorithm is provided in Algorithm 1. The
proposed approach has two parameters, such as, ξ for similarity
threshold and ϵ for edit distance threshold in terms of number
of characters. The similarity algorithm used in the algorithm is
described in Algorithm 2. The worst case complexity of Algorithm
1 is O (n2). The worst case complexity of Algorithm 2 is O (d2 ∗ m2),
where d is the maximum number of words in any pattern p and m
is the maximum length of any word w in any pattern p. So, overall
worst case complexity of the algorithm is O ((n ∗ d ∗ m)2).</p>
        <p>The clusters are represented by leaders which are essentially one
of the patterns in the given dataset. Leader should be contrasted
against a centroid which in most cases is not a pattern in the given
dataset. The number of clusters identified depends on the
similarity threshold ξ . The value of ξ is empirically chosen and is data
dependent. However, it should be noted that the leaders are order
dependent.</p>
      </sec>
    </sec>
    <sec id="sec-7">
      <title>4.4 Leader Clustering with Word Embeddings</title>
      <p>The clustering of addresses with appropriate edit distance provides
good homogeneous clusters. But when the addresses contain
additional words, beyond a certain threshold, such addresses form a
diferent clusters. At this stage, it is educative to examine alternate
approaches to group those addresses that have additional words
which are reasonably rare but still belong to the same location.
Such additional words include such rare descriptions like
directions to reach a place, as we discussed in Section 3. Secondly, it
is interesting to explore ways to bring all the vocabulary that are
semantically similar but syntactically variant. This motivated us to
examine word embeddings based clustering.</p>
      <p>
        In this approach, instead of using edit distance based method,
we will use word embeddings of all the addresses. Each word is
embedded into vector using the continuous bag of words (CBOW)
algorithm [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ] by training exclusively on a large corpus of addresses
by considering only those words that have occurred at least τ times,
where τ =100 in the present case. We considered a window length
of 3 and embedding size of 200. We combine individual vectors
of each of these words in an address through averaging. We term
our entire approach as add2vec (address to vector). To compute
similarity between two addresses, we compute the cosine similarity
between two address patterns.
      </p>
      <sec id="sec-7-1">
        <title>Algorithm 3 add2vec Cosine similarity</title>
        <p>Input: patterns: p1, p2, distance threshold: ξ
vec1 ← 0, vec2 ← 0
for word1 in p1 do</p>
        <p>vec1 ← vec1 + word2vec(word1)
end for
for word2 in p2 do</p>
        <p>vec2 ← vec2 + word2vec(word2)
end for
if cosine_similarity (vec1, vec2) ≥ ξ then</p>
        <p>return YES
else</p>
        <p>return NO
end if</p>
        <p>As we notice in Algorithm 2, edit distance based similarity is
polynomially dependent on the number of words as well as the
length of words in the pattern. Whereas, add2vec based cosine
similarity linearly depends on the number of words in the pattern
and constant vector length l. Therefore, the complexity of add2vec
similarity algorithm is O (2d ), where d is the maximum number
of words in any pattern p. So, overall, the worst case complexity
of the algorithm is O (n2 ∗ d ), whereas worst case complexity of
Afinity propagation algorithm with add2vec based cosine similarity
is O (n2 ∗ d ∗ T ).</p>
        <p>The first advantage of using add2vec approach is that it is
scalable and requires less computation time, given the address word
embeddings. Secondly word2vec can capture spell variants which
can go beyond the threshold chosen for term based comparison as
discussed in Section 4.3. Also, it can handle additional uncommon
words such as directions to reach a place.
We carried out elaborate experimentation to compare and validate
results generated by address clustering algorithms. We used both
human evaluation and commonly used metrics to compute cluster
validity.</p>
        <p>In the setting of address clustering, the actual number of clusters
in the dataset is not known, a priori. In the context of e-Commerce
customers, it is unlikely that one would arrive at clusters of large
sizes except in case of fraud scenario such as resellers or large
apartment complexes. The reseller fraud modelling is one of the
applications of the current exercise of address clustering. In the
experiments as shown in Figure 2, maximum cluster size is of the
order of about 500.</p>
        <p>
          Let us consider a case of validating a clustering algorithm by
making use of labeled patterns [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]. Consider a large multi-class
labeled patterns with each class containing hundreds of patterns.
With the objective of data reduction, we generate representative
patterns or prototypes using a clustering algorithm with
appropriate corresponding hyper-parameters. The prototypes form proper
subset of original class-wise pattern set. The clustering algorithm
can be validated for its performance of identifying appropriate
prototypes. It is done by classifying the test patterns by considering
prototypes alone. However, since in the current scenario, the
number of clusters is large and cluster sizes are small, the approach is
not applicable.
        </p>
        <p>
          In Section 5.1, we discuss two metrics, known as, silhouette
coeficient and Calinski-Harabasz index. The alternate approach
to metrics based validation is by making use of human experts
validating whether cluster members are homogeneous. The
experimentation, results and insights are presented in Section 5.2.
Calinski-Harabasz index: For k clusters, the Calinski-Harabaz
score [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ], also known as Variation Ratio Criterion (VRC), is defined
as average Between Group Sum of Squares (WGSS) to average
Within Group Sum of Squares (WGSS). We follow the same notation
as used in [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ].
        </p>
        <p>Consider that there are k clusters. Given the mean of squared
distances of between all samples, d2 and mean of squared distance
2
within a group, g, dд , the weighted mean of the diferent between
overall and within group mean squared diferences is given by,
(2)
(3)
(4)
(5)
1 k 2 2
Ak = X(np − p) (d − dp )</p>
        <p>n − k p=1
The between group sum of squares is given by,</p>
        <p>1 2</p>
        <p>BGSS = 2 ((k − 1)d + (n − k )Ak )
The within group sum of squares is given by,</p>
        <p>W GSS = 1 Xk(np − p)dp 2
2</p>
        <p>p=1</p>
      </sec>
      <sec id="sec-7-2">
        <title>The Calinski-Harabasz score is given by,</title>
        <p>BGSS/k − 1
s =</p>
        <p>W GSS/n − k</p>
        <p>The score is higher for dense and well separated clusters.</p>
      </sec>
    </sec>
    <sec id="sec-8">
      <title>5.2 Results</title>
      <p>We generate word embeddings by training a large corpus of
addresses of over a million of customer addresses across India by
considering those words that have minimum support of 100. The
approach identifies all spell variants that are close by in cosine
similarity sense. In Table 7, we present spelling variants captured
by Clustering with edit distance and Clustering with word2vec
algorithms. The spell variants that are shown against embeddings
are in addition to those identified using edit distance.</p>
      <p>We aim to cluster similar addresses. Practically, the addresses are
similar within a given geographical locality. The locality is captured
well by PIN code as discussed in Section 4. For the exercises, we
ignore error in PIN codes as mentioned by the customers. This
usually forms a small percentage of the addresses. Further, their
presence would only lead to singleton or clusters of very small
size. Even within a PIN code the number of addresses reaches a
hundreds of thousand addresses. Thus we restrict clustering to a
given PIN code. We conducted PIN code-wise experiments across
the country. We carry out experiments for choosing appropriate
thresholds for clustering. Figure 1 contains number of clusters per
PIN code using add2vec. We consider similarity as threshold as
against conventional measure of dissimilarity for clustering. As
similarity increases, number of clusters increases.</p>
      <p>140000</p>
      <p>We repeat this experiment for diferent States within India for
various similarity thresholds. We further study the number of
addresses per cluster for all the states. For illustration, we present
the results for one state of Punjab in India. Figure 2 contains
number of cluster members for each cluster for thresholds,
0.85(topleft),0.90(top-right),0.95(bottom-left),0.98(bottom-right). Following
observations can be made from these plots.</p>
      <p>• No. of singleton clusters increases with increasing similarity
threshold
• No. of cluster members is of the order of {27 to 212} for 0.85,
{26.7 to 211} for 0.90, {26 to 29} for 0.95 and {25 to 29}
• No. of cluster members per cluster is near optimal
(changeover point) for the score of 0.95
217
s214
r
te211
s
lu28
c
fo25
o
N22
217
s214
r
te211
s
lu28
c
fo25
o</p>
      <p>N22
217
s214
r
te211
s
lu28
c
fo25
o
N22
217
s214
r
te211
s
lu28
c
fo25
o
N22
2−1 2−1 21 23 25 27 29 211 213</p>
      <p>No of addresses in cluster
2−1 2−1 21 23 25 27 29 211 213</p>
      <p>No of addresses in cluster
2−1 2−1 21 23 25 27 29 211 213</p>
      <p>No of addresses in cluster
2−1 2−1 21 23 25 27 29 211 213</p>
      <p>No of addresses in cluster</p>
      <p>The cluster metrics for each of the above thresholds is placed
in Table 8. It can be noted from the table the metrics increase with
increasing similarity value till 0.95 and reduce subsequently.</p>
      <p>Based on the empirical evaluation and observations from the
plots in Figures 1 and 2, and Table 8, we consider a threshold of
0.95 for leader with add2vec.</p>
      <p>For leader clustering with edit distance, where we compare
actual words between two addresses using edit distance, we use two
thresholds. The first threshold, ϵ, is on the edit distance between
two words and the second threshold, ξ , is on the number of words
that could be diferent between two addresses so that they could
be placed in the same clusters. The choice of ϵ depends on word
length. We carried out experiments for diferent values of ϵ and
ξ . The values for ϵ are chosen as {1,2} for word lengths of {≤4,≥5}
respectively. Based on empirical evaluation, we consider a value of
0.95 for the threshold, ξ .</p>
      <p>We present quality of clustering results of proposed Leader
clustering algorithm with add2vec similarity, Leader clustering
algorithm with edit distance similarity and Afinity propagation
algorithm with add2vec similarity. To visualise homogeneity of clusters
generated by each of these algorithms, we have chosen a sample
of 1000 addresses randomly from a pincode. The results for similar
address are shown in Tables 9, 10, 11 .</p>
      <p>It can be observed from the tables, that cluster quality with
afinity propagation with add2vec similarity and leader with add2vec
produce similar clusters. But computation complexity of afinity
propagation is very high. We observe that the algorithm is not
scalable for large data. In case of leader with edit distance, by virtue
of choice of ξ and ϵ, the clusters contained a patterns that does not
belong to the cluster. An example is shown in italics, in Table 10.</p>
      <p>For the above samples, we computed cluster metrics and placed
them in Table 12. The CPU time presented in seconds is based
on random sample of 10,000 addresses. The CPU time on Intel(R)
Xeon(R) CPU E5-2690 v4 @ 2.60GHz with Sklearn 0.19.1
implementation of python 2.7 is presented in Column-4.
We show the efectiveness of clustering approach with word
embeddings in Table 13. Here we consider an address of leader or cluster
prototype and compare its similarity as new words get added. Both
the leader and final address with additional words are taken from
actual address database of Flipkart. For the sake of brevity we
show additional words in small bursts instead of considering them
word by word. The table contain address and its similarity with
the address in row-1. The corresponding similarity is with itself in
row-1 and hence it is 1.0. Further in order to appreciate the changes
from previous address, relatively new terms are shown in italics.
Column-2 contains cosine similarity of the address to the
leaderaddress (row-1). We note from the table, even after doubling of
number of words from 16 of the leader to the address in the last row
that contained 32 words, the similarity remains within the chosen
threshold of 0.95. However this approach will have dificulty when
the additional words are frequent words that appear in the address.</p>
    </sec>
    <sec id="sec-9">
      <title>APPLICATIONS</title>
      <p>We deployed this solution in conjunction with supervised machine
learning model for classifying resellers and found significant gains
in fraud prevention.</p>
      <p>In general, the address clustering solution has multiple
applications in the e-Commerce companies. A efective algorithm links
all the users belonging to the same address but written diferently
either by deliberate attempt with fraud intent or due to
inadvertence. This in turn has multiple applications such as (a) reaching
out to diferent groups of users, (b) plan multiple shipment
delivery initiatives, (c) machine learning models to detect frauds, etc. A
pre-emptive action at the time of ordering can prevent fraudulent
transactions. In summary, this forms an important signal for
machine learning models in Trust and Safety domain of e-commerce
transactions.
7</p>
    </sec>
    <sec id="sec-10">
      <title>SUMMARY AND FUTURE WORK</title>
      <p>We consider a practical problem of clustering addresses in places
where the addresses do not follow a predefined structure. It is
compounded by limited literacy of the customer which result in spell
variations, merged words where space separator between two
address components is missed, abbreviations, inadvertent separation
of a joint word, etc. We consider a clustering algorithm that is
suitable for mining large datasets, known as Leader. It uses single
database scan for forming clusters. In terms of features, we consider
text components of address directly and word embeddings of the
entire address corpus independently for diferent approaches. With
word embeddings, for a given address, we obtain vector
representation by averaging each of the word embeddings. In addition to
these algorithms, we also study the utility of afinity propagation
algorithm and highlight its limitations. We present the algorithms,
discuss relative advantage and disadvantages along with the
elaborate experimental results. We carry out elaborate experiments and
demonstrate that leader clustering with word embeddings, which
we term as add2vec provides address clustering solution. The
clustering approaches of leader with edit-distance could lead to outliers
entering a cluster. And the afinity propagation algorithm is found
to be non-scalable.</p>
      <p>Another advantage of the clustering approach is that we
obtain address prototypes for a clusters of similar address. The huge
corpus of address of hundreds of thousands of addresses for each
PIN code is reduced to smaller set of prototype vectors, which is
a proper subset of original address dataset. This makes
comparison of addresses, and insertion of a new address to the existing
set of clusters as eficient operations, since we only consider the
prototypes for these operations.</p>
      <p>As future work, we propose to evaluate the use of tf-idf weighting
of individual word embeddings to obtain representative address
vector for more efective clusters and hierarchical clustering using
the same approach with diferent valid thresholds for scaling to
larger datasets. Also, we considered a window size of 3 for CBOW
and embedding of 200. The efect of choice of hyper parameters on
clustering performance is also considered for future work.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>C.C.</given-names>
            <surname>Aggarwal</surname>
          </string-name>
          and
          <string-name>
            <given-names>C.</given-names>
            <surname>Zhai</surname>
          </string-name>
          .
          <year>2012</year>
          .
          <article-title>A survey of text clustering algorithms</article-title>
          ,
          <source>In Mining text data</source>
          . Springer, Boston, MA.
          <fpage>77</fpage>
          -128 pages.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>T.R.</given-names>
            <surname>Babu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Chatterjee</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Khandeparker</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.V.</given-names>
            <surname>Subhash</surname>
          </string-name>
          , and
          <string-name>
            <given-names>S.</given-names>
            <surname>Gupta</surname>
          </string-name>
          .
          <year>2015</year>
          .
          <article-title>Geographical address classification without using geolocation coordinates</article-title>
          . ACM.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>T.R.</given-names>
            <surname>Babu</surname>
          </string-name>
          and
          <string-name>
            <given-names>V.</given-names>
            <surname>Kakkar</surname>
          </string-name>
          .
          <year>2017</year>
          .
          <article-title>Address Fraud: Monkey Typed Address Classification for e-Commerce Applications</article-title>
          . http://sigir-ecom.weebly.com/uploads/1/0/2/9/ 102947274/paper_21.pdf
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>T. R.</given-names>
            <surname>Babu</surname>
          </string-name>
          and
          <string-name>
            <given-names>M. N.</given-names>
            <surname>Murty</surname>
          </string-name>
          .
          <year>2001</year>
          .
          <article-title>Comparison of genetic algorithm based prototype selection schemes</article-title>
          .
          <source>Pattern Recognition</source>
          <volume>34</volume>
          ,
          <issue>2</issue>
          (
          <year>2001</year>
          ),
          <fpage>523</fpage>
          -
          <lpage>525</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>T. R.</given-names>
            <surname>Babu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M. N.</given-names>
            <surname>Murty</surname>
          </string-name>
          , and
          <string-name>
            <given-names>V. K.</given-names>
            <surname>Agrawal</surname>
          </string-name>
          .
          <year>2005</year>
          .
          <article-title>On simultaneous selection of prototypes and features in large data</article-title>
          . Berlin, Heidelberg.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>T.</given-names>
            <surname>Calinski</surname>
          </string-name>
          and
          <string-name>
            <given-names>J.</given-names>
            <surname>Harabasz</surname>
          </string-name>
          .
          <year>1974</year>
          .
          <article-title>A dendrite method for cluster analysis</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>C.A.</given-names>
            <surname>Davis</surname>
          </string-name>
          and
          <string-name>
            <given-names>F.T.</given-names>
            '
            <surname>Fonseca</surname>
          </string-name>
          .
          <year>2007</year>
          .
          <article-title>Assessing the certainty of locations produced by an address geocoding system</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          <article-title>[8] FGDC Subcommittee for Culture and Demographic Data</article-title>
          .
          <year>2001</year>
          .
          <article-title>United States Thoroughfare, Landmark, and Postal Address Data Standard</article-title>
          . https://www.fgdc. gov/standards/projects/address-data/AddressDataStandardPart01
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>B. J.</given-names>
            <surname>Frey</surname>
          </string-name>
          and
          <string-name>
            <given-names>D.</given-names>
            <surname>Dueck</surname>
          </string-name>
          .
          <year>2007</year>
          .
          <article-title>Clustering by passing messages between data points</article-title>
          .
          <source>Science</source>
          <volume>315</volume>
          ,
          <issue>5814</issue>
          (
          <year>2007</year>
          ),
          <fpage>972</fpage>
          -
          <lpage>976</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>M.</given-names>
            <surname>Halkidi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Batistakis</surname>
          </string-name>
          , and
          <string-name>
            <given-names>M.</given-names>
            <surname>Vazirgiannis</surname>
          </string-name>
          .
          <year>2001</year>
          .
          <article-title>On clustering validation techniques</article-title>
          .
          <source>Journal of Intelligent Information Systems</source>
          <volume>17</volume>
          ,
          <fpage>2</fpage>
          -
          <lpage>3</lpage>
          (
          <year>2001</year>
          ),
          <fpage>107</fpage>
          -
          <lpage>145</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <surname>India</surname>
            <given-names>Post [</given-names>
          </string-name>
          n. d.].
          <source>PIN Code. Retrieved May 1</source>
          , 2018 from https://www.indiapost. gov.in/MBE/Pages/Content/Pincode.aspx
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>A. K.</given-names>
            <surname>Jain</surname>
          </string-name>
          and
          <string-name>
            <given-names>R. C.</given-names>
            <surname>Dubes</surname>
          </string-name>
          .
          <year>1988</year>
          .
          <article-title>Algorithms for clustering data</article-title>
          . Englewood Clifs: Prentice Hall.
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <surname>Murty</surname>
            <given-names>M.N.</given-names>
          </string-name>
          <string-name>
            <surname>Jain</surname>
            <given-names>A.K.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Flynn</surname>
            <given-names>P.J.</given-names>
          </string-name>
          <year>1999</year>
          .
          <article-title>Data clustering: a review</article-title>
          .
          <source>ACM computing surveys (CSUR) 31</source>
          ,
          <issue>3</issue>
          (
          <year>1999</year>
          ),
          <fpage>264</fpage>
          -
          <lpage>323</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>L.</given-names>
            <surname>Kaufman</surname>
          </string-name>
          and
          <string-name>
            <given-names>P. J.</given-names>
            <surname>Rousseeuw</surname>
          </string-name>
          .
          <year>2009</year>
          .
          <article-title>Finding groups in data: an introduction to cluster analysis</article-title>
          . Vol.
          <volume>344</volume>
          . John Wiley &amp; Sons.
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <given-names>T.</given-names>
            <surname>Mikolov</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Chen</surname>
          </string-name>
          , G. Corrado, and
          <string-name>
            <given-names>J.</given-names>
            <surname>Dean</surname>
          </string-name>
          .
          <year>2013</year>
          .
          <article-title>Eficient estimation of word representations in vector space</article-title>
          . (
          <year>2013</year>
          ). https://arxiv.org/abs/1301.3781
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <given-names>P. J.</given-names>
            <surname>Rousseeuw</surname>
          </string-name>
          .
          <year>1987</year>
          .
          <article-title>Silhouettes: a graphical aid to the interpretation and validation of cluster analysis</article-title>
          .
          <source>J. Comput. Appl</source>
          . Math.
          <volume>20</volume>
          (
          <year>1987</year>
          ),
          <fpage>53</fpage>
          -
          <lpage>65</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          [17]
          <string-name>
            <given-names>M</given-names>
            <surname>Sahami</surname>
          </string-name>
          and
          <string-name>
            <given-names>T. D.</given-names>
            <surname>Heilman</surname>
          </string-name>
          .
          <year>2006</year>
          .
          <article-title>A web-based kernel function for measuring the similarity of short text snippets</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          [18]
          <string-name>
            <given-names>H</given-names>
            <surname>Spath</surname>
          </string-name>
          .
          <year>1982</year>
          .
          <article-title>Cluster Analysis - Algorithms for data reduction and classification of objects</article-title>
          . Ellis Horwood Limited, Chichester.
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          [19]
          <string-name>
            <surname>Universal</surname>
            <given-names>Postal</given-names>
          </string-name>
          <string-name>
            <surname>Union</surname>
          </string-name>
          .
          <year>2018</year>
          .
          <article-title>Postal addressing systems in member countries</article-title>
          . (
          <year>2018</year>
          ). http://www.upu.int/en/activities/addressing/ postal
          <article-title>-addressing-systems-in-member-countries</article-title>
          .html
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          [20]
          <string-name>
            <given-names>C.</given-names>
            <surname>Zhai</surname>
          </string-name>
          .
          <year>2008</year>
          .
          <article-title>Statistical Language Models for Information Retrieval (Synthesis Lectures on Human Language Technologies)</article-title>
          . Morgan &amp; Claypool Publishers.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>