save_models.Rd
Note that model objects contain training data, except columns
ignored (patient_id in the example below). Therefore, if there is PHI in
the training data, the saved model object must be treated as PHI.
save_models
issues a message saying as much.
save_models(x, filename = "models.RDS") load_models(filename)
x | model_list object |
---|---|
filename | File path to save model to or read model from, e.g.
"models/my_models.RDS". Default for |
load_models
returns the model_list which can be assigned to
any variable name
# NOT RUN { m <- machine_learn(pima_diabetes, patient_id, outcome = diabetes) save_models(m, "diabetes_models.RDS") # Restart R, move RDS file to another computer, etc. m2 <- load_models("diabetes_models.RDS") all.equal(m, m2) # }