Lightweight library for computing statistical features from weighted event sequences. Might be used in search ranking and feature extraction.
See examples of basic usage in the examples/.
Filter to top N elements by feature value before computing statistics:
stats, err := wseq.ComputeTopN(weights, features, 5)| Function | Description |
|---|---|
Compute(weights, features) |
Compute all statistics with validation |
ComputeUnchecked(weights, features) |
Compute without validation (faster) |
ComputeInto(stats, weights, features) |
Compute into existing Stats |
ComputeTopN(weights, features, n) |
Filter to top N, then compute |
FilterTopN(weights, features, n) |
Get top N elements by feature value |
- Weights must be in range [0, 1]
- Features must be in range [0, 1]
- Input slices must have equal length
- Input slices must not be empty