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
- #S3 417 http://browser.geekbench.com/geekbench3/8570680
- #S4: 716 https://browser.geekbench.com/android_devices/108
- #S5: 931 https://browser.geekbench.com/android_devices/163
- #S6: 1295 https://browser.geekbench.com/android_devices/209
- #S7: 1811 https://browser.geekbench.com/android_devices/220
- #S8: 1953 https://browser.geekbench.com/android_devices/376
- # S9: 3739 https://www.tek.no/artikler/test-samsung-galaxy-s9/431900/2
- samsung_scores = np.array([417, 716, 931, 1295, 1811, 1953, 3739])
- # Release dates of Galaxy S (Rounded down to month)
- # (source: google "Samsung Galaxy S<version> release date")
- samsung_versions = np.array([2012+5./12, 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]))
- # iphone 4s 284 https://browser.geekbench.com/ios_devices/6
- # iphone 5 754 https://browser.geekbench.com/ios_devices/20
- # iphone 5s 1267 https://browser.geekbench.com/ios_devices/28
- # iphone 6 1360 https://browser.geekbench.com/ios_devices/33
- # iphone 6s 2214 https://browser.geekbench.com/ios_devices/38
- # iphone 7 3388 https://browser.geekbench.com/ios_devices/44
- # iphone 8 4217 https://browser.geekbench.com/ios_devices/50
- iphone_scores = np.array([284, 754, 1267, 1360, 2214, 3388, 4217])
- # Release dates of iPhone (Rounded down to month)
- # (source: google "Iphone <version> release date")
- iphone_versions = np.array(
- [2011. + 10/12., 2012 + 9/12., 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('Geekbench 4 Single score')
- plt.legend()
- plt.grid("on")
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement