Skip to main content

Impact Range Assessment (IRA): An Interpretable Sensitivity Measure for Regression Modeling

Project description

irapy

irapy is a Python library for implementing single-execution Impact Range Assessment (IRA) and repeated IRA analyses.

Installation

pip install irapy

Requirements

irapy Requirements

irapy depends on the following Python libraries:

  • NumPy
  • pandas
  • joblib

These dependencies are installed automatically when using pip install irapy.

irapy was developed using Python 3.12 (NumPy 2.2.5, pandas 2.3.3, joblib 1.5.3) and has been tested on Python environments including Python 3.9 (NumPy 1.26, pandas 2.0) and Python 3.12 (NumPy 2.2, pandas 2.3). Compatibility issues may occur when NumPy and pandas are installed in binary-incompatible combinations.

Usage

Run irapy

You can apply either a single-execution or a repeated IRA to a trained regression model using the corresponding dataset.

from irapy import single_ira, repeated_ira

# single-execution IRA
single_ira_result = single_ira(input_data=X, model=trained_model)
print(single_ira_result)

# repeated IRA
repeated_ira_result = repeated_ira(input_data=X, model=trained_model, n_repeats=50)
print(repeated_ira_result)

Arguments

  • input_data: predictor pandas DataFrame (i.e., the training predictor matrix, often denoted as X_train; use the original, unscaled predictors when a scaler is applied); all predictors must be continuous numeric variables.
  • model: trained model (object with '.predict()', tested with 'scikit-learn' models) or a callable function. A Pipeline object can also be used to combine a scaler and prediction model. When using a Pipeline that already includes a scaler, leave the scaler argument as None.
  • scaler: fitted scaler (optional, e.g., 'StandardScaler' / 'MinMaxScaler' in Python).
  • num_interpol: number of interpolated points (default: 100).
  • num_background_samples: number of background observations (default: 200).
  • random_state: seed for reproducibility (default: 42).
  • sorted_output: whether to sort results by IRA value (default: False).
  • n_repeats (repeated IRA only): number of repeated runs (default: 50).
  • n_jobs (repeated IRA only): number of parallel jobs to run (default: 1). Parallel execution uses the default joblib backend. In notebook or limited-memory environments (e.g., Google Colab), large models or datasets may occasionally produce memory or temporary storage issues when n_jobs > 1.

Project Homepage

https://github.com/jyou2025/impact-range-assessment

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

irapy-0.1.2.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

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

irapy-0.1.2-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file irapy-0.1.2.tar.gz.

File metadata

  • Download URL: irapy-0.1.2.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for irapy-0.1.2.tar.gz
Algorithm Hash digest
SHA256 92be357e14ea18ea2dfb5bde9c6965a4c42a5f777bf699ddad9ca58fefcd8cf1
MD5 6f0a99e5df82a1c08531115183a8d43d
BLAKE2b-256 c9be5fc8ab53dfbcb4827a657c46a5f1bd2731896d5172b01700626b417ee3dc

See more details on using hashes here.

File details

Details for the file irapy-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: irapy-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for irapy-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8f1b11fcc252b0e061583edbc47944306f6d5fd5e3cf2550f05789aa7c0ac3b3
MD5 b787d27fc60af4e648889fc223f69a93
BLAKE2b-256 af0f5a7052f54315f947506fecc9878d685fa6f3f9db580ac0219751ecf02436

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