bella-companion 0.0.42__py3-none-any.whl → 0.0.43__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of bella-companion might be problematic. Click here for more details.

@@ -14,7 +14,7 @@ from bella_companion.simulations.scenarios.epi_skyline import REPRODUCTION_NUMBE
14
14
 
15
15
 
16
16
  def plot_epi_skyline_results():
17
- output_dir = Path(os.environ["BELLA_FIGURES_DIR"]) / "epi-skyline-results"
17
+ output_dir = Path(os.environ["BELLA_FIGURES_DIR"]) / "epi-skyline"
18
18
  os.makedirs(output_dir, exist_ok=True)
19
19
 
20
20
  for i, reproduction_number in enumerate(REPRODUCTION_NUMBERS, start=1):
@@ -1,6 +1,7 @@
1
1
  from functools import partial
2
2
  from itertools import product
3
3
  from pathlib import Path
4
+ from typing import Callable
4
5
 
5
6
  import matplotlib.pyplot as plt
6
7
  import numpy as np
@@ -43,13 +44,18 @@ def plot_shap_features_importance(
43
44
  ) # shape: (n_runs, n_features)
44
45
  features_importances /= features_importances.sum(axis=1, keepdims=True)
45
46
 
46
- for i, (feature_name, feature) in enumerate(features.items()):
47
- sns.violinplot(
48
- y=features_importances[:, i],
49
- x=[feature_name] * len(features_importances),
50
- cut=0,
51
- color="#E74C3C" if feature.is_relevant else "gray",
52
- )
47
+ def _plot_violins(group_check: Callable[[Feature], bool]):
48
+ for i, (feature_name, feature) in enumerate(features.items()):
49
+ if group_check(feature):
50
+ sns.violinplot(
51
+ y=features_importances[:, i],
52
+ x=[feature_name] * len(features_importances),
53
+ cut=0,
54
+ color="#E74C3C" if feature.is_relevant else "gray",
55
+ )
56
+
57
+ _plot_violins(lambda f: not f.is_binary)
58
+ _plot_violins(lambda f: f.is_binary)
53
59
  plt.xlabel("Feature") # pyright: ignore
54
60
  plt.ylabel("Importance") # pyright: ignore
55
61
  plt.savefig(output_file) # pyright: ignore
@@ -14,7 +14,7 @@ from bella_companion.simulations.scenarios.fbd_no_traits import RATES
14
14
 
15
15
 
16
16
  def plot_fbd_no_traits_results():
17
- output_dir = Path(os.environ["BELLA_FIGURES_DIR"]) / "fbd-no-traits-predictions"
17
+ output_dir = Path(os.environ["BELLA_FIGURES_DIR"]) / "fbd-no-traits"
18
18
  os.makedirs(output_dir, exist_ok=True)
19
19
 
20
20
  for i, rates in enumerate(RATES, start=1):
@@ -89,9 +89,9 @@ SCENARIO = Scenario(
89
89
  features={
90
90
  f"{rate}Rate": {
91
91
  "timePredictor": Feature(is_binary=False, is_relevant=True),
92
- "randomPredictor": Feature(is_binary=False, is_relevant=False),
93
92
  "trait1Predictor": Feature(is_binary=True, is_relevant=True),
94
93
  "trait2Predictor": Feature(is_binary=True, is_relevant=False),
94
+ "randomPredictor": Feature(is_binary=False, is_relevant=False),
95
95
  }
96
96
  for rate in RATES
97
97
  },
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bella-companion
3
- Version: 0.0.42
3
+ Version: 0.0.43
4
4
  Summary: Add your description here
5
5
  Requires-Python: >=3.10
6
6
  Description-Content-Type: text/markdown
@@ -50,27 +50,27 @@ bella_companion/simulations/beast_configs/fbd-no-traits/MLP.xml,sha256=JE_cGh2DW
50
50
  bella_companion/simulations/beast_configs/fbd-no-traits/Nonparametric.xml,sha256=m2xaHZwskCFInvVY1QH1fwQqH6p_fgESlPX2BbBeUhk,2822
51
51
  bella_companion/simulations/figures/__init__.py,sha256=aBYbJntH4egFmkSSWiVMYDEApXPYxJD7eA3TCPNNegM,658
52
52
  bella_companion/simulations/figures/epi_multitype_results.py,sha256=j85WgvN5AyAtX-CalMegr2lwlAZBmzyJxkikBPXRjCc,2629
53
- bella_companion/simulations/figures/epi_skyline_results.py,sha256=gI5Ha-OIEShcZLmqVuy0W8hJzkrsydQE-Coa65_BFCo,1667
53
+ bella_companion/simulations/figures/epi_skyline_results.py,sha256=jwognQspt0e1qvrhaYA-MQScsDxpDZd3YKJ5-RHfU6U,1659
54
54
  bella_companion/simulations/figures/fbd_2traits_results.py,sha256=JiXrbYkH1HwdJQhTHXj6KhMEXYgQmQ6LmDboAIO1CPA,2728
55
- bella_companion/simulations/figures/fbd_no_traits_results.py,sha256=fLsgpV3IbLLtxQEFNOL9K4jEEJrG324ziUM0rxIv7_k,1962
55
+ bella_companion/simulations/figures/fbd_no_traits_results.py,sha256=kwDbgUTQUk-LXAvMGvKf1kInFvK7kTJld4BWpgS1sVU,1950
56
56
  bella_companion/simulations/figures/scenarios.py,sha256=gbMz1TUxxT2RSIq2kQlFioNdgSHk-gQY2OQuf6-7Fww,2817
57
57
  bella_companion/simulations/figures/utils.py,sha256=0M5OrxaEuqcj9rR2uAc_O7utQvhEceZGH0sKrGRWaWs,3129
58
58
  bella_companion/simulations/figures/explain/__init__.py,sha256=DnmVIWO65nTT5VsWnbS7NyYgKEY_eo4oMCtCY_ML2Vk,260
59
59
  bella_companion/simulations/figures/explain/pdp.py,sha256=3n3ssgufW_43pn2hO5V5J_jgcJH3Fpb8stIRtTnlQ8w,3801
60
- bella_companion/simulations/figures/explain/shap.py,sha256=qRfOMNwkU-hsBy5MHMTfVFAszaPESVOugCKQTVY8Q4Y,1940
60
+ bella_companion/simulations/figures/explain/shap.py,sha256=1PkbCgynbW-PXkkRpIcY7JoBYqOxqmu1OEOif_roFY8,2207
61
61
  bella_companion/simulations/scenarios/__init__.py,sha256=3Kl1lKcFpfb3vLX64DmSW4XCF5kXU1ZoHtstFH-ZIzU,876
62
62
  bella_companion/simulations/scenarios/common.py,sha256=_ddaSuTvEVdttGkXB4HPc2B7IB1F_GBOCW3cVOPZ-ZM,807
63
63
  bella_companion/simulations/scenarios/epi_multitype.py,sha256=fTkFeGHxyV_1f2nX3g_Oyr_e6wkorhXEicJjIAgeZKA,2439
64
64
  bella_companion/simulations/scenarios/epi_skyline.py,sha256=JqnOVATECxBUqEbkR5lBlMI2O8k4hO6ipR8k9cHUsm0,2365
65
- bella_companion/simulations/scenarios/fbd_2traits.py,sha256=5UmrDlxdCMWOF0v9_0c1Yh0TyaE_FKEdxhSzHNofwQY,3541
65
+ bella_companion/simulations/scenarios/fbd_2traits.py,sha256=-amB3NX0GsVgYbFuHH71t93FuXUEnRUyhWf2Qpcpia4,3541
66
66
  bella_companion/simulations/scenarios/fbd_no_traits.py,sha256=R6CH0fVeQg-Iesl39pq2uY8ICVEO4VZbvUVUCGwauJU,2520
67
67
  bella_companion/simulations/scenarios/scenario.py,sha256=_FRWAyOFbw94lAzd3zCD-1ek4TrssoiXfXRQPShLiIA,620
68
68
  bella_companion/utils/__init__.py,sha256=UtMwPK9dWf9NAl0ic8CSsgdW7aSm-5J49OqgvD7UpYw,480
69
69
  bella_companion/utils/beast.py,sha256=TBa0cLklX1_tXqoQE4LRYvds7mLg_9fS2-6U6OHENHo,2184
70
70
  bella_companion/utils/explain.py,sha256=uP7HPyn2YiykAI69BQV3RooDpC6qKoCLXfp3Uibp4zk,1475
71
71
  bella_companion/utils/slurm.py,sha256=xEyf-Jxk8fy71t3fko_Ic9WtUFSdLFE3w4tR17gaBPw,1868
72
- bella_companion-0.0.42.dist-info/METADATA,sha256=FY_Ja-RMCMyymPVti1WDLQLOtd5ie4rzWl3Zjj6ZJCg,347
73
- bella_companion-0.0.42.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
74
- bella_companion-0.0.42.dist-info/entry_points.txt,sha256=SVEYDBrkBWPrOGwnEH2aO5TSVIAvfKE37sqm-9ut9jg,51
75
- bella_companion-0.0.42.dist-info/top_level.txt,sha256=q0loZYv4vf3zF_tOATyAJqeyLOEuPyLbObNqIGP7Fmc,16
76
- bella_companion-0.0.42.dist-info/RECORD,,
72
+ bella_companion-0.0.43.dist-info/METADATA,sha256=FHwaRLEDuz_6yvFM2QExhAlXKFQ3gdgV_Ez--8kk3BM,347
73
+ bella_companion-0.0.43.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
74
+ bella_companion-0.0.43.dist-info/entry_points.txt,sha256=SVEYDBrkBWPrOGwnEH2aO5TSVIAvfKE37sqm-9ut9jg,51
75
+ bella_companion-0.0.43.dist-info/top_level.txt,sha256=q0loZYv4vf3zF_tOATyAJqeyLOEuPyLbObNqIGP7Fmc,16
76
+ bella_companion-0.0.43.dist-info/RECORD,,