udacity / robotics-nanodegree-issues

Public waffleboard to track Robotics Nanodegree Issues
2 stars 0 forks source link

Lesson 5-15 Train SVM - Normalised plot axis not scaled correclty #85

Closed adammalpass closed 7 years ago

adammalpass commented 7 years ago

The SVM generates two confusion matrices, with and without normalisation. On the right hand side the confusion matrix has been correctly normalised, however its axis has not been updated (it still uses the same range as before normalisation). You can see clearly in the image shared in the lesson:

https://d17h27t6h515a5.cloudfront.net/topher/2017/July/59726c76_screen-shot-2017-07-21-at-2.04.36-pm/screen-shot-2017-07-21-at-2.04.36-pm.png

To fix I think this code needs to be updated, probably passing to the range argument of the colorbar.

https://github.com/udacity/RoboND-Perception-Exercises/blob/master/Exercise-3/sensor_stick/scripts/train_svm.py

ryan-keenan commented 7 years ago

Great catch Adam! I just fixed this. It was a matter of moving the image normalization up to before plt.imshow(). Previously even though the numbers were different, the background image in both plots was the same, leading to the colorbar being the same too!