Spaces:
Sleeping
Sleeping
Accuracy calculation
Browse files
app.py
CHANGED
@@ -47,8 +47,8 @@ def get_forecast(company_name):
|
|
47 |
forecast_df = forecast[['ds', 'yhat', 'yhat_lower', 'yhat_upper']]
|
48 |
|
49 |
# Calculate accuracy metrics
|
50 |
-
actual_prices = stock_df['y'].values[-1000:] # Last
|
51 |
-
predicted_prices = forecast_df['yhat'].values[-1000:] # Forecasted prices for the last
|
52 |
#mae = mean_absolute_error(actual_prices, predicted_prices)
|
53 |
#mse = mean_squared_error(actual_prices, predicted_prices)
|
54 |
#rmse = np.sqrt(mse)
|
@@ -62,7 +62,7 @@ def get_forecast(company_name):
|
|
62 |
|
63 |
# Display accuracy metrics
|
64 |
# accuracy_text = f"MAE: {mae:.2f}, MSE: {mse:.2f}, RMSE: {rmse:.2f}, MAPE: {mape:.2f}%"
|
65 |
-
accuracy_text = f"{accuracy:.2f} %"
|
66 |
|
67 |
return fig , accuracy_text
|
68 |
|
|
|
47 |
forecast_df = forecast[['ds', 'yhat', 'yhat_lower', 'yhat_upper']]
|
48 |
|
49 |
# Calculate accuracy metrics
|
50 |
+
actual_prices = stock_df['y'].values[-1000:] # Last 1000 actual prices
|
51 |
+
predicted_prices = forecast_df['yhat'].values[-1000:] # Forecasted prices for the last 1000 days
|
52 |
#mae = mean_absolute_error(actual_prices, predicted_prices)
|
53 |
#mse = mean_squared_error(actual_prices, predicted_prices)
|
54 |
#rmse = np.sqrt(mse)
|
|
|
62 |
|
63 |
# Display accuracy metrics
|
64 |
# accuracy_text = f"MAE: {mae:.2f}, MSE: {mse:.2f}, RMSE: {rmse:.2f}, MAPE: {mape:.2f}%"
|
65 |
+
accuracy_text = f"{accuracy:.2f} % based on past 03 Years Prediction vs Actual Stock Price."
|
66 |
|
67 |
return fig , accuracy_text
|
68 |
|