trajdl.datasets.base.locseq module#
- class trajdl.datasets.base.locseq.LocSeq(seq: Any, entity_id: str | None = None, ts_seq: List[int] | None = None, ts_delta: List[float] | None = None, dis_delta: List[float] | None = None, start_ts: int | None = None)[source]#
Bases:
BaseSeqLocation sequence representation.
- loc_seq#
The list of locations in the sequence.
- Type:
List[str]
- entity_id#
An optional identifier, which can store the sequence ID or user ID.
- Type:
Union[str, None]
- ts_seq#
A sequence of timestamps (in seconds or milliseconds), defined by the user without constraints.
- Type:
Union[List[int], None]
- static check_seq(seq: Any) List[str][source]#
Check if the sequence is valid.
- Parameters:
seq (Any) – The sequence to be checked.
- Returns:
The validated location sequence.
- Return type:
List[str]
- Raises:
ValueError – If seq is not a List[str].
- property d: str#
Return the destination location.
- property o: str#
Return the starting location.