Last active
March 16, 2020 12:34
-
-
Save santiagocasas/545c589d7c9d7e45d77ad218c95ef5af to your computer and use it in GitHub Desktop.
asymptote and metrics
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
y_pred = logistic_model(x,ai,bi,ci) | |
MSLE=sklm.mean_squared_log_error(y,y_pred) | |
print("Mean squared log error (MSLE): ", '{:.3f}'.format(MSLE)) | |
print("Exp of RMSLE: ", '{:.3f}'.format(np.exp(np.sqrt(MSLE)))) | |
print("R2 score: ", '{:.3f}'.format(sklm.r2_score(y,y_pred))) | |
perc_flat = 0.98 | |
sol = int(fsolve(lambda x : logistic_model(x,ai,bi,ci) - perc_flat*int(ci), bi)) | |
print('Day of flattening of the infection curve') | |
datesol = datetime.strftime(df_dict[country].index[0] + timedelta(days=sol), ' %d, %b %Y' ) | |
print('-->'+datesol) | |
c_pars[(country,'Logistic','c_time')] = sol |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment