Skip to content

Commit ac1ec0e

Browse files
authored
Merge pull request #39 from JuliaAI/dev
For a 0.2.6 release
2 parents 2c30680 + c6b7bc2 commit ac1ec0e

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "FeatureSelection"
22
uuid = "33837fe5-dbff-4c9e-8c2f-c5612fe2b8b6"
33
authors = ["Anthony D. Blaom <anthony.blaom@gmail.com>", "Samuel Okon <okonsamuel50@gmail.com"]
4-
version = "0.2.5"
4+
version = "0.2.6"
55

66
[deps]
77
MLJModelInterface = "e80e1ace-859a-464e-9ed9-23947d8ae3ea"

src/models/rfe.jl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ Train the machine using `fit!(mach, rows=...)`.
9595
`transform(mach, X)` above and predict using the fitted base model on the transformed
9696
table.
9797
98+
!!! note
99+
100+
Because models wrapped in `RecursiveFeatureElimanation` are `Supervised`, the output
101+
of `predict` is propagated in MLJ pipelines. To make this `transform` instead,
102+
additionally wrap in `Transformer` as shown in the example below.
103+
98104
# Fitted parameters
99105
100106
The fields of `fitted_params(mach)` are:
@@ -146,6 +152,17 @@ predict(mach, Xnew)
146152
# transform data with all features to the reduced feature set:
147153
transform(mach, Xnew)
148154
```
155+
156+
To use `selector` as a transformer in an MLJ pipeline, you must explicitly wrap in
157+
`Transformer`, for otherwise it is the output of `predict` and not `transform` that is
158+
propagated to the next model in the pipeline:
159+
160+
```julia
161+
pipe = Transformer(selector) |> ConstantRegressor()
162+
mach = machine(pipe, X, y) |> fit!
163+
predict(mach, Xnew) # prediction of `ConstantRegressor()` based on reduced features.
164+
```
165+
149166
"""
150167
function RecursiveFeatureElimination(
151168
args...;

0 commit comments

Comments
 (0)