Skip to content

Commit 091c66f

Browse files
chuyang-dengChuyang Deng
andauthored
doc: update 1p estimators class description (#1820)
* doc: update 1p estimators class description * follow pep-0257 * add doctrings to args of model classes Co-authored-by: Chuyang Deng <[email protected]>
1 parent fe4ef44 commit 091c66f

File tree

11 files changed

+187
-52
lines changed

11 files changed

+187
-52
lines changed

src/sagemaker/amazon/factorization_machines.py

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@
2525

2626

2727
class FactorizationMachines(AmazonAlgorithmEstimatorBase):
28-
"""Placeholder docstring"""
28+
"""A supervised learning algorithm used in classification and regression.
29+
30+
Factorization Machines combine the advantages of Support Vector Machines
31+
with factorization models. It is an extension of a linear model that is
32+
designed to capture interactions between features within high dimensional
33+
sparse datasets economically."""
2934

3035
repo_name = "factorization-machines"
3136
repo_version = 1
@@ -304,10 +309,19 @@ class FactorizationMachinesModel(Model):
304309
def __init__(self, model_data, role, sagemaker_session=None, **kwargs):
305310
"""
306311
Args:
307-
model_data:
308-
role:
309-
sagemaker_session:
310-
**kwargs:
312+
model_data (str): The S3 location of a SageMaker model data
313+
``.tar.gz`` file.
314+
role (str): An AWS IAM role (either name or full ARN). The Amazon
315+
SageMaker training jobs and APIs that create Amazon SageMaker
316+
endpoints use this role to access training data and model
317+
artifacts. After the endpoint is created, the inference code
318+
might use the IAM role, if it needs to access an AWS resource.
319+
sagemaker_session (sagemaker.session.Session): Session object which
320+
manages interactions with Amazon SageMaker APIs and any other
321+
AWS services needed. If not specified, the estimator creates one
322+
using the default AWS configuration chain.
323+
**kwargs: Keyword arguments passed to the ``FrameworkModel``
324+
initializer.
311325
"""
312326
sagemaker_session = sagemaker_session or Session()
313327
image_uri = image_uris.retrieve(

src/sagemaker/amazon/hyperparameter.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@
1717

1818

1919
class Hyperparameter(object):
20-
"""An algorithm hyperparameter with optional validation. Implemented as a
21-
python descriptor object.
20+
"""An algorithm hyperparameter with optional validation.
21+
22+
Implemented as a python descriptor object.
2223
"""
2324

2425
def __init__(self, name, validate=lambda _: True, validation_message="", data_type=str):

src/sagemaker/amazon/ipinsights.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@
2626

2727

2828
class IPInsights(AmazonAlgorithmEstimatorBase):
29-
"""Placeholder docstring"""
29+
"""An unsupervised learning algorithm that learns the usage patterns for IPv4 addresses.
30+
31+
It is designed to capture associations between IPv4 addresses and various entities, such
32+
as user IDs or account numbers."""
3033

3134
repo_name = "ipinsights"
3235
repo_version = 1
@@ -214,10 +217,19 @@ class IPInsightsModel(Model):
214217
def __init__(self, model_data, role, sagemaker_session=None, **kwargs):
215218
"""
216219
Args:
217-
model_data:
218-
role:
219-
sagemaker_session:
220-
**kwargs:
220+
model_data (str): The S3 location of a SageMaker model data
221+
``.tar.gz`` file.
222+
role (str): An AWS IAM role (either name or full ARN). The Amazon
223+
SageMaker training jobs and APIs that create Amazon SageMaker
224+
endpoints use this role to access training data and model
225+
artifacts. After the endpoint is created, the inference code
226+
might use the IAM role, if it needs to access an AWS resource.
227+
sagemaker_session (sagemaker.session.Session): Session object which
228+
manages interactions with Amazon SageMaker APIs and any other
229+
AWS services needed. If not specified, the estimator creates one
230+
using the default AWS configuration chain.
231+
**kwargs: Keyword arguments passed to the ``FrameworkModel``
232+
initializer.
221233
"""
222234
sagemaker_session = sagemaker_session or Session()
223235
image_uri = image_uris.retrieve(

src/sagemaker/amazon/kmeans.py

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@
2525

2626

2727
class KMeans(AmazonAlgorithmEstimatorBase):
28-
"""Placeholder docstring"""
28+
"""An unsupervised learning algorithm that attempts to find discrete groupings within data.
29+
30+
As the result of KMeans, members of a group are as similar as possible to one another and as
31+
different as possible from members of other groups. You define the attributes that you want
32+
the algorithm to use to determine similarity. """
2933

3034
repo_name = "kmeans"
3135
repo_version = 1
@@ -237,10 +241,19 @@ class KMeansModel(Model):
237241
def __init__(self, model_data, role, sagemaker_session=None, **kwargs):
238242
"""
239243
Args:
240-
model_data:
241-
role:
242-
sagemaker_session:
243-
**kwargs:
244+
model_data (str): The S3 location of a SageMaker model data
245+
``.tar.gz`` file.
246+
role (str): An AWS IAM role (either name or full ARN). The Amazon
247+
SageMaker training jobs and APIs that create Amazon SageMaker
248+
endpoints use this role to access training data and model
249+
artifacts. After the endpoint is created, the inference code
250+
might use the IAM role, if it needs to access an AWS resource.
251+
sagemaker_session (sagemaker.session.Session): Session object which
252+
manages interactions with Amazon SageMaker APIs and any other
253+
AWS services needed. If not specified, the estimator creates one
254+
using the default AWS configuration chain.
255+
**kwargs: Keyword arguments passed to the ``FrameworkModel``
256+
initializer.
244257
"""
245258
sagemaker_session = sagemaker_session or Session()
246259
image_uri = image_uris.retrieve(

src/sagemaker/amazon/knn.py

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@
2525

2626

2727
class KNN(AmazonAlgorithmEstimatorBase):
28-
"""Placeholder docstring"""
28+
"""An index-based algorithm. It uses a non-parametric method for classification or regression.
29+
30+
For classification problems, the algorithm queries the k points that are closest to the sample
31+
point and returns the most frequently used label of their class as the predicted label. For
32+
regression problems, the algorithm queries the k closest points to the sample point and returns
33+
the average of their feature values as the predicted value."""
2934

3035
repo_name = "knn"
3136
repo_version = 1
@@ -225,10 +230,19 @@ class KNNModel(Model):
225230
def __init__(self, model_data, role, sagemaker_session=None, **kwargs):
226231
"""
227232
Args:
228-
model_data:
229-
role:
230-
sagemaker_session:
231-
**kwargs:
233+
model_data (str): The S3 location of a SageMaker model data
234+
``.tar.gz`` file.
235+
role (str): An AWS IAM role (either name or full ARN). The Amazon
236+
SageMaker training jobs and APIs that create Amazon SageMaker
237+
endpoints use this role to access training data and model
238+
artifacts. After the endpoint is created, the inference code
239+
might use the IAM role, if it needs to access an AWS resource.
240+
sagemaker_session (sagemaker.session.Session): Session object which
241+
manages interactions with Amazon SageMaker APIs and any other
242+
AWS services needed. If not specified, the estimator creates one
243+
using the default AWS configuration chain.
244+
**kwargs: Keyword arguments passed to the ``FrameworkModel``
245+
initializer.
232246
"""
233247
sagemaker_session = sagemaker_session or Session()
234248
image_uri = image_uris.retrieve(

src/sagemaker/amazon/lda.py

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@
2525

2626

2727
class LDA(AmazonAlgorithmEstimatorBase):
28-
"""Placeholder docstring"""
28+
"""An unsupervised learning algorithm attempting to describe data as distinct categories.
29+
30+
LDA is most commonly used to discover a
31+
user-specified number of topics shared by documents within a text corpus. Here each
32+
observation is a document, the features are the presence (or occurrence count) of each
33+
word, and the categories are the topics."""
2934

3035
repo_name = "lda"
3136
repo_version = 1
@@ -209,10 +214,19 @@ class LDAModel(Model):
209214
def __init__(self, model_data, role, sagemaker_session=None, **kwargs):
210215
"""
211216
Args:
212-
model_data:
213-
role:
214-
sagemaker_session:
215-
**kwargs:
217+
model_data (str): The S3 location of a SageMaker model data
218+
``.tar.gz`` file.
219+
role (str): An AWS IAM role (either name or full ARN). The Amazon
220+
SageMaker training jobs and APIs that create Amazon SageMaker
221+
endpoints use this role to access training data and model
222+
artifacts. After the endpoint is created, the inference code
223+
might use the IAM role, if it needs to access an AWS resource.
224+
sagemaker_session (sagemaker.session.Session): Session object which
225+
manages interactions with Amazon SageMaker APIs and any other
226+
AWS services needed. If not specified, the estimator creates one
227+
using the default AWS configuration chain.
228+
**kwargs: Keyword arguments passed to the ``FrameworkModel``
229+
initializer.
216230
"""
217231
sagemaker_session = sagemaker_session or Session()
218232
image_uri = image_uris.retrieve(

src/sagemaker/amazon/linear_learner.py

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,14 @@
2525

2626

2727
class LinearLearner(AmazonAlgorithmEstimatorBase):
28-
"""Placeholder docstring"""
28+
"""A supervised learning algorithms used for solving classification or regression problems.
29+
30+
For input, you give the model labeled examples (x, y). x is a high-dimensional vector and
31+
y is a numeric label. For binary classification problems, the label must be either 0 or 1.
32+
For multiclass classification problems, the labels must be from 0 to num_classes - 1. For
33+
regression problems, y is a real number. The algorithm learns a linear function, or, for
34+
classification problems, a linear threshold function, and maps a vector x to an approximation
35+
of the label y."""
2936

3037
repo_name = "linear-learner"
3138
repo_version = 1
@@ -468,10 +475,19 @@ class LinearLearnerModel(Model):
468475
def __init__(self, model_data, role, sagemaker_session=None, **kwargs):
469476
"""
470477
Args:
471-
model_data:
472-
role:
473-
sagemaker_session:
474-
**kwargs:
478+
model_data (str): The S3 location of a SageMaker model data
479+
``.tar.gz`` file.
480+
role (str): An AWS IAM role (either name or full ARN). The Amazon
481+
SageMaker training jobs and APIs that create Amazon SageMaker
482+
endpoints use this role to access training data and model
483+
artifacts. After the endpoint is created, the inference code
484+
might use the IAM role, if it needs to access an AWS resource.
485+
sagemaker_session (sagemaker.session.Session): Session object which
486+
manages interactions with Amazon SageMaker APIs and any other
487+
AWS services needed. If not specified, the estimator creates one
488+
using the default AWS configuration chain.
489+
**kwargs: Keyword arguments passed to the ``FrameworkModel``
490+
initializer.
475491
"""
476492
sagemaker_session = sagemaker_session or Session()
477493
image_uri = image_uris.retrieve(

src/sagemaker/amazon/ntm.py

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@
2525

2626

2727
class NTM(AmazonAlgorithmEstimatorBase):
28-
"""Placeholder docstring"""
28+
"""An unsupervised learning algorithm used to organize a corpus of documents into topics
29+
30+
The resulting topics contain word groupings based on their statistical distribution.
31+
Documents that contain frequent occurrences of words such as "bike", "car", "train",
32+
"mileage", and "speed" are likely to share a topic on "transportation" for example."""
2933

3034
repo_name = "ntm"
3135
repo_version = 1
@@ -239,10 +243,19 @@ class NTMModel(Model):
239243
def __init__(self, model_data, role, sagemaker_session=None, **kwargs):
240244
"""
241245
Args:
242-
model_data:
243-
role:
244-
sagemaker_session:
245-
**kwargs:
246+
model_data (str): The S3 location of a SageMaker model data
247+
``.tar.gz`` file.
248+
role (str): An AWS IAM role (either name or full ARN). The Amazon
249+
SageMaker training jobs and APIs that create Amazon SageMaker
250+
endpoints use this role to access training data and model
251+
artifacts. After the endpoint is created, the inference code
252+
might use the IAM role, if it needs to access an AWS resource.
253+
sagemaker_session (sagemaker.session.Session): Session object which
254+
manages interactions with Amazon SageMaker APIs and any other
255+
AWS services needed. If not specified, the estimator creates one
256+
using the default AWS configuration chain.
257+
**kwargs: Keyword arguments passed to the ``FrameworkModel``
258+
initializer.
246259
"""
247260
sagemaker_session = sagemaker_session or Session()
248261
image_uri = image_uris.retrieve(

src/sagemaker/amazon/object2vec.py

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ def validate(value):
4141

4242

4343
class Object2Vec(AmazonAlgorithmEstimatorBase):
44-
"""Placeholder docstring"""
44+
"""A general-purpose neural embedding algorithm that is highly customizable.
45+
46+
It can learn low-dimensional dense embeddings of high-dimensional objects. The embeddings
47+
are learned in a way that preserves the semantics of the relationship between pairs of
48+
objects in the original space in the embedding space."""
4549

4650
repo_name = "object2vec"
4751
repo_version = 1
@@ -345,10 +349,19 @@ class Object2VecModel(Model):
345349
def __init__(self, model_data, role, sagemaker_session=None, **kwargs):
346350
"""
347351
Args:
348-
model_data:
349-
role:
350-
sagemaker_session:
351-
**kwargs:
352+
model_data (str): The S3 location of a SageMaker model data
353+
``.tar.gz`` file.
354+
role (str): An AWS IAM role (either name or full ARN). The Amazon
355+
SageMaker training jobs and APIs that create Amazon SageMaker
356+
endpoints use this role to access training data and model
357+
artifacts. After the endpoint is created, the inference code
358+
might use the IAM role, if it needs to access an AWS resource.
359+
sagemaker_session (sagemaker.session.Session): Session object which
360+
manages interactions with Amazon SageMaker APIs and any other
361+
AWS services needed. If not specified, the estimator creates one
362+
using the default AWS configuration chain.
363+
**kwargs: Keyword arguments passed to the ``FrameworkModel``
364+
initializer.
352365
"""
353366
sagemaker_session = sagemaker_session or Session()
354367
image_uri = image_uris.retrieve(

src/sagemaker/amazon/pca.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@
2525

2626

2727
class PCA(AmazonAlgorithmEstimatorBase):
28-
"""Placeholder docstring"""
28+
"""An unsupervised machine learning algorithm to reduce feature dimensionality.
29+
30+
As a result, number of features within a dataset is reduced but the dataset still
31+
retain as much information as possible."""
2932

3033
repo_name = "pca"
3134
repo_version = 1
@@ -221,10 +224,19 @@ class PCAModel(Model):
221224
def __init__(self, model_data, role, sagemaker_session=None, **kwargs):
222225
"""
223226
Args:
224-
model_data:
225-
role:
226-
sagemaker_session:
227-
**kwargs:
227+
model_data (str): The S3 location of a SageMaker model data
228+
``.tar.gz`` file.
229+
role (str): An AWS IAM role (either name or full ARN). The Amazon
230+
SageMaker training jobs and APIs that create Amazon SageMaker
231+
endpoints use this role to access training data and model
232+
artifacts. After the endpoint is created, the inference code
233+
might use the IAM role, if it needs to access an AWS resource.
234+
sagemaker_session (sagemaker.session.Session): Session object which
235+
manages interactions with Amazon SageMaker APIs and any other
236+
AWS services needed. If not specified, the estimator creates one
237+
using the default AWS configuration chain.
238+
**kwargs: Keyword arguments passed to the ``FrameworkModel``
239+
initializer.
228240
"""
229241
sagemaker_session = sagemaker_session or Session()
230242
image_uri = image_uris.retrieve(

0 commit comments

Comments
 (0)