Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Average shared span for multiple matches #12

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

hfr1tz3
Copy link

@hfr1tz3 hfr1tz3 commented Dec 22, 2024

Option 2 for issue #11

For each node $n_2\in T_2$ with multiple matches in $T_1$, Let $\beta(n_2)=[n_1\in T_1 \colon \alpha(n_1)=n_2]$. Then we compute the similarity between two trees $T_1$, and $T_2$ as
$$sim(T_1,T_2)=\sum_{n_2\in T_2}\frac{1}{\beta(n_2)}\sum_{n_1\in T_1} m(n_1,n_2),$$
which is the average over shared spans between nodes in $T_2$ and their multiple matches $\beta(n_2)$.

@hfr1tz3 hfr1tz3 marked this pull request as ready for review December 23, 2024 19:00
@hfr1tz3
Copy link
Author

hfr1tz3 commented Dec 23, 2024

I added extra tests that are for the ties='average' method. I am open to more suggestions if we need more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant