Instead the function would ignore that class

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: n training set. Instead, the function would ignore that class. Therefore, the function naiveBayes have already solved this issue, we have no need to worry about it. (b) Randomly assign 80% of the data to the training set, 20% to the test set. I achieved this by randomly sort the data for 50 times and take the former 80% of it (that is 1738 data) as the training set. By estimate the test error 50 times, I get: Test error: 0.052995 0.052995 0.039171 0.069124 0.050691 0.064516 0.071429 0.062212 0.06682 0.06682 0.039171 0.076037 0.064516 0.076037 0.069124 0.052995 0.082949 0.073733 0.076037 0.064516 0.076037 0.050691 0.071429 0.06682 0.059908 0.080645 0.057604 0.062212 0.078341 0.059908 0.082949 0.0553 0.062212 0.059908 0.069124 0.062212 0.076037 0.064516 0.064516 0.064516 0.059908 0.06682 0.064516 0.071429 0.076037 0.078341 0.06682 0.064516 0.0898...
View Full Document

Ask a homework question - tutors are online