'Scipy euclidean and minkowski gave same result
When i tried minkowski and euclidean distance from scipy, i got the same results,
from scipy.spatial import distance
dst1= distance.euclidean(input1, input2)
dst2= distance.minkowski(input1, input2)
print(dst1==dst2)
If i checked the code, the euclidean function is calling minkowski. Github link Why is this so?
Solution 1:[1]
The Minkowski distance has a parameter p. The Euclidean distance is a special case of Minkowski distance, with p = 2.
The default value of p for scipy.distance.minkowski is p = 2, so if you don't specify p, minkowski computes the Euclidean distance.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Warren Weckesser |
