phenoforge
Phenomenological model-family bank and ensemble calibration engine for industrial processes. The reference implementation of BAPE (Bootstrap-Aggregated Phenomenological Ensembles): instead of selecting one phenomenological model for a process dataset, fit many realizations (model families x parameter multistarts x bootstrap resamples) from a curated family bank and aggregate them into a calibrated ensemble with structural inclusion probabilities.
Consumed by the Fragua research product (CAOS_RES_Fragua); designed as a
standalone, domain-agnostic library. The core is pure numpy/scipy (Pyodide-safe).
What it provides
- A family bank (
phenoforge.families): named, cited, bounded phenomenological models with physical parameter ranges and declared calibration-data contracts. Shipping now: the flotation kinetics zoo (Garcia-Zuniga first-order, Klimpel, Kelsall, modified Kelsall, gamma rate distribution, second-order, fully mixed, bank of N mixers) and the comminution energy-size laws (Rittinger, Kick, Bond, Morrell Mi). The bank grows with the Fragua build (thickening, leaching, utilities, PBM). - Fitting (
phenoforge.fit): bounded multistart trust-region nonlinear least squares per family; information criteria (AIC/AICc/BIC) on every fit. - Ensembles (
phenoforge.ensemble):select/akaike_weights/averaged_prediction: IC selection and multimodel averaging (Burnham-Anderson).glue_fit: GLUE behavioural parameter-set ensembles (Beven-Binley).bootstrap_fit: bagging/bragging of one family (paired or moving-block).stack_fit: cross-validated convex stacking over the bank (super-learner recipe; M-open rationale per Yao-Vehtari-Simpson-Gelman).bape_fit: the BAPE ensemble (bootstrap x family-library subsampling, one fitted model per member, inclusion probabilities over families).
- Metrics (
phenoforge.metrics): point (RMSE/MAE/R2), probabilistic calibration (ensemble CRPS, PIT, interval coverage), and structural readouts (weight entropy, known-truth structural recovery that refuses to run silently null). - Routing (
phenoforge.route): match a dataset's declared data kinds to the families they can calibrate.
Quick start
import numpy as np
from phenoforge import list_families
from phenoforge.families import flotation
from phenoforge.ensemble import bape_fit
t = np.array([0.5, 1, 2, 4, 8, 12, 16, 20], dtype=float)
r = 0.85 * (1 - np.exp(-1.2 * t)) # a batch flotation test
ens = bape_fit(flotation.BATCH_FAMILIES, t, r, n_members=200, seed=0)
print(ens.selection_shares()) # which family explains the data, with what share
print(ens.quantiles(t)) # calibrated predictive bands
Method background (primary sources)
- Fasel, Kutz, Brunton, Brunton 2022. Ensemble-SINDy. Proc. R. Soc. A 478:20210904. DOI 10.1098/rspa.2021.0904.
- Pinto, de Azevedo, Oliveira, von Stosch 2019. Bioprocess Biosyst. Eng. 42:1853-1865. DOI 10.1007/s00449-019-02181-y.
- Duan, Ajami, Gao, Sorooshian 2007. Adv. Water Resour. 30:1371-1386. DOI 10.1016/j.advwatres.2006.11.014.
- Beven, Binley 1992. Hydrol. Process. 6:279-298; Beven 2006. J. Hydrol. 320:18-36. DOI 10.1016/j.jhydrol.2005.07.007.
- Yao, Vehtari, Simpson, Gelman 2018. Bayesian Anal. 13:917-1007. DOI 10.1214/17-BA1091.
- Burnham, Anderson 2004. Sociol. Methods Res. 33:261-304. DOI 10.1177/0049124104268644.
- Polat, Chander 2000. Int. J. Miner. Process. 58:145-166. DOI 10.1016/S0301-7516(99)00069-1 (flotation family library).
Development
py -3.12 -m venv .venv
.venv/Scripts/python -m pip install -e ".[dev]"
.venv/Scripts/python -m pytest tests -v
.venv/Scripts/python -m ruff check src tests
License
MIT. See LICENSE.
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 phenoforge-0.4.0.tar.gz.
File metadata
- Download URL: phenoforge-0.4.0.tar.gz
- Upload date:
- Size: 50.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c45e83db2bd91a0d67f8a21d8dc87a36d419f561566ed929b7004e19343f8240
|
|
| MD5 |
3f7988c96d21d4b44043b160129a1dd7
|
|
| BLAKE2b-256 |
3998872c7cecddc25021b6361b83b88eca0da3ae1ecdfc2811582269754a62c7
|
Provenance
The following attestation bundles were made for phenoforge-0.4.0.tar.gz:
Publisher:
release.yml on fsantibanezleal/CAOS_PhenoForge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
phenoforge-0.4.0.tar.gz -
Subject digest:
c45e83db2bd91a0d67f8a21d8dc87a36d419f561566ed929b7004e19343f8240 - Sigstore transparency entry: 2618230982
- Sigstore integration time:
-
Permalink:
fsantibanezleal/CAOS_PhenoForge@0429c3669cf4ae532834da69672583921b436b72 -
Branch / Tag:
refs/tags/v0.04.000 - Owner: https://github.com/fsantibanezleal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0429c3669cf4ae532834da69672583921b436b72 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file phenoforge-0.4.0-py3-none-any.whl.
File metadata
- Download URL: phenoforge-0.4.0-py3-none-any.whl
- Upload date:
- Size: 54.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18362eb17e5e49c4c679b33bc4c7a65d00145e1e0949e4c492a818684c18581b
|
|
| MD5 |
c562f5fc10f61c6337b38259c887eba4
|
|
| BLAKE2b-256 |
8547c5b13d4bf1d79988c0588a89048f7b4e694b2db72f449ad251d1a30c18be
|
Provenance
The following attestation bundles were made for phenoforge-0.4.0-py3-none-any.whl:
Publisher:
release.yml on fsantibanezleal/CAOS_PhenoForge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
phenoforge-0.4.0-py3-none-any.whl -
Subject digest:
18362eb17e5e49c4c679b33bc4c7a65d00145e1e0949e4c492a818684c18581b - Sigstore transparency entry: 2618230993
- Sigstore integration time:
-
Permalink:
fsantibanezleal/CAOS_PhenoForge@0429c3669cf4ae532834da69672583921b436b72 -
Branch / Tag:
refs/tags/v0.04.000 - Owner: https://github.com/fsantibanezleal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0429c3669cf4ae532834da69672583921b436b72 -
Trigger Event:
workflow_dispatch
-
Statement type: