/
transform.jl
35 lines (25 loc) · 1.05 KB
/
transform.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
"""
Transform
Abstract supertype for all feature Transforms.
"""
abstract type Transform end
# Make Transforms callable types
(t::Transform)(x; kwargs...) = apply(x, t; kwargs...)
"""
transform(::T, data)
Defines the feature engineering pipeline for some type `T`, which comprises a collection of
[`Transform`](@ref)s and other steps to be peformed on the `data`.
The idea around a "transform interface” is to make feature transformations composable, i.e.
the output of any one `Transform` should be valid input to another.
Feature engineering pipelines should obey the same principle and it should be trivial to
add/remove `Transform` steps that compose the pipeline without it breaking.
`transform` should be overloaded for custom types `T` that require feature engineering.
The only requirement is that the return of `transform `is itself "transformable", i.e.
calling [`is_transformable`](@ref) on the output returns true.
"""
function transform end
"""
transform!(::T, data)
Mutating version of [`transform`](@ref).
"""
function transform! end