361
361
"Timestamp" : datetime .datetime (2022 , 9 , 5 , 19 , 18 , 40 ),
362
362
},
363
363
],
364
- "HyperParameters" : [
365
- {
366
- "feature_dim" : "2" ,
367
- "mini_batch_size" : "10" ,
368
- "predictor_type" : "binary_classifier" ,
369
- },
370
- {
371
- "_kfold" : "5" ,
372
- "_tuning_objective_metric" : "validation:accuracy" ,
373
- "alpha" : "0.0037170512924477993" ,
374
- "colsample_bytree" : "0.7476726040667319" ,
375
- "eta" : "0.011391935592233605" ,
376
- "eval_metric" : "accuracy,f1,balanced_accuracy,precision_macro,recall_macro,mlogloss" ,
377
- "gamma" : "1.8903517751689445" ,
378
- "lambda" : "0.5098604662224621" ,
379
- "max_depth" : "3" ,
380
- "min_child_weight" : "5.081388147234708e-06" ,
381
- "num_class" : "28" ,
382
- "num_round" : "165" ,
383
- "objective" : "multi:softprob" ,
384
- "subsample" : "0.8828549481113146" ,
385
- },
386
- ],
364
+ "HyperParameters" : {
365
+ "_kfold" : "5" ,
366
+ "_tuning_objective_metric" : "validation:accuracy" ,
367
+ "alpha" : "0.0037170512924477993" ,
368
+ "colsample_bytree" : "0.7476726040667319" ,
369
+ "eta" : "0.011391935592233605" ,
370
+ "eval_metric" : "accuracy,f1,balanced_accuracy,precision_macro,recall_macro,mlogloss" ,
371
+ "gamma" : "1.8903517751689445" ,
372
+ "lambda" : "0.5098604662224621" ,
373
+ "max_depth" : "3" ,
374
+ "min_child_weight" : "5.081388147234708e-06" ,
375
+ "num_class" : "28" ,
376
+ "num_round" : "165" ,
377
+ "objective" : "multi:softprob" ,
378
+ "subsample" : "0.8828549481113146" ,
379
+ },
387
380
"CreatedBy" : {},
388
381
}
389
382
}
@@ -1065,7 +1058,7 @@ def test_training_details_autodiscovery_from_model_overview(
1065
1058
assert len (training_details .training_job_details .training_metrics ) == len (
1066
1059
SEARCH_TRAINING_JOB_EXAMPLE ["Results" ][0 ]["TrainingJob" ]["FinalMetricDataList" ]
1067
1060
)
1068
- assert len (training_details .training_job_details .training_metrics ) == len (
1061
+ assert len (training_details .training_job_details .hyper_parameters ) == len (
1069
1062
SEARCH_TRAINING_JOB_EXAMPLE ["Results" ][0 ]["TrainingJob" ]["HyperParameters" ]
1070
1063
)
1071
1064
assert training_details .training_job_details .training_environment .container_image == [
@@ -1097,8 +1090,10 @@ def test_training_details_autodiscovery_from_model_overview_autopilot(
1097
1090
model_overview = model_overview_example , sagemaker_session = session
1098
1091
)
1099
1092
1093
+ # There are 0 required keys in training_metrics field in SEARCH_TRAINING_JOB_AUTOPILOT_EXAMPLE has
1100
1094
assert len (training_details .training_job_details .training_metrics ) == 0
1101
- assert len (training_details .training_job_details .hyper_parameters ) == 0
1095
+ # There are 3 required keys in hyper_parameters field in SEARCH_TRAINING_JOB_AUTOPILOT_EXAMPLE has
1096
+ assert len (training_details .training_job_details .hyper_parameters ) == 3
1102
1097
1103
1098
1104
1099
@patch ("sagemaker.Session" )
@@ -1115,7 +1110,7 @@ def test_training_details_autodiscovery_from_job_name(session):
1115
1110
assert len (training_details .training_job_details .training_metrics ) == len (
1116
1111
SEARCH_TRAINING_JOB_EXAMPLE ["Results" ][0 ]["TrainingJob" ]["FinalMetricDataList" ]
1117
1112
)
1118
- assert len (training_details .training_job_details .training_metrics ) == len (
1113
+ assert len (training_details .training_job_details .hyper_parameters ) == len (
1119
1114
SEARCH_TRAINING_JOB_EXAMPLE ["Results" ][0 ]["TrainingJob" ]["HyperParameters" ]
1120
1115
)
1121
1116
assert training_details .training_job_details .training_environment .container_image == [
0 commit comments