def METHOD_NAME(sagemaker_session, cpu_instance_type, training_set):
    job_name = unique_name_from_base("pca")
    with timeout(minutes=5):
        pca = sagemaker.amazon.pca.PCA(
            role="SageMakerRole",
            instance_count=1,
            instance_type=cpu_instance_type,
            num_components=48,
            sagemaker_session=sagemaker_session,
            base_job_name="test-pca",
        )
        pca.algorithm_mode = "randomized"
        pca.subtract_mean = True
        pca.extra_components = 5
        pca.fit(pca.record_set(training_set[0][:100]), wait=False, job_name=job_name)
        print("Detached from training job. Will re-attach in 20 seconds")
        time.sleep(20)
    with timeout_and_delete_endpoint_by_name(job_name, sagemaker_session):
        estimator = sagemaker.amazon.pca.PCA.attach(
            training_job_name=job_name, sagemaker_session=sagemaker_session
        )
        model = sagemaker.amazon.pca.PCAModel(
            estimator.model_data, role="SageMakerRole", sagemaker_session=sagemaker_session
        )
        predictor = model.deploy(
            initial_instance_count=1, instance_type=cpu_instance_type, endpoint_name=job_name
        )
        result = predictor.predict(training_set[0][:5])
        assert len(result) == 5
        for record in result:
            assert record.label["projection"] is not None