File tree Expand file tree Collapse file tree 2 files changed +62
-0
lines changed Expand file tree Collapse file tree 2 files changed +62
-0
lines changed Original file line number Diff line number Diff line change 23
23
import logging
24
24
from textwrap import dedent
25
25
from typing import Dict , List , Optional
26
+
26
27
import attr
27
28
28
29
from six .moves .urllib .parse import urlparse
Original file line number Diff line number Diff line change @@ -81,3 +81,64 @@ def __init__(
81
81
tags ,
82
82
network_config ,
83
83
)
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
+ )
You can’t perform that action at this time.
0 commit comments