MATLAB: How to modify the property of the object output by fitensemble

objects

Hi everyone,
I trained my data by fitensemble and obtained the output 'ens', which is an object. Because my data is large (more than hundreds of thousands), I want to remove the properties X, Y, W and UseObsForLearner so that it can substantially save my memory. Further, if I want the model constructed being used in my future intestigation, I can load it easily, quickly and without any memory required.
Any suggestions?
Thanks,
Best Regards,
Jorey

Best Answer

If you are using fitensemble to create a RegressionEnsemble or ClassificationEnsemble you can use the 'compact' function to remove the training data:
But of course since you throw out the training data you won't be able to do cross validation.
Related Question