FeatureTransforms.jl icon indicating copy to clipboard operation
FeatureTransforms.jl copied to clipboard

Custom Transform

Open glennmoy opened this issue 4 years ago • 1 comments

As mentioned in #5 and #6, a CustomTransform (or some other name) would be useful when one wants to apply some custom function to their data.

This would be quite useful since we then wouldn't have to write a new Transform for each of these.

TODO: MWE

glennmoy avatar Feb 02 '21 13:02 glennmoy

Something like

"""
    CustomTransform <: Transform

Apply the function passed in to CustomTransform as the transform.
"""
struct CustomTransform <: Transform
    transform_function::Function
    args
end

function _apply!(x::AbstractArray, CT::CustomTransform; kwargs...)
    return CT.transform_function(x, ct.args...; kwargs...)
end

nicoleepp avatar Feb 02 '21 20:02 nicoleepp