Skip to content

Commit d78850e

Browse files
authored
Merge branch 'pr-framework-processor' into pr-framework-processor-round-02
2 parents 408d5a3 + 6721bfe commit d78850e

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed

src/sagemaker/processing.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import logging
2424
from textwrap import dedent
2525
from typing import Dict, List, Optional
26+
2627
import attr
2728

2829
from six.moves.urllib.parse import urlparse

src/sagemaker/sklearn/processing.py

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,64 @@ def __init__(
8181
tags,
8282
network_config,
8383
)
84+
85+
86+
class SKLearnProcessorAlt(FrameworkProcessor):
87+
"""Handles Amazon SageMaker processing tasks for jobs using scikit-learn containers."""
88+
89+
estimator_cls = SKLearn
90+
91+
def __init__(
92+
self,
93+
framework_version, # New arg
94+
s3_prefix, # New arg
95+
role,
96+
instance_count,
97+
instance_type,
98+
py_version="py3", # New kwarg
99+
image_uri=None,
100+
volume_size_in_gb=30,
101+
volume_kms_key=None,
102+
output_kms_key=None,
103+
max_runtime_in_seconds=None,
104+
base_job_name=None,
105+
sagemaker_session=None,
106+
env=None,
107+
tags=None,
108+
network_config=None,
109+
):
110+
"""This processor executes a Python script in a scikit-learn execution environment.
111+
112+
This class has an 'Alt' suffix to denote it as an alternative to built-in
113+
``sagemaker.sklearn.processing.SKLearnProcessor``.
114+
115+
Unless ``image_uri`` is specified, the scikit-learn environment is an
116+
Amazon-built Docker container that executes functions defined in the supplied
117+
``entry_point`` Python script.
118+
119+
The arguments have the exact same meaning as in ``FrameworkProcessor``.
120+
121+
.. tip::
122+
123+
You can find additional parameters for initializing this class at
124+
:class:`~smallmatter.ds.FrameworkProcessor`.
125+
"""
126+
super().__init__(
127+
self.estimator_cls,
128+
framework_version,
129+
s3_prefix,
130+
role,
131+
instance_count,
132+
instance_type,
133+
py_version,
134+
image_uri,
135+
volume_size_in_gb,
136+
volume_kms_key,
137+
output_kms_key,
138+
max_runtime_in_seconds,
139+
base_job_name,
140+
sagemaker_session,
141+
env,
142+
tags,
143+
network_config,
144+
)

0 commit comments

Comments
 (0)