updateRetrainingScheduler method

Future<void> updateRetrainingScheduler({
  1. required String modelName,
  2. String? lookbackWindow,
  3. ModelPromoteMode? promoteMode,
  4. String? retrainingFrequency,
  5. DateTime? retrainingStartDate,
})

Updates a retraining scheduler.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

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

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

Parameter promoteMode : 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.

Parameter retrainingFrequency : 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

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

Implementation

Future<void> updateRetrainingScheduler({
  required String modelName,
  String? lookbackWindow,
  ModelPromoteMode? promoteMode,
  String? retrainingFrequency,
  DateTime? retrainingStartDate,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target':
        'AWSLookoutEquipmentFrontendService.UpdateRetrainingScheduler'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ModelName': modelName,
      if (lookbackWindow != null) 'LookbackWindow': lookbackWindow,
      if (promoteMode != null) 'PromoteMode': promoteMode.value,
      if (retrainingFrequency != null)
        'RetrainingFrequency': retrainingFrequency,
      if (retrainingStartDate != null)
        'RetrainingStartDate': unixTimestampToJson(retrainingStartDate),
    },
  );
}