fromVectors

fun fromVectors(floatVectorValues: FloatVectorValues, confidenceInterval: Float, totalVectorCount: Int, bits: Byte): ScalarQuantizer

This will read the float vector values and calculate the quantiles. If the number of float vectors is less than .SCALAR_QUANTIZATION_SAMPLE_SIZE then all the values will be read and the quantiles calculated. If the number of float vectors is greater than .SCALAR_QUANTIZATION_SAMPLE_SIZE then a random sample of .SCALAR_QUANTIZATION_SAMPLE_SIZE will be read and the quantiles calculated.

Return

A new ScalarQuantizer instance

Parameters

floatVectorValues

the float vector values from which to calculate the quantiles

confidenceInterval

the confidence interval used to calculate the quantiles

totalVectorCount

the total number of live float vectors in the index. This is vital for accounting for deleted documents when calculating the quantiles.

bits

the number of bits to use for quantization

Throws

IOException

if there is an error reading the float vector values


fun fromVectors(floatVectorValues: FloatVectorValues, confidenceInterval: Float, totalVectorCount: Int, bits: Byte, quantizationSampleSize: Int): ScalarQuantizer