Skip to main content

projected_kernel_matrix

Function projected_kernel_matrix 

Source
pub fn projected_kernel_matrix(
    xs: &[Vec<f32>],
    cfg: &ProjectedKernelConfig,
) -> QuantumResult<Vec<Vec<f32>>>
Expand description

Build the full PQK Gram matrix K[i][j] = k_PQK(xs[i], xs[j]).

Features are computed once per data point and cached, so the cost is O(m · embed) + O(m²·3n) rather than O(m²·embed).

§Errors

Returns QuantumError::EmptyInput for an empty data set; propagates embedding errors.