You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-4Lines changed: 7 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,8 @@ Pkg.add("FeatureSelection")
17
17
```
18
18
19
19
# Example Usage
20
-
Lets build a supervised recursive feature eliminator with `RandomForestRegressor` from `MLJDecisionTreeInterface` as our base model.
20
+
Lets build a supervised recursive feature eliminator with `RandomForestRegressor`
21
+
from DecisionTree.jl as our base model.
21
22
But first we need a dataset to train on. We shall create a synthetic dataset popularly known in the R community as the friedman dataset#1. Notice how the target vector for this dataset depends on only the first
22
23
five columns of feature table. So we expect that our recursive feature elimination should return the first
23
24
columns as important features.
@@ -46,13 +47,15 @@ We can view the important features by inspecting the `fitted_params` object.
46
47
p =fitted_params(mach)
47
48
p.features_left == [:x1, :x2, :x3, :x4, :x5]
48
49
```
49
-
We can even call `predict` and `transform` om the fitted machine. See example
50
+
We can also call `predict` on the fitted machine, to predict using a
51
+
random forest regressor trained just on those features, or call `transform`, to
52
+
select just those features some new table including all the original features.
50
53
in `?RecursiveFeatureElimination`.
51
54
52
55
Okay, let's say that we didn't know that our synthetic dataset depends on only five
53
56
columns from our feature table. We could apply cross fold validation `CV(nfolds=5)` with our
54
57
recursive feature elimination model to select the optimal value of
55
-
`n_features_to_select` for our model. In this case we will use a simple Grid search with
58
+
`n_features` for our model. In this case we will use a simple Grid search with
56
59
root mean square as the measure.
57
60
```julia
58
61
rfe =RecursiveFeatureElimination(model = forest)
@@ -70,7 +73,7 @@ fit!(self_tuning_rfe_mach)
70
73
```
71
74
As before we can inspect the important features by inspesting the `fitted_params` object.
0 commit comments