giotto-ai / giotto-tda

A high-performance topological machine learning toolbox in Python
https://giotto-ai.github.io/gtda-docs
Other
858 stars 175 forks source link

Add curves.Derivative #492

Closed gtauzin closed 4 years ago

gtauzin commented 4 years ago

Reference issues/PRs

Types of changes

Description Add curves.Derivative. See #480.

Screenshots (if appropriate)

Any other comments?

Checklist

wreise commented 4 years ago

Since the tests were failing, i took the initiative to fix them. In the process, i made Derivative inherit from PlotterMixin: it is a bit delciate though, because we do not have the samplings. For the sake of computations, we assume it's uniform, but i think we lack scale/position information for plotting (the x-axis). @gtauzin, @ulupo : what do you think about the current proposal and do you have suggestions on how to bypass these problems ?

gtauzin commented 4 years ago

@wreise Fine with me!

gtauzin commented 4 years ago

@ulupo I think one the test failed because of the CI itself. They should be ran again.

Also this PR does not depend on the curves array shape as the derivative is taken on axis=-1, so it can be merged independently from #480.

ulupo commented 4 years ago

@gtauzin just pointing out that, to be consistent with StandardFeatures, I have added shape checking which only allows for 3D input (I know the transformer would not fail, it's just for consistency/guiding the user). And I have added a n_channels_ attribute again to be consistent with StandardFeatures. Are you happy with these changes and shall I merge?

gtauzin commented 4 years ago

@ulupo Nothing to say, that's perfect !

Thank you!