-
Notifications
You must be signed in to change notification settings - Fork 1
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
Implement apply method that appends result to data and / or forces promotion #38
Comments
Note that one example where all this will fail regardless is in some dimension-reducing transforms like PCA, for which it would be impossible to append to the input data. But this is a hard limitation no matter what we do with the above. |
Is |
I'll note I had similar thoughts while writing an example for the docs. These are not my all-things-considered thoughts.
|
Yeah I guess it is given the output type. I forgot to consider it. Will update the text. |
It was suggested that instead of an |
Thinking about initialising an append |
TBH I'm not sure I like it. We'll have to see after trying out a few ideas. |
Related to #12
We have two methods for applying a transform to data
apply
takes the transform but preserves the originaldata
apply!
takes the transform and mutates the originaldata
in-placeWhile
apply
is universally supported,apply!
is only supported for transforms that can directly replace the input.In one case, this means it needs the output to be the same type:
In this example, we might just want to force the type promotion.
But another simple case arises when the output is a different shape to the input.
Consider
LinearCombination
, which typically takes more than 1 input but produces just 1 output:Note that this kind of transform is Many-to-One, so would expect similar problems for One-to-Many and Many-to-Many.
We therefore might want some
apply
-like methods that would:Given the types of problems these are solving it might be desirable to have these achieved by separate methods.
But note that it's possible to solve both problems using (2) and this would be a consistent behaviour.
Here are some ideas for how we might approach the solution:
apply!(...; force=true)
,apply!(...; append=true)
.apply_force!
,apply_and_append!
, alsoapply!!
(cf https://github.com/JuliaFolds/BangBang.jl)apply!!(x, ::OnetoOne; kwargs...
),apply!!(x, ::ManytoOne; kwargs...)
,apply!!(x, ::ManytoMany; kwargs...)
.This also opens the question of how to name the columns for the appended data for a Table.
Should it be provided by the user? or automatically generated?
The text was updated successfully, but these errors were encountered: