register_model_pro | R Documentation |
Registers a user-defined or pre-defined prognostic 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.
register_model_pro(name, func)
name |
A character string, the unique name to register the model under. |
func |
A function, the R function implementing the prognostic model.
This function should typically accept |
NULL. The function registers the model function invisibly.
get_registered_models_pro
, initialize_modeling_system_pro
# Example of a dummy model function for registration
my_dummy_cox_model <- function(X, y_surv, tune = FALSE) {
# A minimal survival model for demonstration
model_fit <- survival::coxph(y_surv ~ ., data = X)
structure(list(finalModel = model_fit, X_train_cols = colnames(X),
model_type = "survival_dummy_cox"), class = "train")
}
# Register the dummy model
initialize_modeling_system_pro() # Ensure system is initialized
register_model_pro("dummy_cox", my_dummy_cox_model)
"dummy_cox" %in% names(get_registered_models_pro()) # Check if registered
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.