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

Wrong formula for Jaccard index? #48

Closed
luciacsep opened this issue May 5, 2020 · 2 comments
Closed

Wrong formula for Jaccard index? #48

luciacsep opened this issue May 5, 2020 · 2 comments
Assignees
Labels
status:Done ✅ The development is done tag:Methods Analysis and visualisation methods type:Critical Critical bug or issue that needs to be addressed immediately

Comments

@luciacsep
Copy link

🐛 Bug

When using the repOverlap function using the Jaccard index, I think it calculates wrong numbers. When looking at the source code in overlap.R, I saw that the Jaccard index is calculated as follows:

jaccard_index.default <- function(.x, .y) {
  .x = collect(.x, n = Inf)
  .y = collect(.y, n = Inf)
  intersection = nrow(dplyr::intersect(.x, .y))
  intersection/(nrow(.x) + nrow(.y) + intersection)
}

However, doesn't the intersection need to be subtracted:
intersection/(nrow(.x) + nrow(.y) - intersection)
?

I'm using Immunarch v. 0.5.5.

Thank you.

@vadimnazarov vadimnazarov self-assigned this May 5, 2020
@vadimnazarov vadimnazarov added tag:Methods Analysis and visualisation methods type:Critical Critical bug or issue that needs to be addressed immediately status:In progress ⏳ Work in progress labels May 5, 2020
@vadimnazarov
Copy link
Contributor

Hi @luciacsep ,

thank you a lot for noticing this critical issue! It will be fixed in the next release.

@vadimnazarov vadimnazarov added status:Done ✅ The development is done and removed status:In progress ⏳ Work in progress labels May 5, 2020
@vadimnazarov
Copy link
Contributor

Hi @luciacsep !

Thank you again for noticing the bug, we published immunarch on CRAN and moved it to GitHub, feel free to install the latest versions and check if everything is OK for you. I'm closing this issue for now, please feel free to reopen it in case of more related questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:Done ✅ The development is done tag:Methods Analysis and visualisation methods type:Critical Critical bug or issue that needs to be addressed immediately
Projects
None yet
Development

No branches or pull requests

2 participants