PhiFactors#

class caf.mat.direction.factors.PhiFactors(data, period_filter=None, additional_segments=None, segment_filters=None)[source]#

Bases: object

Managing phi factors data for OD to PA conversion.

Parameters:
  • data (DataFrame) – DataFrame with integer column names for time period (to home) and segmentation defined in the index. The segmentation index should at least contain time period (from home) and any other segments should be lists in additional_segments parameter.

  • period_filter (Collection[int] | None) – Optional list of time periods (columns) to keep, if not given all time period columns are used.

  • additional_segments (Sequence[str] | None) – Optional list of segments in addition to the time periods, these should be include in the index.

  • segment_filters (Mapping[str, Sequence[int]] | None) – Optional filters to apply to any of the segment columns in the index.

Methods

__init__(data[, period_filter, ...])

from_csv(path, segment_columns, *[, ...])

Load phi factors from a CSV.

get([slice_])

Get phi factors for a single slice as a time period matrix.