school_holiday_features_adder#

Transform that adds school holiday features to time series data.

School holidays are retrieved from the free OpenHolidays API (https://openholidaysapi.org). The data is licensed under the Open Database License (ODbL) 1.0, which permits commercial use and requires attribution: “School holiday data from OpenHolidays API (openholidaysapi.org), licensed under ODbL 1.0.”

The API is only contacted in SchoolHolidayFeatureAdder.fit (one request per fit, unless csv_path is set) and in SchoolHolidayFeatureAdder.export_csv. Fitted holiday periods are stored on the transform, so they are part of the trained checkpoint. An exported file can be used without any network access, either by setting csv_path (read in fit) or by calling SchoolHolidayFeatureAdder.from_csv, which returns a fitted transform.

Classes#

LocalizedText(*, language, text)

A holiday name in one language.

OpenHolidaysClient(*[, school_holidays_url, ...])

Client for the OpenHolidays API school holidays endpoint.

SchoolHolidayConfig(*, country_code[, ...])

Opt-in configuration for school holiday features.

SchoolHolidayFeatureAdder(*, country_code, ...)

Transform that adds a school holiday indicator to time series data.

SchoolHolidayPeriod(*, start_date, end_date, ...)

A school holiday period.

SchoolHolidayRecord(*, startDate, endDate, ...)

A school holiday as returned by the OpenHolidays /SchoolHolidays endpoint.

SchoolHolidayRow(*, country_code[, ...])

One row of a CSV file written by SchoolHolidayFeatureAdder.export_csv.

SchoolHolidaysRequest(*, countryIsoCode, ...)

Query parameters for the OpenHolidays /SchoolHolidays endpoint.

Subdivision(*, code, shortName)

A subdivision a holiday applies to.