Skip to content

update_retraining_scheduler async

update_retraining_scheduler(
    model_name: ModelName,
    *,
    config_overrides: Optional[AsyncLookoutEquipmentClientConfig] = None,
    retraining_start_date: Optional[Timestamp] = None,
    retraining_frequency: Optional[RetrainingFrequency] = None,
    lookback_window: Optional[LookbackWindow] = None,
    promote_mode: Optional[ModelPromoteMode] = None,
) -> None

Updates a retraining scheduler.

Parameters:

  • model_name (ModelName) –

    The name of the model whose retraining scheduler you want to update.

  • retraining_start_date (Optional[Timestamp], default: None ) –

    The start date for the retraining scheduler. Lookout for Equipment truncates the time you provide to the nearest UTC day.

  • retraining_frequency (Optional[RetrainingFrequency], default: None ) –

    This parameter uses the ISO 8601 standard to set the frequency at which you want retraining to occur in terms of Years, Months, and/or Days (note: other parameters like Time are not currently supported). The minimum value is 30 days (P30D) and the maximum value is 1 year (P1Y). For example, the following values are valid:

    • P3M15D – Every 3 months and 15 days

    • P2M – Every 2 months

    • P150D – Every 150 days

  • lookback_window (Optional[LookbackWindow], default: None ) –

    The number of past days of data that will be used for retraining.

  • promote_mode (Optional[ModelPromoteMode], default: None ) –

    Indicates how the service will use new models. In MANAGED mode, new models will automatically be used for inference if they have better performance than the current model. In MANUAL mode, the new models will not be used until they are manually activated.

Raises:

  • AccessDeniedException –

    The request could not be completed because you do not have access to the resource.

  • ConflictException –

    The request could not be completed due to a conflict with the current state of the target resource.

  • InternalServerException –

    Processing of the request has failed because of an unknown error, exception or failure.

  • ResourceNotFoundException –

    The resource requested could not be found. Verify the resource ID and retry your request.

  • ThrottlingException –

    The request was denied due to request throttling.

  • ValidationException –

    The input fails to satisfy constraints specified by Amazon Lookout for Equipment or a related Amazon Web Services service that's being utilized.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

Updates a retraining scheduler

>>> await client.update_retraining_scheduler(model_name='sample-model', retraining_start_date='2024-01-01T00:00:00Z', retraining_frequency='P1Y')
Source code in docs_src/capo_lookoutequipment/_services/async_lookout_equipment.py
async def update_retraining_scheduler(
    self,
    model_name: "capo_lookoutequipment.types.model_name.ModelName",
    *,
    config_overrides: Optional[AsyncLookoutEquipmentClientConfig] = None,
    retraining_start_date: Optional[
        "capo_lookoutequipment.types.timestamp.Timestamp"
    ] = None,
    retraining_frequency: Optional[
        "capo_lookoutequipment.types.retraining_frequency.RetrainingFrequency"
    ] = None,
    lookback_window: Optional[
        "capo_lookoutequipment.types.lookback_window.LookbackWindow"
    ] = None,
    promote_mode: Optional[
        "capo_lookoutequipment.types.model_promote_mode.ModelPromoteMode"
    ] = None,
) -> None:
    """<p>Updates a retraining scheduler. </p>

    Args:
        model_name: <p>The name of the model whose retraining scheduler you want to update. </p>
        retraining_start_date: <p>The start date for the retraining scheduler. Lookout for Equipment truncates the time you provide to the nearest UTC day.</p>
        retraining_frequency: <p>This parameter uses the <a href="https://en.wikipedia.org/wiki/ISO_8601#Durations">ISO 8601</a> standard to set the frequency at which you want retraining to occur in terms of Years, Months, and/or Days (note: other parameters like Time are not currently supported). The minimum value is 30 days (P30D) and the maximum value is 1 year (P1Y). For example, the following values are valid:</p> <ul> <li> <p>P3M15D – Every 3 months and 15 days</p> </li> <li> <p>P2M – Every 2 months</p> </li> <li> <p>P150D – Every 150 days</p> </li> </ul>
        lookback_window: <p>The number of past days of data that will be used for retraining.</p>
        promote_mode: <p>Indicates how the service will use new models. In <code>MANAGED</code> mode, new models will automatically be used for inference if they have better performance than the current model. In <code>MANUAL</code> mode, the new models will not be used <a href="https://docs.aws.amazon.com/lookout-for-equipment/latest/ug/versioning-model.html#model-activation">until they are manually activated</a>.</p>

    Raises:
        capo_lookoutequipment.errors.access_denied_exception.AccessDeniedException: <p>The request could not be completed because you do not have access to the resource. </p>
        capo_lookoutequipment.errors.conflict_exception.ConflictException: <p> The request could not be completed due to a conflict with the current state of the target resource. </p>
        capo_lookoutequipment.errors.internal_server_exception.InternalServerException: <p> Processing of the request has failed because of an unknown error, exception or failure. </p>
        capo_lookoutequipment.errors.resource_not_found_exception.ResourceNotFoundException: <p> The resource requested could not be found. Verify the resource ID and retry your request. </p>
        capo_lookoutequipment.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_lookoutequipment.errors.validation_exception.ValidationException: <p> The input fails to satisfy constraints specified by Amazon Lookout for Equipment or a related Amazon Web Services service that's being utilized. </p>
        capo_lookoutequipment.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Updates a retraining scheduler

        >>> await client.update_retraining_scheduler(model_name='sample-model', retraining_start_date='2024-01-01T00:00:00Z', retraining_frequency='P1Y')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_lookoutequipment.types.update_retraining_scheduler_request.UpdateRetrainingSchedulerRequest]",
    ) -> AsyncOperationResponse[None]:
        import capo_lookoutequipment._operations.aws_lookout_equipment_frontend_service.update_retraining_scheduler

        (
            output,
            http_response,
        ) = await capo_lookoutequipment._operations.aws_lookout_equipment_frontend_service.update_retraining_scheduler.async_update_retraining_scheduler(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateRetrainingScheduler")
    )
    input_: capo_lookoutequipment.types.update_retraining_scheduler_request.UpdateRetrainingSchedulerRequest = {
        "model_name": model_name
    }
    if retraining_start_date is not None:
        input_["retraining_start_date"] = retraining_start_date
    if retraining_frequency is not None:
        input_["retraining_frequency"] = retraining_frequency
    if lookback_window is not None:
        input_["lookback_window"] = lookback_window
    if promote_mode is not None:
        input_["promote_mode"] = promote_mode

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output