Feature selection methods for tuiml.
The selectors are categorized into several strategies:
Univariate Selectors ~~~~~~~~~~~~~~~~~~~~ These score each feature independently using statistical tests:SelectKBestSelector: Keep top k features.
SelectPercentileSelector: Keep top percentage.
SelectThresholdSelector: Keep by raw score.
SelectFprSelector: Keep by signicance (p-value).
CFSSelector: Correlation-based Subset Selection.
SequentialFeatureSelector: Greedy forward/backward.
BestFirstSelector: Search with backtracking.
WrapperSelector: Evaluates subsets with an estimator.
VarianceThresholdSelector: Removes constant features.
RandomSubsetSelector: Stochastic subsampling.
BootstrapFeaturesSelector: Sample with replacement.
Univariate selection with Information Gain:
>>> from tuiml.features.selection import SelectKBestSelector
>>> from tuiml.evaluation.metrics import information_gain
>>> import numpy as np
>>> X, y = np.random.randn(20, 10), np.random.randint(0, 2, 20)
>>> selector = SelectKBestSelector(score_func=information_gain, k=5)
>>> X_new = selector.fit_transform(X, y)
Automatic subset selection using CFS:
>>> from tuiml.features.selection import CFSSelector
>>> cfs = CFSSelector()
>>> X_new = cfs.fit_transform(X, y)
>>> print(f"Selected: {cfs.get_support(indices=True)}")
Random Subset feature selection....
Recursive feature elimination selectors.
Sequential feature selection methods....
Subset-based feature selection methods....
Univariate feature selection methods....
Variance-based feature selection....