title: Misclassification error rate and accuracy
body: <p><img src="https://i.stack.imgur.com/kwDuO.jpg" alt="scatter plot">Below is a Matlab code for Bayes classifier which classifies arbitrary numbers into their classes.</p>
  
  <pre><code> training = [3;5;17;19;24;27;31;38;45;48;52;56;66;69;73;78;84;88]; 
       target_class = [0;0;10;10;20;20;30;30;40;40;50;50;60;60;70;70;80;80];  
  
        test = [1:2:90]'; 
       class  = classify(test,training, target_class, 'diaglinear');  % Naive Bayes classifier 
   [test class]
  </code></pre>
  
  <p>(a) If someone could provide code snippets for calculating the Bayes error for misclassification and accuracy. I went through matlab's documentation regarding <code>[class,err]=classify(...)</code>. But, I am unable to follow it and work. </p>
  
  <p>(b) Also, how to plot a scatter plot and histogram indicating the number of data points belonging to different classes? I tried out with <code>scatter(training(:),target_class(:))</code> but it gives something else!</p>
  
  <p>(c) How to work with crossvalidate()? An example would really help.Thank you.</p>