def test_auto_ml_input_object_fit(sagemaker_session): auto_ml = AutoML( role=ROLE, target_attribute_name=TARGET_ATTRIBUTE_NAME, sagemaker_session=sagemaker_session, max_candidates=1, ) job_name = unique_name_from_base("auto-ml", max_length=32) s3_input = sagemaker_session.upload_data(path=TRAINING_DATA, key_prefix=PREFIX + "/input") inputs = AutoMLInput(inputs=s3_input, target_attribute_name=TARGET_ATTRIBUTE_NAME) with timeout(minutes=AUTO_ML_DEFAULT_TIMEMOUT_MINUTES): auto_ml.fit(inputs, job_name=job_name)
def test_auto_ml_input(sagemaker_session): inputs = AutoMLInput( inputs=DEFAULT_S3_INPUT_DATA, target_attribute_name="target", compression="Gzip" ) auto_ml = AutoML( role=ROLE, target_attribute_name=TARGET_ATTRIBUTE_NAME, sagemaker_session=sagemaker_session ) auto_ml.fit(inputs) _, args = sagemaker_session.auto_ml.call_args assert args["input_config"] == [ { "CompressionType": "Gzip", "DataSource": { "S3DataSource": {"S3DataType": "S3Prefix", "S3Uri": DEFAULT_S3_INPUT_DATA} }, "TargetAttributeName": TARGET_ATTRIBUTE_NAME, } ]