File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name = " FeatureSelection"
22uuid = " 33837fe5-dbff-4c9e-8c2f-c5612fe2b8b6"
33authors = [" 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 ]
77MLJModelInterface = " e80e1ace-859a-464e-9ed9-23947d8ae3ea"
Original file line number Diff line number Diff 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
100106The fields of `fitted_params(mach)` are:
@@ -146,6 +152,17 @@ predict(mach, Xnew)
146152# transform data with all features to the reduced feature set:
147153transform(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"""
150167function RecursiveFeatureElimination (
151168 args... ;
You can’t perform that action at this time.
0 commit comments