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. APipelineobject can also be used to combine a scaler and prediction model. When using aPipelinethat already includes a scaler, leave thescalerargument asNone.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
Metadata
Release files for irapy 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| irapy-0.1.2.tar.gz | 6.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| irapy-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.5 kB
Release files / irapy-0.1.2.tar.gz
| Download URL | irapy-0.1.2.tar.gz |
|---|---|
| Size | 6.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
92be357e14ea18ea2dfb5bde9c6965a4c42a5f777bf699ddad9ca58fefcd8cf1
|
|
BLAKE2b-256 checksum How to use checksums |
c9be5fc8ab53dfbcb4827a657c46a5f1bd2731896d5172b01700626b417ee3dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / irapy-0.1.2-py3-none-any.whl
| Download URL | irapy-0.1.2-py3-none-any.whl |
|---|---|
| Size | 6.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8f1b11fcc252b0e061583edbc47944306f6d5fd5e3cf2550f05789aa7c0ac3b3
|
|
BLAKE2b-256 checksum How to use checksums |
af0f5a7052f54315f947506fecc9878d685fa6f3f9db580ac0219751ecf02436
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|