Skip to main content

Statistical Inference for Sequential Feature Selection after Domain Adaptation

Project description

Statistical Inference for Sequential Feature Selection after Domain Adaptation

This package provides a statistical inference framework for sequential feature selection (SeqFS) after domain adaptation (DA). It leverages the SI framework and employs a divide-and-conquer strategy to efficiently compute the p-value of selected features. Our method ensures reliable feature selection by controlling the false positive rate (FPR) while simultaneously maximizing the true positive rate (TPR), effectively reducing the false negative rate (FNR).

For more details, refer to the paper at https://arxiv.org/abs/2501.09933

Installization

You can install this package from PyPI using:

pip install si-seqfs-da

Example

from si_seqfs_da import gendata, SI_SeqFS_DA
import numpy as np

ns = 50 #number of source's samples
nt = 10 #number of target's samples
p = 4 #number of features

true_beta_s = np.full((p,1), 2) #source's beta
true_beta_t = np.full((p,1), 0) #target's beta

Xs, Xt, Ys, Yt, Sigma_s, Sigma_t = gendata.generate(ns, nt, p, true_beta_s, true_beta_t)



K = 2 # number of features to be selected


# apply DA-SeqFS to select relevant features
print('Selected features: ', DA_SeqFS.DA_SeqFS(Xs, Ys,
                                                Xt, Yt,
                                                Sigma_s, Sigma_t,
                                                K, method='forward'))

# compute p-value with SI-SeqFS-DA 
print('p-value =',SI_SeqFS_DA.SI_SeqFS_DA(Xs, Ys, 
                                Xt, Yt, 
                                K, Sigma_s, Sigma_t, 
                                method='forward', jth=None)) 
                                #jth = None means randomly choose jth

K = 'AIC' # stopping criterion
# apply DA-SeqFS to select relevant features
print('Selected features: ', DA_SeqFS.DA_SeqFS(Xs, Ys, 
                                                Xt, Yt, 
                                                Sigma_s, Sigma_t,
                                                K, method='backward'))
# compute p-value with SI-SeqFS-DA 
print('p-value =',SI_SeqFS_DA.SI_SeqFS_DA(Xs, Ys, Xt, Yt, K, Sigma_s, Sigma_t, method='backward', jth=1))

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

si_seqfs_da-1.0.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

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

si_seqfs_da-1.0-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file si_seqfs_da-1.0.tar.gz.

File metadata

  • Download URL: si_seqfs_da-1.0.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for si_seqfs_da-1.0.tar.gz
Algorithm Hash digest
SHA256 7447cf2ea182b3a2eca1516cb0ecf074bb280ed33978ca4a9b6e0bc40a6805cf
MD5 4a20c21a0800ea344d7df9ee182f3666
BLAKE2b-256 23c1eb7f8526a7054cc1a7071aab49065b18f8af15514de709518f31160c09c2

See more details on using hashes here.

File details

Details for the file si_seqfs_da-1.0-py3-none-any.whl.

File metadata

  • Download URL: si_seqfs_da-1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for si_seqfs_da-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e28b9f6ae36924db04c59d8a6d92086921f8a820681cf138ea663f1047401853
MD5 bed65e30654bbd795b2486d6de096f48
BLAKE2b-256 6ca83c6dd29a239b3f264cd333ea3d53c6f1e8da24fa67f9ca3c141b325d8cca

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