Skip to content

Commit

Permalink
🎨 make data work independent of location, label plots better
Browse files Browse the repository at this point in the history
  • Loading branch information
enryH committed Nov 8, 2024
1 parent 6986e38 commit eb9c3a0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
17 changes: 9 additions & 8 deletions project/04_1_train_pimms_models.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,11 @@
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"\n",
"IN_COLAB = 'COLAB_GPU' in os.environ\n",
"from pathlib import Path\n",
"\n",
"fn_intensities = 'data/dev_datasets/HeLa_6070/protein_groups_wide_N50.csv'\n",
"if IN_COLAB:\n",
"fn_intensities = Path('data/dev_datasets/HeLa_6070/protein_groups_wide_N50.csv')\n",
"if not fn_intensities.exists():\n",
" print(\"Use example data from GitHub.\")\n",
" fn_intensities = ('https://raw.githubusercontent.com/RasmussenLab/pimms/main/'\n",
" 'project/data/dev_datasets/HeLa_6070/protein_groups_wide_N50.csv')"
]
Expand Down Expand Up @@ -651,7 +650,8 @@
" feat_medians=splits.train_X.median(),\n",
" ax=ax,\n",
" metric_name='MAE',\n",
" palette=color_model_mapping)"
" palette=color_model_mapping)\n",
" ax.set_ylabel('Mean aboslute error (MAE)')"
]
},
{
Expand Down Expand Up @@ -724,7 +724,8 @@
" ),\n",
" color=color_model_mapping[model_selected],\n",
" alpha=1)\n",
"_ = ax.legend()"
"_ = ax.legend()\n",
"ax.set_xlabel('log2 intensity bin')"
]
}
],
Expand All @@ -749,7 +750,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.17"
"version": "3.11.9"
},
"mystnb": {
"execution_raise_on_error": true,
Expand Down
11 changes: 6 additions & 5 deletions project/04_1_train_pimms_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,11 @@
# Specify example data:

# %%
import os

IN_COLAB = 'COLAB_GPU' in os.environ
from pathlib import Path

fn_intensities = 'data/dev_datasets/HeLa_6070/protein_groups_wide_N50.csv'
if IN_COLAB:
fn_intensities = Path('data/dev_datasets/HeLa_6070/protein_groups_wide_N50.csv')
if not fn_intensities.exists():
print("Use example data from GitHub.")
fn_intensities = ('https://raw.githubusercontent.com/RasmussenLab/pimms/main/'
'project/data/dev_datasets/HeLa_6070/protein_groups_wide_N50.csv')

Expand Down Expand Up @@ -308,6 +307,7 @@
ax=ax,
metric_name='MAE',
palette=color_model_mapping)
ax.set_ylabel('Mean aboslute error (MAE)')

# %% [markdown]
# replace predicted values with validation data values
Expand Down Expand Up @@ -349,3 +349,4 @@
color=color_model_mapping[model_selected],
alpha=1)
_ = ax.legend()
ax.set_xlabel('log2 intensity bin')

0 comments on commit eb9c3a0

Please sign in to comment.