Why doesn't deploytool include dependencies from toolboxes?
1 次查看(过去 30 天)
显示 更早的评论
tl;dr: I'm using deploytool to make a standalone executable version of our software. Two dependencies are not being included automatically ('fitcnb' from the ident toolbox, and 'fitcnb' from the classreg toolbox), nor are any of the functions that they call. I know that this is the problem, since commenting out our calls to 'predict' and 'fitcnb' eliminates the error. Manually including dependencies hasn't worked so far. We're running Matlab2016a on OSx 10.11.3.
I have two questions:
1. Why doesn't deploytool automatically include 'predict' and 'fitcnb'? You can see in the code snippets below that they're called directly from our scripts.
2. How can I find all the dependencies of 'predict' and 'fitcnb' so that I can ensure they're included?
I believe the issue is partly related to the fact that some function handles are formed dynamically by str2func (documentation at the bottom of classreg.learning.FitTemplate says as much). This might explain why deploytool isn't finding the dependencies of 'predict' and 'fitcnb', but it doesn't explain why those two functions are missing.
Here's how we call 'predict' and 'fitcnb':
% master script
% ... (many lines skipped)
[scoreMatrix, feats_new] = scorenb(DistList,possList,classList); % custom function
function [score,feats] = scorenb(Dist2,possibleInts,TP_Matrix)
% ... (many lines skipped)
for iter = 1:Nmodel
% Fit Naive Bayes model
nab = fitcnb(Xtr(:,f2consider),ytr);
[~,scoretmp] = predict(nab,Xnew(:,f2consider));
end
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Naive Bayes 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!