@pytest.mark.skipif((tests.integ.test_region() in tests.integ.NO_AUTO_ML_REGIONS), reason='AutoML is not supported in the region yet.')
def test_create_model_best_candidate(sagemaker_session, cpu_instance_type):
    auto_ml_utils.create_auto_ml_job_if_not_exist(sagemaker_session)
    auto_ml = AutoML.attach(auto_ml_job_name=AUTO_ML_JOB_NAME, sagemaker_session=sagemaker_session)
    best_candidate = auto_ml.best_candidate()
    with timeout(minutes=5):
        pipeline_model = auto_ml.create_model(name=DEFAULT_MODEL_NAME, candidate=best_candidate, sagemaker_session=sagemaker_session, vpc_config=None, enable_network_isolation=False, model_kms_key=None, predictor_cls=None)
    inputs = sagemaker_session.upload_data(path=TRANSFORM_DATA, key_prefix=(PREFIX + '/transform_input'))
    pipeline_model.transformer(instance_count=1, instance_type=cpu_instance_type, assemble_with='Line', output_path='s3://{}/{}'.format(sagemaker_session.default_bucket(), 'transform_test'), accept='text/csv').transform(data=inputs, content_type='text/csv', split_type='Line', join_source='Input')
@pytest.mark.skipif((tests.integ.test_region() in tests.integ.NO_AUTO_ML_REGIONS), reason='AutoML is not supported in the region yet.')
def test_create_model_best_candidate(sagemaker_session, cpu_instance_type):
    auto_ml_utils.create_auto_ml_job_if_not_exist(sagemaker_session)
    auto_ml = AutoML.attach(auto_ml_job_name=AUTO_ML_JOB_NAME, sagemaker_session=sagemaker_session)
    best_candidate = auto_ml.best_candidate()
    with timeout(minutes=5):
        pipeline_model = auto_ml.create_model(name=DEFAULT_MODEL_NAME, candidate=best_candidate, sagemaker_session=sagemaker_session, vpc_config=None, enable_network_isolation=False, model_kms_key=None, predictor_cls=None)
    inputs = sagemaker_session.upload_data(path=TRANSFORM_DATA, key_prefix=(PREFIX + '/transform_input'))
    pipeline_model.transformer(instance_count=1, instance_type=cpu_instance_type, assemble_with='Line', output_path='s3://{}/{}'.format(sagemaker_session.default_bucket(), 'transform_test'), accept='text/csv').transform(data=inputs, content_type='text/csv', split_type='Line', join_source='Input')