Remove sklearn version check when sklearn is not needed

main
Aurélien Geron 2022-04-17 12:17:13 +12:00
parent ce104660c6
commit 58e5232e29
5 changed files with 624 additions and 733 deletions

File diff suppressed because it is too large Load Diff

View File

@ -2220,7 +2220,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.9.10"
},
"nav_menu": {},
"toc": {
@ -2577,8 +2577,7 @@
}
}
}
},
"accelerator": "GPU"
}
},
"nbformat": 4,
"nbformat_minor": 4

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -60,28 +60,6 @@
"assert sys.version_info >= (3, 7)"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "TAlKky09pKzv"
},
"source": [
"It also requires Scikit-Learn ≥ 1.0.1:"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"id": "YqCwW7cMpKzw"
},
"outputs": [],
"source": [
"import sklearn\n",
"\n",
"assert sklearn.__version__ >= \"1.0.1\""
]
},
{
"cell_type": "markdown",
"metadata": {
@ -93,7 +71,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 2,
"metadata": {
"id": "0Piq5se2pKzx"
},
@ -115,7 +93,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 3,
"metadata": {
"id": "8d4TH3NbpKzx"
},
@ -143,7 +121,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 4,
"metadata": {
"id": "PQFH5Y9PpKzy"
},
@ -172,19 +150,11 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 5,
"metadata": {
"id": "Ekxzo6pOpKzy"
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"No GPU was detected. Neural nets can be very slow without a GPU.\n"
]
}
],
"outputs": [],
"source": [
"if not tf.config.list_physical_devices('GPU'):\n",
" print(\"No GPU was detected. Neural nets can be very slow without a GPU.\")\n",
@ -204,7 +174,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
@ -230,7 +200,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
@ -258,7 +228,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
@ -283,7 +253,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 9,
"metadata": {},
"outputs": [
{
@ -297,7 +267,7 @@
" '...']"
]
},
"execution_count": 10,
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
@ -317,7 +287,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 10,
"metadata": {},
"outputs": [
{
@ -326,7 +296,7 @@
"array([ 0.0273956 , -0.00611216, 0.03585979, 0.0197368 ], dtype=float32)"
]
},
"execution_count": 11,
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
@ -352,7 +322,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 11,
"metadata": {},
"outputs": [
{
@ -361,7 +331,7 @@
"(400, 600, 3)"
]
},
"execution_count": 12,
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
@ -373,7 +343,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 12,
"metadata": {},
"outputs": [
{
@ -412,7 +382,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 13,
"metadata": {},
"outputs": [
{
@ -421,7 +391,7 @@
"Discrete(2)"
]
},
"execution_count": 14,
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
@ -446,7 +416,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 14,
"metadata": {},
"outputs": [
{
@ -455,7 +425,7 @@
"array([ 0.02727336, 0.18847767, 0.03625453, -0.26141977], dtype=float32)"
]
},
"execution_count": 15,
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
@ -475,7 +445,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 15,
"metadata": {},
"outputs": [
{
@ -514,7 +484,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 16,
"metadata": {},
"outputs": [
{
@ -523,7 +493,7 @@
"1.0"
]
},
"execution_count": 17,
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
@ -541,7 +511,7 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 17,
"metadata": {},
"outputs": [
{
@ -550,7 +520,7 @@
"False"
]
},
"execution_count": 18,
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
@ -568,7 +538,7 @@
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": 18,
"metadata": {},
"outputs": [
{
@ -577,7 +547,7 @@
"{}"
]
},
"execution_count": 19,
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
@ -595,7 +565,7 @@
},
{
"cell_type": "code",
"execution_count": 20,
"execution_count": 19,
"metadata": {},
"outputs": [],
"source": [
@ -626,7 +596,7 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 20,
"metadata": {},
"outputs": [],
"source": [
@ -650,7 +620,7 @@
},
{
"cell_type": "code",
"execution_count": 22,
"execution_count": 21,
"metadata": {},
"outputs": [
{
@ -659,7 +629,7 @@
"(41.698, 8.389445512070509, 24.0, 63.0)"
]
},
"execution_count": 22,
"execution_count": 21,
"metadata": {},
"output_type": "execute_result"
}
@ -686,7 +656,7 @@
},
{
"cell_type": "code",
"execution_count": 23,
"execution_count": 22,
"metadata": {},
"outputs": [],
"source": [
@ -746,7 +716,7 @@
},
{
"cell_type": "code",
"execution_count": 24,
"execution_count": 23,
"metadata": {},
"outputs": [],
"source": [
@ -783,7 +753,7 @@
},
{
"cell_type": "code",
"execution_count": 25,
"execution_count": 24,
"metadata": {},
"outputs": [],
"source": [
@ -836,7 +806,7 @@
},
{
"cell_type": "code",
"execution_count": 26,
"execution_count": 25,
"metadata": {},
"outputs": [],
"source": [
@ -868,7 +838,7 @@
},
{
"cell_type": "code",
"execution_count": 27,
"execution_count": 26,
"metadata": {},
"outputs": [],
"source": [
@ -901,7 +871,7 @@
},
{
"cell_type": "code",
"execution_count": 28,
"execution_count": 27,
"metadata": {},
"outputs": [],
"source": [
@ -930,7 +900,7 @@
},
{
"cell_type": "code",
"execution_count": 29,
"execution_count": 28,
"metadata": {},
"outputs": [
{
@ -939,7 +909,7 @@
"array([-22, -40, -50])"
]
},
"execution_count": 29,
"execution_count": 28,
"metadata": {},
"output_type": "execute_result"
}
@ -957,7 +927,7 @@
},
{
"cell_type": "code",
"execution_count": 30,
"execution_count": 29,
"metadata": {
"scrolled": true
},
@ -969,7 +939,7 @@
" array([1.26665318, 1.0727777 ])]"
]
},
"execution_count": 30,
"execution_count": 29,
"metadata": {},
"output_type": "execute_result"
}
@ -981,7 +951,7 @@
},
{
"cell_type": "code",
"execution_count": 31,
"execution_count": 30,
"metadata": {},
"outputs": [],
"source": [
@ -993,7 +963,7 @@
},
{
"cell_type": "code",
"execution_count": 32,
"execution_count": 31,
"metadata": {},
"outputs": [],
"source": [
@ -1012,7 +982,7 @@
},
{
"cell_type": "code",
"execution_count": 33,
"execution_count": 32,
"metadata": {},
"outputs": [],
"source": [
@ -1022,7 +992,7 @@
},
{
"cell_type": "code",
"execution_count": 34,
"execution_count": 33,
"metadata": {},
"outputs": [
{
@ -1058,7 +1028,7 @@
},
{
"cell_type": "code",
"execution_count": 35,
"execution_count": 34,
"metadata": {},
"outputs": [],
"source": [
@ -1083,7 +1053,7 @@
},
{
"cell_type": "code",
"execution_count": 36,
"execution_count": 35,
"metadata": {},
"outputs": [
{
@ -1151,7 +1121,7 @@
},
{
"cell_type": "code",
"execution_count": 37,
"execution_count": 36,
"metadata": {},
"outputs": [],
"source": [
@ -1177,7 +1147,7 @@
},
{
"cell_type": "code",
"execution_count": 38,
"execution_count": 37,
"metadata": {},
"outputs": [],
"source": [
@ -1188,7 +1158,7 @@
},
{
"cell_type": "code",
"execution_count": 39,
"execution_count": 38,
"metadata": {},
"outputs": [],
"source": [
@ -1210,7 +1180,7 @@
},
{
"cell_type": "code",
"execution_count": 40,
"execution_count": 39,
"metadata": {},
"outputs": [
{
@ -1221,7 +1191,7 @@
" [ -inf, 50.13365013, -inf]])"
]
},
"execution_count": 40,
"execution_count": 39,
"metadata": {},
"output_type": "execute_result"
}
@ -1232,7 +1202,7 @@
},
{
"cell_type": "code",
"execution_count": 41,
"execution_count": 40,
"metadata": {},
"outputs": [
{
@ -1241,7 +1211,7 @@
"array([0, 0, 1])"
]
},
"execution_count": 41,
"execution_count": 40,
"metadata": {},
"output_type": "execute_result"
}
@ -1280,7 +1250,7 @@
},
{
"cell_type": "code",
"execution_count": 42,
"execution_count": 41,
"metadata": {},
"outputs": [],
"source": [
@ -1300,7 +1270,7 @@
},
{
"cell_type": "code",
"execution_count": 43,
"execution_count": 42,
"metadata": {},
"outputs": [],
"source": [
@ -1317,7 +1287,7 @@
},
{
"cell_type": "code",
"execution_count": 44,
"execution_count": 43,
"metadata": {},
"outputs": [],
"source": [
@ -1330,7 +1300,7 @@
},
{
"cell_type": "code",
"execution_count": 45,
"execution_count": 44,
"metadata": {},
"outputs": [],
"source": [
@ -1355,7 +1325,7 @@
},
{
"cell_type": "code",
"execution_count": 46,
"execution_count": 45,
"metadata": {},
"outputs": [
{
@ -1407,7 +1377,7 @@
},
{
"cell_type": "code",
"execution_count": 47,
"execution_count": 46,
"metadata": {},
"outputs": [],
"source": [
@ -1432,7 +1402,7 @@
},
{
"cell_type": "code",
"execution_count": 48,
"execution_count": 47,
"metadata": {},
"outputs": [],
"source": [
@ -1453,7 +1423,7 @@
},
{
"cell_type": "code",
"execution_count": 49,
"execution_count": 48,
"metadata": {},
"outputs": [],
"source": [
@ -1471,7 +1441,7 @@
},
{
"cell_type": "code",
"execution_count": 50,
"execution_count": 49,
"metadata": {},
"outputs": [],
"source": [
@ -1503,7 +1473,7 @@
},
{
"cell_type": "code",
"execution_count": 51,
"execution_count": 50,
"metadata": {},
"outputs": [],
"source": [
@ -1526,7 +1496,7 @@
},
{
"cell_type": "code",
"execution_count": 52,
"execution_count": 51,
"metadata": {},
"outputs": [],
"source": [
@ -1546,7 +1516,7 @@
},
{
"cell_type": "code",
"execution_count": 53,
"execution_count": 52,
"metadata": {},
"outputs": [],
"source": [
@ -1560,7 +1530,7 @@
},
{
"cell_type": "code",
"execution_count": 54,
"execution_count": 53,
"metadata": {},
"outputs": [],
"source": [
@ -1596,7 +1566,7 @@
},
{
"cell_type": "code",
"execution_count": 55,
"execution_count": 54,
"metadata": {
"scrolled": true
},
@ -1635,7 +1605,7 @@
},
{
"cell_type": "code",
"execution_count": 56,
"execution_count": 55,
"metadata": {},
"outputs": [
{
@ -1664,7 +1634,7 @@
},
{
"cell_type": "code",
"execution_count": 57,
"execution_count": 56,
"metadata": {},
"outputs": [],
"source": [
@ -1695,7 +1665,7 @@
},
{
"cell_type": "code",
"execution_count": 58,
"execution_count": 57,
"metadata": {},
"outputs": [],
"source": [
@ -1719,7 +1689,7 @@
},
{
"cell_type": "code",
"execution_count": 59,
"execution_count": 58,
"metadata": {},
"outputs": [],
"source": [
@ -1736,7 +1706,7 @@
},
{
"cell_type": "code",
"execution_count": 60,
"execution_count": 59,
"metadata": {},
"outputs": [],
"source": [
@ -1780,7 +1750,7 @@
},
{
"cell_type": "code",
"execution_count": 61,
"execution_count": 60,
"metadata": {},
"outputs": [
{
@ -1829,7 +1799,7 @@
},
{
"cell_type": "code",
"execution_count": 62,
"execution_count": 61,
"metadata": {},
"outputs": [
{
@ -1857,7 +1827,7 @@
},
{
"cell_type": "code",
"execution_count": 63,
"execution_count": 62,
"metadata": {
"scrolled": true,
"tags": []
@ -1884,7 +1854,7 @@
},
{
"cell_type": "code",
"execution_count": 64,
"execution_count": 63,
"metadata": {},
"outputs": [
{
@ -1968,7 +1938,7 @@
},
{
"cell_type": "code",
"execution_count": 65,
"execution_count": 64,
"metadata": {},
"outputs": [
{
@ -1996,7 +1966,7 @@
},
{
"cell_type": "code",
"execution_count": 66,
"execution_count": 65,
"metadata": {
"scrolled": true
},
@ -2015,7 +1985,7 @@
},
{
"cell_type": "code",
"execution_count": 67,
"execution_count": 66,
"metadata": {},
"outputs": [],
"source": [
@ -2041,7 +2011,7 @@
},
{
"cell_type": "code",
"execution_count": 68,
"execution_count": 67,
"metadata": {},
"outputs": [
{
@ -2093,7 +2063,7 @@
},
{
"cell_type": "code",
"execution_count": 69,
"execution_count": 68,
"metadata": {},
"outputs": [
{
@ -2121,7 +2091,7 @@
},
{
"cell_type": "code",
"execution_count": 70,
"execution_count": 69,
"metadata": {
"scrolled": true
},
@ -2140,7 +2110,7 @@
},
{
"cell_type": "code",
"execution_count": 71,
"execution_count": 70,
"metadata": {},
"outputs": [],
"source": [
@ -2199,7 +2169,7 @@
},
{
"cell_type": "code",
"execution_count": 72,
"execution_count": 71,
"metadata": {},
"outputs": [],
"source": [
@ -2215,7 +2185,7 @@
},
{
"cell_type": "code",
"execution_count": 73,
"execution_count": 72,
"metadata": {},
"outputs": [
{
@ -2224,7 +2194,7 @@
"Box(-inf, inf, (8,), float32)"
]
},
"execution_count": 73,
"execution_count": 72,
"metadata": {},
"output_type": "execute_result"
}
@ -2235,7 +2205,7 @@
},
{
"cell_type": "code",
"execution_count": 74,
"execution_count": 73,
"metadata": {},
"outputs": [
{
@ -2245,7 +2215,7 @@
" -0.05269805, 0. , 0. ], dtype=float32)"
]
},
"execution_count": 74,
"execution_count": 73,
"metadata": {},
"output_type": "execute_result"
}
@ -2275,7 +2245,7 @@
},
{
"cell_type": "code",
"execution_count": 75,
"execution_count": 74,
"metadata": {},
"outputs": [
{
@ -2284,7 +2254,7 @@
"Discrete(4)"
]
},
"execution_count": 75,
"execution_count": 74,
"metadata": {},
"output_type": "execute_result"
}
@ -2313,7 +2283,7 @@
},
{
"cell_type": "code",
"execution_count": 76,
"execution_count": 75,
"metadata": {},
"outputs": [],
"source": [
@ -2347,7 +2317,7 @@
},
{
"cell_type": "code",
"execution_count": 77,
"execution_count": 76,
"metadata": {},
"outputs": [],
"source": [
@ -2388,7 +2358,7 @@
},
{
"cell_type": "code",
"execution_count": 78,
"execution_count": 77,
"metadata": {},
"outputs": [],
"source": [
@ -2417,7 +2387,7 @@
},
{
"cell_type": "code",
"execution_count": 79,
"execution_count": 78,
"metadata": {},
"outputs": [],
"source": [
@ -2436,7 +2406,7 @@
},
{
"cell_type": "code",
"execution_count": 80,
"execution_count": 79,
"metadata": {},
"outputs": [],
"source": [
@ -2453,7 +2423,7 @@
},
{
"cell_type": "code",
"execution_count": 81,
"execution_count": 80,
"metadata": {},
"outputs": [
{
@ -2497,7 +2467,7 @@
},
{
"cell_type": "code",
"execution_count": 82,
"execution_count": 81,
"metadata": {},
"outputs": [
{
@ -2530,7 +2500,7 @@
},
{
"cell_type": "code",
"execution_count": 83,
"execution_count": 82,
"metadata": {},
"outputs": [],
"source": [
@ -2554,7 +2524,7 @@
},
{
"cell_type": "code",
"execution_count": 84,
"execution_count": 83,
"metadata": {},
"outputs": [],
"source": [