Skip to content

Commit 3462496

Browse files
authored
README.rst additions (#13)
Add SageMaker banner. Add link to 'Read the Docs'. Provide more information on AWS built-in algorithms and RecordSet.
1 parent 4a30f56 commit 3462496

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed

README.rst

+46-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1+
.. image:: branding/icon/sagemaker-banner.png
2+
:height: 100px
3+
:alt: SageMaker
4+
5+
====================
16
SageMaker Python SDK
27
====================
38

49
SageMaker Python SDK is an open source library for training and deploying machine learning models on Amazon SageMaker.
510

611
With the SDK, you can train and deploy models using popular deep learning frameworks: **Apache MXNet** and **TensorFlow**. You can also train and deploy models with **Amazon algorithms**, these are scalable implementations of core machine learning algorithms that are optimized for SageMaker and GPU training. If you have **your own algorithms** built into SageMaker compatible Docker containers, you can train and host models using these as well.
712

13+
For detailed API reference please go to: `Read the Docs <https://readthedocs.org/projects/sagemaker/>`_
14+
815
Table of Contents
916
-----------------
1017

@@ -1417,7 +1424,45 @@ Amazon SageMaker provides several built-in machine learning algorithms that you
14171424
14181425
The full list of algorithms is available on the AWS website: https://docs.aws.amazon.com/sagemaker/latest/dg/algos.html
14191426
1420-
SageMaker Python SDK includes Estimator wrappers for the AWS K-means, Principal Components Analysis, and Liner Learner algorithms.
1427+
SageMaker Python SDK includes Estimator wrappers for the AWS K-means, Principal Components Analysis, and Linear Learner algorithms.
1428+
1429+
Definition and usage
1430+
~~~~~~~~~~~~~~~~~~~~
1431+
Estimators that wrap Amazon's built-in algorithms define algorithm's hyperparameters with defaults. When a default is not possible you need to provide the value during construction:
1432+
1433+
- ``KMeans`` Estimator requires parameter ``k`` to define number of clusters
1434+
- ``PCA`` Estimator requires parameter ``num_components`` to define number of principal components
1435+
1436+
Interaction is identical as any other Estimators. There are additional details about how data is specified.
1437+
1438+
Input data format
1439+
^^^^^^^^^^^^^^^^^
1440+
Please note that Amazon's built-in algorithms are working best with protobuf ``recordIO`` format.
1441+
The data is expected to be available in S3 location and depending on algorithm it can handle dat in multiple data channels.
1442+
1443+
This package offers support to prepare data into required fomrat and upload data to S3.
1444+
Provided class ``RecordSet`` captures necessary details like S3 location, number of records, data channel and is expected as input parameter when calling ``fit()``.
1445+
1446+
Function ``record_set`` is available on algorithms objects to make it simple to achieve the above.
1447+
It takes 2D numpy array as input, uploads data to S3 and returns ``RecordSet`` objects. By default it uses ``train`` data channel and no labels but can be specified when called.
1448+
1449+
Please find an example code snippet for illustration:
1450+
1451+
.. code:: python
1452+
1453+
from sagemaker import PCA
1454+
pca_estimator = PCA(role='SageMakerRole', train_instance_count=1, train_instance_type='ml.m4.xlarge', num_components=3)
1455+
1456+
import numpy as np
1457+
records = pca_estimator.record_set(np.arange(10).reshape(2,5))
1458+
1459+
pca_estimator.fit(records)
1460+
1461+
1462+
Predictions support
1463+
~~~~~~~~~~~~~~~~~~~
1464+
Calling inference on deployed Amazon's built-in algorithms requires specific input format. By default, this library creates a predictor that allows to use just numpy data.
1465+
Data is converted so that ``application/x-recordio-protobuf`` input format is used. Received response is deserialized from the protobuf and provided as result from the ``predict`` call.
14211466
14221467
14231468
BYO Docker Containers with SageMaker Estimators

branding/icon/sagemaker-banner.png

9.17 KB
Loading

0 commit comments

Comments
 (0)