getAccuracyMetrics method

Future<GetAccuracyMetricsResponse> getAccuracyMetrics({
  1. required String predictorArn,
})

Provides metrics on the accuracy of the models that were trained by the CreatePredictor operation. Use metrics to see how well the model performed and to decide whether to use the predictor to generate a forecast. For more information, see Predictor Metrics.

This operation generates metrics for each backtest window that was evaluated. The number of backtest windows (NumberOfBacktestWindows) is specified using the EvaluationParameters object, which is optionally included in the CreatePredictor request. If NumberOfBacktestWindows isn't specified, the number defaults to one.

The parameters of the filling method determine which items contribute to the metrics. If you want all items to contribute, specify zero. If you want only those items that have complete data in the range being evaluated to contribute, specify nan. For more information, see FeaturizationMethod.

May throw InvalidInputException. May throw ResourceNotFoundException. May throw ResourceInUseException.

Parameter predictorArn : The Amazon Resource Name (ARN) of the predictor to get metrics for.

Implementation

Future<GetAccuracyMetricsResponse> getAccuracyMetrics({
  required String predictorArn,
}) async {
  ArgumentError.checkNotNull(predictorArn, 'predictorArn');
  _s.validateStringLength(
    'predictorArn',
    predictorArn,
    0,
    256,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonForecast.GetAccuracyMetrics'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'PredictorArn': predictorArn,
    },
  );

  return GetAccuracyMetricsResponse.fromJson(jsonResponse.body);
}