I have to this code for machine learning with bayesian techniques but it is giving me error
1 次查看(过去 30 天)
显示 更早的评论
x = bankadditionalfull X = x(:,1:end-1); Y = x.y C = cvpartition(Y,'holdout',0.2); Xtrain = X(training(C,1),:); Ytrain = Y(training(C,1)); Z = Y(test(C,1)); Bayes_model = fitcnb(Xtrain,Ytrain,'Distribution','kernel');
% Evaluation Accuracy using the Test set % Generate a confusion matrix [Bayes_predict,class_score] = Nb.predict(X(test(C,1),:)); [conf,classorder] = confusionmat(Z, Bayes_predict); conf %Calculate what percentage of confusion matrix is off the diagonal Bayes_Error = 1 - trace(conf)/sum(conf(:)); Bayes_Error
It is giving me this error "Error in Bayesian (line 9) Bayes_model = fitcnb(Xtrain,Ytrain,'Distribution','kernel')"
1 个评论
Image Analyst
2017-4-5
You forgot to post the last half of the error - where it actually says what the actual error was. And you forgot to supply us with data so we can run your code. I can't run "bankadditionalfull", whatever that is. What does this say for you?
which bankadditionalfull
Did you write it, or is it in a toolbox that you have but I don't?
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!