|
123 | 123 | "print(\"X test dim\", X_test.shape, \"Y test dim\", Y_test.shape)" |
124 | 124 | ] |
125 | 125 | }, |
| 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 | + }, |
126 | 179 | { |
127 | 180 | "cell_type": "markdown", |
128 | 181 | "id": "b23f6d44", |
|
293 | 346 | "id": "9073cba9", |
294 | 347 | "metadata": {}, |
295 | 348 | "source": [ |
296 | | - "## Model Test" |
| 349 | + "## Model Prediction" |
297 | 350 | ] |
298 | 351 | }, |
299 | 352 | { |
|
0 commit comments