Advertisement
Guest User

Untitled

a guest
Mar 11th, 2018
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.01 KB | None | 0 0
  1. import numpy as np
  2. import matplotlib
  3. import matplotlib.pyplot as plt
  4.  
  5. #S3  1276 http://browser.geekbench.com/geekbench3/8570680
  6. #S4: 1772 https://browser.geekbench.com/android_devices/108
  7. #S5: 2414 https://browser.geekbench.com/android_devices/163
  8. #S6: 4049 https://browser.geekbench.com/android_devices/209
  9. #S7: 5348 https://browser.geekbench.com/android_devices/220
  10. #S8: 6428 https://browser.geekbench.com/android_devices/376
  11. # S9: 8945 https://www.tek.no/artikler/test-samsung-galaxy-s9/431900/2
  12. samsung_scores = np.array([1276, 1772, 2414, 4049, 5348, 6428, 8945])
  13.  
  14. # Release dates of Galaxy S (Rounded down to month)
  15. # (source: google "Samsung Galaxy S<version> release date")
  16. samsung_versions = np.array([2012+5./12, 2013+4/12., 2014+4/12., 2015+4/12.,
  17.                              2016+3./12, 2017+4/12., 2018+3/12.])
  18.  
  19. p_samsung =  plt.plot(samsung_versions, samsung_scores, '*',
  20.          label='Samsung Galaxy S <Year>')
  21.  
  22. # Now we fit the data, except the latest, and see how good a prediction it is
  23. samsung_versions_shifted = samsung_versions - samsung_versions[0]*np.ones_like(samsung_versions)
  24. samsung_poly_coeff = np.polyfit(samsung_versions_shifted[:-2],
  25.     np.log(samsung_scores[:-2]), 1)
  26.  
  27.  
  28. plt.plot(samsung_versions,
  29.          np.exp(samsung_poly_coeff[1])*np.exp(samsung_versions_shifted*samsung_poly_coeff[0]),
  30.          '--', color=p_samsung[0].get_color(),
  31.          label='$%.2f (%.2f)^{\\mathrm{Year} - %.2f}$'
  32.          % (np.exp(samsung_poly_coeff[1]),
  33.           np.exp(samsung_poly_coeff[0]),
  34.           samsung_versions[0]))
  35. # iphone 4s 491 https://browser.geekbench.com/ios_devices/6
  36. # iphone 5 1207 https://browser.geekbench.com/ios_devices/20
  37. # iphone 5s 2144 https://browser.geekbench.com/ios_devices/28
  38. # iphone 6 2307 https://browser.geekbench.com/ios_devices/33
  39. # iphone 6s 3813 https://browser.geekbench.com/ios_devices/38
  40. # iphone 7 5694 https://browser.geekbench.com/ios_devices/44
  41. # iphone 8 10129 https://browser.geekbench.com/ios_devices/50
  42.  
  43. iphone_scores = np.array([491, 1207, 2144, 2307, 3813, 5694, 10129])
  44.  
  45. # Release dates of iPhone (Rounded down to month)
  46. # (source: google "Iphone <version> release date")
  47. iphone_versions = np.array(
  48.     [2011. + 10/12., 2012 + 9/12., 2013+ 9/12., 2014+9/12.,
  49.                    2015+9/12., 2016+9/12., 2017+9/12.])
  50.  
  51.  
  52. p_apple = plt.plot(iphone_versions, iphone_scores,
  53.                    'o', label='Apple iPhone <Year>')
  54.  
  55. iphone_versions_shifted = iphone_versions - iphone_versions[0]*np.ones_like(iphone_versions)
  56. apple_poly_coeff = np.polyfit(iphone_versions_shifted[:-2],
  57.     np.log(iphone_scores[:-2]), 1)
  58.  
  59.  
  60. plt.plot(iphone_versions,
  61.          np.exp(apple_poly_coeff[1])*np.exp(iphone_versions_shifted*apple_poly_coeff[0]),
  62.          '--', color=p_apple[0].get_color(),
  63.          label='$%.2f (%.2f)^{\\mathrm{Year} - %.2f}$'
  64.          % (np.exp(apple_poly_coeff[1]),
  65.           np.exp(apple_poly_coeff[0]),
  66.           iphone_versions[0]))
  67.  
  68.  
  69. plt.xlabel('Year')
  70. plt.ylabel('3D Mark Ice Storm')
  71. plt.legend()
  72. plt.grid("on")
  73. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement