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
Repository housing feature selection algorithms for use with the machine learning toolbox [MLJ](https://juliaai.github.io/MLJ.jl/dev/).
8
+
9
+
This package provides a collection of feature selection algorithms designed for use with MLJ, a powerful machine learning toolbox in Julia. It aims to facilitate the process of selecting the most relevant features from your datasets, enhancing the performance and interpretability of your machine learning models.
10
+
11
+
## Key Features
12
+
- Integration with MLJ: Seamlessly integrates with MLJ's extensive suite of tools and models.
13
+
- Variety of Algorithms: Includes multiple feature selection algorithms to suit different types of data and models.
14
+
- User-friendly: Easy to use with clear documentation and examples.
15
+
16
+
## Getting Started
17
+
To get started with this package, refer to the documentation for installation instructions, usage guides, and API references.
18
+
19
+
## Contributing
20
+
Contributions are welcome! Please refer to MLJ contributing [guidelines](https://github.com/JuliaAI/MLJ.jl/blob/dev/CONTRIBUTING.md) for more information.
21
+
22
+
## License
23
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
We can inspect the feature importances in two ways:
76
76
```jldoctest
77
-
julia> report(mach).ranking
78
-
10-element Vector{Int64}:
79
-
1
80
-
1
81
-
1
82
-
1
83
-
1
84
-
2
85
-
3
86
-
4
87
-
5
88
-
6
77
+
julia> report(mach).scores
78
+
Dict{Symbol, Int64} with 10 entries:
79
+
:x9 => 4
80
+
:x2 => 6
81
+
:x5 => 6
82
+
:x6 => 3
83
+
:x7 => 2
84
+
:x3 => 6
85
+
:x8 => 1
86
+
:x4 => 6
87
+
:x10 => 5
88
+
:x1 => 6
89
89
90
90
julia> feature_importances(mach)
91
91
10-element Vector{Pair{Symbol, Int64}}:
92
-
:x1 => 6
93
-
:x2 => 5
94
-
:x3 => 4
95
-
:x4 => 3
96
-
:x5 => 2
97
-
:x6 => 1
98
-
:x7 => 1
92
+
:x9 => 4
93
+
:x2 => 6
94
+
:x5 => 6
95
+
:x6 => 3
96
+
:x7 => 2
97
+
:x3 => 6
99
98
:x8 => 1
100
-
:x9 => 1
101
-
:x10 => 1
99
+
:x4 => 6
100
+
:x10 => 5
101
+
:x1 => 6
102
102
```
103
-
Note that a variable with lower rank has more significance than a variable with higher rank while a variable with higher feature importance is better than a variable with lower feature importance.
104
-
105
103
We can view the important features used by our model by inspecting the `fitted_params`
106
104
object.
107
105
```jldoctest
108
106
julia> p = fitted_params(mach)
109
-
(features_left = [:x1, :x2, :x3, :x4, :x5],
107
+
(features_left = [:x4, :x2, :x1, :x5, :x3],
110
108
model_fitresult = (forest = Ensemble of Decision Trees
111
109
Trees: 100
112
-
Avg Leaves: 25.26
113
-
Avg Depth: 8.36,),)
110
+
Avg Leaves: 25.3
111
+
Avg Depth: 8.01,),)
114
112
115
113
julia> p.features_left
116
114
5-element Vector{Symbol}:
117
-
:x1
118
-
:x2
119
-
:x3
120
115
:x4
116
+
:x2
117
+
:x1
121
118
:x5
119
+
:x3
122
120
```
123
121
We can also call the `predict` method on the fitted machine, to predict using a
124
122
random forest regressor trained using only the important features, or call the `transform`
@@ -149,24 +147,24 @@ As before we can inspect the important features by inspecting the object returne
0 commit comments