Spaces:
Running
Running
Fixed the export function
Browse files
app.py
CHANGED
|
@@ -126,24 +126,24 @@ def export_results(eval_df, cv_results, future_forecasts):
|
|
| 126 |
# Create temp directory if it doesn't exist
|
| 127 |
temp_dir = tempfile.mkdtemp()
|
| 128 |
|
| 129 |
-
|
| 130 |
|
| 131 |
if eval_df is not None:
|
| 132 |
eval_path = os.path.join(temp_dir, f"evaluation_metrics_{timestamp}.csv")
|
| 133 |
eval_df.to_csv(eval_path, index=False)
|
| 134 |
-
|
| 135 |
|
| 136 |
if cv_results is not None:
|
| 137 |
cv_path = os.path.join(temp_dir, f"cross_validation_results_{timestamp}.csv")
|
| 138 |
cv_results.to_csv(cv_path, index=False)
|
| 139 |
-
|
| 140 |
|
| 141 |
if future_forecasts is not None:
|
| 142 |
forecast_path = os.path.join(temp_dir, f"forecasts_{timestamp}.csv")
|
| 143 |
future_forecasts.to_csv(forecast_path, index=False)
|
| 144 |
-
|
| 145 |
|
| 146 |
-
return
|
| 147 |
|
| 148 |
# Main forecasting logic
|
| 149 |
def run_forecast(
|
|
|
|
| 126 |
# Create temp directory if it doesn't exist
|
| 127 |
temp_dir = tempfile.mkdtemp()
|
| 128 |
|
| 129 |
+
result_files = []
|
| 130 |
|
| 131 |
if eval_df is not None:
|
| 132 |
eval_path = os.path.join(temp_dir, f"evaluation_metrics_{timestamp}.csv")
|
| 133 |
eval_df.to_csv(eval_path, index=False)
|
| 134 |
+
result_files.append(eval_path)
|
| 135 |
|
| 136 |
if cv_results is not None:
|
| 137 |
cv_path = os.path.join(temp_dir, f"cross_validation_results_{timestamp}.csv")
|
| 138 |
cv_results.to_csv(cv_path, index=False)
|
| 139 |
+
result_files.append(cv_path)
|
| 140 |
|
| 141 |
if future_forecasts is not None:
|
| 142 |
forecast_path = os.path.join(temp_dir, f"forecasts_{timestamp}.csv")
|
| 143 |
future_forecasts.to_csv(forecast_path, index=False)
|
| 144 |
+
result_files.append(forecast_path)
|
| 145 |
|
| 146 |
+
return result_files
|
| 147 |
|
| 148 |
# Main forecasting logic
|
| 149 |
def run_forecast(
|