Advertisement
Guest User

Untitled

a guest
Mar 11th, 2018
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.14 KB | None | 0 0
  1. import numpy as np
  2. import matplotlib
  3. import matplotlib.pyplot as plt
  4.  
  5. # Can't find data for S3?
  6. #S4: 1292 https://www.futuremark.com/hardware/mobile/Samsung+Galaxy+S4+4G_+%28MSM8974AA+v2%29/review
  7. #S5: 1401 https://www.futuremark.com/hardware/mobile/Samsung+Galaxy+S5+LTE-A/review
  8. #S6: 1637 https://www.futuremark.com/hardware/mobile/Samsung+Galaxy+S6+Edge/review
  9. #S7: 2476 https://www.futuremark.com/hardware/mobile/Samsung+Galaxy+S7+%28Exynos+8+Octa%29/review
  10. #S8: 4566 https://www.futuremark.com/hardware/mobile/Samsung+Galaxy+S8_+%28MSM8998%29/review
  11. #S9: 5793 http://bgr.com/2018/03/08/galaxy-s9-vs-iphone-x-speed-benchmark-tests-comparison/
  12. samsung_scores = np.array([1292, 1401, 1637, 2476, 4566, 5793])
  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([2013+4/12., 2014+4/12., 2015+4/12.,
  17.                              2016+3./12, 2017+4/12., 2018+3/12.])
  18.  
  19.  
  20. p_samsung =  plt.plot(samsung_versions, samsung_scores, '*',
  21.          label='Samsung Galaxy S <Year>')
  22.  
  23. # Now we fit the data, except the latest, and see how good a prediction it is
  24. samsung_versions_shifted = samsung_versions - samsung_versions[0]*np.ones_like(samsung_versions)
  25. samsung_poly_coeff = np.polyfit(samsung_versions_shifted[:-1],
  26.     np.log(samsung_scores[:-1]), 1)
  27.  
  28.  
  29. plt.plot(samsung_versions,
  30.          np.exp(samsung_poly_coeff[1])*np.exp(samsung_versions_shifted*samsung_poly_coeff[0]),
  31.          '--', color=p_samsung[0].get_color(),
  32.          label='$%.2f (%.2f)^{\\mathrm{Year} - %.2f}$'
  33.          % (np.exp(samsung_poly_coeff[1]),
  34.           np.exp(samsung_poly_coeff[0]),
  35.           samsung_versions[0]))
  36.  
  37.  
  38. # Can't find data for iphone 4s?
  39. # Can't find data for iphone 5?
  40. # iphone 5s 1182 https://www.futuremark.com/hardware/mobile/Apple+iPhone+5s/review
  41. # iphone 6 1446 https://www.futuremark.com/hardware/mobile/Apple+iPhone+6/review
  42. # iphone 6s 2367 https://www.futuremark.com/hardware/mobile/Apple+iPhone+6s/review
  43. # iphone 7 2600 https://www.futuremark.com/hardware/mobile/Apple+iPhone+7/review
  44. # iphone 8 3734 https://www.futuremark.com/hardware/mobile/Apple+iPhone+8/review
  45.  
  46. iphone_scores = np.array([1182, 1446, 2367, 2600, 3734])
  47.  
  48. # Release dates of iPhone (Rounded down to month)
  49. # (source: google "Iphone <version> release date")
  50. iphone_versions = np.array(
  51.     [2013+ 9/12., 2014+9/12.,
  52.                    2015+9/12., 2016+9/12., 2017+9/12.])
  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 Sling Shot')
  73. plt.legend()
  74. plt.grid("on")
  75. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement