Created
August 10, 2021 05:10
-
-
Save LauraLangdon/3844439fc0151be27dda160801a3ec20 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_distance(tweet1_vector, tweet2_vector) -> int: | |
""" | |
Implement Minkowski distance metric | |
:param tweet1_vector: vector of first tweet | |
:param tweet2_vector: vector of second tweet | |
:return: Minkowski distance between tweets | |
""" | |
distance = 0 | |
for x in range(tweet1_vector.shape[0] - 2): | |
distance = distance + abs(tweet1_vector[x] - tweet2_vector[x]) | |
return distance |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment