Learn R Programming

fastml (version 0.5.0)

evaluate_models: Evaluate Models Function

Description

Evaluates the trained models on the test data and computes performance metrics.

Usage

evaluate_models(
  models,
  train_data,
  test_data,
  label,
  task,
  metric = NULL,
  event_class
)

Value

A list with two elements:

performance

A named list of performance metric tibbles for each model.

predictions

A named list of data frames with columns including truth, predictions, and probabilities per model.

Arguments

models

A list of trained model objects.

train_data

Preprocessed training data frame.

test_data

Preprocessed test data frame.

label

Name of the target variable.

task

Type of task: "classification" or "regression".

metric

The performance metric to optimize (e.g., "accuracy", "rmse").

event_class

A single string. Either "first" or "second" to specify which level of truth to consider as the "event".