You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, when calculating the partial_raito between abcd and abd, it gives:
> partial_ratio('abcd','abd')
80.0
According to my understranding, the optimal alignment would be:
> ratio('abcd','abd')
85.71428571428571
and 80.0 is probably from:
> ratio('ab','abd')
80.0
Did I misunderstand this? I would like to check the docs but it fails to load the contents under these functions.
And is it possible to calculate the partial_ratio with equal weights for indels and substitutions?
Thanks!
The text was updated successfully, but these errors were encountered:
I would like to check the docs but it fails to load the contents under these functions.
Thanks for mentioning. It appears the CI job currently generates the docs in a broken way for some reason. I manually fixed the docs and opened #174 to track the issue
fuzz.partial_ratio is calculated using a sliding window of length min(len(s1), len(s2)) and then calculating the fuzz.ratio of each alignment. So for the two sequences "abdc" and "abd" it calculates the fuzz.ratio for the following alignments:
Alignment
similarity
abd <-> a
50
abd <-> ab
80
abd <-> abc
66.67
abd <-> bcd
66.67
abd <-> cd
40
abd <-> bcd
50
For this reason it is actually not guaranteed to be at least as high as the fuzz.ratio between the two full sequences. fuzz.partial_ratio always uses fuzz.ratio which uses the Indel Distance (just uses Insertions/Deletions, so similar to Levenshtein distance with a weight of 2 for Substitutions) and there is no option to select a different metric as of now.
Hi, when calculating the
partial_raito
betweenabcd
andabd
, it gives:According to my understranding, the optimal alignment would be:
and
80.0
is probably from:Did I misunderstand this? I would like to check the docs but it fails to load the contents under these functions.
And is it possible to calculate the
partial_ratio
with equal weights for indels and substitutions?Thanks!
The text was updated successfully, but these errors were encountered: