dates
ies_pi_predict.dates
determine_training_dates
determine_training_dates(
prediction_start: datetime,
prediction_end: datetime,
min_training_days=default_min_training_days,
max_training_days=default_max_training_days,
min_factor=default_min_factor,
) -> tuple[datetime, datetime]
determine_training_dates calculates the dates needed for accurate training, given the dates for the prediction.
It uses min_factor to multiply the period of time between the two prediction dates, and it adjust the values with min_training_days and max_training_days.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
prediction_start
|
datetime
|
The start date of the prediction. |
required |
prediction_end
|
datetime
|
The end date of the prediction. |
required |
min_training_days
|
int
|
The minimum number of training days to consider. Defaults to config.default_min_training_days. |
default_min_training_days
|
max_training_days
|
int
|
The maximum number of training days to consider. Defaults to config.default_max_training_days. |
default_max_training_days
|
min_factor
|
float
|
The multiplying factor of the period of time. Defaults to config.default_min_factor. |
default_min_factor
|
Raises:
| Type | Description |
|---|---|
ValueError
|
When end_date comes before start_date. |
Returns:
| Type | Description |
|---|---|
tuple[datetime, datetime]
|
tuple[datetime, datetime]: A tuple containing the training_start_date and training_end_date. |