@@ -87,82 +87,4 @@ MMI.metadata_model(
8787 load_path = " FeatureSelection.FeatureSelector"
8888)
8989
90- # # Docstring
91- """
92- $(MMI. doc_header (FeatureSelector))
93-
94- Use this model to select features (columns) of a table, usually as
95- part of a model `Pipeline`.
96-
97-
98- # Training data
99-
100- In MLJ or MLJBase, bind an instance `model` to data with
101-
102- mach = machine(model, X)
103-
104- where
105-
106- - `X`: any table of input features, where "table" is in the sense of Tables.jl
107-
108- Train the machine using `fit!(mach, rows=...)`.
109-
110-
111- # Hyper-parameters
112-
113- - `features`: one of the following, with the behavior indicated:
114-
115- - `[]` (empty, the default): filter out all features (columns) which
116- were not encountered in training
117-
118- - non-empty vector of feature names (symbols): keep only the
119- specified features (`ignore=false`) or keep only unspecified
120- features (`ignore=true`)
121-
122- - function or other callable: keep a feature if the callable returns
123- `true` on its name. For example, specifying
124- `FeatureSelector(features = name -> name in [:x1, :x3], ignore =
125- true)` has the same effect as `FeatureSelector(features = [:x1,
126- :x3], ignore = true)`, namely to select all features, with the
127- exception of `:x1` and `:x3`.
128-
129- - `ignore`: whether to ignore or keep specified `features`, as
130- explained above
131-
132-
133- # Operations
134-
135- - `transform(mach, Xnew)`: select features from the table `Xnew` as
136- specified by the model, taking features seen during training into
137- account, if relevant
138-
139-
140- # Fitted parameters
141-
142- The fields of `fitted_params(mach)` are:
143-
144- - `features_to_keep`: the features that will be selected
145-
146-
147- # Example
148-
149- ```
150- using MLJ
151-
152- X = (ordinal1 = [1, 2, 3],
153- ordinal2 = coerce(["x", "y", "x"], OrderedFactor),
154- ordinal3 = [10.0, 20.0, 30.0],
155- ordinal4 = [-20.0, -30.0, -40.0],
156- nominal = coerce(["Your father", "he", "is"], Multiclass));
157-
158- selector = FeatureSelector(features=[:ordinal3, ], ignore=true);
159-
160- julia> transform(fit!(machine(selector, X)), X)
161- (ordinal1 = [1, 2, 3],
162- ordinal2 = CategoricalValue{Symbol,UInt32}["x", "y", "x"],
163- ordinal4 = [-20.0, -30.0, -40.0],
164- nominal = CategoricalValue{String,UInt32}["Your father", "he", "is"],)
165-
166- ```
167- """
168- FeatureSelector
90+ # docstring is in "src/type_docstrings.jl"
0 commit comments