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

countmap with comparisons other than == #717

Closed
ParadaCarleton opened this issue Sep 8, 2021 · 3 comments
Closed

countmap with comparisons other than == #717

ParadaCarleton opened this issue Sep 8, 2021 · 3 comments

Comments

@ParadaCarleton
Copy link
Contributor

Sometimes I'd like to build a countmap that compares using an operator other than == -- for instance, I might want to build a countmap using to decide whether two objects are (close enough) to equal, or maybe isseteq. It might be a good idea to add a third argument, defaulting to ==, that lets you do this.

@mschauer
Copy link
Member

mschauer commented Sep 8, 2021

countmap is dictionary or Radix sort based, so there are no mutual comparisons with == either as far as I can see.

@nalimilan
Copy link
Member

Grouping using is a very difficult and ill-defined problem as it's not a transitive operation. Grouping with == is also tricky due to things like NaN == NaN returning false, not to mention missing.

Anyway we would need a precise use case to evaluate whether something can be done about it.

@mschauer
Copy link
Member

mschauer commented Sep 9, 2021

Maybe nice to point out, that grouping in approximately equal groups is a form of clustering and you can look at https://github.com/JuliaStats/Clustering.jl and perhaps try https://en.wikipedia.org/wiki/K-means_clustering

@mschauer mschauer closed this as completed Sep 9, 2021
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

No branches or pull requests

3 participants