Strategies for Minimizing Model Size in R While Maintaining Predictive Ability

In training regression models with the text package in R, the model's size increases with the number of training datapoints, resulting in unnecessarily large model objects. The models are created using the parsnip package with the glmnet engine. R's memory handling system, which prevents data duplication, makes it difficult to distinguish what components/attributes of the model that take up space; for instance: object_size(model) shows 700 MB, but object_size(model$final_recipe) and object_size(model$final_model) are nearly the same at 698 MB respectively, and thus doesn’t show the actual size of the components.

  • How can I efficiently identify and remove the memory-heavy components of the model to reduce its size, while maintaining its predictive ability?

Crossposted @ : regression - Strategies for Minimizing Model Size in R While Maintaining Predictive Ability - Stack Overflow

1 Like

:wave: Replied on StackOverflow

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.