Function opendp::transformations::then_index
source · pub fn then_index<M, TOA>(
categories: Vec<TOA>,
null: TOA
) -> PartialTransformation<VectorDomain<AtomDomain<usize>>, VectorDomain<AtomDomain<TOA>>, M, M>where
TOA: Primitive,
M: DatasetMetric,
(VectorDomain<AtomDomain<usize>>, M): MetricSpace,
(VectorDomain<AtomDomain<TOA>>, M): MetricSpace,
Expand description
Make a transformation that treats each element as an index into a vector of categories.
Arguments
input_domain
- The domain of the input vector.input_metric
- The metric of the input vector.categories
- The set of categories to index into.null
- Category to return if the index is out-of-range of the category set.
Generics
M
- Metric TypeTOA
- Atomic Output Type. Output data will beVec<TOA>
.