Skip to content

rehanguha/interspace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Interspace

Gives us different distance between two vectors which are given in as an input.

Installation

pip install interspace

Different Distance Functions

minkowski(vector_1, vector_2, p=1)

euclidean(vector_1, vector_2)

manhattan(vector_1, vector_2)

cosine_similarity(vector_1, vector_2)

haversine(coord1, coord2, R = 6372800)

hamming(int, int); hamming(str, str) # where, length of both the strings should be same

mahalanobis(vector_1, vector_2, inverse_of_the_covariance_matrix)

Usage

import interspace

# Calculate Euclidean Distace
interspace.euclidean([1,2,3],[4,5,6])
##Output: 5.196152422706632

# Compute the great-circle distance between two points on a sphere 
# given their longitudes and latitudes.
interspace.haversine((42.5170365,  15.2778599),(51.5073219,  -0.1276474))
##Output: 1532329.6237517272

About

Interspace gives us different type distances between two vectors.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages