Summary
In this chapter, we ventured into the fascinating realm of distances and their many applications. We began by exploring the calculation of geographic distances, introducing the remarkable formulas of the law of Cosines, the law of Haversines, and Vincenty’s distance. Using the PyGeodesy package in Python and the geosphere library in R, we harnessed the power of computation to accurately measure distances between geographic locations.
Expanding our horizons, we delved into the realm of string distances. We encountered the metrics of Hamming, Levenshtein, Jaro-Winkler, and Jaccard distances, each offering unique insights into the dissimilarity or similarity between strings. Python’s TextDistance package and R’s stringdist library provided us with the essential tools to effortlessly compute these string distances.
In your study, you encountered a significant computational hurdle: the quadratic nature of the distance algorithms implemented. With the...