Skip to content

Instantly share code, notes, and snippets.

@meetps
Created December 25, 2016 05:15
Show Gist options
  • Save meetps/f089091900c55f559028da6c8c0ce660 to your computer and use it in GitHub Desktop.
Save meetps/f089091900c55f559028da6c8c0ce660 to your computer and use it in GitHub Desktop.
import numpy as np
import matplotlib.pyplot as plt
x= range(1,15)
x1= range(2,16)
x2= range(3,17)
y= np.asarray([0.8219895422 , 0.8403141689 , 0.9581152138 , 0.9921465969 , 0.9921465969 , 0.9895288058, 0.9973822383 , 0.9895288158, 0.997382199 , 0.997382199 , 0.997382199, 0.9921466362, 0.9947644372, 0.9947643979])
variability = [0.0264397719, 0.0228848261, 0.0287958109, 0.0157067863, 0.0081151739, 0.0104711742, 0.0026177617, 0.0078533832, 0.002617801, 0.00011, 0.002346846, 0.002617801, 0.0052355628, 0.0052356021]
# example data
ma = np.asarray([0.8958115321, 0.9581152138, 0.9790576116, 1, 0.9976439897, 1, 1, 0.997382199, 1, 0.997492679, 1, 0.9947644372, 1, 1])
mi = np.asarray([0.8693717602, 0.9162303877, 0.9502618007, 0.9842932137, 0.9895288158, 0.9895288258, 0.9973822383, 0.9895288158, 0.997382199, 0.997382679, 0.997653154, 0.9921466362, 0.9947644372, 0.9947643979])
asymmetric_error = [ma - y, y - mi]
asymmetric_error = [variability, variability]
plt.errorbar(x, y, yerr=asymmetric_error, label='dnn')
plt.errorbar(x1, y, yerr=asymmetric_error, label= 'knn')
plt.errorbar(x2, y, yerr=asymmetric_error, label= 'svm')
plt.xlabel('k')
plt.ylabel('top_k Accuracy')
plt.title('Flavia Dataset Box Plots')
plt.legend(loc=4)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment