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

Syntax with type parameter {m} in OrdinalPatterns is not harmonious with the rest of the library #394

Open
Datseris opened this issue Jan 20, 2024 · 10 comments
Labels
discussion-design Discussion or design matters documentation Improvements or additions to documentation high priority

Comments

@Datseris
Copy link
Member

Making the ordinal patterns take m as a type parameter, as opposted to a keyowrd, was likely a mistake. Does it have a perforamnce benefit? If it does, it can only have one if m is given as a constant literal, 3, and not if it is given as a variable m, because in the later case the type can anyways not be inferred.

However, there are so many other types/outcome spaces that do delay embedding, yet m is a keyword. E.g., Dispersion, Cosine, etc. This is not harmonious and can even be confusing to a user ("why does one take m in one way and the other in another way...?").

I think we should revert the ordinal pattern decision and make it be a keyword there as well...

@Datseris Datseris added documentation Improvements or additions to documentation discussion-design Discussion or design matters labels Jan 20, 2024
@kahaaga
Copy link
Member

kahaaga commented Jan 20, 2024

This would not be breaking, so should be fine. Either alternative is good with me.

@Datseris
Copy link
Member Author

This is high priority now, because that is the syntax we use in the paper. ANother thing I am taken aback we haven't closed yet. Damn, I should have gone thorugh the issues list before putting the paper online.

@kahaaga
Copy link
Member

kahaaga commented Jun 10, 2024

Are you on it, or should I do it, @Datseris ?

@kahaaga
Copy link
Member

kahaaga commented Jun 10, 2024

Note that we also need to change BubbleSortSwapsEncoding, because it uses the same syntax.

@Datseris
Copy link
Member Author

haven't started yet!

@kahaaga
Copy link
Member

kahaaga commented Jun 10, 2024

Actually, the syntax OrdinalPatternEncoding(m=3) already works - we did that for backwards compatibility when releasing 3.0. We just need to update the docstring.

@kahaaga
Copy link
Member

kahaaga commented Jun 10, 2024

For BubbleSortSwapsEncoding, we do, however, need another constructor

@Datseris
Copy link
Member Author

We just need to update the docstring.

and probably also move the code from deprecated.jl into the main source.

@kahaaga
Copy link
Member

kahaaga commented Jun 16, 2024

Decision to be made: should m, tau, etc be keywords or positional arguments? Currently we have

Dispersion(; c = 5, m = 2, τ = 1, check_unique = true)
 CosineSimilarityBinning(; m::Int, τ::Int, nbins::Int)
 SequentialPairDistances(x::AbstractVector; n = 3, metric = Chebyshev(), m = 3, τ = 1)
 etc...

while (after updating syntax) we have

OrdinalPatterns(m = 3, τ = 1, lt::Function = ComplexityMeasures.isless_rand) # positional
# and the same for the other ordinal pattern outcomes spaces

I like keyword arguments better. Any objections?

@Datseris
Copy link
Member Author

Keyword arguments are fine!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion-design Discussion or design matters documentation Improvements or additions to documentation high priority
Projects
None yet
Development

No branches or pull requests

2 participants