Skip to content

Commit

Permalink
Merge branch 'main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-Markham authored Feb 14, 2024
2 parents f43b7aa + 1a6ba6f commit 716a861
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@



This is a Python package for CStree models :footcite:p:`duarte2021representation`, a family of graphical causal models that encode context-specific dependence for multivariate multinomial distributions.
This is a Python package for CStree models :footcite:p:`duarte2021representation` :footcite:p:`rios2024scalable` a family of graphical causal models that encode context-specific dependence for multivariate multinomial distributions.

.. As not all staged tree models admit this property, CStrees are a subclass that provides a transparent, intuitive and compact representation of context-specific causal information.
Expand Down
16 changes: 13 additions & 3 deletions docs/_static/bibtex.bib
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
@article{duarte2021representation,
@misc{duarte2021representation,
title={Representation of context-specific causal models with observational and interventional data},
author={Duarte, Eliana and Solus, Liam},
journal={arXiv preprint arXiv:2101.09271},
archivePrefix={arXiv},
year={2021},
url={https://arxiv.org/abs/2101.09271}
primaryClass={stat.ML},
eprint={2101.09271}
}

@misc{rios2024scalable,
title={Scalable Structure Learning for Sparse Context-Specific Causal Systems},
author={Felix L. Rios and Alex Markham and Liam Solus},
year={2024},
eprint={2402.07762},
archivePrefix={arXiv},
primaryClass={stat.ML}
}
2 changes: 1 addition & 1 deletion docs/source/learn_demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"This notebook shows how to learn a CStree from observational data using an exhaustive search. procedure. "
"This notebook shows how to learn a CStree from observational data using an exhaustive search procedure. "
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/cstrees/__meta__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Automatically created. Please do not edit.
__version__ = '1.1.1'
__version__ = '1.1.2'
__author__ = ''
8 changes: 4 additions & 4 deletions src/cstrees/learning.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@ def _optimal_staging_at_level(
staging_score = context_scores["scores"][var]["None"]
continue

# here we (=I) anyway extract just the context, so the stage format
# is a bit redundant.
stage_context = sc._stage_to_context_key(stage, order)
score = context_scores["scores"][var][stage_context]
# here we (=I) anyway extract just the context, so the stage format is a bit redundant.
stage_context = sc._stage_to_context_key(stage, order)
if stage_context in context_scores["scores"][var]:
score = context_scores["scores"][var][stage_context]
staging_score += score

# Update the max score and the max staging
Expand Down
3 changes: 2 additions & 1 deletion src/cstrees/scoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,8 @@ def order_score_tables(
for stage in staging:
# OK! even when restricting to some possible cvars
stage_context = _stage_to_context_key(stage, subset)
staging_unnorm_post += context_scores["scores"][var][stage_context]
if stage_context in context_scores["scores"][var]:
staging_unnorm_post += context_scores["scores"][var][stage_context]

if i == 0:
order_scores["scores"][var][subset_str] = staging_unnorm_post
Expand Down

0 comments on commit 716a861

Please sign in to comment.