Feature Selection
FEATURE_SELECTION
Source code in engines/contentFilterEngine/miscellaneous_techniques/feature_selection.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
|
__init__(k=10, method='chi2')
Initialize feature selection.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
k
|
int
|
Number of top features to select |
10
|
method
|
str
|
Feature selection method ('chi2', 'variance', 'correlation') |
'chi2'
|
Source code in engines/contentFilterEngine/miscellaneous_techniques/feature_selection.py
7 8 9 10 11 12 13 14 15 16 17 18 19 |
|
fit_transform(X, y=None)
Fit the feature selector and transform the data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X
|
Input features |
required | |
y
|
Target variables (optional for some methods) |
None
|
Source code in engines/contentFilterEngine/miscellaneous_techniques/feature_selection.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
|
get_feature_importance()
Return feature importance scores.
Source code in engines/contentFilterEngine/miscellaneous_techniques/feature_selection.py
62 63 64 65 66 |
|
transform(X)
Transform new data using selected features.
Source code in engines/contentFilterEngine/miscellaneous_techniques/feature_selection.py
56 57 58 59 60 |
|