This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
cs401r_w2016:lab5 [2016/01/15 18:01] admin [Extra credit:] |
cs401r_w2016:lab5 [2021/06/30 23:42] (current) |
||
---|---|---|---|
Line 20: | Line 20: | ||
{{ :cs401r_w2016:lab5_confmat2.png?direct&300|}} | {{ :cs401r_w2016:lab5_confmat2.png?direct&300|}} | ||
- | - The overall classification rate. For example, when I coded up Part 2, my classification error rate was 17.97%. When I coded up Part (3), my error rate was 3.80%. | + | - The overall classification rate. For example, when I coded up Part 2, my classification error rate was 17.97%. When I coded up Part (3), my error rate was <del>3.80%</del> 4.0%. (if you omit the factor of 1/2 in the exponent, you get 3.8%) |
- A confusion matrix (see MLAPP pg. 183), or [[https://en.wikipedia.org/wiki/Confusion_matrix|this wikipedia article]]. A confusion matrix is a complete report of all of the different ways your classifier was wrong, and is much more informative than a single error rate; for example, a confusion matrix will report the number of times your classifier reported "3", when the true class was "8". You can report this confusion matrix either as a text table, or as an image. My confusion matrix is shown to the right; you can see that my classifier generally gets things right (the strong diagonal), but sometimes predicts "9" when the true class is "4" (for example). | - A confusion matrix (see MLAPP pg. 183), or [[https://en.wikipedia.org/wiki/Confusion_matrix|this wikipedia article]]. A confusion matrix is a complete report of all of the different ways your classifier was wrong, and is much more informative than a single error rate; for example, a confusion matrix will report the number of times your classifier reported "3", when the true class was "8". You can report this confusion matrix either as a text table, or as an image. My confusion matrix is shown to the right; you can see that my classifier generally gets things right (the strong diagonal), but sometimes predicts "9" when the true class is "4" (for example). | ||
Line 66: | Line 66: | ||
- | The data that you will analyzing is the famous [[http://yann.lecun.com/exdb/mnist/|MNIST handwritten digits dataset]]. You can download some pre-processed MATLAB data files below: | + | The data that you will analyzing is the famous [[http://yann.lecun.com/exdb/mnist/|MNIST handwritten digits dataset]]. You can download some pre-processed MATLAB data files from the class Dropbox, or via direct links below: |
- | [[http://hatch.cs.byu.edu/courses/stat_ml/mnist_train.mat|MNIST training data vectors and labels]] | + | [[https://www.dropbox.com/s/23vs1osykktxbqg/mnist_train.mat?dl=0|MNIST training data vectors and labels]] |
- | [[http://hatch.cs.byu.edu/courses/stat_ml/mnist_test.mat|MNIST test data vectors and labels]] | + | [[https://www.dropbox.com/s/47dupql5jm9alc4/mnist_test.mat?dl=0|MNIST test data vectors and labels]] |
These can be loaded using the scipy.io.loadmat function, as follows: | These can be loaded using the scipy.io.loadmat function, as follows: | ||
Line 95: | Line 95: | ||
<code python> | <code python> | ||
import matplotlib.pyplot as plt | import matplotlib.pyplot as plt | ||
- | plt.imshow( X.reshape(28,28).T, interpolation='nearest', cmap=matplotlib.cm.gray) | + | plt.imshow( X.reshape(28,28).T, interpolation='nearest', cmap="gray") |
</code> | </code> | ||