Is there any way in MATLAB to store a compact version of a Generalized Linear Model?

2 vues (au cours des 30 derniers jours)
We have a problem in which we need to store a large number of model results from fitglm for later use in prediction. The predict function takes the entire model structure as input. Since the model structure contains many tables that we do not need and would prefer not to have to store, I am writing to ask if there is a minimal structure needed for a prediction and can that be stored separately on disk for later use? We have considered storing just the coefficients but that can create problems when there are categorical variables.

Réponse acceptée

MathWorks Support Team
MathWorks Support Team le 4 Mai 2023
Modifié(e) : MathWorks Support Team le 4 Mai 2023
You can use the function "compact" (released in MATLAB R2016b) in order to compress many of the models and objects used in the Statistics and Machine Learning Toolbox. In the case of generalized linear models, the compact model uses less memory than the full model because it does not include a copy of the data or anything comparable in size to the data. However, the compact model also does not support some properties (such as Residuals) or function (such as addTerms) that require the actual data. Refer to the following page for more information about the "compact" function:

Plus de réponses (0)

Produits


Version

R2017a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by