Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- import matplotlib
- import matplotlib.pyplot as plt
- # Can't find data for S3?
- #S4: 1292 https://www.futuremark.com/hardware/mobile/Samsung+Galaxy+S4+4G_+%28MSM8974AA+v2%29/review
- #S5: 1401 https://www.futuremark.com/hardware/mobile/Samsung+Galaxy+S5+LTE-A/review
- #S6: 1637 https://www.futuremark.com/hardware/mobile/Samsung+Galaxy+S6+Edge/review
- #S7: 2476 https://www.futuremark.com/hardware/mobile/Samsung+Galaxy+S7+%28Exynos+8+Octa%29/review
- #S8: 4566 https://www.futuremark.com/hardware/mobile/Samsung+Galaxy+S8_+%28MSM8998%29/review
- #S9: 5793 http://bgr.com/2018/03/08/galaxy-s9-vs-iphone-x-speed-benchmark-tests-comparison/
- samsung_scores = np.array([1292, 1401, 1637, 2476, 4566, 5793])
- # Release dates of Galaxy S (Rounded down to month)
- # (source: google "Samsung Galaxy S<version> release date")
- samsung_versions = np.array([2013+4/12., 2014+4/12., 2015+4/12.,
- 2016+3./12, 2017+4/12., 2018+3/12.])
- p_samsung = plt.plot(samsung_versions, samsung_scores, '*',
- label='Samsung Galaxy S <Year>')
- # Now we fit the data, except the latest, and see how good a prediction it is
- samsung_versions_shifted = samsung_versions - samsung_versions[0]*np.ones_like(samsung_versions)
- samsung_poly_coeff = np.polyfit(samsung_versions_shifted[:-1],
- np.log(samsung_scores[:-1]), 1)
- plt.plot(samsung_versions,
- np.exp(samsung_poly_coeff[1])*np.exp(samsung_versions_shifted*samsung_poly_coeff[0]),
- '--', color=p_samsung[0].get_color(),
- label='$%.2f (%.2f)^{\\mathrm{Year} - %.2f}$'
- % (np.exp(samsung_poly_coeff[1]),
- np.exp(samsung_poly_coeff[0]),
- samsung_versions[0]))
- # Can't find data for iphone 4s?
- # Can't find data for iphone 5?
- # iphone 5s 1182 https://www.futuremark.com/hardware/mobile/Apple+iPhone+5s/review
- # iphone 6 1446 https://www.futuremark.com/hardware/mobile/Apple+iPhone+6/review
- # iphone 6s 2367 https://www.futuremark.com/hardware/mobile/Apple+iPhone+6s/review
- # iphone 7 2600 https://www.futuremark.com/hardware/mobile/Apple+iPhone+7/review
- # iphone 8 3734 https://www.futuremark.com/hardware/mobile/Apple+iPhone+8/review
- iphone_scores = np.array([1182, 1446, 2367, 2600, 3734])
- # Release dates of iPhone (Rounded down to month)
- # (source: google "Iphone <version> release date")
- iphone_versions = np.array(
- [2013+ 9/12., 2014+9/12.,
- 2015+9/12., 2016+9/12., 2017+9/12.])
- p_apple = plt.plot(iphone_versions, iphone_scores,
- 'o', label='Apple iPhone <Year>')
- iphone_versions_shifted = iphone_versions - iphone_versions[0]*np.ones_like(iphone_versions)
- apple_poly_coeff = np.polyfit(iphone_versions_shifted[:-1],
- np.log(iphone_scores[:-1]), 1)
- plt.plot(iphone_versions,
- np.exp(apple_poly_coeff[1])*np.exp(iphone_versions_shifted*apple_poly_coeff[0]),
- '--', color=p_apple[0].get_color(),
- label='$%.2f (%.2f)^{\\mathrm{Year} - %.2f}$'
- % (np.exp(apple_poly_coeff[1]),
- np.exp(apple_poly_coeff[0]),
- iphone_versions[0]))
- plt.xlabel('Year')
- plt.ylabel('3D Mark Sling Shot')
- plt.legend()
- plt.grid("on")
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement