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

ParameterTypeDescription
sample_sizefloat | intIf a float in (0, 1]: fraction of paths to sample. If an int: absolute number of paths.
random_stateint | NoneRandom seed for reproducible results.
path_id_colstr | NoneOverride the path ID column.