Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed wrong cell order #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 24 additions & 30 deletions 3-logreg-nb-imdb.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2141,9 +2141,7 @@
{
"cell_type": "code",
"execution_count": 189,
"metadata": {
"scrolled": false
},
"metadata": {},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -2979,15 +2986,6 @@
"p1[:10]"
]
},
{
"cell_type": "code",
"execution_count": 291,
"metadata": {},
"outputs": [],
"source": [
"v = movie_reviews.vocab"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -6770,9 +6768,7 @@
{
"cell_type": "code",
"execution_count": 236,
"metadata": {
"scrolled": false
},
"metadata": {},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -6824,9 +6820,7 @@
{
"cell_type": "code",
"execution_count": 251,
"metadata": {
"scrolled": false
},
"metadata": {},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -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
}