Created
November 19, 2019 03:56
-
-
Save peter-stuart-turner/af01d1bad7610f3215272d27e52d50e2 to your computer and use it in GitHub Desktop.
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
## Read in data (skip 2028 Silver Institute 'predicted' entry) | |
est_thrifting = pd.read_excel('../data/silver_solar_thrifting_estimates.xlsx').iloc[0:10] | |
fc_loadings = pd.DataFrame(columns=['ds','y']) | |
fc_loadings['ds'] = est_thrifting['Year'].values | |
fc_loadings['ds'] = fc_loadings['ds'].apply(lambda d: datetime.datetime.strptime(str(d), "%Y")) | |
fc_loadings['y'] = est_thrifting['Market Average Silver Loadings (g/cell)'].values | |
model_loadings = fbprophet.Prophet(changepoint_prior_scale=5) | |
model_loadings.fit(fc_loadings) | |
future_df_loadings = model_loadings.make_future_dataframe(periods=30, freq='y') | |
forecast_loadings = model_loadings.predict(future_df_loadings) | |
model_loadings.plot(forecast_loadings); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment