Skip to content

Commit 05776f9

Browse files
committed
Update binary_logistic_regression_tf_with_hidden_layers.ipynb
1 parent 8e9b663 commit 05776f9

File tree

1 file changed

+54
-1
lines changed

1 file changed

+54
-1
lines changed

binary_logistic_regression_tf_with_hidden_layers.ipynb

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,59 @@
123123
"print(\"X test dim\", X_test.shape, \"Y test dim\", Y_test.shape)"
124124
]
125125
},
126+
{
127+
"cell_type": "markdown",
128+
"id": "b1955eac",
129+
"metadata": {},
130+
"source": [
131+
"## Plot Data"
132+
]
133+
},
134+
{
135+
"cell_type": "code",
136+
"execution_count": null,
137+
"id": "0d2bbfe0",
138+
"metadata": {},
139+
"outputs": [],
140+
"source": [
141+
"plt.figure(figsize=(10, 5))\n",
142+
"plt.subplot(1, 3, 1)\n",
143+
"plt.plot(X[Y == 1, 0],\n",
144+
" X[Y == 1, 1],\n",
145+
" \"o\", color='orangered', ms=1)\n",
146+
"plt.plot(X[Y == 0, 0],\n",
147+
" X[Y == 0, 1],\n",
148+
" \"o\", color='dodgerblue', ms=1)\n",
149+
"plt.axis(\"square\")\n",
150+
"plt.title(\"data '1' red and '0' blue\" + str(X.shape))\n",
151+
"plt.xlabel(\"feature 1\")\n",
152+
"plt.ylabel(\"feature 2\")\n",
153+
"plt.axis([-10, 10, -10, 10])\n",
154+
"plt.grid()\n",
155+
"\n",
156+
"plt.subplot(1, 3, 2)\n",
157+
"plt.plot(X[Y == 1, 0],\n",
158+
" X[Y == 1, 1],\n",
159+
" \"o\", color='orangered', ms=1)\n",
160+
"plt.axis(\"square\")\n",
161+
"plt.title(\"data '1' red \" + str(X.shape))\n",
162+
"plt.xlabel(\"feature 1\")\n",
163+
"plt.ylabel(\"feature 2\")\n",
164+
"plt.axis([-10, 10, -10, 10])\n",
165+
"plt.grid()\n",
166+
"\n",
167+
"plt.subplot(1, 3, 3)\n",
168+
"plt.plot(X[Y == 0, 0],\n",
169+
" X[Y == 0, 1],\n",
170+
" \"o\", color='dodgerblue', ms=1)\n",
171+
"plt.axis(\"square\")\n",
172+
"plt.title(\"data '0' blue \" + str(X.shape))\n",
173+
"plt.xlabel(\"feature 1\")\n",
174+
"plt.ylabel(\"feature 2\")\n",
175+
"plt.axis([-10, 10, -10, 10])\n",
176+
"plt.grid()"
177+
]
178+
},
126179
{
127180
"cell_type": "markdown",
128181
"id": "b23f6d44",
@@ -293,7 +346,7 @@
293346
"id": "9073cba9",
294347
"metadata": {},
295348
"source": [
296-
"## Model Test"
349+
"## Model Prediction"
297350
]
298351
},
299352
{

0 commit comments

Comments
 (0)