Skip to main content

A package for Statistical Inference for Feature Selection after OT-based Domain Adaptation

Project description

Statistical Inference for Feature Selection after Optimal Transport-based Domain Adaptation (AISTATS 2025)

This package implements a statistical inference for feature selection (FS) after optimal transport-based domain adaptation (OT-based DA). The main idea is to leverages the SI framework and employs a divide-and conquer approach to efficiently compute the $p$-value. By providing valid $p$-values for the selected features, our proposed method not only controls the false positive rate (FPR) in FS under DA but also maximizes the true positive rate (TPR), i.e., reducing the false negative rate (FNR). We believe this study represents a significant step toward controllable machine learning in the context of DA.

See the paper https://arxiv.org/abs/2410.15022 for more details.

Requirements

This package has the following requirements:

We recommend to install or update anaconda to the latest version and use Python 3 (We used Python 3.12.3).

NOTE: We use scipy package (version 1.13.1) to solve the linear program (simplex method). However, the default package does not return the set of basic variables. Therefore, 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' at https://github.com/NT-Loi/SFS_DA.git.

How to Automatically Replace the Files

If Using Anaconda

  • First, initialize and activate the target environment (if you want to use your conda base environment, you should replace 'your-env-name' by 'base'):
$ conda init
$ conda activate your-env-name
  • Then, run the following command to replace the necessary files:
python replace_scipy_linprog.py --env anaconda --dir files_to_replace

If Using System Python (Non-Anaconda) - Run the following command:

$ python replace_scipy_linprog.py --env python --dir files_to_replace

Installation

This package can be installed using pip:

$ pip install sfs_da

Usage

We provide several Jupyter notebooks demonstrating how to use the sfs-da package in our examples directory.

  • Example for computing $p$-value for Lasso after DA
>> ex0_p_value_lasso_DA.ipynb
  • Example for computing $p$-value for Elastic Net after DA
>> ex1_p_value_elasticnet_DA.ipynb
  • Check the uniformity of the pivot
>> ex2_validity_of_p_value.ipynb

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

sfs_da-1.0.1.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

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

sfs_da-1.0.1-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file sfs_da-1.0.1.tar.gz.

File metadata

  • Download URL: sfs_da-1.0.1.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for sfs_da-1.0.1.tar.gz
Algorithm Hash digest
SHA256 d6098503904b1ec442db262acda7136ba335fb06aa2fc348727933862dd3be47
MD5 7e8cea339be5c3c83f73b73d5b3335b7
BLAKE2b-256 ab4989c489ed117490c7d06ba9b5020c036c9d9a77a9142876b1d89c06212e6c

See more details on using hashes here.

File details

Details for the file sfs_da-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: sfs_da-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 12.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for sfs_da-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 67d39e526cc8263743134685e5eb727bb6072bb6f4ddca20ae6e9548a3d7f105
MD5 dfeb10687b89a1accc6566e59bba293f
BLAKE2b-256 91515bfbfad6f814fc26aa181a5f84ad1e37a857d225248e2a7d41c71a36655a

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