Skip to content

Commit 896fd1c

Browse files
committed
reorganize xgboost imports, add markdown on deleting endpoints
1 parent b0ebd03 commit 896fd1c

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

sagemaker-spark/pyspark_mnist/xgboost_mnist.ipynb

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,13 @@
5555
},
5656
"outputs": [],
5757
"source": [
58+
"import os\n",
59+
"\n",
5860
"from pyspark import SparkContext, SparkConf\n",
5961
"from pyspark.sql import SparkSession\n",
60-
"import os\n",
61-
"import sagemaker_pyspark\n",
62+
"\n",
6263
"import sagemaker\n",
64+
"import sagemaker_pyspark\n",
6365
"from sagemaker import get_execution_role\n",
6466
"\n",
6567
"sagemaker_session = sagemaker.Session()\n",
@@ -209,8 +211,8 @@
209211
"\n",
210212
"for cluster in range(10):\n",
211213
" print('\\n\\n\\nCluster {}:'.format(int(cluster)))\n",
212-
" digits = [ img for l, img in zip(clusters, images) if int(l.prediction) == cluster ]\n",
213-
" height=((len(digits)-1)//5)+1\n",
214+
" digits=[ img for l, img in zip(clusters, images) if int(l.prediction) == cluster ]\n",
215+
" height=((len(digits) - 1) // 5) + 1\n",
214216
" width=5\n",
215217
" plt.rcParams[\"figure.figsize\"] = (width,height)\n",
216218
" _, subplots = plt.subplots(height, width)\n",
@@ -223,6 +225,13 @@
223225
" plt.show()"
224226
]
225227
},
228+
{
229+
"cell_type": "markdown",
230+
"metadata": {},
231+
"source": [
232+
"Since we don't need to make any more inferences, now we delete the endpoint:"
233+
]
234+
},
226235
{
227236
"cell_type": "code",
228237
"execution_count": null,

0 commit comments

Comments
 (0)