Skip to content

Commit

Permalink
patch bug, update simulations to include more plotting
Browse files Browse the repository at this point in the history
  • Loading branch information
jgallowa07 committed Feb 28, 2024
1 parent 5889166 commit c821f0c
Show file tree
Hide file tree
Showing 3 changed files with 541 additions and 519 deletions.
7 changes: 2 additions & 5 deletions multidms/model_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -914,9 +914,7 @@ def shift_sparsity(
# feature columns for distinct sparsity measurements
feature_cols = ["dataset_name", x, "mut_type"]

# include **kwargs because apply will pass them to sparsity
# TODO I'm not sure if this is actually how we should do this.
def sparsity(x, **kwargs):
def sparsity(x):
return (x == 0).mean()

def mut_type(mut):
Expand All @@ -931,9 +929,8 @@ def mut_type(mut):
.assign(mut_type=lambda x: x.mutation.apply(mut_type))
.reset_index()
.groupby(by=feature_cols)
# .apply(sparsity, include_groups=True)
.apply(sparsity, include_groups=False)
# .drop(columns=feature_cols + ["mutation"])
.drop(columns=["mutation"])
.reset_index(drop=False)
.melt(id_vars=feature_cols, var_name="mut_param", value_name="sparsity")
)
Expand Down
1,051 changes: 538 additions & 513 deletions notebooks/simulation_validation.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dependencies = [
"jaxopt",
"typing_extensions",
"numpy",
"pandas",
"pandas>=2.2.0",
"binarymap",
"altair==5.1.2", # pandas convert_dtypes bug
"matplotlib",
Expand Down

0 comments on commit c821f0c

Please sign in to comment.