Releases: cnellington/Contextualized
Releases · cnellington/Contextualized
v0.2.8 -- Documentation Overhaul, New Statistical Tests (JOSS)
New tagged v0.2.8 release for Zenodo archive for JOSS
v0.2.8 -- Documentation Overhaul, New Statistical Tests
Major Updates
- Full documentation overhaul, including common use-cases, motivations, quick-start instructions, demos on real diabetes data to fit models and test for heterogeneity, and formal descriptions of the underlying statistical framework.
- Find individual contexts driving heterogeneity and test their significance with
contextualized.analysis.pvals.test_each_context
. - New demo for
test_each_context
: Finding Drivers of Heterogeneous Effects. - Added API reference for
test_each_context
,select_good_bootstraps
, andprint_acc_by_covars
- Added maximum stable version
torch<2.2.0
Minor Updates
- Fixed bug in easy correlation networks prediction when
indivudal_preds=False
- Increased overall test coverage to 87%, only leaving out visualization utilities.
- Added tests for correctness to all analysis tools. Models must identify the significance of known heterogeneous and homogeneous effects to pass integration tests.
Auto-generated release notes
- create sequential context testing utility function by @aaron10l in #220
- Sequential testing bugfixes, updated docs by @cnellington in #227
- sequential testing function unittest by @aaron10l in #234
- add network quicktests to main test file, fix bug with averaged correlation networks by @cnellington in #236
- Website cleaning by @cnellington in #239
- clean up easy regression notebook by @aaron10l in #240
- add link to comparison with linear interpretability methods by @cnellington in #241
Full Changelog: v0.2.7...v0.2.8
v0.2.7 -- Linear Encoders, API Reference, and Developer Resources
Major Updates
- Contextualize all models with linear encoders for simplicity and interpretability (set
encoder_type='linear'
) - Added stable versions to all requirements, upgrading to torch >=2.1.0 and lightning >=2.0.0, Python >=3.8
- Added API reference for
contextualized.easy
andcontextualized.analysis
and search to online documentation - Added the Benefits of Contextualized ML demo notebook to the website
- Silenced most pytorch logging to make the important stuff stand out
Minor Updates
- Fixed bug in easy Bayesian networks error computation
- Resolved distributed training on GPUs for the dags TensorDataset
- Depreciating dev branch, using pypi for stable versioning and main branch for active development
- Added tests for correctness, where models must recover known known data generation mechanisms to pass (not just converging on random data)
- All code is black formatted and began adding type hints and docstrings as standard practice. Docstrings use Google style now.
- Added resources and scripts to standardize development workflows and requirements (
dev_requirements.txt
,make_docs.sh
,format_style.sh
)
v0.2.6 -- Consistency Tests, P-values
Contextualization adds new flexibility to model inference. In this update, we add tests to assess when contextualization captures meaningful heterogeneous effects, and determine when these effects should be ignored.
Use analysis.pvals
to estimate the significance of effects captured by contextualized modeling
calc_homogeneous_context_effects_pvals
tests if the direct effect of context on outcomes is significantcalc_homogeneous_predictor_effects_pvals
tests if the effect of context-invariant models on outcomes is significantcalc_heterogeneous_predictor_effects_pvals
tests it the effect of context-dependent models on outcomes is significant
Use analysis.bootstraps
with select_good_bootstraps
to select only training runs which converge for follow-up analysis.
v0.2.5 -- DAG losses, factor graphs, neighborhood selection, and sklearn-style graph baselines
- Major NOTMAD upgrades: Infer Contextualized DAGs with
NOTMAD
using the NOTEARS, Poly, or DAGMA losses, and use factor graphs to infer high dimensional DAGs! - More Contextualized Networks: Use ContextualizedNeighborhoodSelection in the regression module to do contextualized neighborhood selection and infer graphs using lasso regression with minimal assumptions.
- Network Baselines: Use
contextualized.baselines
to infer traditional correlation networks and Bayesian networks using a simple sklearn-style interface (fit, predict, measure_mses), and create "grouped" versions of these models using any grouping or discrete context (e.g. clustering, feature splits, age groups, cell types) with theGroupedNetworks
class -- and follow up withContextualizedCorrelationNetworks
orContextualizedBayesianNetworks
in theeasy
module to see how much more accurate contextualized models can be! - Set
metamodel_type='Naive'
in the regression and dags lightning_modules to remove archetypes and estimate models directly from a neural network (not yet in the sklearn-style easy models). - Set
fit_intercept=False
in the regression lightning_modules to remove contextualized intercepts, and only infer models with context-varying coefficients (not yet in the sklearn-style easy models). - Various bugfixes, including a sign-flip in easy correlation measure_mses.
- Disabled dynamic trainer output to improve readability of stdout
v0.2.4 -- BCELoss and Easy Network MSE
- Contextualized Classifier now uses binary cross-entropy loss, solving a problem with nan-values in backpropagation
- Bugfix in Contextualized Easy Networks measure_mse
v0.2.3 -- Easy Early Stopping + Bugfixes
- Added kwargs for controlling early stopping and checkpointing in the easy modules
- Bugfixes for predicting bootstrapped vs. averaged params in easy modules
v0.2.2 -- Analysis Utils and PyPI
- Added analysis and plotting utilities for contextualized models under
contextualized.analysis
- Install the latest stable release of Contextualized from PyPI with
pip install contextualized-ml
v0.2.0 -- Contextualized Graphical Models
- Estimate contextualized graphical models under a cohesive PyTorch Lightning framework, with simple multi-gpu acceleration.
- Bayesian networks:
contextualized.dags.torch_notmad.torch_notmad.NOTMAD_model
- Correlation networks:
contextualized.regression.lightning_modules.ContextualizedCorrelation
- Markov networks:
contextualized.regression.lightning_modules.ContextualizedMarkovGraph
- Bayesian networks:
v0.1.2 -- Saving, loading, and base_predictors
- Include a
base_predictor
in yourcontextualized.regression
orcontextualized.easy
object to improve learning and restrict contextualized to estimate only non-base effects (differences in parameters/outcomes from the base model) - Easily share your results and transfer your experiments between machines with
contextualized.save
andcontextualized.load