NearestNeighborConverter#
- class sdm.prior.NearestNeighborConverter(p: HP[float] | Correlated[float] | float, output_mode: str | HP[str] = 'identity', *, random_fn: RandomFunction | None = None)#
Bases:
CategoricalConverterAssign each row to its nearest sampled center using Minkowski distance.
- Parameters:
p (HP[float] | Correlated[float] | float) – Minkowski distance exponent.
output_mode (str | HP[str]) – Representation passed to child nodes.
"identity"keeps input slices,"index"repeats category indices across channels,"center"returns the nearest center, and"function"appliesrandom_fnto that center.random_fn (RandomFunction | None) – Random function applied to selected centers. Required for
"function"output mode.