Skip to main content

A package for feature selection using Subsampling Winner Algorithm

Project description

subsamp Feature Selection with Subsampling Winner Algorithm

Subsampling Winner Algorithm (SWA)

SubsampWinner is a Python package that implements the Subsampling Winner Algorithm (SWA) for feature selection in high-dimensional datasets. It includes a robust double assurance procedure to enhance stability and reliability in feature selection.

Features

  • Subsampling Winner Algorithm (SWA) for efficient feature selection;
  • Double Assurance procedure for improved stability;
  • Support for both homoskedastic and heteroskedastic data;
  • Parallel processing capabilities for improved performance;
  • Flexible parameter tuning and multiple testing correction methods.

Installation

You can install SubsampWinner using pip:

pip install subsampwinner

Quick Start

import numpy as np
from subsamp import subsamp, SubsampDoubleAssurance
from GenerateData import generate_heteroskedastic_data

# Generate sample data
n, p = 100, 80
beta0 = np.array([0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5])
beta0_index = np.arange(len(beta0))
beta = np.zeros(p)
beta[beta0_index] = beta0
gamma = np.zeros(p)

X, y, _, _ = generate_heteroskedastic_data(n, p, hetero_func=lambda x: 3, 
    beta=beta, gamma=gamma, type='diagonal')

# Initialize and run SWA
swa = subsamp(s=20, m=1000, qnum=15)
swa.fit(X, y)

print("Selected features:", swa.finalists)

# Run Double Assurance procedure
sda = SubsampDoubleAssurance(m=1000)
results = sda.double_assurance(X, y, s0=26, T=0.9, I_max=20, init_range=0.3, r=0.75)

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

subsampwinner-0.0.4.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

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

subsampwinner-0.0.4-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

Details for the file subsampwinner-0.0.4.tar.gz.

File metadata

  • Download URL: subsampwinner-0.0.4.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.7

File hashes

Hashes for subsampwinner-0.0.4.tar.gz
Algorithm Hash digest
SHA256 8d62bfab10e5ae6b55979ac643ba53d9c5c172e6f7faeae4abb67a345b576ae5
MD5 3ccfe17ed5c73f723a6d000b3b0f8e23
BLAKE2b-256 0ba54f1a31ad3196f6cae6d19b747d86fe0f2a3cb42b44abe24fb92ba10e60e8

See more details on using hashes here.

File details

Details for the file subsampwinner-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: subsampwinner-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 17.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.7

File hashes

Hashes for subsampwinner-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e7d597625f33f3d24fef89531cb01d782dc79f7f7e19467d0baf78a54ca550c9
MD5 4dd4ae7f04b97aa8fb85821595c7e672
BLAKE2b-256 357a88c2f0364ea501a98884f43698ed538985369703ee805b69387cc867b6e0

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