TimeOfDayCost(times: Tuple[datetime.time, ...], cost: Tuple[float, ...], aggregation: str, net: bool, fill: str, timezone: str = None)¶
Cost values based on the time of day.
- times (tuple of datetime.time) – The times to associate with each cost value
- cost (tuple of float) – The cost per unit error of the forecasted variable for each time. Must have the same length as times.
- aggregation (str) – Aggregation method to use after calculating cost for the error series. Currently only ‘sum’ or ‘mean’ are available.
- net (bool) – If True, compute the ‘net’ aggregate error instead of first calcuating the absolute error before performing the aggregation.
- fill (str) – Fill method to apply for times between those specified in times. Options are ‘forward’ or ‘backward’.
- timezone (str, default None) – IANA timezone string to use when constructing datetimes. If None, the timezone of the observations is used, which is the report timezone when calculated in a report.
__init__(times: Tuple[datetime.time, ...], cost: Tuple[float, ...], aggregation: str, net: bool, fill: str, timezone: str = None) → None¶
__init__(times, …], cost, …], …)
Construct a dataclass from the given dict, matching keys with the class fields.
Convience wrapper for
dataclasses.replace()to create a new dataclasses from the old with the given keys replaced.
Convert the dataclass into a dictionary suitable for uploading to the API.