Spaces:
Sleeping
Sleeping
Coder
commited on
Commit
·
3726ea1
1
Parent(s):
1d3e57b
initial commit
Browse files
app.py
CHANGED
@@ -13,7 +13,6 @@ def fetch_stock_data(ticker_symbol, start_date, end_date):
|
|
13 |
stock_data = yf.download(ticker_symbol, start=start_date, end=end_date)
|
14 |
df = stock_data[['Adj Close']].reset_index()
|
15 |
df = df.rename(columns={'Date': 'ds', 'Adj Close': 'y'})
|
16 |
-
# df.to_csv(f"{ticker_symbol}.csv")
|
17 |
return df
|
18 |
|
19 |
def train_prophet_model(df):
|
@@ -90,20 +89,11 @@ def main():
|
|
90 |
st.warning(f'The last available adjusted closing price for {ticker_symbol} on {end_date.strftime("%d %B %Y")} is **{actual_last_price:.2f}**.')
|
91 |
|
92 |
if sentiment == 'Positive':
|
93 |
-
st.success(f'
|
94 |
elif sentiment == 'Negative':
|
95 |
-
st.error(f'
|
96 |
else:
|
97 |
-
st.info(f'
|
98 |
-
|
99 |
-
st.markdown(f"""
|
100 |
-
**Prediction for {forecast_horizon.lower()}:**
|
101 |
-
|
102 |
-
- **Date:** {latest_forecast['ds'].strftime("%d %B %Y")}
|
103 |
-
- **Predicted Price:** {latest_forecast['yhat']:.2f}
|
104 |
-
- **Lower Bound:** {latest_forecast['yhat_lower']:.2f}
|
105 |
-
- **Upper Bound:** {latest_forecast['yhat_upper']:.2f}
|
106 |
-
""")
|
107 |
|
108 |
st.markdown(f"""
|
109 |
**Find below the prediction Data for the {forecast_horizon.lower()}:**
|
|
|
13 |
stock_data = yf.download(ticker_symbol, start=start_date, end=end_date)
|
14 |
df = stock_data[['Adj Close']].reset_index()
|
15 |
df = df.rename(columns={'Date': 'ds', 'Adj Close': 'y'})
|
|
|
16 |
return df
|
17 |
|
18 |
def train_prophet_model(df):
|
|
|
89 |
st.warning(f'The last available adjusted closing price for {ticker_symbol} on {end_date.strftime("%d %B %Y")} is **{actual_last_price:.2f}**.')
|
90 |
|
91 |
if sentiment == 'Positive':
|
92 |
+
st.success(f'**Predicted Price:** {latest_forecast['yhat']:.2f}. **Range:** {latest_forecast['yhat_lower']:.2f} - {latest_forecast['yhat_upper']:.2f} \nOverall predication indicates positive sentiment for {forecast_horizon.lower()} time frame.')
|
93 |
elif sentiment == 'Negative':
|
94 |
+
st.error(f'f'**Predicted Price:** {latest_forecast['yhat']:.2f}. **Range:** {latest_forecast['yhat_lower']:.2f} - {latest_forecast['yhat_upper']:.2f} \nOverall predication indicates negative sentiment for {forecast_horizon.lower()} time frame.')
|
95 |
else:
|
96 |
+
st.info(f'f'**Predicted Price:** {latest_forecast['yhat']:.2f}. **Range:** {latest_forecast['yhat_lower']:.2f} - {latest_forecast['yhat_upper']:.2f} \nOverall predication indicates neutral sentiment for {forecast_horizon.lower()} time frame.')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
|
98 |
st.markdown(f"""
|
99 |
**Find below the prediction Data for the {forecast_horizon.lower()}:**
|