Spaces:
Build error
Build error
Commit ·
debaa06
1
Parent(s): cf1d20f
Update app.py
Browse files5 unmodified lines678991011124 unmodified lines171819202021222324252627262728293011 unmodified lines4243444545465 unmodified linesimport numpy as npimport pandas as pd
START = "2018-01-01"START = "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.cache_data@st.cachedef load_data(ticker): data = yf.download(ticker, START, TODAY) data.reset_index(inplace=True) return data
def plot_forecast(stock, forecast): fig = plot_plotly(Prophet(), forecast)def 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(selected_stock, forecast)plot_forecast(m, selected_stock, forecast)
app.py+6-5