-
Notifications
You must be signed in to change notification settings - Fork 178
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
User Defined Cover #97
Comments
hi @leesteinberg. This sounds like a great new feature to add to the library. Have you seen the cover class implementation? /kepler-mapper/cover.py? To define your own cover, you could inherit from
I would be happy to incorporate a pull request for this! |
Submitted pull request #98 implementing CoverBounds class as discussed. Edit: @sauln I'll think about how to write a test later today... |
Thanks for working on this @leesteinberg! |
Hi there
I can see that there is a TODO to implement a cover defining API. I was wondering what is the best way of creating a user-defined cover at the moment (if it is possible at all). From what I can tell, we are currently restricted to a
(n_bins, overlap_perc)
method. Is it possible to define a cover explicity (for one or more dimensions in the lens), using cutoff values or similar (like, setting the maximum and minimum values of the covering space in each dimension)? I ask because in its current implementation I think the [non-]presence of an outlier can skew the covering space quite drasticallyLet me know what my options are for the covering space. I would also be interested to know the status of the above TODO. More information as to how the cover class currently works might also be useful if I was going to write my own.
Thanks!
Edit: I've modified the code such that you can pass
kmapper.map
aCoverBounds
variable.if CoverBounds == None:
Normal behaviorHowever, CoverBounds can also be a
(ndim_lens, 2)
array, withmin, max
for every dimension of your lens. If the default behavior is fine for a particular dimension, pass itnp.float('inf'), np.float('inf')
.For example, if I have a lens in R2 and want to set the maximum and minimum of the second dimension to be 0 and 1, I can pass:
mapper.map(CoverBounds = np.array([[np.float('inf'), np.float('inf')],[0,1]]))
and that should have the desired behavior.Edit 2: Might change it so rather than
inf
detection, works offNone
detection in theCoverBounds
array.I think a system designed like this should produce exactly the same cover, independent of input data limits.
Devs - let me hear your thoughts on this - I can clean up and submit a pull request.
The text was updated successfully, but these errors were encountered: