How can I reduce the size of machine learning model from classification learner app, to be used by my code?
조회 수: 8 (최근 30일)
이전 댓글 표시
I have developed a module, a part of which uses (predict function) a ML model, generated and saved from Classification Learner App. The problem is with the larger size of the model and memory constraints from hardware. I have two queries :
- Is there any way where I can code the prediction model by using fit functions (example, take the trained model specs and code it instead)?
- If not, then how can I optimize and reduce the size of the trained model?
댓글 수: 2
Asvin Kumar
2021년 6월 24일
Is there an example you can share of the model or the workflow (MATLAB example) that you are following?
Sharing more details might help get more responses from the community.
답변 (1개)
Aditya Patil
2021년 7월 12일
The size of the model depends on the number of parameters required to define it. Due to their nature, ensembles in general, and forests in specific require lot of parameters.
There are two workarounds,
- You can use other models that are defined using much smaller number of parameters, say SVMs.
- If you want to use ensembles and forests, then you can reduce the number of trees used, and you can reduce the number of leaves in a tree. This will however come at the cost of accuracy.
You should continue to use compact models irrespective of above workarounds. I would not recommend trying to implement the code for the model, as that is unlikely to give any significant improvements over the model.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Classification Ensembles에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!