Skip to main content

A feature selection method based on identifying features that best segregate classes via their underlying probablity density estimations

Project description

PDE-Seg (PDE-Segregate) is a univariate filter feature selection method based on a filter-measure that ranks features according to their ability to segregate the probability density estimates (PDE) of the class samples.

Install

PDE-Seg can be installed from PyPI:

pip install pdeseg

Example

from pdeseg import PDE_Segregate

import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import make_classification

# Create random classification dataset
X, y = make_classification(
    n_samples=300, n_features=50, n_classes=3, n_informative=5,
    shuffle=False
)

# Initialize PDE-Segregate object
pdeRanker = PDE_Segregate()

# Carry out feature selection
pdeRanker.fit(X, y)

# Get top 10 features
top10Features = pdeRanker.get_topnFeatures(10)

# Visualize the top feature's ability to segregate PDEs
fig, axs = plt.subplots(1, 2, sharey=True)

# Top ranked feature
pdeRanker.plot_overlapAreas(top10Features[0], legend="intersection", _ax=axs[0])
axs[0].set_title("Most relevant feature", loc="left")

# Last ranked feature
axs[1].set_title("Least relevant feature", loc="left")
pdeRanker.plot_overlapAreas(49, legend="intersection", _ax=axs[1])

axs[0].set_ylabel(r"Probability Density, $\hat{P}$")
for i in range(2):
    axs[i].set_xlim(-0.5, 1.5)
    axs[i].set_xticks(np.arange(-0.5, 2.0, 0.5))

Check out the notebooks provided as tutorials and examples of some specific use cases.

Citation

Please cite the paper (2024)

The other feature selection methods that were compared to in our paper is as listed below:

  1. LH-RELIEF: Feature weight estimation for gene selection: a local hyperlinear learning approach DOI: https://doi.org/10.1186/1471-2105-15-70

  2. I-RELIEF: Iterative RELIEF for Feature Weighting: Algorithms, Theories, and Applications DOI: https://doi.org/10.1109/TPAMI.2007.1093

  3. RELIEF-F: Estimating attributes: Analysis and extensions of RELIEF DOI: https://doi.org/10.1007/3-540-57868-4_57

  4. MultiSURF: Benchmarking relief-based feature selection methods for bioinformatics data mining DOI: https://doi.org/10.1016/j.jbi.2018.07.015

  5. Random Forests DOI: https://doi.org/10.1023/A:1010933404324

  6. ANOVA F-statistic: Statistical Methods for Research Workers

  7. Mutual Information: Estimating mutual information DOI: https://doi.org/10.1103/PhysRevE.69.066138

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

pdeseg-0.1.0.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pdeseg-0.1.0-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file pdeseg-0.1.0.tar.gz.

File metadata

  • Download URL: pdeseg-0.1.0.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pdeseg-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8b87554dc907bdec32803ae78179072146d5aa5ace045ab925bced7710cca883
MD5 e8f0d5e40eae851c9176b362dfdab031
BLAKE2b-256 d058a302cfbb867100cb78c803bfb1bb71953fddd81ca38115a31a4e548ebf5f

See more details on using hashes here.

File details

Details for the file pdeseg-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pdeseg-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pdeseg-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9c2a8b06670c104df9dadf3ea7425795392b9a2006bc1c47d6fe3e1db79978b8
MD5 66cb68eb7b8f2b63154e342dff0cab98
BLAKE2b-256 c10db5ab90fd10289323ba3115386120037241b9cdab509a753dfd47859ddf79

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page