I have to this code for machine learning with bayesian techniques but it is giving me error
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commento
Image Analyst
il 5 Apr 2017
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?
Risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!