scipy.spatial.distance.
rogerstanimoto#
- scipy.spatial.distance.rogerstanimoto(u, v, w=None)[Quelle]#
Berechnet die Rogers-Tanimoto-Unähnlichkeit zwischen zwei booleschen 1D-Arrays.
Die Rogers-Tanimoto-Unähnlichkeit zwischen zwei booleschen 1D-Arrays u und v ist definiert als
\[\frac{R} {c_{TT} + c_{FF} + R}\]wobei \(c_{ij}\) die Anzahl der Vorkommen von \(\mathtt{u[k]} = i\) und \(\mathtt{v[k]} = j\) für \(k < n\) ist und \(R = 2(c_{TF} + c_{FT})\).
- Parameter:
- u(N,) array_like, bool
Eingabearray.
- v(N,) array_like, bool
Eingabearray.
- w(N,) array_like, optional
Die Gewichte für jeden Wert in u und v. Standard ist None, was jedem Wert ein Gewicht von 1,0 gibt.
- Rückgabe:
- rogerstanimotodouble
Die Rogers-Tanimoto-Unähnlichkeit zwischen den Vektoren u und v.
Beispiele
>>> from scipy.spatial import distance >>> distance.rogerstanimoto([1, 0, 0], [0, 1, 0]) 0.8 >>> distance.rogerstanimoto([1, 0, 0], [1, 1, 0]) 0.5 >>> distance.rogerstanimoto([1, 0, 0], [2, 0, 0]) -1.0