CommonWeatherEnricher 类

为 GFS 预测和 ISD 历史记录数据定义常见的天气扩充器。

NOAA 全球预报系统(GFS) 天气 数据和 NOAA 集成 Surface Data (ISD) 历史数据 在开放数据集目录中可用。 这些公共数据集可用于扩充数据。

使用公共数据对象进行初始化。

构造函数

CommonWeatherEnricher(public_data_object: PublicData, enable_telemetry: bool = False)

参数

名称 说明
public_data_object
必需

公共数据集。

enable_telemetry

指示是否发送遥测数据。

默认值: False
public_data_object
必需

公共数据集。

enable_telemetry
必需

指示是否发送遥测数据。

方法

enrich_customer_data_no_agg

使用默认aggregator_all扩充客户数据。

enrich_customer_data_with_agg

使用指定的聚合器扩充客户数据。

enrich_customer_data_no_agg

使用默认aggregator_all扩充客户数据。

enrich_customer_data_no_agg(customer_data_object: CustomerData, location_match_granularity: int = 1, time_round_granularity: str = 'hour') -> Tuple[CustomerData, PublicData, List[Tuple[str, str]]]

参数

名称 说明
customer_data_object
必需

客户数据类的实例。

location_match_granularity
int

location_granularity.closest_top_n

默认值: 1
time_round_granularity
str

时间粒度、“day”、“hour”或“month”。

默认值: hour

返回

类型 说明

扩充的客户数据的元组(new_customer_data),processed_public_data。

enrich_customer_data_with_agg

使用指定的聚合器扩充客户数据。

enrich_customer_data_with_agg(customer_data_object: CustomerData, agg: str, location_match_granularity: int = 1, time_round_granularity: str = 'hour') -> Tuple[CustomerData, List[Tuple[str, str]]]

参数

名称 说明
customer_data_object
必需

客户数据类的实例。

agg
必需

聚合器。

location_match_granularity
int

location_granularity.closest_top_n

默认值: 1
time_round_granularity
str

time_granularity

默认值: hour

返回

类型 说明

扩充的客户数据的元组(joined_data)