{'fraction_non_alphanumeric': 0.04064464712653856, 'fraction_numerical': 0.011644381475250156, 'mean_word_length': 4.534672874295516, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
An individual-level ground truth dataset for home location detection

Home detection, assigning a phone device to its home antenna, is a ubiquitous part of most studies in the literature on mobile phone data. Despite its widespread use, home detection relies on a few assumptions that are difficult to check without ground truth, i.e., where the individual that owns the device resides. In this paper, we provide an unprecedented evaluation of the accuracy of home detection algorithms on a group of sixty-five participants for whom we know their exact home address and the antennas that might serve them. Besides, we analyze not only Call Detail Records (CDRs) but also two other mobile phone streams: eXtended Detail Records (XDRs, the ``data'' channel) and Control Plane Records (CPRs, the network stream). These data streams vary not only in their temporal granularity but also they differ in the data generation mechanism', e.g., CDRs are purely human-triggered while CPR is purely machine-triggered events. Finally, we quantify the amount of data that is needed for each stream to carry out successful home detection for each stream. We find that the choice of stream and the algorithm heavily influences home detection, with an hour-of-day algorithm for the XDRs performing the best, and with CPRs performing best for the amount of data needed to perform home detection. Our work is useful for researchers and practitioners in order to minimize data requests and to maximize the accuracy of home antenna location.

in support of official statistics, to reduce costs and time of data collection and increase the timeliness and scalability of the collected data [38,16,26]. In particular, the recent years have witnessed the emergence of methodologies that use heterogeneous digital data -such as social media data, GPS traces, or mobile phone records -to estimate socio-economic indicators of objective and subjective well-being [41,15,33,23,29,21,36,27,25,24,13,10]. Among the many applications of data science to official statistics, the usage of mobile phone data to identify where someone lives, i.e., detecting an individual's home location, has emerged as one of the most critical issues in many tasks, such as the estimation of population density [9,18,35], commuting and migration flows [14,19,17,4], air pollution [34,20], and the estimation of privacy risk [8,30,7,31,11]. The knowledge of individuals' home location forms the crucial link between digital data and census data, making it a key enabler for the integration of these two sources of information.
Most of the home detection algorithms (HDAs) proposed in the literature [1,12,40,39] process mobile phone records according to heuristics rather than principled approaches. Indeed, they rely on simple decision rules based on how much, and when, an individual calls in each location during a period of observation.
The simplest HDA identifies an individual's home location as the one in which they made the highest number of calls. A variant of this HDA identifies an individual's home location as the one in which they make the highest number of calls during nighttime (between 7pm and 9am). Other HDAs use a combination of criteria or slight variations of the ones mentioned above [40,39]. Although these HDAs have been used in many works and tools [32,29,22,5,6,42,10,28], a thorough validation of their accuracy still lacks in the literature.
On the one hand, HDAs have been validated on human-triggered data such as Call Detail Records (CDRs), which describe each user's position only when they make or receive a call. Since the inter-event time between two calls is bursty [37], CDRs are sparse and provide an incomplete picture of an individual's positions over time [2]. It is not clear whether human/machine-triggered records (e.g., eXtended Detail Records or XDRs) or pure network machine-triggered records (e.g., Control Planes Records or CPRs) can overcome the limitations of using the more temporally sparse CDRs and provide more accurate estimates of an individual's home location.
On the other hand, there is no consensus on which HDA is the most accurate and what determines its accuracy, mainly because of the lack of proper validation. Apart from sporadic cases [1,12], ground truth data at the individual level are not provided by mobile providers for privacy protection reasons, making it difficult to obtain a large sample of users for which complete information about positions and residence are available at the same time. For example, Vanhoof et al. [40] provide a high-level validation of the most popular HDAs by comparing each mobile phone tower's population as estimated by official censuses with the number of users whose home is detected to be in that tower. They conclude that there is an urgent need for validation of HDAs at the individual level, i.e., evaluating the performance in detecting the home location on a set of individuals for which the actual home location is known [40].
This paper provides an unprecedented dataset that allows validation of HDAs on individual-level ground truth data and three streams of mobile phone records -CDRs, XDRs, and CPRs. Specifically, 65 users working for Telefónica Chile gave their written consent to provide us access to their phone records for two weeks, as well as their actual address of residence. This information allows us to assess the accuracy of HDAs, i.e., their capacity to detect a user's actual home correctly, on a ground truth dataset. Our validation reveals the most accurate HDA among the popular ones proposed in the literature, and that human-machine-and machine-triggered records (XDRs and CPRs, respectively) improve the accuracy of HDAs considerably with respect to pure humantriggered records (CDRs). Moreover, we set up a "data minimization" experiment to study how the accuracy of detecting home locations changes by the stream used and the number of records for each user. We find that, depending on the stream, just a small fraction of the records is enough to achieve reasonably accurate estimations of an individual's home location, hence providing a tool to manage the uncertainty and utility trade-off in geo-privacy.
With this paper, we also release both the code to reproduce the HDAs and a dataset that describes, for each ground truth user, the towers visited, the visitation frequency to each tower, and an estimation of the tower(s) associated with the user's address of residence. To the best of our knowledge, this is an unprecedented contribution to the field, which paves the road towards the definition of more accurate home detection algorithms.

Methods
We obtained written consent from 65 people working for Telefónica Chile to use the precise latitude and longitude of their homes in Santiago de Chile, calculated over the original addresses (e.g., 123 Santiago Street, Providencia) with reverse lookup using Google Maps. We also obtained consent to gather two weeks (14 days, September 24-October 6, 2019 inclusive) of their historical mobile phone records for three streams: Call Detail Records (CDRs), eXtended Detail Records (XDRs), and Control Plane Records (CPRs). For CPRs, October 5 is missing (see Figure 1), and there are 13 days only.
Mobile phone operators collect CDRs and XDRs for billing and operational purposes. CDRs are purely user-triggered, i.e., they are generated by the users every time they make or receive a phone call. Consequently, when a user does not make/receive a call, their position is not recorded. XDRs are a mixture of human-and device-triggered, either by explicitly requesting an http address or automatically downloading content from the Internet (e.g., emails). In contrast, CPRs are network-triggered (e.g., assigning a new antenna, connecting new devices) and are used to monitor the cellphone network health. Although all three streams are equal in terms of their geo-location properties (the set of towers remains more or less constant in time), they vary significantly in their time granularity and data sparsity. Figure 2 shows an illustrative example of CDRs, XDRs, and CPRs of an individual, and how the most frequented tower changes stream by stream.
Formally, a Call Detail Record (CDR) is a tuple (u o , u i , t, d, A o , A i ), where u o and u i are the identifier of the user that places the call (the caller) and the one that receives the call (the callee), respectively; t is a timestamp of when the call was placed, and d is the call duration (in minutes). A o and A i are the antennas for the "outgoing call" (where the call is placed) and the "receiving call" (where the call is picked up). Our dataset contains 1933 antennas ( Figure  3), which may be a tower (containing many antennas), or a single antenna, as in indoor spaces [3]. In this study, an antenna A is associated with its location in space expressed as a latitude and longitude pair, hence A = (l x , l y ) where l x , and l y are the longitude and latitude of A. For simplicity, from now on, we always use the term "tower" when referring to a location a user is located at.
An eXtended Detail Record (XDR) is a tuple (u, t, A, k), in which there is only one antenna A involved, u is the caller's identifier, t is a timestamp of when the record is created, and k is the amount of downloaded information (in kilobytes). A Control Plane Record (CPR) is a tuple (u, t, A, e), where each e ∈ E is an "event" of the network. There are many possible control-plane events, such as "handovers" (when a new antenna is pushed on the device).
For the period under investigation, we have 19,234 CDRs, 43,607 XDRs and 772,871 CPRs. Figure 1a compares the number of records in our dataset of the three streams. CPRs (network-triggered) are by far the most frequent ones (i.e., most records per user), followed by XDRs (human-and device-triggered) and CDRs (human-triggered). CDRs are also the data type with the highest variance across the days of the week. Figure 1b shows the number of active users (those with at least one record) per hour in our dataset for each stream. Again, CPRs show the highest number of active users, followed by XDRs and CDRs. Note also that CPRs have the lowest variance between the week's days, while CDRs have the highest variance.

Code availability
The code to reproduce the analyses in the paper is available at https://github.com/leoferres/home_loc.

Data Records
From the CDRs, XDRs, and CPRs of the users, we extract aggregated data about the activity in each tower according to five home detection algorithms (HDAs, see Section 4). Tables 1, 2 and 3 show the structure of the released data. In practice, the tower identified by an HDA X on a stream T as the home location of a user u is the tower in the row with the highest value of "activity" in Table 1 in which "data type"= T and "HDA"= X. We indicate as H X,T (u) the tower detected as the home location by HDA X on stream T for user u.

Activity
In the Activity dataset, each row describes the activity a user has in a tower, according to a data stream and an HDA. Column "device" (type: string) indicates the (anonymized) device identifier. Column "tower" (type: string) indicates the identifier of a mobile phone tower. Column "activity" (type: integer) indicates the amount of activity the user has in the tower. Column "stream" (type: string) indicates the type of records (CDRs, XDRs, or CPRs) and column "HDA" the home detection algorithm. Given a stream T , a user u, and an HDA X, the row with the highest value of "activity" is the home detected by X on T for u. For example, for CDRs and HDA1, column "activity" indicates the number of CDRs the user has for that tower. For XDRs and HDA2, the same column indicates the number of distinct days the user has at least one XDR for that tower. Table  1 shows some examples of records in the Activity dataset corresponding to a single user. Note that the records are sorted by device, stream, HDA, and activity. In total, the Activity dataset contains 260,400 rows.

Towers
In the Towers dataset, each row describes the identifier and the geographic location of a mobile phone tower. Column "tower" (type: string) indicates the identifier of a mobile phone tower. Columns "lat" (type: float) and "lng" (type: float) indicate the tower's latitude and longitude, respectively. Table 2 shows some examples or records describing mobile phone towers. In total, the Towers dataset containts 65 rows.

Ground truth
In the Ground truth dataset, each row describes a mobile phone device and the identifiers of the three closest tower to the user's actual home location. Column "device" (type: string) indicates the (anonymized) device identifier. Columns "closest", "2nd closest", and "3rd closest" (type: string) indicate the identifiers of the towers that are the closest tower, the second closest tower, and the third closest tower to the actual home location of the user, respectively.

Technical Validation
We use the released dataset to assess the agreement between popular home detection algorithms and assess their accuracy with respect to the ground truth dataset.
We consider the five most popular home detection algorithms defined for mobile phone data [40], denoted as HDA1-HDA5. For every stream -CDRs, XDRs, and CPRs -and for every user u, the HDAs calculate the most active tower given some constraints. Algorithm HDA1 counts the number of records at every tower for u. The tower with the highest activity is u's home location. Algorithm HDA2 calculates the activity of towers for every unique day. In our case, for CDRs and XDRs, if the user spends every day at home, the highest number will be 14, while for CPRs, it will be 13. Thus, wherever u is on most days over two weeks is their home. Algorithm HDA3 calculates the most active towers during nighttime: between 7pm and 7am, inclusive. The tower that is most active during this period at night is u's home location. Algorithm HDA4 is an extension of HDA1 that implements a spatial perimeter of 1 km around each tower. Whatever tower aggregates most activities in the perimeter is u's home. Finally, according to HDA5, u's home location is the tower with most activities in a 1 km perimeter between 7pm and 7am. 1

Agreement between HDAs
We investigate whether, for the same user, different HDAs detect the same home location and how the choice of the stream influences the agreement between algorithms. Given a stream T ∈ {CDRs, XDRs, CPRs}, we assess to which degree two HDAs X and Y agree on a set of individuals by evaluating the Simple Matching Coefficient (SMC) [40], defined as: where u = 1 . . . N denotes the N users in our dataset, H X,T (u) and H Y,T (u) denote the home location detected for user u on stream T by HDAs X and Y respectively, and δ is the Kronecker delta which is equal to 1 when H X,T (u) = H Y,T (u) and 0 otherwise. Values of SMC thus range between 0 and 100. They can be interpreted as the percentage of individual cases for which both algorithms detected the same home location, i.e., the agreement between two HDAs. Figure 4 shows the SMC for each combination of HDAs and stream and the average SMC between each HDA and all the others, for each stream. We find that the average agreement between the HDAs is the highest for XDRs (41.09%) and the lowest for CPRs (27.85%). Moreover, there are two distinct groups of HDAs with similar SMC: HDA1, HDA2, and HDA3 on one side, and HDA4 and HDA5 on the other side (Figure 4), regardless of the stream.
Our results provide important practical insights. First, XDRs should be preferred when performing home location detection. Since they lead to the highest agreement between HDAs, XDRs would guarantee a higher reproducibility of the results. Unfortunately, most of the works in the literature use CDRs, and with different HDAs. Second, for XDRs, the average agreement is about 41%. This means that in more than half of the cases, the HDAs disagree on what the user's home location should be, highlighting a fortiori that the choice of the HDA is crucial. The best solution would be to select the combination of HDA and stream that, on average, gives the most accurate home location detection. Therefore, what is the most accurate combination of HDA and stream on individual ground truth data?

Accuracy of HDAs
For each user u ∈ G, where G is the set of the 65 users, we know the address of residence, from which we obtain the exact position (e.g., latitude and longitude) of their actual home location H (u) using Google Maps. Since the closest tower is not necessarily the one that serves a user at home 2 , for each u ∈ G, we compute  Given an HDA X, a stream T , and a user u, we say that 3 }, i.e., if the home location detected by X on T is at least on of the three closest towers to u's ground truth home location. Therefore, we define the home detection accuracy ACC X,T of the combination of HDA X and stream T as the number of correctly classified home locations over the total number of ground truth users |G|. As an instance, ACC X,T = 0.50 means that, using stream T , HDA X can correctly detect the home location for half of ground truth users. Figure 5 (top left) shows the home detection accuracy of the five HDAs, varying the stream. We find that, on average, XDRs lead to the highest accuracy (ACC X,XDRs = 0.52). HDA1, HDA2, and HDA3 are way far the best algorithms, achieving a home detection accuracy greater than or close to 50% on XDRs and CPRs, i.e., they can identify the correct home location for more than 50% of the ground truth users. In particular, HDA3 is the algorithm achieving the best overall accuracy (ACC HDA3,XDRs = 0.68 = ACC HDA3,CPRs ). Figure  5 (top right) shows the home detection accuracy if just the closest tower to a user's actual home location (i.e., H (u) = H (u) 1 ) is considered. Again, XDRs lead to the highest average accuracy and HDA1-3 are way far the best algorithms, even though accuracy drops down to ACC X,XDRs = 0.26.
The home detection accuracy of an HDA on a stream is computed considering as detected home locations the towers with the highest activity. We can relax this condition by defining a detected home location to be correct if at least one of the top k towers detected by an HDA X on a stream T is correct. We denote with H (k) X,T (u) a tower that is within the k towers with the highest activity according to HDA X and stream T for user u. We define the home detection k-accuracy (ACC  X,T for heavily used that the network re-routes some users. Moreover, a user may have a tower close to their home, but with the antenna's azimuth pointing the opposite direction. In contrast, one tower farther away that has an antenna directly "illuminating" the user's home. k = 2, 3. Clearly, ACC (k) X,T increases with k and, again, XDRs lead to the highest average accuracy (ACC (2) X,XDRs = 0.64, ACC X,XDRs = 0.74). Figure 6(left) shows the average distance of the detected home locations from the individuals' actual home (in km). Figure 6(right) does the same but for correctly detected home locations only. XDRs provides, in general, the best results: on average, the distance between the position of tower detected as the home location has a distance to the actual home lower than 5km.

Data Minimization
We then turn to the question of what is the minimum amount of data, for each stream, that is required to achieve a given sought accuracy, and whether they are qualitatively different at the time of doing so. For instance, does the "machine-only" feature of CPRs work better than the "human-machine hybrid" characteristics of XDRs? This experiment is important for both researchers and telco operators: it is usually not easy to access mobile phone data. Thus, requesting these data with a principled approach rather than a "blanket" request, could go a long way in building trust between companies and scientists, while also requiring less human resources and storage infrastructure to prepare and share the data.
To find out, we run a randomization algorithm that sampled the data at different percentage intervals. Thus, we calculate the home detection algorithms accuracy for 10%, 20%, ..., 100% of their available data without replacement for each user. We run this experiment five times for each stream to have a more general idea about the data's statistical robustness. Figure 7 shows, for each HDA and stream, the average home detection accuracy varying the number of records used. The shaded areas are the standard deviation of the different runs (the five runs).
We find three main results. First, CDRs lead to the highest variance in the accuracy across the trials: the accuracy of home detection can largely vary based on the set of records selected per user. In contrast, CPRs lead to the most stable accuracy. Second, a high fraction of CDRs is needed to achieve an accuracy similar to that obtained using 100% of the records. For example, for HDA3, at least 40% of the records are needed. In contrast, just a small fraction of CPRs (even 10%) is enough to achieve the same accuracy as using all the records. XDRs lie between these two extremes.

Conclusions
Mobile phone data are a crucial data source for official statistics, including the important task of home location detection. To the best of our knowledge, this is the first time that individual-level ground truth data are used to assess the accuracy of the existing HDAs. Our analysis reveals that the type of stream used -CDRs, XDRs, CPRs -heavily influences the home detection accuracy. Similarly, the choice of the algorithm is crucial: HDA3, which defines the home of an individual as the most active tower during nighttime, is the most accurate algorithm, regardless of the stream used. Consequently, using XDRs in combination with HDA3 is the solution leading to the highest home detection accuracy. Nevertheless, our data minimization experiment revealed that CPRs are the most resilient to reducing the number of records available per user, and XDRs the second most resilient stream. Overall, our work demonstrates that CDRs, the most used stream in the literature to detect individuals' homes, lead to low accuracy and stability, questioning the plethora of research made in the last years.
Experiences like ours may contribute to shaping the discussion on the best mobile phone stream to capture presences and human mobility patterns. This is crucial because citizens and policy makers' decisions depend on what we measure, how right our measurements are, and how well our measures are understood.

# of unique users CPRs
XDRs CDRs