import numpy as np
import matplotlib.pyplot as plt
Another similar similarity, basedon http://www.catalysoft.com/articles/StrikeAMatch.html
Some simple transformation results in
def j2s(j):
"""jaccard similarity to simon similarity"""
return 2 - 2 / (1 + j)
xs = np.arange(0, 1.01, 0.01)
plt.figure(figsize=(6, 3))
plt.plot(xs, j2s(xs) - xs)
# plt.plot(xs, xs, '--')
plt.grid()
plt.xlabel('Simon similarity - Jaccard similarity')
plt.ylabel('Delta')
Text(0, 0.5, 'Delta')
plt.figure(figsize=(6, 5))
plt.plot(xs, j2s(xs))
plt.plot(xs, xs, '--')
plt.grid()
plt.xlabel('Jaccard similarity')
plt.ylabel('Simon similarity')
Text(0, 0.5, 'Simon similarity')
Since $1 - J$ is a proper distance:
Assume $1 - S$ is also a proper distance, then
Since $J_{AC} + J_{CB} \le J_{AB} + 1$, so
Now we only need to show $(1 + J_{AC})(1 + J_{CB}) \le 2(1 + J_{AB})$,
The last inequality obviously doesn't always hold, so $S_{AC} + S_{CB} \le S_{AB} + 1$ doesn't always hold, hence $S$ isn't a proper distance.