{"categories":[{"label":"Mathematics","url":"https://skillfed.io/packages/category/scientific-engineering-mathematics/2"}],"enrichment":{"capability":"Performs fast sparse matrix multiplication with integrated top-n result selection, reducing memory footprint and improving performance over separate multiplication and filtering steps.","skillfed_tags":["sparse-matrices","similarity-matching","high-performance"],"use_cases":["Find top-10 most similar documents in a corpus by multiplying TF-IDF matrices and retaining only the highest-scoring matches per row.","Distribute large-scale matrix multiplication across a cluster by splitting matrices into chunks, computing top-n products per chunk, and re-zipping results.","Reduce memory footprint when comparing high-dimensional embeddings by filtering to top-n results during multiplication rather than storing the full product.","Parallelize sparse matrix operations across multiple CPU cores to speed up similarity computations on multi-core systems.","Apply threshold-based filtering during multiplication to discard low-confidence matches and further reduce output size."],"what_it_does":"sparse_dot_topn is a Python package that accelerates a common operation in large-scale similarity matching: multiplying two sparse matrices and keeping only the top-n results per row. It wraps a C++ extension (with vendored OpenMP) to perform this combined operation in a single pass, avoiding the memory overhead of computing the full product and then filtering. The package supports CSR, CSC, and COO sparse matrix formats with 32- and 64-bit integer and float data types, and can parallelize across multiple threads.\n\nThe main use case is comparing very large feature vectors (e.g., TF-IDF matrices) and selecting the best matches efficiently. It offers optional threshold filtering to discard low-scoring results and density hints to reduce pre-allocated memory. The package is actively maintained, supports modern Python versions (3.9\u20133.12), and provides pre-built wheels for common platforms, though source installation is possible for architecture-specific optimization.","worth_installing":"Yes. The package solves a genuine performance and memory bottleneck in large-scale sparse matrix operations. It is actively maintained, has no known vulnerabilities, carries a permissive license, and provides convenient pre-built wheels. Install friction is moderate but manageable. Recommended for projects involving large sparse matrix similarity matching or top-n filtering."},"id":"sparse-dot-topn","links":{"html":"https://skillfed.io/packages/sparse-dot-topn","md":"https://skillfed.io/packages/sparse-dot-topn.md","pypi":"https://pypi.org/project/sparse-dot-topn/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2025-12-16","license_spdx":null,"license_treatment":"permissive","name":"sparse-dot-topn","python_support":"supports_current","summary":"This package boosts a sparse matrix multiplication followed by selecting the top-n multiplication"},"popularity":{"monthly_downloads":262316,"position":8376,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"1.2.0"}
