Select features using Kolmogorov–Smirnov (K-S) test for binary classification tasks.
Project description
KSFeatureSelector
KSFeatureSelector is a lightweight Python package for selecting the most discriminatory features
in a binary classification problem using the Kolmogorov–Smirnov (K-S) test.
Features
- Uses the K-S test to rank features by their ability to separate classes.
- Supports filtering features by:
- A maximum p-value threshold.
- A fixed number of top features.
- Easy-to-read, numpy-style docstrings and validations.
- Pure Python +
pandas+scipy.
Installation
-
bash pip install ksfeatureselector
-
local pip install .
Usage
from ksfeatureselector import select_ks_features
# Your DataFrame `df` should contain numerical features and a binary target column
x_cols = ['feature1', 'feature2', 'feature3']
y_var = 'target'
# Select top features based on p-value or top-n count
select_ks_features(df, x_cols, y_var, top_p=0.05)
# or
select_ks_features(df, x_cols, y_var, top_n=5)
License
- MIT License
Author
-- V Subrahmanya Raghu Ram Kishore Parupudi
-- email: pvsrrkishore@gmail.com
Project details
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 ksfeatureselector-0.1.0.tar.gz.
File metadata
- Download URL: ksfeatureselector-0.1.0.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b57d1fc6abd06d76a940283d4aa4f8a4599c35cc00499ce94c8387900b8696c8
|
|
| MD5 |
a3d3c8f4ab66b15a54bf7f9fcf17a6a9
|
|
| BLAKE2b-256 |
830e2f7cec9b07a7c69aedf8e2b5b1061ef46e166066e38b331d0d353e4c92b0
|
File details
Details for the file ksfeatureselector-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ksfeatureselector-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
184075e25b0903320ca797688b93ed42108f317f3248a69244a8e535bcf4ce9c
|
|
| MD5 |
f33e7d59ba6b0e8d5901a6278c1ea46b
|
|
| BLAKE2b-256 |
7ecbe9a7833f4e6683f453981a9e181d8fae15e1772c4d89e3b92db736d0e4b9
|