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

Implementing the TableTransforms.jl transformer interface in a different package #175

Closed
EssamWisam opened this issue Jul 29, 2023 · 7 comments · Fixed by #182
Closed

Implementing the TableTransforms.jl transformer interface in a different package #175

EssamWisam opened this issue Jul 29, 2023 · 7 comments · Fixed by #182
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers help wanted Extra attention is needed question Further information is requested

Comments

@EssamWisam
Copy link
Contributor

I'm working on a small package for oversampling input tables. I thought it would be nice if I make it possible to use the methods in the package using a similar API to the one here but I couldn't find the relevant section to help me do that in the docs.

@juliohm juliohm added the question Further information is requested label Jul 29, 2023
@juliohm
Copy link
Member

juliohm commented Jul 29, 2023

Hi @EssamWisam , thank you for opening the issue. You mean that you would like to see a dev guide in our docs?

In general, all you need to do to adhere to the interface here is to implement a subset of apply, revert and reapply. The three functions are well-documented in this package and in TransformsBase.jl (check the docstrings).

  • The apply function is required. It tells what the transform does. Check our Sample transform, it seems similar to what you want to do: https://juliaml.github.io/TableTransforms.jl/stable/transforms/#Sample

  • The revert function takes the result of apply and a cache variable to revert the transform. Not all transforms are revertible. You can signal that with isrevertible.

  • The reapply has a fallback if you define your transform as StatelessTransform. It is always a good idea to subtype your transform type with one of our abstract transform types to inherit behavior.

@EssamWisam
Copy link
Contributor Author

EssamWisam commented Jul 29, 2023

Hi @EssamWisam , thank you for opening the issue. You mean that you would like to see a dev guide in our docs?

I think that would be nice in general for people wanting to implement custom transforms that adhere with this nice API. The option I considered before this one was MLJ and it was in the docs, that's why I thought I would find a similar one here as an initial impression.

Thank you so much for the helpful answer.

@juliohm juliohm added documentation Improvements or additions to documentation help wanted Extra attention is needed good first issue Good for newcomers labels Jul 29, 2023
@juliohm
Copy link
Member

juliohm commented Jul 29, 2023

Thank you @EssamWisam. If you can contribute this section based on your experience implementing the interface, that would be super helpful. GitHub allows you to edit the repository without headache, you can press . (dot) in the keyboard to edit the documentation files and start a PR.

Do you think you can tackle this? Happy to help.

@EssamWisam
Copy link
Contributor Author

@juliohm I will see if I could do that after I finish. I have a quick question, what advantage do I get by implementing subsets of the functions included inTableTransforms.jl\transforms.jl (i.e., indirectly implementing those in TransformsBase.jl) over only using TransformsBase.jl and implementing the required functions? The end goal is to perhaps ensure composability with other transforms in the package when TableTransforms.jl is used.

@juliohm
Copy link
Member

juliohm commented Jul 30, 2023 via email

@juliohm
Copy link
Member

juliohm commented Aug 9, 2023

@EssamWisam did you have a chance to implement the interface? Can you help writing a section in the docs?

@EssamWisam
Copy link
Contributor Author

EssamWisam commented Aug 9, 2023

@juliohm I believe yes, using TransformsBase. It's on my agenda; hopefully by next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants