pathsig.projections.anisotropic#
- pathsig.projections.anisotropic(weights, weight_threshold, depth, path_dim, full_levels=())#
Projection selecting coordinates via an anisotropic truncation rule. It selects words \((i_1,\ldots,i_n)\) satisfying
\[\texttt{weights}[i_1] + \cdots + \texttt{weights}[i_n] \le \texttt{weight\_threshold},\]together with all words at levels listed in
full_levels.- Parameters:
weights (iterable of float or int) – Per-letter weights of length
path_dim.weight_threshold (float or int) – Non-strict threshold used by the selection rule.
depth (int) – Maximum word length (signature level) to include.
path_dim (int) – Path dimension (alphabet size).
full_levels (iterable of int) – (optional) Levels in \(\{1,2,\ldots,\mathrm{depth}\}\) that should be included in full in addition to the anisotropically selected set.
- Returns:
Projection object to be used with
pathsig.Signatureandpathsig.LogSignature.- Return type:
Projection
Notes
It is preferable to specify
weightsandweight_thresholdas integers. Floating-point inputs can make the cutoffweights[i_1] + ... + weights[i_n] <= weight_thresholdunstable near the boundary due to inexact representation and accumulated rounding error. Integer arithmetic, by contrast, yields a deterministic, platform-independent truncation rule.Examples
import pathsig proj = pathsig.projections.anisotropic( weights=[1, 2, 3, 4], weight_threshold=6, depth=5, path_dim=4, ) sig_size = proj.sig_size # output feature dimension