Created
May 13, 2020 22:39
-
-
Save barce/9871ca545ca096defd84a2311b77890a to your computer and use it in GitHub Desktop.
polyfit for prediction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def predict_stats(a_stats, i_days): | |
x = np.array( list(range(0,len(a_stats))) ) | |
y = np.array(a_stats) | |
z = np.polyfit(x,y,3) # construct x**2 + xy + 3 | |
p_true = np.poly1d(z) | |
return p_true(len(a_stats) + i_days) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment