Open
Conversation
…ures Add three new public functions to the scoring module: - compute_ranks_parallel(distances): computes rank matrix via parallel row-wise argsort + scatter (replaces double-argsort, returns int32) - coranking_measures_from_ranks(ranks_high, ranks_low, k_neighbors): computes QNN, LCMC, AUC, kmax, Qlocal, Qglobal, T(k), C(k) directly from rank matrices without materialising the N×N co-ranking matrix Q, reducing peak memory from O(3N²) to O(2N²) - _coranking_qnn_histogram, _coranking_trust_cont: numba helpers All existing API is unchanged. Verified numerically identical results against DRScorer.coranking_matrix + DRScorer.coranking_measures.
Add tanimoto_similarity_matrix_blas() as a drop-in replacement for tanimoto_int_similarity_matrix_numba(). Delegates the O(N*M*D) dot product to BLAS SGEMM, then applies the Tanimoto formula in-place via a small numba kernel (_apply_tanimoto_formula). Returns identical float32 output (max diff < 1e-5). Speedup grows with matrix size as BLAS benefits from cache blocking and SIMD.
Owner
|
I'm ready to merge it, but would like to see if new functions give the same results as the old one. Could you please add tests on simulated data and check the results for the old and new version of the code? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tanimoto_similarity_matrix_blas) — 10-50x faster than element-wise numba for large matricescompute_ranks_parallel) — argsort + scatter via numba prange, returns int32coranking_measures_from_ranks) — computes QNN, LCMC, AUC, Qlocal, Qglobal, T, C directly from rank matrices without materializing the N×N Q matrix