Is there a known issue compiling the stats toolbox?
1 次查看(过去 30 天)
显示 更早的评论
We're compiling our code as a standalone program, and getting it working has been tricky. From trial and error, we've isolated the problem to a single call to a function in the statistics and machine learning toolbox ('fitcnb'). If I comment out this single line, the code compiles and the program runs; if I don't comment it out, the code compiles but crashes at runtime.
I've seen a couple other questions with issues when compiling the stats toolbox. (Question 1) (Question 2) The only resolution seems to be creating custom functions and avoiding the stats toolbox. This is fine if the functions are simple, but in our case it's a machine learning classifier, and I'd rather not re-write that.
From the current documentation, the stats toolbox is completely supported. However that doesn't seem to be the case. Is this either a known issue with the stats toolbox?
We're using Matlab 2016a, Matlab compiler 9, and OSx 10.11.3.
Edit: To reproduce the error on my machine, I do the following:
% compile the standalone
mcc -m callStatsToolbox.m
% attempt to run the standalone
!./run_callStatsToolbox.sh /Applications/MATLAB/MATLAB_Runtime/v901/
where callStatsToolbox.m is the following function:
function callStatsToolbox()
XX = rand(10^4,5); % make some random data
yy = rand(10^4,1)>0.5; % make random labels
naive_bayes_model = fitcnb(XX,yy);
[predicted_class, score] = predict(naive_bayes_model,XX);
disp('It worked!')
4 个评论
Walter Roberson
2017-4-24
I took the callStatsToolbox code you posted, and packaged it using Application Compiler, on OS-X El Capitan and R2017a. The only change I made was to convert the disp('It worked!') to a uiwait(msgbox('It worked!')) . There was no difficulty in the building or execution.
回答(1 个)
Image Analyst
2017-4-24
Did you look in mccExcludedFiles.log?
Have you sent the crash log into the Mathworks? They will help you figure out what is crashing the app if you have a current maintenance contract with them.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!