executeEvaluation method
- required bool executed,
- required List parameters,
- required String datasetSplitType,
- required BuildContext context,
- required dynamic ref,
Executes model evaluation based on the given parameters and conditions.
executed
- Boolean indicating if the model evaluation should proceed.
parameters
- List of parameters specific to the model.
datasetSplitType
- String indicating the dataset split type ('Training', 'Tuning', etc.).
context
- Build context for the operation.
ref
- Reference used in the evaluation (e.g., for dependency injection).
Implementation
Future<void> executeEvaluation({
required bool executed,
required List parameters,
required String datasetSplitType,
required BuildContext context,
required dynamic ref,
}) async {
// 20241220 gjw One of the following templates then needs to be
// run to convert the appropriate predictions and probabilities
// to the variables that are non-specific to a dataset
// partition.
final templateMap = {
'Training': 'evaluate_template_tr',
'Tuning': 'evaluate_template_tu',
'Validation': 'evaluate_template_tu',
'Testing': 'evaluate_template_te',
'Complete': 'evaluate_template_tc',
};
if (executed) {
final template = templateMap[datasetSplitType] ??
(throw Exception('Invalid datasetSplitType: $datasetSplitType'));
// Insert 'template' as the second item in the parameters list.
final selectedParameters = [
parameters.first,
template,
...parameters.skip(1),
];
await rSource(context, ref, selectedParameters.cast<String>());
}
}