Skip to content

Commit ce45f26

Browse files
authored
doc: add link to Amazon algorithm estimator parent class to clarify **kwargs (#1179)
This commit also fixes some minor Sphinx syntax issues in the docstrings.
1 parent c9aa033 commit ce45f26

11 files changed

+86
-14
lines changed

src/sagemaker/amazon/amazon_estimator.py

+16-4
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,27 @@ def __init__(
4949
"""Initialize an AmazonAlgorithmEstimatorBase.
5050
5151
Args:
52-
role:
53-
train_instance_count:
54-
train_instance_type:
52+
role (str): An AWS IAM role (either name or full ARN). The Amazon
53+
SageMaker training jobs and APIs that create Amazon SageMaker
54+
endpoints use this role to access training data and model
55+
artifacts. After the endpoint is created, the inference code
56+
might use the IAM role, if it needs to access an AWS resource.
57+
train_instance_count (int): Number of Amazon EC2 instances to use
58+
for training.
59+
train_instance_type (str): Type of EC2 instance to use for training,
60+
for example, 'ml.c4.xlarge'.
5561
data_location (str or None): The s3 prefix to upload RecordSet
5662
objects to, expressed as an S3 url. For example
5763
"s3://example-bucket/some-key-prefix/". Objects will be saved in
5864
a unique sub-directory of the specified location. If None, a
5965
default data location will be used.
60-
**kwargs:
66+
**kwargs: Additional parameters passed to
67+
:class:`~sagemaker.estimator.EstimatorBase`.
68+
69+
.. tip::
70+
71+
You can find additional parameters for initializing this class at
72+
:class:`~sagemaker.estimator.EstimatorBase`.
6173
"""
6274

6375
if "enable_network_isolation" in kwargs:

src/sagemaker/amazon/factorization_machines.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
1+
# Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License"). You
44
# may not use this file except in compliance with the License. A copy of
@@ -205,6 +205,12 @@ def __init__(
205205
that takes effect when factors_init_method parameter is
206206
'constant'.
207207
**kwargs: base class keyword argument values.
208+
209+
.. tip::
210+
211+
You can find additional parameters for initializing this class at
212+
:class:`~sagemaker.estimator.amazon_estimator.AmazonAlgorithmEstimatorBase` and
213+
:class:`~sagemaker.estimator.EstimatorBase`.
208214
"""
209215
super(FactorizationMachines, self).__init__(
210216
role, train_instance_count, train_instance_type, **kwargs

src/sagemaker/amazon/ipinsights.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
1+
# Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License"). You
44
# may not use this file except in compliance with the License. A copy of
@@ -119,6 +119,12 @@ def __init__(
119119
weight_decay (float): Optional. Weight decay coefficient. Adds L2
120120
regularization.
121121
**kwargs: base class keyword argument values.
122+
123+
.. tip::
124+
125+
You can find additional parameters for initializing this class at
126+
:class:`~sagemaker.estimator.amazon_estimator.AmazonAlgorithmEstimatorBase` and
127+
:class:`~sagemaker.estimator.EstimatorBase`.
122128
"""
123129
super(IPInsights, self).__init__(role, train_instance_count, train_instance_type, **kwargs)
124130
self.num_entity_vectors = num_entity_vectors

src/sagemaker/amazon/kmeans.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
1+
# Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License"). You
44
# may not use this file except in compliance with the License. A copy of
@@ -135,6 +135,12 @@ def __init__(
135135
is provided, the score shall be reported in terms of all
136136
requested metrics.
137137
**kwargs: base class keyword argument values.
138+
139+
.. tip::
140+
141+
You can find additional parameters for initializing this class at
142+
:class:`~sagemaker.estimator.amazon_estimator.AmazonAlgorithmEstimatorBase` and
143+
:class:`~sagemaker.estimator.EstimatorBase`.
138144
"""
139145
super(KMeans, self).__init__(role, train_instance_count, train_instance_type, **kwargs)
140146
self.k = k

src/sagemaker/amazon/knn.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
1+
# Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License"). You
44
# may not use this file except in compliance with the License. A copy of
@@ -128,6 +128,12 @@ def __init__(
128128
faiss_index_pq_m (int): Optional. Number of vector sub-components to
129129
construct in the index, if index_type is "faiss.IVFPQ".
130130
**kwargs: base class keyword argument values.
131+
132+
.. tip::
133+
134+
You can find additional parameters for initializing this class at
135+
:class:`~sagemaker.estimator.amazon_estimator.AmazonAlgorithmEstimatorBase` and
136+
:class:`~sagemaker.estimator.EstimatorBase`.
131137
"""
132138

133139
super(KNN, self).__init__(role, train_instance_count, train_instance_type, **kwargs)

src/sagemaker/amazon/lda.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
1+
# Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License"). You
44
# may not use this file except in compliance with the License. A copy of
@@ -106,6 +106,12 @@ def __init__(
106106
tol (float): Optional. Target error tolerance for the ALS phase of
107107
the algorithm.
108108
**kwargs: base class keyword argument values.
109+
110+
.. tip::
111+
112+
You can find additional parameters for initializing this class at
113+
:class:`~sagemaker.estimator.amazon_estimator.AmazonAlgorithmEstimatorBase` and
114+
:class:`~sagemaker.estimator.EstimatorBase`.
109115
"""
110116
# this algorithm only supports single instance training
111117
if kwargs.pop("train_instance_count", 1) != 1:

src/sagemaker/amazon/linear_learner.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
1+
# Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License"). You
44
# may not use this file except in compliance with the License. A copy of
@@ -318,6 +318,12 @@ def __init__(
318318
which give each class equal importance in the loss function. Only used when
319319
predictor_type is multiclass_classifier.
320320
**kwargs: base class keyword argument values.
321+
322+
.. tip::
323+
324+
You can find additional parameters for initializing this class at
325+
:class:`~sagemaker.estimator.amazon_estimator.AmazonAlgorithmEstimatorBase` and
326+
:class:`~sagemaker.estimator.EstimatorBase`.
321327
"""
322328
super(LinearLearner, self).__init__(
323329
role, train_instance_count, train_instance_type, **kwargs

src/sagemaker/amazon/ntm.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
1+
# Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License"). You
44
# may not use this file except in compliance with the License. A copy of
@@ -139,6 +139,12 @@ def __init__(
139139
regularization.
140140
learning_rate (float): Optional. Learning rate for the optimizer.
141141
**kwargs: base class keyword argument values.
142+
143+
.. tip::
144+
145+
You can find additional parameters for initializing this class at
146+
:class:`~sagemaker.estimator.amazon_estimator.AmazonAlgorithmEstimatorBase` and
147+
:class:`~sagemaker.estimator.EstimatorBase`.
142148
"""
143149

144150
super(NTM, self).__init__(role, train_instance_count, train_instance_type, **kwargs)

src/sagemaker/amazon/object2vec.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
1+
# Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License"). You
44
# may not use this file except in compliance with the License. A copy of
@@ -255,6 +255,12 @@ def __init__(
255255
enc1_freeze_pretrained_embedding (bool): Optional. Freeze pretrained
256256
embedding weights
257257
**kwargs: base class keyword argument values.
258+
259+
.. tip::
260+
261+
You can find additional parameters for initializing this class at
262+
:class:`~sagemaker.estimator.amazon_estimator.AmazonAlgorithmEstimatorBase` and
263+
:class:`~sagemaker.estimator.EstimatorBase`.
258264
"""
259265

260266
super(Object2Vec, self).__init__(role, train_instance_count, train_instance_type, **kwargs)

src/sagemaker/amazon/pca.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
1+
# Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License"). You
44
# may not use this file except in compliance with the License. A copy of
@@ -113,6 +113,12 @@ def __init__(
113113
default value equal to the maximum of 10 and num_components will
114114
be used. Valid for randomized mode only.
115115
**kwargs: base class keyword argument values.
116+
117+
.. tip::
118+
119+
You can find additional parameters for initializing this class at
120+
:class:`~sagemaker.estimator.amazon_estimator.AmazonAlgorithmEstimatorBase` and
121+
:class:`~sagemaker.estimator.EstimatorBase`.
116122
"""
117123
super(PCA, self).__init__(role, train_instance_count, train_instance_type, **kwargs)
118124
self.num_components = num_components

src/sagemaker/amazon/randomcutforest.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
1+
# Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License"). You
44
# may not use this file except in compliance with the License. A copy of
@@ -104,6 +104,12 @@ def __init__(
104104
precision, recall, and f1 scores. If test data is provided, the
105105
score shall be reported in terms of all requested metrics.
106106
**kwargs: base class keyword argument values.
107+
108+
.. tip::
109+
110+
You can find additional parameters for initializing this class at
111+
:class:`~sagemaker.estimator.amazon_estimator.AmazonAlgorithmEstimatorBase` and
112+
:class:`~sagemaker.estimator.EstimatorBase`.
107113
"""
108114

109115
super(RandomCutForest, self).__init__(

0 commit comments

Comments
 (0)