Код: Выделить всё
series = TimeSeries.from_dataframe(df_single, "Date", varName)
days = pd.date_range(start=df_single["Date"][0], periods=len(df_single), freq='D')
# Create a binary covariate: 0 for weekdays, 1 for weekends
weekend_covariate = [1 if day.weekday() in [5, 6] else 0 for day in days]
extended_covariate = TimeSeries.from_times_and_values(days, weekend_covariate)
# Split data into training and validation sets
train_series = series[:-14] # Train on all but the last 14 days
val_series = series[-14:] # Validate on the last 14 days
covariates_train = extended_covariate[:-14]
covariates_val = extended_covariate # Covariates must cover both past and future
# Define TFTModel (supports future covariates)
model = TiDEModel(
input_chunk_length=92, # Number of past days to look at
output_chunk_length=14, # Forecast horizon
n_epochs=50,
random_state=42
)
# Fit the model on training data and future covariates
model.fit(series=train_series, future_covariates=covariates_train)
# Make predictions
prediction = model.predict(n=14, future_covariates=covariates_val)

Итак, мой вопрос: как правильно добавить ограничения в модель, чтобы правильно распознавать выходные дни?
Подробнее здесь: https://stackoverflow.com/questions/790 ... s-modeling