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

Thematic mapping utilities #68

Open
ericemc3 opened this issue Dec 28, 2020 · 4 comments
Open

Thematic mapping utilities #68

ericemc3 opened this issue Dec 28, 2020 · 4 comments
Labels
enhancement New feature or request help wanted For potential community contributions

Comments

@ericemc3
Copy link

An extension to op.ntile() could prove useful to encode numeric values to categories from manual breaks.
Something similar to the R cut function:
dens_code = cut( pop_density, breaks = c(0, 1000, 5000,20000,100000, Inf)...)
or d3.scaleThreshold()

jenks() and kmeans() are also useful clustering methods, we can borrow them from the simple statistics library, but of course if they were in Arquero it would be convenient.

@jcmkk3
Copy link

jcmkk3 commented Dec 28, 2020

santoku is a very featureful package for R that tries to improve on cut. I don't think that Arquero needs this many features, but there could be some API inspiration there, in addition to d3 and other patterns in the JavaScript world.

@jheer jheer added enhancement New feature or request help wanted For potential community contributions labels Dec 29, 2020
@jheer
Copy link
Member

jheer commented Dec 29, 2020

I'd be happy to consider a new cut / chop / etc implementation for inclusion in Arquero. Similar to recode it might be added as a new standard op function.

As for clustering algorithms, I think those might be more fitting as extensions defined in a separate package, as discussed in #67.

@ericemc3
Copy link
Author

Great, thanks!

@ericemc3
Copy link
Author

A simple implementation for an op.cut could just be:
consider for instance breaks = [t1, t2, t3]
recode x with:
x ∈ [min, t1[ => 0
x ∈ [t1, t2[ => 1
x ∈ [t2, t3[ => 2
x ∈ [t3, max] => 3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted For potential community contributions
Projects
None yet
Development

No branches or pull requests

3 participants