Learn R Programming

fastml (version 0.6.1)

summary.fastml: Summary Function for fastml (Using yardstick for ROC Curves)

Description

Summarizes the results of machine learning models trained using the `fastml` package. Depending on the task type (classification or regression), it provides customized output such as performance metrics, best hyperparameter settings, and confusion matrices. It is designed to be informative and readable, helping users quickly interpret model results.

Usage

# S3 method for fastml
summary(
  object,
  algorithm = "best",
  type = c("all", "metrics", "params", "conf_mat"),
  sort_metric = NULL,
  ...
)

Value

Prints summary of fastml models.

Arguments

object

An object of class fastml.

algorithm

A vector of algorithm names to display summary. Default is "best".

type

Character vector indicating which outputs to produce. Options are "all" (all available outputs), "metrics" (performance metrics), "params" (best hyperparameters), and "conf_mat" (confusion matrix). Default is "all".

sort_metric

The metric to sort by. Default uses optimized metric.

...

Additional arguments.

Details

For classification tasks, the summary includes metrics such as Accuracy, F1 Score, Kappa, Precision, ROC AUC, Sensitivity, and Specificity. A confusion matrix is also provided for the best model(s). For regression tasks, the summary reports RMSE, R-squared, and MAE.

Users can control the type of output with the `type` argument: `metrics` displays model performance metrics. `params` shows the best hyperparameter settings. `conf_mat` prints confusion matrices (only for classification). `all` includes all of the above.

If multiple algorithms are trained, the summary highlights the best model based on the optimized metric.