Advertisement
Guest User

Untitled

a guest
Mar 9th, 2018
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.32 KB | None | 0 0
  1. import numpy as np
  2. import matplotlib
  3. import matplotlib.pyplot as plt
  4.  
  5. #S3  5610 https://www.futuremark.com/hardware/mobile/Samsung+Galaxy+S3+%28MSM8960%29/review
  6. #S4: 18443 https://www.futuremark.com/hardware/mobile/Samsung+Galaxy+S4+4G_+%28MSM8974AA+v2%29/review
  7. #S5: 18437 https://www.futuremark.com/hardware/mobile/Samsung+Galaxy+S5+LTE-A/review
  8. #S6: 21488 https://www.futuremark.com/hardware/mobile/Samsung+Galaxy+S6+Edge/review
  9. #S7: 28510 https://www.tek.no/artikler/test-samsung-galaxy-s9/431900/2
  10. #S8: 28940 https://www.tek.no/artikler/test-samsung-galaxy-s9/431900/2
  11. #S9: 39365 https://www.tek.no/artikler/test-samsung-galaxy-s9/431900/2
  12. samsung_scores = np.array([5610, 18433, 18437, 21488, 28510, 28940, 39365])
  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[:-1],
  25.     np.log(samsung_scores[:-1]), 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.  
  36.          
  37. # iphone 4s 2351 https://www.futuremark.com/hardware/mobile/Apple+iPhone+4s/review
  38. # iphone 5 6005 https://www.futuremark.com/hardware/mobile/Apple+iPhone+5/review
  39. # iphone 5s 14819 https://www.futuremark.com/hardware/mobile/Apple+iPhone+5s/review
  40. # iphone 6 17281 https://www.futuremark.com/hardware/mobile/Apple+iPhone+6/review
  41. # iphone 6s 28051 https://www.futuremark.com/hardware/mobile/Apple+iPhone+6s/review
  42. # iphone 7 36132 https://www.tek.no/artikler/test-samsung-galaxy-s9/431900/2
  43. # iphone 8 64785 https://www.tek.no/artikler/test-samsung-galaxy-s9/431900/2
  44.  
  45. iphone_scores = np.array([2351, 6005, 14819, 17281, 28051, 36132, 64785])
  46.  
  47. # Release dates of iPhone (Rounded down to month)
  48. # (source: google "Iphone <version> release date")
  49. iphone_versions = np.array(
  50.     [2011. + 10/12., 2012 + 9/12., 2013+ 9/12., 2014+9/12.,
  51.                    2015+9/12., 2016+9/12., 2017+9/12.])
  52.  
  53.  
  54. p_apple = plt.plot(iphone_versions, iphone_scores,
  55.                    'o', label='Apple iPhone <Year>')
  56.  
  57. iphone_versions_shifted = iphone_versions - iphone_versions[0]*np.ones_like(iphone_versions)
  58. apple_poly_coeff = np.polyfit(iphone_versions_shifted[:-1],
  59.     np.log(iphone_scores[:-1]), 1)
  60.  
  61.  
  62. plt.plot(iphone_versions,
  63.          np.exp(apple_poly_coeff[1])*np.exp(iphone_versions_shifted*apple_poly_coeff[0]),
  64.          '--', color=p_apple[0].get_color(),
  65.          label='$%.2f (%.2f)^{\\mathrm{Year} - %.2f}$'
  66.          % (np.exp(apple_poly_coeff[1]),
  67.           np.exp(apple_poly_coeff[0]),
  68.           iphone_versions[0]))
  69.  
  70.  
  71. plt.xlabel('Year')
  72. plt.ylabel('3D Mark Ice Storm Unlimited')
  73. plt.legend()
  74. plt.grid("on")
  75. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement