Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -51,8 +51,8 @@ if date_column in features:
|
|
51 |
|
52 |
selected_features = st.multiselect("Select features for analysis", features)
|
53 |
|
54 |
-
# Specify forecast period
|
55 |
-
|
56 |
|
57 |
# Check if the necessary columns exist
|
58 |
if target_variable and date_column in data.columns:
|
@@ -63,8 +63,8 @@ if target_variable and date_column in data.columns:
|
|
63 |
model = Prophet()
|
64 |
model.fit(train_data)
|
65 |
|
66 |
-
# Make future predictions for the specified number of
|
67 |
-
future = model.make_future_dataframe(periods=
|
68 |
forecast = model.predict(future)
|
69 |
|
70 |
# Display the forecast
|
|
|
51 |
|
52 |
selected_features = st.multiselect("Select features for analysis", features)
|
53 |
|
54 |
+
# Specify forecast period in months
|
55 |
+
forecast_period_months = st.number_input("Enter forecast period in months", min_value=1, value=6)
|
56 |
|
57 |
# Check if the necessary columns exist
|
58 |
if target_variable and date_column in data.columns:
|
|
|
63 |
model = Prophet()
|
64 |
model.fit(train_data)
|
65 |
|
66 |
+
# Make future predictions for the specified number of months
|
67 |
+
future = model.make_future_dataframe(periods=forecast_period_months, freq='M') # Predicting specified months into the future
|
68 |
forecast = model.predict(future)
|
69 |
|
70 |
# Display the forecast
|