Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -50,8 +50,8 @@ def predict_values(start_doc, end_doc, days_option):
|
|
50 |
close_future_rate = close_rate_model.make_future_dataframe(periods=days_option, freq='D')
|
51 |
|
52 |
# Generate DOC values within the specified range
|
53 |
-
doc_values = np.linspace(start_doc, end_doc, num=len(farm_future_rate))
|
54 |
-
doc_values = np.round(doc_values, 1)
|
55 |
|
56 |
# Assign the generated DOC values to the future dataframes
|
57 |
farm_future_rate['DOC'] = doc_values
|
@@ -65,13 +65,24 @@ def predict_values(start_doc, end_doc, days_option):
|
|
65 |
|
66 |
# Filter to get only the future predictions (last `days_option` days)
|
67 |
farm_output = farm_forecast_rate[['ds', 'yhat', 'yhat_lower', 'yhat_upper']].tail(days_option).copy()
|
68 |
-
farm_output['DOC'] = np.round(farm_future_rate['DOC'].tail(days_option), 1)
|
|
|
|
|
|
|
|
|
|
|
69 |
|
70 |
open_output = open_forecast_rate[['ds', 'yhat', 'yhat_lower', 'yhat_upper']].tail(days_option).copy()
|
71 |
-
open_output['DOC'] = np.round(open_future_rate['DOC'].tail(days_option), 1)
|
|
|
|
|
|
|
72 |
|
73 |
close_output = close_forecast_rate[['ds', 'yhat', 'yhat_lower', 'yhat_upper']].tail(days_option).copy()
|
74 |
-
close_output['DOC'] = np.round(close_future_rate['DOC'].tail(days_option), 1)
|
|
|
|
|
|
|
75 |
|
76 |
# Create Plotly graphs
|
77 |
fig_farm = go.Figure()
|
|
|
50 |
close_future_rate = close_rate_model.make_future_dataframe(periods=days_option, freq='D')
|
51 |
|
52 |
# Generate DOC values within the specified range
|
53 |
+
doc_values = np.linspace(start_doc, end_doc, num=len(farm_future_rate))
|
54 |
+
doc_values = np.round(doc_values, 1)
|
55 |
|
56 |
# Assign the generated DOC values to the future dataframes
|
57 |
farm_future_rate['DOC'] = doc_values
|
|
|
65 |
|
66 |
# Filter to get only the future predictions (last `days_option` days)
|
67 |
farm_output = farm_forecast_rate[['ds', 'yhat', 'yhat_lower', 'yhat_upper']].tail(days_option).copy()
|
68 |
+
farm_output['DOC'] = np.round(farm_future_rate['DOC'].tail(days_option), 1)
|
69 |
+
|
70 |
+
# Round the predictions to 1 decimal place
|
71 |
+
farm_output['yhat'] = np.round(farm_output['yhat'], 1)
|
72 |
+
farm_output['yhat_lower'] = np.round(farm_output['yhat_lower'], 1)
|
73 |
+
farm_output['yhat_upper'] = np.round(farm_output['yhat_upper'], 1)
|
74 |
|
75 |
open_output = open_forecast_rate[['ds', 'yhat', 'yhat_lower', 'yhat_upper']].tail(days_option).copy()
|
76 |
+
open_output['DOC'] = np.round(open_future_rate['DOC'].tail(days_option), 1)
|
77 |
+
open_output['yhat'] = np.round(open_output['yhat'], 1)
|
78 |
+
open_output['yhat_lower'] = np.round(open_output['yhat_lower'], 1)
|
79 |
+
open_output['yhat_upper'] = np.round(open_output['yhat_upper'], 1)
|
80 |
|
81 |
close_output = close_forecast_rate[['ds', 'yhat', 'yhat_lower', 'yhat_upper']].tail(days_option).copy()
|
82 |
+
close_output['DOC'] = np.round(close_future_rate['DOC'].tail(days_option), 1)
|
83 |
+
close_output['yhat'] = np.round(close_output['yhat'], 1)
|
84 |
+
close_output['yhat_lower'] = np.round(close_output['yhat_lower'], 1)
|
85 |
+
close_output['yhat_upper'] = np.round(close_output['yhat_upper'], 1)
|
86 |
|
87 |
# Create Plotly graphs
|
88 |
fig_farm = go.Figure()
|