Update app.py
Browse files
app.py
CHANGED
@@ -52,15 +52,15 @@ def forecast_plot(forecast_days,test_days, days):
|
|
52 |
Return the figure object.
|
53 |
'''
|
54 |
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
|
65 |
def mean_absolute_percentage_error(y_true, y_pred):
|
66 |
'''Calculate and return the Mean Absolute Percentage Error (MAPE) between actual values (y_true) and predicted values (y_pred).'''
|
|
|
52 |
Return the figure object.
|
53 |
'''
|
54 |
|
55 |
+
fig, ax = plt.subplots(figsize=(14, 4))
|
56 |
+
ax.plot(forecast_days['ds'], forecast_days['yhat'], label='Forecast', color='green')
|
57 |
+
ax.scatter(test_days['ds'], test_days['y'], label='Actual', color='orange')
|
58 |
+
ax.set_xlabel('Date')
|
59 |
+
ax.set_ylabel('MGW')
|
60 |
+
plt.title(f'Prophet Forecast - Model 3 - {days} days horizon')
|
61 |
+
plt.legend()
|
62 |
+
|
63 |
+
return fig
|
64 |
|
65 |
def mean_absolute_percentage_error(y_true, y_pred):
|
66 |
'''Calculate and return the Mean Absolute Percentage Error (MAPE) between actual values (y_true) and predicted values (y_pred).'''
|