Skip to content

Commit caa8bc5

Browse files
committed
change header names
1 parent 0358cb1 commit caa8bc5

File tree

1 file changed

+28
-14
lines changed

1 file changed

+28
-14
lines changed

sagemaker-spark/pyspark_mnist/pyspark_mnist_kmeans.ipynb

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
"# SageMakerPySpark MNIST Example\n",
2626
"\n",
2727
"1. [Introduction](#Introduction)\n",
28-
"2. [Data Inspection](#Data-Inspection)\n",
29-
"3. [Training the K-Means Model](#Training-the-K-Means-Model)\n",
30-
"4. [Validate the Model for use](#Validate-the-Model-for-use)\n",
31-
"5. [Bring your Own Algorithm](#Bring-your-Own-Algorithm)\n"
28+
"2. [Loading the Data](#Loading-the-Data)\n",
29+
"3. [Training and Hosting a Model](#Training-and-Hosting-a-Model)\n",
30+
"4. [Inference](#Inference)\n",
31+
"5. [More on SageMaker Spark](#More-on-SageMaker-Spark)\n"
3232
]
3333
},
3434
{
@@ -50,7 +50,9 @@
5050
{
5151
"cell_type": "code",
5252
"execution_count": null,
53-
"metadata": {},
53+
"metadata": {
54+
"collapsed": true
55+
},
5456
"outputs": [],
5557
"source": [
5658
"from pyspark import SparkContext, SparkConf\n",
@@ -78,7 +80,9 @@
7880
{
7981
"cell_type": "code",
8082
"execution_count": null,
81-
"metadata": {},
83+
"metadata": {
84+
"collapsed": true
85+
},
8286
"outputs": [],
8387
"source": [
8488
"# replace this with your own region, such as us-east-1\n",
@@ -96,7 +100,8 @@
96100
"cell_type": "markdown",
97101
"metadata": {},
98102
"source": [
99-
"## Data Inspection\n",
103+
"## Loading the Data\n",
104+
"\n",
100105
"In order to train and make inferences our input DataFrame must have a column of Doubles (named \"label\" by default) and a column of Vectors of Doubles (named \"features\" by default).\n",
101106
"\n",
102107
"Spark's LibSVM DataFrameReader loads a DataFrame already suitable for training and inference."
@@ -105,7 +110,9 @@
105110
{
106111
"cell_type": "code",
107112
"execution_count": null,
108-
"metadata": {},
113+
"metadata": {
114+
"collapsed": true
115+
},
109116
"outputs": [],
110117
"source": [
111118
"trainingData.show()"
@@ -115,7 +122,7 @@
115122
"cell_type": "markdown",
116123
"metadata": {},
117124
"source": [
118-
"## Training the K-Means Model\n",
125+
"## Training and Hosting a Model\n",
119126
"Now we create a KMeansSageMakerEstimator, which uses the KMeans Amazon SageMaker Algorithm to train on our input data, and uses the KMeans Amazon SageMaker model image to host our model.\n",
120127
"\n",
121128
"Calling fit() on this estimator will train our model on Amazon SageMaker, and then create an Amazon SageMaker Endpoint to host our model.\n",
@@ -128,7 +135,9 @@
128135
{
129136
"cell_type": "code",
130137
"execution_count": null,
131-
"metadata": {},
138+
"metadata": {
139+
"collapsed": true
140+
},
132141
"outputs": [],
133142
"source": [
134143
"import random\n",
@@ -154,15 +163,18 @@
154163
"cell_type": "markdown",
155164
"metadata": {},
156165
"source": [
157-
"## Validate the Model for use\n",
166+
"## Inference\n",
167+
"\n",
158168
"Now we transform our DataFrame.\n",
159169
"To do this, we serialize each row's \"features\" Vector of Doubles into a Protobuf format for inference against the Amazon SageMaker Endpoint. We deserialize the Protobuf responses back into our DataFrame:"
160170
]
161171
},
162172
{
163173
"cell_type": "code",
164174
"execution_count": null,
165-
"metadata": {},
175+
"metadata": {
176+
"collapsed": true
177+
},
166178
"outputs": [],
167179
"source": [
168180
"transformedData = model.transform(testData)\n",
@@ -173,7 +185,9 @@
173185
{
174186
"cell_type": "code",
175187
"execution_count": null,
176-
"metadata": {},
188+
"metadata": {
189+
"collapsed": true
190+
},
177191
"outputs": [],
178192
"source": [
179193
"from pyspark.sql.types import DoubleType\n",
@@ -230,7 +244,7 @@
230244
"cell_type": "markdown",
231245
"metadata": {},
232246
"source": [
233-
"## Bring your Own Algorithm\n",
247+
"## More on SageMaker Spark\n",
234248
"\n",
235249
"The SageMaker Spark Github repository has more about SageMaker Spark, including how to use SageMaker Spark with your own algorithms on Amazon SageMaker: https://github.com/aws/sagemaker-spark\n"
236250
]

0 commit comments

Comments
 (0)