I have to this code for machine learning with bayesian techniques but it is giving me error

조회 수: 5 (최근 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
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?
Also, read this.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Design of Experiments (DOE)에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by