NeuralNetw​orkClassif​ication object not supported for code generation

1 次查看(过去 30 天)
I trained a model using fitcnet() as follows:
mdl = fitcnet(trainTable,"Labels","Standardize",true,"Verbose",1)
I would like to see what the C/C++ code looks like so I tried
saveLearnerForCoder(mdl,'fitcnetCode')
but got the following error message:
First argument must be a classification, regression, or nearest neighbor searcher model supported for code generation.
Looking at https://www.mathworks.com/help/stats/savelearnerforcoder.html#bvclu99-Mdl models generated by fitcnet should work as they are ClassificationNeuralNetwork objects. Seems like a straightforward implementation. Why do I get that error?

回答(1 个)

Ji Lee
Ji Lee 2022-4-6
MATLAB Coder code generation support for neural networks became available recently in R2022a:
That particular documentation link points to the documentation for the latest release (R2022a). If you are using R2021b, you'll want to examine the archived R2021b version of that documentation:

类别

Help CenterFile Exchange 中查找有关 Get Started with Statistics and Machine Learning Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by