Fast feature subset selection library
Project description
ffselect
Fast feature subset selection library
This algorithm performs feature subset selection in O(n log n) or O(n) time
It may be useful for eliminating polynomial features with n equal to hundreds or thousands, where regular subset selection algorithms cannot perform in adequate time.
Usage
from ffselect.subset import MinSubsetSelection, FastSubsetSelection
MinSubsetSelection(data, target, fit_function, features, loss=True, interactive=True)
"""
Minimal feature subset selection algorithm
data: Input data to pass to the fitting function
target: Target parameter feature name
fit_function: Callable function that fits the model and returns R^2/loss
features: List of feature names
loss: Set to true (by default) if the fitting function returns loss, R^2 otherwise
interactive: Print output (default True)
return: Tuple with the resulting R^2/loss and the list of features
"""
def FastSubsetSelection(data, target, fit_function, features, threshold = None, loss = True, interactive = True):
"""
Fast feature subset selection algorithm in linear time. May drop important features
data: Input data to pass to the fitting function
target: Target parameter feature name
fit_function: Callable function that fits the model and returns R^2/loss
features: List of feature names
threshold: Minimal difference in loss/R^2 at which we drop the feature
loss: Set to true (by default) if the fitting function returns loss, R^2 otherwise
interactive: Print output (default True)
return: Tuple with the resulting R^2/loss and the list of features
"""
Please view subset.ipynb for the complete example
Installation
pip3 install ffselect
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ffselect-0.0.1.tar.gz.
File metadata
- Download URL: ffselect-0.0.1.tar.gz
- Upload date:
- Size: 40.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f5cdc8c51c763730b311ff190ef233e27ec4918da7e9004e12f83a448baf9a3d
|
|
| MD5 |
edb592b8aeb2d8cb748c06e8a8ff31f3
|
|
| BLAKE2b-256 |
20812cf240975a73102b1b061332c1cecc76655988077d39dcf1aac1b18b760b
|
File details
Details for the file ffselect-0.0.1-py3-none-any.whl.
File metadata
- Download URL: ffselect-0.0.1-py3-none-any.whl
- Upload date:
- Size: 28.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
945ba3064af3840be145594fd11203f67f3023657877c3e540bbc084ee5f67c0
|
|
| MD5 |
28b6c65470a6778f6d4fdb2877885cf5
|
|
| BLAKE2b-256 |
35d9370c8713e46c7a448d9c431ee6c813890a17e93828c2594f8183960ba54a
|