Evaluates the trained models on the test data and computes performance metrics.
evaluate_models(models, train_data, test_data, label, task, metric = NULL)
A list of performance metrics for each model.
A list of trained model objects.
Preprocessed training data frame.
Preprocessed test data frame.
Name of the target variable.
Type of task: "classification" or "regression".
The performance metric to optimize (e.g., "accuracy", "rmse").