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
Note: This package utilizes the scipy package to solve linear programming problems using the simplex method. However, the default scipy package does not provide the set of basic variables in its output. To address this limitation, we slightly modified the package so that it can return the set of basic variables by replacing the two files '_linprog.py' and '_linprog_simplex.py' in scipy.optimize module with our modified files in the folder 'files_to_replace'.
Please visit these detailed instructions on replacing the files.
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
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 si_seqfs_da-1.1.tar.gz.
File metadata
- Download URL: si_seqfs_da-1.1.tar.gz
- Upload date:
- Size: 12.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54990907f5a226fdf6c7b9fd6f84fb1943f95ec492cc4f87abb3ebe3387c054b
|
|
| MD5 |
ee441f16a100192c090b3d5d3cbac65d
|
|
| BLAKE2b-256 |
c6baefd5ba5827ba925db940e94e93249a96105a0c28076a6746ad2c2a3a242e
|
File details
Details for the file si_seqfs_da-1.1-py3-none-any.whl.
File metadata
- Download URL: si_seqfs_da-1.1-py3-none-any.whl
- Upload date:
- Size: 16.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
16e7ff257799f2ac51fba09543e3f63566ed2a0bc625aa539092f9b5b0dffbff
|
|
| MD5 |
011d25fe70056c640991699e88dcdeca
|
|
| BLAKE2b-256 |
82394d91865f22e1d4011988df271bba6ed3b01494107f72b5743ddc6b9572b2
|