共用方式為


HolidayEnricher 類別

定義常見的假日擴充器。

HolidayEnricher 類別可用來聯結假日公用數據與您的數據。 例如,請參閱開放式數據集目錄中的 公用假日 數據集。

使用公用數據物件進行初始化。

建構函式

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

參數

名稱 Description
public_data_object
必要

公用數據集。

enable_telemetry

指出是否要傳送遙測。

預設值: False

方法

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, time_round_granularity: str = 'day') -> Tuple[CustomerData, PublicData, List[Tuple[str, str]]]

參數

名稱 Description
customer_data_object
必要

客戶數據類別的實例。

time_round_granularity
str

時間粒度、『day』、『hour』或 『month』。 默認值為 『day』。

預設值: day

傳回

類型 Description

擴充客戶數據的 Tuple(new_customer_data)和processed_public_data。

enrich_customer_data_with_agg

使用指定的匯總工具擴充客戶數據。

enrich_customer_data_with_agg(customer_data_object: CustomerData, agg: str, time_round_granularity: str = 'day') -> Tuple[CustomerData, List[Tuple[str, str]]]

參數

名稱 Description
customer_data_object
必要

客戶數據類別的實例。

agg
必要

匯總工具。

time_round_granularity
str

時間粒度、『hour』、『day』或 『month』。 默認值為 『day』。

預設值: day

傳回

類型 Description

擴充客戶數據的 Tuple(joined_data)。