From fbc8164f1a0bb9653cc532c25a0868d17206e735 Mon Sep 17 00:00:00 2001 From: Henry Webel Date: Mon, 30 Oct 2023 16:12:20 +0000 Subject: [PATCH] :bug: add dependencies specific to notebook - pandas 2.0 requires numeric values for mean aggregation --- tutorial/log_reg.ipynb | 12 +++++++++++- tutorial/log_reg.py | 5 ++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/tutorial/log_reg.ipynb b/tutorial/log_reg.ipynb index 6c3fb91..ba725cd 100644 --- a/tutorial/log_reg.ipynb +++ b/tutorial/log_reg.ipynb @@ -14,6 +14,16 @@ "> Predict Alzheimer disease based on proteomics measurements." ] }, + { + "cell_type": "code", + "execution_count": null, + "id": "cd90b1b6", + "metadata": {}, + "outputs": [], + "source": [ + "!pip install njab heatmapz openpyxl " + ] + }, { "cell_type": "code", "execution_count": null, @@ -672,7 +682,7 @@ " return_train_score=True,\n", " # fit_params=dict(sample_weight=weights)\n", ")\n", - "cv_feat = cv_feat.groupby('n_features').agg(['mean', 'std'])\n", + "cv_feat = cv_feat.drop('test_case', axis=1).groupby('n_features').agg(['mean', 'std'])\n", "cv_feat" ] }, diff --git a/tutorial/log_reg.py b/tutorial/log_reg.py index 59d02bc..03e0eb8 100644 --- a/tutorial/log_reg.py +++ b/tutorial/log_reg.py @@ -22,6 +22,9 @@ # # > Predict Alzheimer disease based on proteomics measurements. +# %% +# !pip install njab heatmapz openpyxl + # %% import itertools import logging @@ -366,7 +369,7 @@ return_train_score=True, # fit_params=dict(sample_weight=weights) ) -cv_feat = cv_feat.groupby('n_features').agg(['mean', 'std']) +cv_feat = cv_feat.drop('test_case', axis=1).groupby('n_features').agg(['mean', 'std']) cv_feat # %% [markdown]