Closed EssamWisam closed 1 year ago
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.
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.
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.
@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.
In theory you only need to depend on TransformsBase.jl to get full integration.
Em dom., 30 de jul. de 2023 11:03, Essam @.***> escreveu:
@juliohm https://github.com/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.
— Reply to this email directly, view it on GitHub https://github.com/JuliaML/TableTransforms.jl/issues/175#issuecomment-1657181692, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZQW3IHDZAFDHFHEXI76FLXSZSRRANCNFSM6AAAAAA24MKKKE . You are receiving this because you were mentioned.Message ID: @.***>
@EssamWisam did you have a chance to implement the interface? Can you help writing a section in the docs?
@juliohm I believe yes, using TransformsBase
. It's on my agenda; hopefully by next week.
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.