diff --git a/notebooks/explainer_examples.ipynb b/notebooks/explainer_examples.ipynb index b13ed64a47..d75cdc69c4 100644 --- a/notebooks/explainer_examples.ipynb +++ b/notebooks/explainer_examples.ipynb @@ -79,7 +79,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Error from server (AlreadyExists): namespaces \"seldon\" already exists\r\n" + "Error from server (AlreadyExists): namespaces \"seldon\" already exists\n" ] } ], @@ -103,7 +103,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Context \"kind-kind\" modified.\r\n" + "Context \"kind-kind\" modified.\n" ] } ], @@ -113,7 +113,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ @@ -132,7 +132,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "metadata": {}, "outputs": [ { @@ -168,7 +168,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "metadata": { "scrolled": true }, @@ -177,7 +177,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "seldondeployment.machinelearning.seldon.io/income created\r\n" + "seldondeployment.machinelearning.seldon.io/income created\n" ] } ], @@ -187,7 +187,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 6, "metadata": {}, "outputs": [ { @@ -205,7 +205,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 7, "metadata": { "scrolled": true }, @@ -225,7 +225,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 8, "metadata": { "scrolled": true }, @@ -245,7 +245,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 9, "metadata": { "scrolled": true }, @@ -254,7 +254,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "{'data': {'names': ['t:0', 't:1'], 'tensor': {'shape': [1, 2], 'values': [0.8585304277244477, 0.14146957227555243]}}, 'meta': {}}\n" + "{'data': {'names': ['t:0', 't:1'], 'tensor': {'shape': [1, 2], 'values': [0.8585304277244477, 0.14146957227555243]}}, 'meta': {'requestPath': {'classifier': 'seldonio/sklearnserver:1.7.0-dev'}}}\n" ] } ], @@ -273,14 +273,14 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 13, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "{\"data\":{\"names\":[\"t:0\",\"t:1\"],\"ndarray\":[[0.8585304277244477,0.14146957227555243]]},\"meta\":{}}\r\n" + "{\"data\":{\"names\":[\"t:0\",\"t:1\"],\"ndarray\":[[0.8585304277244477,0.14146957227555243]]},\"meta\":{\"requestPath\":{\"classifier\":\"seldonio/sklearnserver:1.7.0-dev\"}}}\n" ] } ], @@ -299,7 +299,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 14, "metadata": { "scrolled": true }, @@ -327,7 +327,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 15, "metadata": {}, "outputs": [ { @@ -336,9 +336,10 @@ "text": [ " % Total % Received % Xferd Average Speed Time Time Time Current\n", " Dload Upload Total Spent Left Speed\n", - "100 1715 100 1624 100 91 8837 495 --:--:-- --:--:-- --:--:-- 8826\n", + "100 2269 100 2178 100 91 8817 368 --:--:-- --:--:-- --:--:-- 9149\n", "\u001b[1;39m[\n", - " \u001b[0;32m\"Marital Status = Separated\"\u001b[0m\u001b[1;39m\n", + " \u001b[0;32m\"Marital Status = Separated\"\u001b[0m\u001b[1;39m,\n", + " \u001b[0;32m\"Capital Gain <= 0.00\"\u001b[0m\u001b[1;39m\n", "\u001b[1;39m]\u001b[0m\n" ] } @@ -351,7 +352,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 16, "metadata": { "scrolled": true }, @@ -360,7 +361,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "seldondeployment.machinelearning.seldon.io \"income\" deleted\r\n" + "seldondeployment.machinelearning.seldon.io \"income\" deleted\n" ] } ], @@ -379,7 +380,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 17, "metadata": {}, "outputs": [ { @@ -414,7 +415,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 18, "metadata": { "scrolled": true }, @@ -423,7 +424,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "seldondeployment.machinelearning.seldon.io/movie created\r\n" + "seldondeployment.machinelearning.seldon.io/movie created\n" ] } ], @@ -433,7 +434,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 19, "metadata": { "scrolled": true }, @@ -453,14 +454,14 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 20, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "deployment \"movie-default-explainer\" successfully rolled out\r\n" + "deployment \"movie-default-explainer\" successfully rolled out\n" ] } ], @@ -470,7 +471,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 23, "metadata": { "scrolled": true }, @@ -483,14 +484,14 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 24, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "{\"data\":{\"names\":[\"t:0\",\"t:1\"],\"ndarray\":[[0.21266916924914636,0.7873308307508536]]},\"meta\":{}}\r\n" + "{\"data\":{\"names\":[\"t:0\",\"t:1\"],\"ndarray\":[[0.21266916924914636,0.7873308307508536]]},\"meta\":{\"requestPath\":{\"classifier\":\"seldonio/sklearnserver:1.7.0-dev\"}}}\n" ] } ], @@ -502,7 +503,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 27, "metadata": { "scrolled": true }, @@ -524,7 +525,7 @@ "}\n", "\n", "Response:\n", - "{'data': {'names': ['t:0', 't:1'], 'ndarray': [[0.21266916924914636, 0.7873308307508536]]}, 'meta': {}}\n" + "{'data': {'names': ['t:0', 't:1'], 'ndarray': [[0.21266916924914636, 0.7873308307508536]]}, 'meta': {'requestPath': {'classifier': 'seldonio/sklearnserver:1.7.0-dev'}}}\n" ] } ], @@ -537,17 +538,17 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 28, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "\u001b[1;39m[\r\n", - " \u001b[0;32m\"emotionally\"\u001b[0m\u001b[1;39m,\r\n", - " \u001b[0;32m\"vapid\"\u001b[0m\u001b[1;39m\r\n", - "\u001b[1;39m]\u001b[0m\r\n" + "\u001b[1;39m[\n", + " \u001b[0;32m\"emotionally\"\u001b[0m\u001b[1;39m,\n", + " \u001b[0;32m\"vapid\"\u001b[0m\u001b[1;39m\n", + "\u001b[1;39m]\u001b[0m\n" ] } ], @@ -559,7 +560,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 29, "metadata": { "scrolled": true }, @@ -580,7 +581,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 30, "metadata": { "scrolled": true }, @@ -589,7 +590,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "seldondeployment.machinelearning.seldon.io \"movie\" deleted\r\n" + "seldondeployment.machinelearning.seldon.io \"movie\" deleted\n" ] } ], @@ -608,14 +609,14 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 31, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Overwriting resources/cifar10_explainer.yaml\n" + "Writing resources/cifar10_explainer.yaml\n" ] } ], @@ -645,14 +646,14 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 32, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "seldondeployment.machinelearning.seldon.io/cifar10-classifier created\r\n" + "seldondeployment.machinelearning.seldon.io/cifar10-classifier created\n" ] } ], @@ -662,14 +663,15 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 33, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "deployment \"cifar10-classifier-default-0-cifar10-classifier\" successfully rolled out\r\n" + "Waiting for deployment \"cifar10-classifier-default-0-cifar10-classifier\" rollout to finish: 0 of 1 updated replicas are available...\n", + "deployment \"cifar10-classifier-default-0-cifar10-classifier\" successfully rolled out\n" ] } ], @@ -679,14 +681,15 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 34, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "deployment \"cifar10-classifier-default-explainer\" successfully rolled out\r\n" + "Waiting for deployment \"cifar10-classifier-default-explainer\" rollout to finish: 0 of 1 updated replicas are available...\n", + "deployment \"cifar10-classifier-default-explainer\" successfully rolled out\n" ] } ], @@ -696,22 +699,9 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 35, "metadata": {}, "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "WARNING: Logging before flag parsing goes to stderr.\n", - "W1106 08:48:27.877613 139714443523840 deprecation.py:506] From /home/clive/anaconda3/envs/seldon-core/lib/python3.6/site-packages/tensorflow_core/python/keras/initializers.py:143: calling RandomNormal.__init__ (from tensorflow.python.ops.init_ops) with dtype is deprecated and will be removed in a future version.\n", - "Instructions for updating:\n", - "Call initializer instance with the dtype argument instead of passing it to the constructor\n", - "W1106 08:48:27.892694 139714443523840 deprecation.py:506] From /home/clive/anaconda3/envs/seldon-core/lib/python3.6/site-packages/tensorflow_core/python/ops/resource_variable_ops.py:1630: calling BaseResourceVariable.__init__ (from tensorflow.python.ops.resource_variable_ops) with constraint is deprecated and will be removed in a future version.\n", - "Instructions for updating:\n", - "If using Keras pass *_constraint arguments to layers.\n" - ] - }, { "name": "stdout", "output_type": "stream", @@ -743,7 +733,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 36, "metadata": {}, "outputs": [ { @@ -751,7 +741,7 @@ "output_type": "stream", "text": [ "{\n", - " \"predictions\": [[8.98417127e-08, 1.35163679e-12, 5.20754609e-13, 9.01404201e-05, 4.04729e-12, 0.999909759, 9.77382086e-09, 1.30629796e-09, 5.39957488e-12, 3.7917457e-14]\n", + " \"predictions\": [[8.98418833e-08, 1.35163929e-12, 5.20754609e-13, 9.01406747e-05, 4.04729e-12, 0.999909759, 9.77383952e-09, 1.30630051e-09, 5.39958529e-12, 3.7917457e-14]\n", " ]\n", "}\n" ] @@ -803,16 +793,16 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 37, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "" + "" ] }, - "execution_count": 8, + "execution_count": 37, "metadata": {}, "output_type": "execute_result" }, @@ -845,14 +835,14 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 38, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "seldondeployment.machinelearning.seldon.io \"cifar10-classifier\" deleted\r\n" + "seldondeployment.machinelearning.seldon.io \"cifar10-classifier\" deleted\n" ] } ], @@ -873,7 +863,7 @@ }, { "cell_type": "code", - "execution_count": 49, + "execution_count": 39, "metadata": {}, "outputs": [ { @@ -926,7 +916,7 @@ }, { "cell_type": "code", - "execution_count": 50, + "execution_count": 40, "metadata": {}, "outputs": [ { @@ -957,7 +947,7 @@ }, { "cell_type": "code", - "execution_count": 51, + "execution_count": 41, "metadata": {}, "outputs": [], "source": [ @@ -969,14 +959,14 @@ }, { "cell_type": "code", - "execution_count": 52, + "execution_count": 42, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Overwriting resources/wine_explainer.yaml\n" + "Writing resources/wine_explainer.yaml\n" ] } ], @@ -1008,7 +998,7 @@ }, { "cell_type": "code", - "execution_count": 53, + "execution_count": 43, "metadata": { "scrolled": true }, @@ -1017,7 +1007,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "seldondeployment.machinelearning.seldon.io/wine created\r\n" + "seldondeployment.machinelearning.seldon.io/wine created\n" ] } ], @@ -1027,7 +1017,7 @@ }, { "cell_type": "code", - "execution_count": 54, + "execution_count": 44, "metadata": {}, "outputs": [ { @@ -1045,7 +1035,7 @@ }, { "cell_type": "code", - "execution_count": 55, + "execution_count": 45, "metadata": { "scrolled": true }, @@ -1054,7 +1044,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "deployment \"wine-default-explainer\" successfully rolled out\r\n" + "Waiting for deployment \"wine-default-explainer\" rollout to finish: 0 of 1 updated replicas are available...\n", + "deployment \"wine-default-explainer\" successfully rolled out\n" ] } ], @@ -1064,7 +1055,7 @@ }, { "cell_type": "code", - "execution_count": 56, + "execution_count": 46, "metadata": { "scrolled": true }, @@ -1084,7 +1075,7 @@ }, { "cell_type": "code", - "execution_count": 57, + "execution_count": 47, "metadata": { "scrolled": true }, @@ -1093,7 +1084,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "{'data': {'names': ['t:0', 't:1', 't:2'], 'tensor': {'shape': [1, 3], 'values': [-0.203700284044519, 0.8934751316557469, 2.2237213335499804]}}, 'meta': {}}\n" + "{'data': {'names': ['t:0', 't:1', 't:2'], 'tensor': {'shape': [1, 3], 'values': [-0.203700284044519, 0.8934751316557469, 2.2237213335499804]}}, 'meta': {'requestPath': {'classifier': 'seldonio/sklearnserver:1.7.0-dev'}}}\n" ] } ], @@ -1115,14 +1106,14 @@ }, { "cell_type": "code", - "execution_count": 58, + "execution_count": 48, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "{\"data\":{\"names\":[\"t:0\",\"t:1\",\"t:2\"],\"ndarray\":[[-0.203700284044519,0.8934751316557469,2.2237213335499804]]},\"meta\":{}}\r\n" + "{\"data\":{\"names\":[\"t:0\",\"t:1\",\"t:2\"],\"ndarray\":[[-0.203700284044519,0.8934751316557469,2.2237213335499804]]},\"meta\":{\"requestPath\":{\"classifier\":\"seldonio/sklearnserver:1.7.0-dev\"}}}\n" ] } ], @@ -1141,7 +1132,7 @@ }, { "cell_type": "code", - "execution_count": 59, + "execution_count": 49, "metadata": { "scrolled": true }, @@ -1158,7 +1149,7 @@ }, { "cell_type": "code", - "execution_count": 60, + "execution_count": 50, "metadata": {}, "outputs": [], "source": [ @@ -1168,7 +1159,7 @@ }, { "cell_type": "code", - "execution_count": 61, + "execution_count": 51, "metadata": {}, "outputs": [], "source": [ @@ -1178,14 +1169,14 @@ }, { "cell_type": "code", - "execution_count": 62, + "execution_count": 52, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", - "
\n", + "
\n", "
\n", " Visualization omitted, Javascript library not loaded!
\n", " Have you run `initjs()` in this notebook? If this notebook was from another\n", @@ -1195,8 +1186,8 @@ "
\n", " " ], @@ -1204,7 +1195,7 @@ "" ] }, - "execution_count": 62, + "execution_count": 52, "metadata": {}, "output_type": "execute_result" } @@ -1228,7 +1219,7 @@ }, { "cell_type": "code", - "execution_count": 63, + "execution_count": 53, "metadata": {}, "outputs": [ { @@ -1237,7 +1228,7 @@ "text": [ " % Total % Received % Xferd Average Speed Time Time Time Current\n", " Dload Upload Total Spent Left Speed\n", - "100 4129 100 3916 100 213 1267 68 0:00:03 0:00:03 --:--:-- 1267\n", + "100 4141 100 3928 100 213 2189 118 0:00:01 0:00:01 --:--:-- 2308\n", "\u001b[1;39m{\n", " \u001b[0m\u001b[34;1m\"meta\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m{\n", " \u001b[0m\u001b[34;1m\"name\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"KernelShap\"\u001b[0m\u001b[1;39m,\n", @@ -1265,53 +1256,53 @@ " \u001b[0m\u001b[34;1m\"shap_values\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m[\n", " \u001b[1;39m[\n", " \u001b[1;39m[\n", - " \u001b[0;39m-0.018454421208892513\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.012763470836013313\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m-0.001740270040221814\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m-0.07633537428284093\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.006251732078452754\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m-0.13734297799429607\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m-0.1184209545879712\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.016528383221730947\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m-0.035244307767622385\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m-0.1230174198090298\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m-0.14524487323369617\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m-0.2507145522127333\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m-0.1309476564266916\u001b[0m\u001b[1;39m\n", + " \u001b[0;39m-0.026564448172395394\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.01474754619811397\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.0029785794627824602\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m-0.06989674989941941\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.0066466495859965335\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m-0.13846708957225218\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m-0.12276753108492278\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.018077515209726447\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m-0.033220065213557526\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m-0.12530431153383026\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m-0.148057466855813\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m-0.24993296604936582\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m-0.13015888350286176\u001b[0m\u001b[1;39m\n", " \u001b[1;39m]\u001b[0m\u001b[1;39m\n", " \u001b[1;39m]\u001b[0m\u001b[1;39m,\n", " \u001b[1;39m[\n", " \u001b[1;39m[\n", - " \u001b[0;39m0.015452322719423872\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m-0.03832005916153608\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m-0.04544081251256327\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m-7.582651671816931e-05\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m-0.04651784436924722\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.01980318229602418\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m-0.05109329519459854\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.0071260827408027305\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m-0.03975300296252354\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m-0.16144118472393876\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m-0.15110853673546232\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m-0.1006346397643918\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.06837621797012206\u001b[0m\u001b[1;39m\n", + " \u001b[0;39m0.00815794870767661\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m-0.03941083710746157\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m-0.044818303904592904\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.010477810662623877\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m-0.049213513737447256\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.01974804098011501\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m-0.053256982608956116\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.007843279332888253\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m-0.037433584332097314\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m-0.16615405642879122\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m-0.15230659779480793\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m-0.0943545957610265\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.06709399577727015\u001b[0m\u001b[1;39m\n", " \u001b[1;39m]\u001b[0m\u001b[1;39m\n", " \u001b[1;39m]\u001b[0m\u001b[1;39m,\n", " \u001b[1;39m[\n", " \u001b[1;39m[\n", - " \u001b[0;39m0.005403884749745513\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.020371174031396766\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.04217363001738739\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.07712885770720579\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.03400723775835046\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.1216306489876593\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.16988456143104136\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m-0.02030618995668898\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.07351750311197458\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.2879617844043466\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.29473542234118644\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.3536965903131064\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.06890108397640105\u001b[0m\u001b[1;39m\n", + " \u001b[0;39m0.021654431619118508\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.02028068848580955\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.03706436976364458\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.05831112850130049\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.03633892265257299\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.12322951677316496\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.1758965321885464\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m-0.022874111141031328\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.06871646495343742\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.29626374518120013\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.2991585173893212\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.34574854290539925\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.06931743960062864\u001b[0m\u001b[1;39m\n", " \u001b[1;39m]\u001b[0m\u001b[1;39m\n", " \u001b[1;39m]\u001b[0m\u001b[1;39m\n", " \u001b[1;39m]\u001b[0m\u001b[1;39m,\n", @@ -1367,19 +1358,19 @@ " \u001b[0m\u001b[34;1m\"importances\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m{\n", " \u001b[0m\u001b[34;1m\"0\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m{\n", " \u001b[0m\u001b[34;1m\"ranked_effect\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m[\n", - " \u001b[0;39m0.2507145522127333\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.14524487323369617\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.13734297799429607\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.1309476564266916\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.1230174198090298\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.1184209545879712\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.07633537428284093\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.035244307767622385\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.018454421208892513\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.016528383221730947\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.012763470836013313\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.006251732078452754\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.001740270040221814\u001b[0m\u001b[1;39m\n", + " \u001b[0;39m0.24993296604936582\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.148057466855813\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.13846708957225218\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.13015888350286176\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.12530431153383026\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.12276753108492278\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.06989674989941941\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.033220065213557526\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.026564448172395394\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.018077515209726447\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.01474754619811397\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.0066466495859965335\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.0029785794627824602\u001b[0m\u001b[1;39m\n", " \u001b[1;39m]\u001b[0m\u001b[1;39m,\n", " \u001b[0m\u001b[34;1m\"names\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m[\n", " \u001b[0;32m\"od280/od315_of_diluted_wines\"\u001b[0m\u001b[1;39m,\n", @@ -1399,19 +1390,19 @@ " \u001b[1;39m}\u001b[0m\u001b[1;39m,\n", " \u001b[0m\u001b[34;1m\"1\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m{\n", " \u001b[0m\u001b[34;1m\"ranked_effect\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m[\n", - " \u001b[0;39m0.16144118472393876\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.15110853673546232\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.1006346397643918\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.06837621797012206\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.05109329519459854\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.04651784436924722\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.04544081251256327\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.03975300296252354\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.03832005916153608\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.01980318229602418\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.015452322719423872\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.0071260827408027305\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m7.582651671816931e-05\u001b[0m\u001b[1;39m\n", + " \u001b[0;39m0.16615405642879122\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.15230659779480793\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.0943545957610265\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.06709399577727015\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.053256982608956116\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.049213513737447256\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.044818303904592904\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.03941083710746157\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.037433584332097314\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.01974804098011501\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.010477810662623877\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.00815794870767661\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.007843279332888253\u001b[0m\u001b[1;39m\n", " \u001b[1;39m]\u001b[0m\u001b[1;39m,\n", " \u001b[0m\u001b[34;1m\"names\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m[\n", " \u001b[0;32m\"color_intensity\"\u001b[0m\u001b[1;39m,\n", @@ -1421,29 +1412,29 @@ " \u001b[0;32m\"flavanoids\"\u001b[0m\u001b[1;39m,\n", " \u001b[0;32m\"magnesium\"\u001b[0m\u001b[1;39m,\n", " \u001b[0;32m\"ash\"\u001b[0m\u001b[1;39m,\n", - " \u001b[0;32m\"proanthocyanins\"\u001b[0m\u001b[1;39m,\n", " \u001b[0;32m\"malic_acid\"\u001b[0m\u001b[1;39m,\n", + " \u001b[0;32m\"proanthocyanins\"\u001b[0m\u001b[1;39m,\n", " \u001b[0;32m\"total_phenols\"\u001b[0m\u001b[1;39m,\n", + " \u001b[0;32m\"alcalinity_of_ash\"\u001b[0m\u001b[1;39m,\n", " \u001b[0;32m\"alcohol\"\u001b[0m\u001b[1;39m,\n", - " \u001b[0;32m\"nonflavanoid_phenols\"\u001b[0m\u001b[1;39m,\n", - " \u001b[0;32m\"alcalinity_of_ash\"\u001b[0m\u001b[1;39m\n", + " \u001b[0;32m\"nonflavanoid_phenols\"\u001b[0m\u001b[1;39m\n", " \u001b[1;39m]\u001b[0m\u001b[1;39m\n", " \u001b[1;39m}\u001b[0m\u001b[1;39m,\n", " \u001b[0m\u001b[34;1m\"2\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m{\n", " \u001b[0m\u001b[34;1m\"ranked_effect\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m[\n", - " \u001b[0;39m0.3536965903131064\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.29473542234118644\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.2879617844043466\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.16988456143104136\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.1216306489876593\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.07712885770720579\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.07351750311197458\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.06890108397640105\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.04217363001738739\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.03400723775835046\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.020371174031396766\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.02030618995668898\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.005403884749745513\u001b[0m\u001b[1;39m\n", + " \u001b[0;39m0.34574854290539925\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.2991585173893212\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.29626374518120013\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.1758965321885464\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.12322951677316496\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.06931743960062864\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.06871646495343742\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.05831112850130049\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.03706436976364458\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.03633892265257299\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.022874111141031328\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.021654431619118508\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.02028068848580955\u001b[0m\u001b[1;39m\n", " \u001b[1;39m]\u001b[0m\u001b[1;39m,\n", " \u001b[0m\u001b[34;1m\"names\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m[\n", " \u001b[0;32m\"od280/od315_of_diluted_wines\"\u001b[0m\u001b[1;39m,\n", @@ -1451,31 +1442,31 @@ " \u001b[0;32m\"color_intensity\"\u001b[0m\u001b[1;39m,\n", " \u001b[0;32m\"flavanoids\"\u001b[0m\u001b[1;39m,\n", " \u001b[0;32m\"total_phenols\"\u001b[0m\u001b[1;39m,\n", - " \u001b[0;32m\"alcalinity_of_ash\"\u001b[0m\u001b[1;39m,\n", - " \u001b[0;32m\"proanthocyanins\"\u001b[0m\u001b[1;39m,\n", " \u001b[0;32m\"proline\"\u001b[0m\u001b[1;39m,\n", + " \u001b[0;32m\"proanthocyanins\"\u001b[0m\u001b[1;39m,\n", + " \u001b[0;32m\"alcalinity_of_ash\"\u001b[0m\u001b[1;39m,\n", " \u001b[0;32m\"ash\"\u001b[0m\u001b[1;39m,\n", " \u001b[0;32m\"magnesium\"\u001b[0m\u001b[1;39m,\n", - " \u001b[0;32m\"malic_acid\"\u001b[0m\u001b[1;39m,\n", " \u001b[0;32m\"nonflavanoid_phenols\"\u001b[0m\u001b[1;39m,\n", - " \u001b[0;32m\"alcohol\"\u001b[0m\u001b[1;39m\n", + " \u001b[0;32m\"alcohol\"\u001b[0m\u001b[1;39m,\n", + " \u001b[0;32m\"malic_acid\"\u001b[0m\u001b[1;39m\n", " \u001b[1;39m]\u001b[0m\u001b[1;39m\n", " \u001b[1;39m}\u001b[0m\u001b[1;39m,\n", " \u001b[0m\u001b[34;1m\"aggregated\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m{\n", " \u001b[0m\u001b[34;1m\"ranked_effect\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m[\n", - " \u001b[0;39m0.7050457822902315\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.5910888323103449\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.5724203889373152\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.3393988112136111\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.27877680927797954\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.2682249583732147\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.1535400585067649\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.1485148138421205\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.08935471257017247\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.08677681420605043\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.07145470402894616\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.04396065591922266\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.0393106286780619\u001b[0m\u001b[1;39m\n", + " \u001b[0;39m0.6900361047157916\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.5995225820399421\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.5877221131438216\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.3519210458824253\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.28144464732553215\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.26657031888076055\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.13937011449909226\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.13868568906334378\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.09219908597601678\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.08486125313101994\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.07443907179138509\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.05637682849919051\u001b[0m\u001b[1;39m,\n", + " \u001b[0;39m0.04879490568364603\u001b[0m\u001b[1;39m\n", " \u001b[1;39m]\u001b[0m\u001b[1;39m,\n", " \u001b[0m\u001b[34;1m\"names\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m[\n", " \u001b[0;32m\"od280/od315_of_diluted_wines\"\u001b[0m\u001b[1;39m,\n", @@ -1484,13 +1475,13 @@ " \u001b[0;32m\"flavanoids\"\u001b[0m\u001b[1;39m,\n", " \u001b[0;32m\"total_phenols\"\u001b[0m\u001b[1;39m,\n", " \u001b[0;32m\"proline\"\u001b[0m\u001b[1;39m,\n", - " \u001b[0;32m\"alcalinity_of_ash\"\u001b[0m\u001b[1;39m,\n", " \u001b[0;32m\"proanthocyanins\"\u001b[0m\u001b[1;39m,\n", - " \u001b[0;32m\"ash\"\u001b[0m\u001b[1;39m,\n", + " \u001b[0;32m\"alcalinity_of_ash\"\u001b[0m\u001b[1;39m,\n", " \u001b[0;32m\"magnesium\"\u001b[0m\u001b[1;39m,\n", + " \u001b[0;32m\"ash\"\u001b[0m\u001b[1;39m,\n", " \u001b[0;32m\"malic_acid\"\u001b[0m\u001b[1;39m,\n", - " \u001b[0;32m\"nonflavanoid_phenols\"\u001b[0m\u001b[1;39m,\n", - " \u001b[0;32m\"alcohol\"\u001b[0m\u001b[1;39m\n", + " \u001b[0;32m\"alcohol\"\u001b[0m\u001b[1;39m,\n", + " \u001b[0;32m\"nonflavanoid_phenols\"\u001b[0m\u001b[1;39m\n", " \u001b[1;39m]\u001b[0m\u001b[1;39m\n", " \u001b[1;39m}\u001b[0m\u001b[1;39m\n", " \u001b[1;39m}\u001b[0m\u001b[1;39m\n", @@ -1508,7 +1499,7 @@ }, { "cell_type": "code", - "execution_count": 64, + "execution_count": 54, "metadata": { "scrolled": true }, @@ -1517,7 +1508,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "seldondeployment.machinelearning.seldon.io \"wine\" deleted\r\n" + "seldondeployment.machinelearning.seldon.io \"wine\" deleted\n" ] } ], @@ -1538,14 +1529,14 @@ }, { "cell_type": "code", - "execution_count": 65, + "execution_count": 55, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Overwriting resources/mnist_rest_explainer.yaml\n" + "Writing resources/mnist_rest_explainer.yaml\n" ] } ], @@ -1579,14 +1570,14 @@ }, { "cell_type": "code", - "execution_count": 66, + "execution_count": 56, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "seldondeployment.machinelearning.seldon.io/tfserving created\r\n" + "seldondeployment.machinelearning.seldon.io/tfserving created\n" ] } ], @@ -1596,7 +1587,7 @@ }, { "cell_type": "code", - "execution_count": 67, + "execution_count": 57, "metadata": {}, "outputs": [ { @@ -1614,7 +1605,7 @@ }, { "cell_type": "code", - "execution_count": 68, + "execution_count": 58, "metadata": {}, "outputs": [ { @@ -1644,7 +1635,7 @@ }, { "cell_type": "code", - "execution_count": 69, + "execution_count": 62, "metadata": {}, "outputs": [], "source": [ @@ -1654,7 +1645,7 @@ }, { "cell_type": "code", - "execution_count": 70, + "execution_count": 63, "metadata": {}, "outputs": [], "source": [ @@ -1666,7 +1657,7 @@ }, { "cell_type": "code", - "execution_count": 71, + "execution_count": 64, "metadata": {}, "outputs": [], "source": [ @@ -1678,7 +1669,7 @@ }, { "cell_type": "code", - "execution_count": 72, + "execution_count": 65, "metadata": {}, "outputs": [], "source": [ @@ -1688,7 +1679,7 @@ }, { "cell_type": "code", - "execution_count": 73, + "execution_count": 66, "metadata": {}, "outputs": [ { @@ -1697,7 +1688,7 @@ "array([7, 2, 1, 0, 4, 1, 4, 9, 6, 9])" ] }, - "execution_count": 73, + "execution_count": 66, "metadata": {}, "output_type": "execute_result" } @@ -1708,7 +1699,7 @@ }, { "cell_type": "code", - "execution_count": 74, + "execution_count": 67, "metadata": {}, "outputs": [], "source": [ @@ -1720,7 +1711,7 @@ }, { "cell_type": "code", - "execution_count": 75, + "execution_count": 68, "metadata": {}, "outputs": [], "source": [ @@ -1732,7 +1723,7 @@ }, { "cell_type": "code", - "execution_count": 76, + "execution_count": 69, "metadata": {}, "outputs": [], "source": [ @@ -1741,7 +1732,7 @@ }, { "cell_type": "code", - "execution_count": 77, + "execution_count": 70, "metadata": {}, "outputs": [ { @@ -1793,14 +1784,14 @@ }, { "cell_type": "code", - "execution_count": 78, + "execution_count": 71, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "seldondeployment.machinelearning.seldon.io \"tfserving\" deleted\r\n" + "seldondeployment.machinelearning.seldon.io \"tfserving\" deleted\n" ] } ], @@ -1821,7 +1812,7 @@ }, { "cell_type": "code", - "execution_count": 199, + "execution_count": 72, "metadata": {}, "outputs": [ { @@ -1856,14 +1847,14 @@ }, { "cell_type": "code", - "execution_count": 200, + "execution_count": 73, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "seldondeployment.machinelearning.seldon.io/income configured\r\n" + "seldondeployment.machinelearning.seldon.io/income created\n" ] } ], @@ -1873,14 +1864,15 @@ }, { "cell_type": "code", - "execution_count": 201, + "execution_count": 74, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "deployment \"income-default-0-income-model\" successfully rolled out\r\n" + "Waiting for deployment \"income-default-0-income-model\" rollout to finish: 0 of 1 updated replicas are available...\n", + "deployment \"income-default-0-income-model\" successfully rolled out\n" ] } ], @@ -1890,7 +1882,7 @@ }, { "cell_type": "code", - "execution_count": 202, + "execution_count": 75, "metadata": { "scrolled": true }, @@ -1910,7 +1902,7 @@ }, { "cell_type": "code", - "execution_count": 203, + "execution_count": 77, "metadata": { "scrolled": true }, @@ -1919,7 +1911,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "{'data': {'names': [], 'tensor': {'shape': [1], 'values': [-1.2381880283355713]}}, 'meta': {'requestPath': {'income-model': 'seldonio/xgboostserver:1.6.0'}}}\n" + "{'data': {'names': [], 'tensor': {'shape': [1], 'values': [-1.2381880283355713]}}, 'meta': {'requestPath': {'income-model': 'seldonio/xgboostserver:1.7.0-dev'}}}\n" ] } ], @@ -1938,7 +1930,7 @@ }, { "cell_type": "code", - "execution_count": 204, + "execution_count": 78, "metadata": {}, "outputs": [], "source": [ @@ -1949,7 +1941,7 @@ }, { "cell_type": "code", - "execution_count": 242, + "execution_count": 79, "metadata": { "scrolled": true }, @@ -1958,7 +1950,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Elapsed time: 12.412888288497925\n" + "Elapsed time: 8.356285572052002\n" ] } ], @@ -1976,7 +1968,7 @@ }, { "cell_type": "code", - "execution_count": 226, + "execution_count": 80, "metadata": {}, "outputs": [], "source": [ @@ -1986,7 +1978,7 @@ }, { "cell_type": "code", - "execution_count": 227, + "execution_count": 81, "metadata": {}, "outputs": [], "source": [ @@ -1996,7 +1988,7 @@ }, { "cell_type": "code", - "execution_count": 228, + "execution_count": 82, "metadata": {}, "outputs": [], "source": [ @@ -2026,7 +2018,7 @@ }, { "cell_type": "code", - "execution_count": 229, + "execution_count": 83, "metadata": {}, "outputs": [], "source": [ @@ -2035,7 +2027,7 @@ }, { "cell_type": "code", - "execution_count": 230, + "execution_count": 84, "metadata": {}, "outputs": [ { @@ -2088,14 +2080,14 @@ }, { "cell_type": "code", - "execution_count": 232, + "execution_count": 85, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", - "
\n", + "
\n", "
\n", " Visualization omitted, Javascript library not loaded!
\n", " Have you run `initjs()` in this notebook? If this notebook was from another\n", @@ -2105,16 +2097,16 @@ "
\n", " " ], "text/plain": [ - "" + "" ] }, - "execution_count": 232, + "execution_count": 85, "metadata": {}, "output_type": "execute_result" } @@ -2130,14 +2122,14 @@ }, { "cell_type": "code", - "execution_count": 97, + "execution_count": 86, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "seldondeployment.machinelearning.seldon.io \"income\" deleted\r\n" + "seldondeployment.machinelearning.seldon.io \"income\" deleted\n" ] } ], @@ -2160,14 +2152,14 @@ }, { "cell_type": "code", - "execution_count": 255, + "execution_count": 104, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Writing resources/income_gpu_explainer.yaml\n" + "Overwriting resources/income_gpu_explainer.yaml\n" ] } ], @@ -2201,14 +2193,14 @@ }, { "cell_type": "code", - "execution_count": 256, + "execution_count": 105, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "seldondeployment.machinelearning.seldon.io/incomegpu unchanged\r\n" + "seldondeployment.machinelearning.seldon.io/incomegpu unchanged\n" ] } ], @@ -2218,14 +2210,14 @@ }, { "cell_type": "code", - "execution_count": 257, + "execution_count": 106, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "deployment \"incomegpu-default-0-income-model\" successfully rolled out\r\n" + "deployment \"incomegpu-default-0-income-model\" successfully rolled out\n" ] } ], @@ -2235,7 +2227,7 @@ }, { "cell_type": "code", - "execution_count": 258, + "execution_count": 107, "metadata": { "scrolled": true }, @@ -2255,7 +2247,7 @@ }, { "cell_type": "code", - "execution_count": 246, + "execution_count": 110, "metadata": { "scrolled": true }, @@ -2264,7 +2256,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "{'data': {'names': [], 'tensor': {'shape': [1], 'values': [-1.2381880283355713]}}, 'meta': {'requestPath': {'income-model': 'seldonio/xgboostserver:1.6.0'}}}\n" + "None\n" ] } ], @@ -2283,7 +2275,7 @@ }, { "cell_type": "code", - "execution_count": 247, + "execution_count": 102, "metadata": {}, "outputs": [], "source": [ @@ -2294,14 +2286,14 @@ }, { "cell_type": "code", - "execution_count": 248, + "execution_count": 140, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Elapsed time: 0.7827632427215576\n" + "Elapsed time: 0.004498720169067383\n" ] } ], @@ -2310,9 +2302,7 @@ "start = time.time()\n", "res = sc.explain(deployment_name=\"incomegpu\", predictor=\"default\", data=data[0:2000])\n", "end = time.time()\n", - "print(\"Elapsed time:\",end-start)\n", - "explanation = res.response\n", - "explanationStr = json.dumps(explanation)" + "print(\"Elapsed time:\",end-start)" ] }, { @@ -2324,27 +2314,35 @@ }, { "cell_type": "code", - "execution_count": 249, + "execution_count": 141, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Explanation not successfull: are you running on GPU enabled cluster?\n" + ] + } + ], "source": [ "from alibi.api.interfaces import Explanation\n", - "explanation = Explanation.from_json(explanationStr)" - ] - }, - { - "cell_type": "code", - "execution_count": 250, - "metadata": {}, - "outputs": [], - "source": [ - "explanation.shap_values = np.array(explanation.shap_values)\n", - "explanation.raw[\"instances\"] = np.array(explanation.raw[\"instances\"])" + "\n", + "if res.success:\n", + " explanation = res.response\n", + " explanationStr = json.dumps(explanation)\n", + " explanation = Explanation.from_json(explanationStr)\n", + " \n", + " explanation.shap_values = np.array(explanation.shap_values)\n", + " explanation.raw[\"instances\"] = np.array(explanation.raw[\"instances\"])\n", + "else:\n", + " explanation = None\n", + " print(\"Explanation not successfull: are you running on GPU enabled cluster?\")" ] }, { "cell_type": "code", - "execution_count": 251, + "execution_count": 142, "metadata": {}, "outputs": [], "source": [ @@ -2374,16 +2372,7 @@ }, { "cell_type": "code", - "execution_count": 252, - "metadata": {}, - "outputs": [], - "source": [ - "decoded_features = decode_data(data,explanation.feature_names,explanation.categorical_names)" - ] - }, - { - "cell_type": "code", - "execution_count": 253, + "execution_count": 145, "metadata": {}, "outputs": [ { @@ -2436,69 +2425,36 @@ }, { "cell_type": "code", - "execution_count": 254, + "execution_count": 146, "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "\n", - "
\n", - "
\n", - " Visualization omitted, Javascript library not loaded!
\n", - " Have you run `initjs()` in this notebook? If this notebook was from another\n", - " user you must also trust this notebook (File -> Trust notebook). If you are viewing\n", - " this notebook on github the Javascript has been stripped for security. If you are using\n", - " JupyterLab this error is because a JupyterLab extension has not yet been written.\n", - "
\n", - " " - ], - "text/plain": [ - "" - ] - }, - "execution_count": 254, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ - "shap.force_plot(\n", - " explanation.expected_value[0], # 0 is a class index but we have single-output model\n", - " explanation.shap_values[0] , \n", - " decoded_features, \n", - " explanation.feature_names,\n", - ")" + "if explanation is not None:\n", + " decoded_features = decode_data(data, explanation.feature_names, explanation.categorical_names)\n", + " shap.force_plot(\n", + " explanation.expected_value[0], # 0 is a class index but we have single-output model\n", + " explanation.shap_values[0] , \n", + " decoded_features, \n", + " explanation.feature_names,\n", + " )" ] }, { "cell_type": "code", - "execution_count": 207, + "execution_count": 147, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "seldondeployment.machinelearning.seldon.io \"incomegpu\" deleted\r\n" + "Error from server (NotFound): error when deleting \"resources/income_gpu_explainer.yaml\": seldondeployments.machinelearning.seldon.io \"incomegpu\" not found\n" ] } ], "source": [ "!kubectl delete -f resources/income_gpu_explainer.yaml" ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { @@ -2518,7 +2474,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.8" + "version": "3.7.9" }, "varInspector": { "cols": { diff --git a/testing/scripts/kind_test_all.sh b/testing/scripts/kind_test_all.sh index 9ecbf94a75..5da7782ce1 100755 --- a/testing/scripts/kind_test_all.sh +++ b/testing/scripts/kind_test_all.sh @@ -42,8 +42,8 @@ if [[ ${KIND_EXIT_VALUE} -eq 0 ]]; then run_end_to_end_tests() { - echo "Files changed in python folder:" - git --no-pager diff --exit-code --name-only origin/master ../../python + echo "Files changed in python or wrapper folder:" + git --no-pager diff --exit-code --name-only origin/master ../../python ../../wrappers/s2i/python PYTHON_MODIFIED=$? if [[ $PYTHON_MODIFIED -gt 0 ]]; then make s2i_build_base_images @@ -111,8 +111,8 @@ if [[ ${KIND_EXIT_VALUE} -eq 0 ]]; then return 1 fi - echo "Files changed in prepackaged folder:" - git --no-pager diff --exit-code --name-only origin/master ../../servers ../../integrations + echo "Files changed in prepackaged, python, or wrapper folder:" + git --no-pager diff --exit-code --name-only origin/master ../../servers ../../integrations ../../python ../../wrappers/s2i/python PREPACKAGED_MODIFIED=$? if [[ $PREPACKAGED_MODIFIED -gt 0 ]]; then make kind_build_prepackaged diff --git a/wrappers/s2i/python/Dockerfile.local b/wrappers/s2i/python/Dockerfile.local index d2bc429ef7..7d70d611fb 100644 --- a/wrappers/s2i/python/Dockerfile.local +++ b/wrappers/s2i/python/Dockerfile.local @@ -9,6 +9,9 @@ ARG PYTHON_VERSION RUN conda install --yes python=$PYTHON_VERSION conda=$CONDA_VERSION RUN apt-get update --yes && apt-get install --yes gcc make build-essential +# Pin pip and setuptools +RUN pip install pip==20.2 setuptools==46.1 + RUN mkdir microservice WORKDIR /microservice diff --git a/wrappers/s2i/python/Dockerfile.redhat b/wrappers/s2i/python/Dockerfile.redhat index 4e24d33d2f..3fc62156e3 100644 --- a/wrappers/s2i/python/Dockerfile.redhat +++ b/wrappers/s2i/python/Dockerfile.redhat @@ -9,8 +9,8 @@ ARG PYTHON_VERSION RUN conda install --yes python=$PYTHON_VERSION conda=$CONDA_VERSION RUN dnf install -y make automake gcc gcc-c++ -# Upgrade pip version -RUN pip install pip==20.2 +# Pin pip and setuptools +RUN pip install pip==20.2 setuptools==46.1 RUN mkdir microservice WORKDIR /microservice