From 6fe3a762f1767bbb4616966787780873a4cfa124 Mon Sep 17 00:00:00 2001 From: Mike Wattsm Date: Sat, 23 Nov 2019 12:39:20 +0300 Subject: [PATCH] tqdm error unhashable type fixed --- ...TopK Reinforce Off Policy Correction.ipynb | 21 +++++++++++++ .../[Library Basics]/1. Getting Started.ipynb | 31 ++++++++++++++++--- recnn/data/dataset_functions.py | 2 +- requirements.txt | 4 +-- 4 files changed, 50 insertions(+), 8 deletions(-) diff --git a/examples/2. REINFORCE TopK Off Policy Correction/3. TopK Reinforce Off Policy Correction.ipynb b/examples/2. REINFORCE TopK Off Policy Correction/3. TopK Reinforce Off Policy Correction.ipynb index c0cff27..1223d79 100644 --- a/examples/2. REINFORCE TopK Off Policy Correction/3. TopK Reinforce Off Policy Correction.ipynb +++ b/examples/2. REINFORCE TopK Off Policy Correction/3. TopK Reinforce Off Policy Correction.ipynb @@ -56,6 +56,27 @@ "jtplot.style(theme='grade3')" ] }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'4.32.1'" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "import tqdm\n", + "tqdm.__version__" + ] + }, { "cell_type": "code", "execution_count": 2, diff --git a/examples/[Library Basics]/1. Getting Started.ipynb b/examples/[Library Basics]/1. Getting Started.ipynb index fd38aa9..31b7805 100644 --- a/examples/[Library Basics]/1. Getting Started.ipynb +++ b/examples/[Library Basics]/1. Getting Started.ipynb @@ -12,7 +12,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 1, "metadata": {}, "outputs": [], "source": [ @@ -46,13 +46,13 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "1b7b6d91db8d491e952504edfda5e1ca", + "model_id": "c552329800d74192831117036889e6ce", "version_major": 2, "version_minor": 0 }, @@ -63,10 +63,17 @@ "metadata": {}, "output_type": "display_data" }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n" + ] + }, { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "7610e3d8b10e405398e4ed6e9eeac7f2", + "model_id": "62fc38b490824d23a19e2f67c956fcde", "version_major": 2, "version_minor": 0 }, @@ -77,10 +84,17 @@ "metadata": {}, "output_type": "display_data" }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n" + ] + }, { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "1721557df4944cccb0742d94a1902e7b", + "model_id": "853d950bccb646c8ace3ee41b90b6deb", "version_major": 2, "version_minor": 0 }, @@ -90,6 +104,13 @@ }, "metadata": {}, "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n" + ] } ], "source": [ diff --git a/recnn/data/dataset_functions.py b/recnn/data/dataset_functions.py index f19c65a..c2e0c6b 100644 --- a/recnn/data/dataset_functions.py +++ b/recnn/data/dataset_functions.py @@ -50,7 +50,7 @@ def prepare_dataset(df, key_to_id, frame_size, env, sort_users=False, **kwargs): """ df['rating'] = df['rating'].progress_apply(lambda i: 2 * (i - 2.5)) - df['movieId'] = df['movieId'].progress_apply(key_to_id.get) + df['movieId'] = df['movieId'].progress_apply(lambda i: key_to_id.get(i)) users = df[['userId', 'movieId']].groupby(['userId']).size() users = users[users > frame_size] diff --git a/requirements.txt b/requirements.txt index 8a3d23c..4dda4d5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ scikit-learn +tqdm pandas numpy -tqdm -pytest \ No newline at end of file +pytest