Skip to main content

center_kernel_matrix_test

Function center_kernel_matrix_test 

Source
pub fn center_kernel_matrix_test(
    k_test: &Array2<f64>,
    k_train: &Array2<f64>,
) -> Result<Array2<f64>>
Expand description

Center a test kernel matrix using the training kernel matrix statistics

For out-of-sample data, the centering must use the training data statistics: K_test_c = K_test - 1’_m K_train - K_test 1_n + 1’_m K_train 1_n

§Arguments

  • k_test - Test kernel matrix, shape (m, n) where m = test samples, n = training samples
  • k_train - Training kernel matrix, shape (n, n)

§Returns

  • Result<Array2<f64>> - The centered test kernel matrix, shape (m, n)