Spaces:
Build error
Build error
Commit ·
debaa06
1
Parent(s): cf1d20f
Update app.py
Browse files5 unmodified lines67891011124 unmodified lines171819202122232425262728293011 unmodified lines424344455 unmodified linesimport numpy as npimport pandas as pdSTART = "2018-01-01"TODAY = date.today().strftime("%Y-%m-%d")st.title('Stock Forecast App')4 unmodified linesn_years = st.slider('Years of prediction:', 1, 2)period = n_years * 365st.cache_datadef load_data(ticker):data = yf.download(ticker, START, TODAY)data.reset_index(inplace=True)return datadef plot_forecast(stock, forecast):fig = plot_plotly(Prophet(), forecast)fig.update_layout(title=f"{stock} Stock Forecast",xaxis_title="Date",11 unmodified linesfuture = m.make_future_dataframe(periods=period)forecast = m.predict(future)plot_forecast(selected_stock, forecast)5 unmodified lines67891011124 unmodified lines171819202122232425262728293011 unmodified lines42434445465 unmodified linesimport numpy as npimport pandas as pdSTART = "2015-01-01"TODAY = date.today().strftime("%Y-%m-%d")st.title('Stock Forecast App')4 unmodified linesn_years = st.slider('Years of prediction:', 1, 2)period = n_years * 365@st.cachedef load_data(ticker):data = yf.download(ticker, START, TODAY)data.reset_index(inplace=True)return datadef plot_forecast(model, stock, forecast):fig = plot_plotly(model, forecast)fig.update_layout(title=f"{stock} Stock Forecast",xaxis_title="Date",11 unmodified linesfuture = m.make_future_dataframe(periods=period)forecast = m.predict(future)plot_forecast(m, selected_stock, forecast)
app.py+6-5