Updates the MLModelName and the ScoreThreshold of an MLModel.
You can use the GetMLModel operation to view the contents of the updated data element.
Parameters:
-
ml_model_id
(EntityId)
–
The ID assigned to the MLModel during creation.
-
ml_model_name
(Optional[EntityName], default:
None
)
–
A user-supplied name or description of the MLModel.
-
score_threshold
(Optional[ScoreThreshold], default:
None
)
–
The ScoreThreshold used in binary classification MLModel that marks the boundary between a positive prediction and a negative prediction.
Output values greater than or equal to the ScoreThreshold receive a positive result from the MLModel, such as true. Output values less than the ScoreThreshold receive a negative response from the MLModel, such as false.
Raises:
Source code in docs_src/capo_machine_learning/_services/async_machine_learning.py
| async def update_ml_model(
self,
ml_model_id: "capo_machine_learning.types.entity_id.EntityId",
*,
config_overrides: Optional[AsyncMachineLearningClientConfig] = None,
ml_model_name: Optional[
"capo_machine_learning.types.entity_name.EntityName"
] = None,
score_threshold: Optional[
"capo_machine_learning.types.score_threshold.ScoreThreshold"
] = None,
) -> "capo_machine_learning.types.update_ml_model_output.UpdateMLModelOutput":
"""<p>Updates the <code>MLModelName</code> and the <code>ScoreThreshold</code> of an <code>MLModel</code>.</p> <p>You can use the <code>GetMLModel</code> operation to view the contents of the updated data element.</p>
Args:
ml_model_id: <p>The ID assigned to the <code>MLModel</code> during creation.</p>
ml_model_name: <p>A user-supplied name or description of the <code>MLModel</code>.</p>
score_threshold: <p>The <code>ScoreThreshold</code> used in binary classification <code>MLModel</code> that marks the boundary between a positive prediction and a negative prediction.</p> <p>Output values greater than or equal to the <code>ScoreThreshold</code> receive a positive result from the <code>MLModel</code>, such as <code>true</code>. Output values less than the <code>ScoreThreshold</code> receive a negative response from the <code>MLModel</code>, such as <code>false</code>.</p>
Raises:
capo_machine_learning.errors.internal_server_exception.InternalServerException: <p>An error on the server occurred when trying to process a request.</p>
capo_machine_learning.errors.invalid_input_exception.InvalidInputException: <p>An error on the client occurred. Typically, the cause is an invalid input value.</p>
capo_machine_learning.errors.resource_not_found_exception.ResourceNotFoundException: <p>A specified resource cannot be located.</p>
capo_machine_learning.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_machine_learning.types.update_ml_model_input.UpdateMLModelInput]",
) -> AsyncOperationResponse[
"capo_machine_learning.types.update_ml_model_output.UpdateMLModelOutput"
]:
import capo_machine_learning._operations.amazon_ml_20141212.update_ml_model
(
output,
http_response,
) = await capo_machine_learning._operations.amazon_ml_20141212.update_ml_model.async_update_ml_model(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("UpdateMLModel")
)
input_: capo_machine_learning.types.update_ml_model_input.UpdateMLModelInput = {
"ml_model_id": ml_model_id
}
if ml_model_name is not None:
input_["ml_model_name"] = ml_model_name
if score_threshold is not None:
input_["score_threshold"] = score_threshold
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|