Update app.py
Browse files
app.py
CHANGED
@@ -37,6 +37,23 @@ def calculate_performance_metrics(actual, predicted):
|
|
37 |
def main():
|
38 |
st.title('Stock Forecasting with Prophet')
|
39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
# Set up the layout
|
41 |
st.sidebar.header('User Input Parameters')
|
42 |
ticker_symbol = st.sidebar.text_input('Enter Ticker Symbol', 'RACE')
|
@@ -78,11 +95,8 @@ def main():
|
|
78 |
|
79 |
st.subheader('Performance Metrics')
|
80 |
|
81 |
-
st.write('The metrics below provide a quantitative measure of the model’s accuracy.')
|
82 |
-
|
83 |
-
st.write('Mean Squared Error (MSE): A lower value indicates better performance, and it penalizes larger errors more than MAE.')
|
84 |
-
st.write('Root Mean Squared Error (RMSE): A lower value indicates better performance, similar to MSE, but in the same units as the target variable.')
|
85 |
-
|
86 |
actual = df['y']
|
87 |
predicted = forecast['yhat'][:len(df)]
|
88 |
metrics = calculate_performance_metrics(actual, predicted)
|
|
|
37 |
def main():
|
38 |
st.title('Stock Forecasting with Prophet')
|
39 |
|
40 |
+
|
41 |
+
# Introduction
|
42 |
+
st.markdown("""
|
43 |
+
## Welcome to the Stock Forecasting App!
|
44 |
+
This app uses the Prophet time series forecasting model to predict future stock prices based on historical data.
|
45 |
+
Simply enter a stock ticker symbol, choose the start and end dates for the analysis, select your forecast horizon,
|
46 |
+
and hit the "Forecast Stock Prices" button to see the predictions.
|
47 |
+
|
48 |
+
### How to Use:
|
49 |
+
1. Enter the **ticker symbol** of the stock you're interested in (e.g., 'AAPL' for Apple Inc.).
|
50 |
+
2. Choose the **start and end dates** for historical data analysis.
|
51 |
+
3. Select the **forecast horizon** from the dropdown to predict 1, 2, 3, or 5 years into the future.
|
52 |
+
4. Click the **"Forecast Stock Prices"** button to generate the forecast.
|
53 |
+
|
54 |
+
Scroll down to view the forecast results and performance metrics of the model.
|
55 |
+
""")
|
56 |
+
|
57 |
# Set up the layout
|
58 |
st.sidebar.header('User Input Parameters')
|
59 |
ticker_symbol = st.sidebar.text_input('Enter Ticker Symbol', 'RACE')
|
|
|
95 |
|
96 |
st.subheader('Performance Metrics')
|
97 |
|
98 |
+
st.write('The metrics below provide a quantitative measure of the model’s accuracy. The Mean Absolute Error (MAE) is the average absolute difference between predicted and actual values, Mean Squared Error (MSE) is the average squared difference, and Root Mean Squared Error (RMSE) is the square root of MSE, which is more interpretable in the same units as the target variable.')
|
99 |
+
|
|
|
|
|
|
|
100 |
actual = df['y']
|
101 |
predicted = forecast['yhat'][:len(df)]
|
102 |
metrics = calculate_performance_metrics(actual, predicted)
|