register_model_dia: Register a Diagnostic Model Function

View source: R/diagnosis.R

register_model_diaR Documentation

Register a Diagnostic Model Function

Description

Registers a user-defined or pre-defined diagnostic model function with the internal model registry. This allows the function to be called later by its registered name, facilitating a modular model management system.

Usage

register_model_dia(name, func)

Arguments

name

A character string, the unique name to register the model under.

func

A function, the R function implementing the diagnostic model. This function should typically accept X (features) and y (labels) as its first two arguments and return a caret::train object.

Value

NULL. The function registers the model function invisibly.

See Also

get_registered_models_dia, initialize_modeling_system_dia

Examples


# Example of a dummy model function for registration
my_dummy_rf_model <- function(X, y, tune = FALSE, cv_folds = 5) {
  message("Training dummy RF model...")
  # This is a placeholder and doesn't train a real model.
  # It returns a list with a structure similar to a caret train object.
  list(method = "dummy_rf")
}

# Initialize the system before registering
initialize_modeling_system_dia()

# Register the new model
register_model_dia("dummy_rf", my_dummy_rf_model)

# Verify that the model is now in the list of registered models
"dummy_rf" %in% names(get_registered_models_dia())


E2E documentation built on Aug. 27, 2025, 1:09 a.m.