|
252 | 252 | },
|
253 | 253 | {
|
254 | 254 | "cell_type": "code",
|
255 |
| - "execution_count": 24, |
| 255 | + "execution_count": 32, |
256 | 256 | "metadata": {},
|
257 | 257 | "outputs": [
|
258 | 258 | {
|
259 | 259 | "name": "stdout",
|
260 | 260 | "output_type": "stream",
|
261 | 261 | "text": [
|
262 |
| - "Logistic Regression: 167.08\n", |
263 |
| - "LSTM 1: 170.38\n", |
264 |
| - "LSTM 3: 161.46\n" |
| 262 | + "Logistic Regression: 0.92\n", |
| 263 | + "LSTM 1: 0.94\n", |
| 264 | + "LSTM 3: 0.93\n" |
265 | 265 | ]
|
266 | 266 | }
|
267 | 267 | ],
|
268 | 268 | "source": [
|
269 |
| - "from sklearn.metrics import auc\n", |
270 |
| - "print(f'Logistic Regression: {auc(y, p1):0.2f}')\n", |
271 |
| - "print(f'LSTM 1: {auc(y, p2):0.2f}')\n", |
272 |
| - "print(f'LSTM 3: {auc(y, p3):0.2f}')" |
| 269 | + "from sklearn.metrics import roc_auc_score\n", |
| 270 | + "print(f'Logistic Regression: {roc_auc_score(y, p1):0.2f}')\n", |
| 271 | + "print(f'LSTM 1: {roc_auc_score(y, p2):0.2f}')\n", |
| 272 | + "print(f'LSTM 3: {roc_auc_score(y, p3):0.2f}')" |
| 273 | + ] |
| 274 | + }, |
| 275 | + { |
| 276 | + "cell_type": "code", |
| 277 | + "execution_count": 37, |
| 278 | + "metadata": {}, |
| 279 | + "outputs": [ |
| 280 | + { |
| 281 | + "name": "stdout", |
| 282 | + "output_type": "stream", |
| 283 | + "text": [ |
| 284 | + "Logistic Regression: 0.86\n", |
| 285 | + "LSTM 1: 0.87\n", |
| 286 | + "LSTM 3: 0.88\n" |
| 287 | + ] |
| 288 | + } |
| 289 | + ], |
| 290 | + "source": [ |
| 291 | + "from sklearn.metrics import accuracy_score\n", |
| 292 | + "print(f'Logistic Regression: {accuracy_score(y, p1>0.6):0.2f}')\n", |
| 293 | + "print(f'LSTM 1: {accuracy_score(y, p2>0.6):0.2f}')\n", |
| 294 | + "print(f'LSTM 3: {accuracy_score(y, p3>0.6):0.2f}')" |
273 | 295 | ]
|
274 | 296 | },
|
275 | 297 | {
|
|
0 commit comments