Skip to content

Commit a42a76e

Browse files
committed
update some chapter 4 and 5 recipes
1 parent a290002 commit a42a76e

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

chapter04/stopping_credit_default.ipynb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,6 @@
901901
],
902902
"source": [
903903
"from sklearn.metrics import confusion_matrix\n",
904-
"from sklearn.metrics import ConfusionMatrixDisplay\n",
905904
"import pandas as pd\n",
906905
"\n",
907906
"cm = confusion_matrix(y_test, preds.mean().numpy() >= 0.5)\n",

chapter05/Making decisions based on knowledge.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4107,7 +4107,7 @@
41074107
"name": "python",
41084108
"nbconvert_exporter": "python",
41094109
"pygments_lexer": "ipython3",
4110-
"version": "3.6.7"
4110+
"version": "3.6.11"
41114111
}
41124112
},
41134113
"nbformat": 4,

chapter05/Solving the n-queens problem.ipynb

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -563,13 +563,12 @@
563563
"outputs": [],
564564
"source": [
565565
"import numpy as np\n",
566-
"from numba import jit\n",
567566
"\n",
568-
"@jit(nopython=True)\n",
569-
"def cost_function(props) -> int:\n",
567+
"def cost_function(props):\n",
570568
" \"\"\"Given a props vector from a particle,\n",
571-
" a vector of queens' positions, how right are we?\"\"\"\n",
572-
" res: int = 0\n",
569+
" a vector of queens' positions, how right are we?\n",
570+
" \"\"\"\n",
571+
" res = 0\n",
573572
" for i1, q1 in enumerate(props[:-1]):\n",
574573
" for i2, q2 in enumerate(props[i1+1:], i1+1):\n",
575574
" if (q1 != q2) and (abs(i1 - i2) != abs(q1 - q2)):\n",
@@ -1384,7 +1383,7 @@
13841383
"name": "python",
13851384
"nbconvert_exporter": "python",
13861385
"pygments_lexer": "ipython3",
1387-
"version": "3.6.7"
1386+
"version": "3.6.11"
13881387
}
13891388
},
13901389
"nbformat": 4,

0 commit comments

Comments
 (0)