createEvaluation method

Future<CreateEvaluationOutput> createEvaluation({
  1. required String evaluationDataSourceId,
  2. required String evaluationId,
  3. required String mLModelId,
  4. String? evaluationName,
})

Creates a new Evaluation of an MLModel. An MLModel is evaluated on a set of observations associated to a DataSource. Like a DataSource for an MLModel, the DataSource for an Evaluation contains values for the Target Variable. The Evaluation compares the predicted result for each observation to the actual outcome and provides a summary so that you know how effective the MLModel functions on the test data. Evaluation generates a relevant performance metric, such as BinaryAUC, RegressionRMSE or MulticlassAvgFScore based on the corresponding MLModelType: BINARY, REGRESSION or MULTICLASS.

CreateEvaluation is an asynchronous operation. In response to CreateEvaluation, Amazon Machine Learning (Amazon ML) immediately returns and sets the evaluation status to PENDING. After the Evaluation is created and ready for use, Amazon ML sets the status to COMPLETED.

You can use the GetEvaluation operation to check progress of the evaluation during the creation operation.

May throw InvalidInputException. May throw InternalServerException. May throw IdempotentParameterMismatchException.

Parameter evaluationDataSourceId : The ID of the DataSource for the evaluation. The schema of the DataSource must match the schema used to create the MLModel.

Parameter evaluationId : A user-supplied ID that uniquely identifies the Evaluation.

Parameter mLModelId : The ID of the MLModel to evaluate.

The schema used in creating the MLModel must match the schema of the DataSource used in the Evaluation.

Parameter evaluationName : A user-supplied name or description of the Evaluation.

Implementation

Future<CreateEvaluationOutput> createEvaluation({
  required String evaluationDataSourceId,
  required String evaluationId,
  required String mLModelId,
  String? evaluationName,
}) async {
  ArgumentError.checkNotNull(
      evaluationDataSourceId, 'evaluationDataSourceId');
  _s.validateStringLength(
    'evaluationDataSourceId',
    evaluationDataSourceId,
    1,
    64,
    isRequired: true,
  );
  ArgumentError.checkNotNull(evaluationId, 'evaluationId');
  _s.validateStringLength(
    'evaluationId',
    evaluationId,
    1,
    64,
    isRequired: true,
  );
  ArgumentError.checkNotNull(mLModelId, 'mLModelId');
  _s.validateStringLength(
    'mLModelId',
    mLModelId,
    1,
    64,
    isRequired: true,
  );
  _s.validateStringLength(
    'evaluationName',
    evaluationName,
    0,
    1024,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonML_20141212.CreateEvaluation'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'EvaluationDataSourceId': evaluationDataSourceId,
      'EvaluationId': evaluationId,
      'MLModelId': mLModelId,
      if (evaluationName != null) 'EvaluationName': evaluationName,
    },
  );

  return CreateEvaluationOutput.fromJson(jsonResponse.body);
}