Interface Quantizer
- All Known Implementing Classes:
RaBitQuantizer
Quantizers are typically used in machine learning and information retrieval to transform raw data into a format that is more suitable for processing, such as a compressed representation.
-
Method Summary
Modifier and TypeMethodDescriptionencode(RealVector vector) Encodes the given data vector into another vector representation.default Transformed<RealVector>encode(Transformed<RealVector> vector) Returns theEstimatorinstance associated with this object.static QuantizernoOpQuantizer(Metric metric) Creates a no-opQuantizerthat does not perform any data transformation.
-
Method Details
-
estimator
Returns theEstimatorinstance associated with this object.The estimator is responsible for performing the primary distance estimation or calculation logic. This method provides access to that underlying component.
- Returns:
- the
Estimatorinstance, which is guaranteed to be non-null.
-
encode
-
encode
Encodes the given data vector into another vector representation.This method transforms the raw input data into a different, quantized format, which is often a vector more suitable for processing/storing the data. The specifics of the encoding depend on the implementation of the class.
- Parameters:
vector- the inputRealVectorto be encoded. Must not benulland is assumed to have been preprocessed, such as by rotation and/or translation. The preprocessing has to align with the requirements of the specific quantizer.- Returns:
- the encoded vector representation of the input data, guaranteed to be non-null.
-
noOpQuantizer
Creates a no-opQuantizerthat does not perform any data transformation.The returned quantizer's
encode(RealVector)method acts as an identity function, returning the input vector without modification. Theestimator()is created directly from the distance function of the providedMetric. This can be useful for baseline comparisons or for algorithms that require aQuantizerbut where no quantization is desired.
-