Problem
The HNOCA kernel is currently computed as:
kernel_matrix.data /= 2 * n_neighbors - kernel_matrix.data
kernel_matrix.data = kernel_matrix.data**2
This means the base kernel before squaring uses 2 * n_neighbors as the denominator, while the Jarrad (Jaccard-based) kernel uses 4 * n_neighbors:
kernel_matrix.data /= 4 * n_neighbors - kernel_matrix.data # Jarrad / Jaccard
Fix
To be faithful to the original HNOCA implementation, the HNOCA kernel should be the Jarrad kernel squared, i.e.:
HNOCA(x, y) = Jarrad(x, y)^2
This requires changing the denominator from 2 * n_neighbors to 4 * n_neighbors:
kernel_matrix.data /= 4 * n_neighbors - kernel_matrix.data
kernel_matrix.data = kernel_matrix.data**2
Problem
The HNOCA kernel is currently computed as:
This means the base kernel before squaring uses
2 * n_neighborsas the denominator, while the Jarrad (Jaccard-based) kernel uses4 * n_neighbors:Fix
To be faithful to the original HNOCA implementation, the HNOCA kernel should be the Jarrad kernel squared, i.e.:
This requires changing the denominator from
2 * n_neighborsto4 * n_neighbors: