2

I've trained a GBM model, and it's ready to work. I just want to share it with someone (make it as a file and send it)..

How can I do that in R?

Thanks!

Kev
  • 375
  • 1
  • 7
  • `save` (as M.Viking said) or `saveRDS`, the classic R functions for saving objects to files for perfect transfer to another R instance (different user, different computer, doesn't matter). – r2evans Dec 12 '22 at 17:20

1 Answers1

2

You can use the base save() function

https://www.rdocumentation.org/packages/base/versions/3.6.2/topics/save

save(gbm.model.name, file="saved_model.RData")

And your colleague can load()

gbm.model.name <- load(file="saved_model.RData")

There is a way to exchange models between languages called PMML https://en.wikipedia.org/wiki/Predictive_Model_Markup_Language This post describes https://stackoverflow.com/a/28625679/10276092

M.Viking
  • 5,067
  • 4
  • 17
  • 33