From 53b76adc1a2c3b4338cfd2cb4489ccc51d28f92f Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Mon, 6 Apr 2026 16:41:03 +1200 Subject: [PATCH 1/2] add use of `Transform` for wrapping RFE instances to docstring --- src/models/rfe.jl | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/models/rfe.jl b/src/models/rfe.jl index c87f1d4..b907a7a 100644 --- a/src/models/rfe.jl +++ b/src/models/rfe.jl @@ -95,6 +95,12 @@ Train the machine using `fit!(mach, rows=...)`. `transform(mach, X)` above and predict using the fitted base model on the transformed table. +!!! note + + Because models wrapped in `RecursiveFeatureElimanation` are `Supervised`, the output + of `predict` is propagated in MLJ pipelines. To make this `transform` instead, + additionally wrap in `Transformer` as shown in the example below. + # Fitted parameters The fields of `fitted_params(mach)` are: @@ -146,6 +152,17 @@ predict(mach, Xnew) # transform data with all features to the reduced feature set: transform(mach, Xnew) ``` + +To use `selector` as a transformer in an MLJ pipeline, you must explicitly wrap in +`Transformer`, for otherwise it is the output of `predict` and not `transform` that is +propagated to the next model in the pipeline: + +```julia +pipe = Transformer(selector) |> ConstantRegressor() +mach = machine(pipe, X, y) |> fit! +predict(mach, Xnew) # prediction of `ConstantRegressor()` based on reduced features. +``` + """ function RecursiveFeatureElimination( args...; From c6b7bc2c61057bbdc0f74bb1f64eeebeafbff440 Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Mon, 6 Apr 2026 19:58:35 +1200 Subject: [PATCH 2/2] bump 0.2.6 --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 4ae5d79..082c5e7 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "FeatureSelection" uuid = "33837fe5-dbff-4c9e-8c2f-c5612fe2b8b6" authors = ["Anthony D. Blaom ", "Samuel Okon