Sample Paths
Randomly samples a subset of paths. All events for sampled paths are kept. Uses DuckDB reservoir sampling.
Usage
# Sample 10% of paths
es.sample_paths(0.1)
# Sample exactly 1000 paths
es.sample_paths(1000)
# Reproducible sampling
es.sample_paths(0.2, random_state=42)Parameters
| Parameter | Type | Description |
|---|---|---|
sample_size | float | int | If a float in (0, 1]: fraction of paths to sample. If an int: absolute number of paths. |
random_state | int | None | Random seed for reproducible results. |
path_id_col | str | None | Override the path ID column. |