Skip to content

delete_hyper_parameter_tuning_job

delete_hyper_parameter_tuning_job(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    hyper_parameter_tuning_job_name: Optional[HyperParameterTuningJobName] = None,
) -> None

Deletes a hyperparameter tuning job. The DeleteHyperParameterTuningJob API deletes only the tuning job entry that was created in SageMaker when you called the CreateHyperParameterTuningJob API. It does not delete training jobs, artifacts, or the IAM role that you specified when creating the model.

Parameters:

Raises:

Source code in docs_src/capo_sagemaker/_services/sage_maker.py
def delete_hyper_parameter_tuning_job(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    hyper_parameter_tuning_job_name: Optional[
        "capo_sagemaker.types.hyper_parameter_tuning_job_name.HyperParameterTuningJobName"
    ] = None,
) -> None:
    """<p>Deletes a hyperparameter tuning job. The <code>DeleteHyperParameterTuningJob</code> API deletes only the tuning job entry that was created in SageMaker when you called the <code>CreateHyperParameterTuningJob</code> API. It does not delete training jobs, artifacts, or the IAM role that you specified when creating the model.</p>

    Args:
        hyper_parameter_tuning_job_name: <p>The name of the hyperparameter tuning job that you want to delete.</p>

    Raises:
        capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_sagemaker.types.delete_hyper_parameter_tuning_job_request.DeleteHyperParameterTuningJobRequest]",
    ) -> OperationResponse[None]:
        import capo_sagemaker._operations.sage_maker.delete_hyper_parameter_tuning_job

        output, http_response = (
            capo_sagemaker._operations.sage_maker.delete_hyper_parameter_tuning_job.delete_hyper_parameter_tuning_job(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteHyperParameterTuningJob")
    )
    input_: capo_sagemaker.types.delete_hyper_parameter_tuning_job_request.DeleteHyperParameterTuningJobRequest = {}
    if hyper_parameter_tuning_job_name is not None:
        input_["hyper_parameter_tuning_job_name"] = hyper_parameter_tuning_job_name

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output