@@ -63,7 +63,7 @@ def __init__(
63
63
self .generate_candidate_definitions_only = generate_candidate_definitions_only
64
64
self .tags = tags
65
65
66
- self ._current_job_name = None
66
+ self .current_job_name = None
67
67
self ._auto_ml_job_desc = None
68
68
self ._best_candidate = None
69
69
self .sagemaker_session = sagemaker_session or Session ()
@@ -111,7 +111,7 @@ def describe_auto_ml_job(self, job_name=None):
111
111
dict: A dictionary response with the AutoML Job description.
112
112
"""
113
113
if job_name is None :
114
- job_name = self ._current_job_name
114
+ job_name = self .current_job_name
115
115
self ._auto_ml_job_desc = self .sagemaker_session .describe_auto_ml_job (job_name )
116
116
return self ._auto_ml_job_desc
117
117
@@ -128,7 +128,7 @@ def best_candidate(self, job_name=None):
128
128
return self ._best_candidate
129
129
130
130
if job_name is None :
131
- job_name = self ._current_job_name
131
+ job_name = self .current_job_name
132
132
if self ._auto_ml_job_desc is None :
133
133
self ._auto_ml_job_desc = self .sagemaker_session .describe_auto_ml_job (job_name )
134
134
elif self ._auto_ml_job_desc ["AutoMLJobName" ] != job_name :
@@ -168,7 +168,7 @@ def list_candidates(
168
168
list: A list of dictionaries with candidates information
169
169
"""
170
170
if job_name is None :
171
- job_name = self ._current_job_name
171
+ job_name = self .current_job_name
172
172
173
173
list_candidates_args = {"job_name" : job_name }
174
174
@@ -249,6 +249,7 @@ def deploy(
249
249
candidate = CandidateEstimator (candidate , sagemaker_session = sagemaker_session )
250
250
251
251
inference_containers = candidate .containers
252
+ endpoint_name = endpoint_name or self .current_job_name
252
253
253
254
return self ._deploy_inference_pipeline (
254
255
inference_containers ,
@@ -373,14 +374,14 @@ def _prepare_for_auto_ml_job(self, job_name=None):
373
374
created from base_job_name or "sagemaker-auto-ml".
374
375
"""
375
376
if job_name is not None :
376
- self ._current_job_name = job_name
377
+ self .current_job_name = job_name
377
378
else :
378
379
if self .base_job_name :
379
380
base_name = self .base_job_name
380
381
else :
381
382
base_name = "sagemaker-auto-ml"
382
383
# CreateAutoMLJob API validates that member length less than or equal to 32
383
- self ._current_job_name = name_from_base (base_name , max_length = 32 )
384
+ self .current_job_name = name_from_base (base_name , max_length = 32 )
384
385
385
386
if self .output_path is None :
386
387
self .output_path = "s3://{}/" .format (self .sagemaker_session .default_bucket ())
@@ -426,6 +427,7 @@ class AutoMLJob(_Job):
426
427
427
428
def __init__ (self , sagemaker_session , job_name , inputs ):
428
429
self .inputs = inputs
430
+ self .job_name = job_name
429
431
super (AutoMLJob , self ).__init__ (sagemaker_session = sagemaker_session , job_name = job_name )
430
432
431
433
@classmethod
@@ -444,13 +446,13 @@ def start_new(cls, auto_ml, inputs):
444
446
"""
445
447
config = cls ._load_config (inputs , auto_ml )
446
448
auto_ml_args = config .copy ()
447
- auto_ml_args ["job_name" ] = auto_ml ._current_job_name
449
+ auto_ml_args ["job_name" ] = auto_ml .current_job_name
448
450
auto_ml_args ["problem_type" ] = auto_ml .problem_type
449
451
auto_ml_args ["job_objective" ] = auto_ml .job_objective
450
452
auto_ml_args ["tags" ] = auto_ml .tags
451
453
452
454
auto_ml .sagemaker_session .auto_ml (** auto_ml_args )
453
- return cls (auto_ml .sagemaker_session , auto_ml ._current_job_name , inputs )
455
+ return cls (auto_ml .sagemaker_session , auto_ml .current_job_name , inputs )
454
456
455
457
@classmethod
456
458
def _load_config (cls , inputs , auto_ml , expand_role = True , validate_uri = True ):
0 commit comments