nexuml.evaluation.utils¶
nexuml.evaluation.utils
¶
Utilities for evaluation algorithms.
ReservoirSampler
¶
Online reservoir sampling (Vitter's Algorithm R).
Maintains a fixed-size random sample of items seen so far, suitable for streaming large datasets without storing everything.
FeatureStore
¶
RAMFeatureStore
¶
MemmapFeatureStore
¶
Bases: FeatureStore
Disk-backed feature storage that streams directly to a numpy memmap.
Features are written to disk during append() without buffering in RAM.
The memmap is pre-allocated to (max_samples, D) when max_samples is
provided; otherwise capacity starts at 1024 rows and doubles as needed.
finalize() trims the file to the actual row count written.
create_feature_store
¶
create_feature_store(
backend: str = "ram",
*,
max_samples: int | None = None,
storage_path: str | Path | None = None,
retain_storage: bool = False,
) -> FeatureStore
Create a feature store backend.
Returns:
| Type | Description |
|---|---|
FeatureStore
|
The requested |
Raises:
| Type | Description |
|---|---|
ValueError
|
If backend is not |