From 65ac046fae335c3ea8bd0418e60dd0363bfbd1fb Mon Sep 17 00:00:00 2001 From: Peter Krejzl Date: Tue, 24 Dec 2019 09:23:26 +0100 Subject: [PATCH] fixed wrong cell order --- 3-logreg-nb-imdb.ipynb | 54 +++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 30 deletions(-) diff --git a/3-logreg-nb-imdb.ipynb b/3-logreg-nb-imdb.ipynb index 8735a6f..27b6423 100644 --- a/3-logreg-nb-imdb.ipynb +++ b/3-logreg-nb-imdb.ipynb @@ -2141,9 +2141,7 @@ { "cell_type": "code", "execution_count": 189, - "metadata": { - "scrolled": false - }, + "metadata": {}, "outputs": [ { "data": { @@ -2842,6 +2840,16 @@ "negative = y.c2i['negative']" ] }, + { + "cell_type": "code", + "execution_count": 289, + "metadata": {}, + "outputs": [], + "source": [ + "p1 = np.squeeze(np.asarray(x[y.items==positive].sum(0)))\n", + "p0 = np.squeeze(np.asarray(x[y.items==negative].sum(0)))" + ] + }, { "cell_type": "code", "execution_count": 284, @@ -2862,6 +2870,15 @@ "len(p1), len(p0)" ] }, + { + "cell_type": "code", + "execution_count": 291, + "metadata": {}, + "outputs": [], + "source": [ + "v = movie_reviews.vocab" + ] + }, { "cell_type": "code", "execution_count": 285, @@ -2949,16 +2966,6 @@ "For each word in our vocabulary, we are summing up how many positive reviews it is in, and how many negative reviews." ] }, - { - "cell_type": "code", - "execution_count": 289, - "metadata": {}, - "outputs": [], - "source": [ - "p1 = np.squeeze(np.asarray(x[y.items==positive].sum(0)))\n", - "p0 = np.squeeze(np.asarray(x[y.items==negative].sum(0)))" - ] - }, { "cell_type": "code", "execution_count": 290, @@ -2979,15 +2986,6 @@ "p1[:10]" ] }, - { - "cell_type": "code", - "execution_count": 291, - "metadata": {}, - "outputs": [], - "source": [ - "v = movie_reviews.vocab" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -6770,9 +6768,7 @@ { "cell_type": "code", "execution_count": 236, - "metadata": { - "scrolled": false - }, + "metadata": {}, "outputs": [ { "data": { @@ -6824,9 +6820,7 @@ { "cell_type": "code", "execution_count": 251, - "metadata": { - "scrolled": false - }, + "metadata": {}, "outputs": [ { "data": { @@ -7062,9 +7056,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.1" + "version": "3.7.4" } }, "nbformat": 4, - "nbformat_minor": 2 + "nbformat_minor": 4 }