Skip to content

Commit 83f248f

Browse files
committed
Add StatelessTableTransform
1 parent c5be198 commit 83f248f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/transforms.jl

+11
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ This function is intended for developers of new types.
5757
"""
5858
function revertmeta end
5959

60+
"""
61+
StatelessTableTransform
62+
63+
This trait is useful to signal that we can [`reapply`](@ref) a transform
64+
"fitted" with training data to "test" data without relying on the `cache`.
65+
"""
66+
abstract type StatelessTableTransform <: TableTransform end
67+
6068
"""
6169
StatelessFeatureTransform
6270
@@ -162,6 +170,9 @@ reapplymeta(::FeatureTransform, meta, mcache) = meta
162170
# STATELESS FALLBACKS
163171
# --------------------
164172

173+
reapply(transform::StatelessTableTransform, table, cache) =
174+
apply(transform, table) |> first
175+
165176
reapply(transform::StatelessFeatureTransform, table, cache) =
166177
apply(transform, table) |> first
167178

0 commit comments

Comments
 (0)