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

[Feature Request] generic binning (binmap) function #259

Closed
kMutagene opened this issue Apr 3, 2023 · 0 comments
Closed

[Feature Request] generic binning (binmap) function #259

kMutagene opened this issue Apr 3, 2023 · 0 comments

Comments

@kMutagene
Copy link
Member

Is your feature request related to a problem? Please describe.

While functions such as Distributions.Empirical.create are great for investigating frequency of float values in a dataset, it might be nice to have a generic binning function that keeps the original data.

Describe the solution you'd like
A generic binning function that returns bin => data in bin map.

As a specific example, when I have a dataset of the following type:

type MyType {A: string; B: float}

I would like to use a function e.g. bin<'T> with signature

let bin<'T> (projection: 'T -> float) (binSize: float) (data: seq<'T>) : Map<float,seq<'T>> = ...

That bins data based on the projection function and returns a Map with the binned data. The advantage of this approach here is that i would not loose the association of the fields A and B in the record type.

Describe alternatives you've considered
Proceeding my life without having this function

@bvenn bvenn closed this as completed in e35a3e6 Apr 3, 2023
bvenn added a commit that referenced this issue Apr 3, 2023
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

1 participant