{ "info": { "author": "Zhe Sun", "author_email": "ymwdalex@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "# sparse\\_dot\\_topn: \n\n**sparse\\_dot\\_topn** provides a fast way to performing a sparse matrix multiplication followed by top-n multiplication result selection.\n\nComparing very large feature vectors and picking the best matches, in practice often results in performing a sparse matrix multiplication followed by selecting the top-n multiplication results. In this package, we implement a customized Cython function for this purpose. When comparing our Cythonic approach to doing the same use with SciPy and NumPy functions, **our approach improves the speed by about 40% and reduces memory consumption.**\n\nThis package is made by ING Wholesale Banking Advanced Analytics team. This [blog](https://medium.com/@ingwbaa/https-medium-com-ingwbaa-boosting-selection-of-the-most-similar-entities-in-large-scale-datasets-450b3242e618) explains how we implement it.\n\n## Example\n``` python\n import numpy as np\n from scipy.sparse import csr_matrix\n from scipy.sparse import rand\n from sparse_dot_topn import awesome_cossim_topn\n\n N = 10\n a = rand(100, 1000000, density=0.005, format='csr')\n b = rand(1000000, 200, density=0.005, format='csr')\n\n # Use standard implementation\n\n c = awesome_cossim_topn(a, b, N, 0.01)\n\n # Use parallel implementation with 4 threads\n\n d = awesome_cossim_topn(a, b, N, 0.01, use_threads=True, n_jobs=4)\n```\n\nYou can also find code which compares our boosting method with calling scipy+numpy function directly in example/comparison.py\n\n## Dependency and Install\nInstall `numpy` and `cython` first before installing this package. Then,\n``` sh\npip install sparse_dot_topn\n```\n\n\n## Uninstall\n``` sh\npip uninstall sparse_dot_topn\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ing-bank/sparse_dot_topn", "keywords": "cosine-similarity sparse-matrix scipy cython", "license": "", "maintainer": "", "maintainer_email": "", "name": "sparse-dot-topn", "package_url": "https://pypi.org/project/sparse-dot-topn/", "platform": "", "project_url": "https://pypi.org/project/sparse-dot-topn/", "project_urls": { "Homepage": "https://github.com/ing-bank/sparse_dot_topn" }, "release_url": "https://pypi.org/project/sparse-dot-topn/0.2.6/", "requires_dist": null, "requires_python": "", "summary": "This package boosts a sparse matrix multiplication followed by selecting the top-n multiplication", "version": "0.2.6" }, "last_serial": 5920491, "releases": { "0.2": [ { "comment_text": "", "digests": { "md5": "0cfd8c8b14542677235d79a411ee4dd1", "sha256": "b041f5db301763f3930127d8afce3735d9b44ca9096db2a643da69c1bed16349" }, "downloads": -1, "filename": "sparse_dot_topn-0.2-cp36-cp36m-macosx_10_12_x86_64.whl", "has_sig": false, "md5_digest": "0cfd8c8b14542677235d79a411ee4dd1", "packagetype": "bdist_wheel", "python_version": "cp36", "requires_python": null, "size": 30448, "upload_time": "2018-11-14T20:01:53", "url": "https://files.pythonhosted.org/packages/d3/8a/ab211aff58ef9f6448cd3af24a812d219ff51af2eebe70aedacc62316dd9/sparse_dot_topn-0.2-cp36-cp36m-macosx_10_12_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "96f2d130483a7f56ac5f05afda25046f", "sha256": "ab2696a85a44536b4048b702239dc374b14274cb00c17593629d1f82bd397528" }, "downloads": -1, "filename": "sparse_dot_topn-0.2.tar.gz", "has_sig": false, "md5_digest": "96f2d130483a7f56ac5f05afda25046f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 52921, "upload_time": "2018-11-14T20:01:55", "url": "https://files.pythonhosted.org/packages/78/ea/23bc3c551972082493c479c9818e15507a638027e19afd7e71a53004147b/sparse_dot_topn-0.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "ec31706c288fae46f9a5a24829cc616d", "sha256": "e503f5ff6224619aaf0d0d851a03458da01dc72b61925394a443d995a8726c9a" }, "downloads": -1, "filename": "sparse_dot_topn-0.2.1-cp36-cp36m-macosx_10_12_x86_64.whl", "has_sig": false, "md5_digest": "ec31706c288fae46f9a5a24829cc616d", "packagetype": "bdist_wheel", "python_version": "cp36", "requires_python": null, "size": 31543, "upload_time": "2018-11-26T22:10:06", "url": "https://files.pythonhosted.org/packages/ef/13/9f8ecf785985485c7763281f2dac9b983bce8690f3ba904dce89a14f025a/sparse_dot_topn-0.2.1-cp36-cp36m-macosx_10_12_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "23104cab9c4146a67c2f829a5ee2ab88", "sha256": "04f1d9ce5982eda5a61fcd11fed3967ec3b21d8ea0646253e6e4b1361dd43293" }, "downloads": -1, "filename": "sparse_dot_topn-0.2.1.tar.gz", "has_sig": false, "md5_digest": "23104cab9c4146a67c2f829a5ee2ab88", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 54687, "upload_time": "2018-11-26T22:10:08", "url": "https://files.pythonhosted.org/packages/45/d5/61a7e0ad871453385db289a3f44a7ab707f4f643aeb65a0f99e36d785b43/sparse_dot_topn-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "08e1c045d5b2caf1237f93490c3a2f6b", "sha256": "0dadde3a591b0f63b1ef970d368cd0c0a54cad5a5295e7d9afdb7d751bd5d6ad" }, "downloads": -1, "filename": "sparse_dot_topn-0.2.2-cp27-cp27m-macosx_10_12_intel.whl", "has_sig": false, "md5_digest": "08e1c045d5b2caf1237f93490c3a2f6b", "packagetype": "bdist_wheel", "python_version": "cp27", "requires_python": null, "size": 61518, "upload_time": "2019-05-28T22:23:54", "url": "https://files.pythonhosted.org/packages/52/6b/a53b606c1022a3b997183d69165ebd1b608e311200f66797ec8ad3faeb5e/sparse_dot_topn-0.2.2-cp27-cp27m-macosx_10_12_intel.whl" }, { "comment_text": "", "digests": { "md5": "e2a8a280133869d930e2e408c16e5f31", "sha256": "8fb943fb4b60c1c20365d2862c3bf27be051f39ad450d5359d1fcb36fa2b42b9" }, "downloads": -1, "filename": "sparse_dot_topn-0.2.2-cp36-cp36m-macosx_10_12_x86_64.whl", "has_sig": false, "md5_digest": "e2a8a280133869d930e2e408c16e5f31", "packagetype": "bdist_wheel", "python_version": "cp36", "requires_python": null, "size": 31547, "upload_time": "2018-11-27T08:43:14", "url": "https://files.pythonhosted.org/packages/fa/e2/3cf3a06265797542e0bb7a10dc6a3da033f49be0e44d6167901a36a3f10e/sparse_dot_topn-0.2.2-cp36-cp36m-macosx_10_12_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "d214b6b2785a8d7694012bebaff8b6ce", "sha256": "16c61ea3221f21cc6e33bea296e91a3a79e3a3a381b38fff0ec9de516fe47bcc" }, "downloads": -1, "filename": "sparse_dot_topn-0.2.2-cp37-cp37m-macosx_10_12_x86_64.whl", "has_sig": false, "md5_digest": "d214b6b2785a8d7694012bebaff8b6ce", "packagetype": "bdist_wheel", "python_version": "cp37", "requires_python": null, "size": 31197, "upload_time": "2019-05-28T22:23:55", "url": "https://files.pythonhosted.org/packages/71/34/123e39fcad61243985d089271effaa107a2bca13569bb59cda33d294b3a6/sparse_dot_topn-0.2.2-cp37-cp37m-macosx_10_12_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "d7a76c1b5964893d46666e2411d136b8", "sha256": "a3234e586ca25d8c24da3aa3e63d676792282265e07996346db18c4898e36ec0" }, "downloads": -1, "filename": "sparse_dot_topn-0.2.2.tar.gz", "has_sig": false, "md5_digest": "d7a76c1b5964893d46666e2411d136b8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 54724, "upload_time": "2018-11-27T08:43:17", "url": "https://files.pythonhosted.org/packages/f6/f0/babb3362b108c54c151dff172d09ba4957b4b79e3b84c75dbaab3384f952/sparse_dot_topn-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "e7d5853a1125fe2bdb8de81810b88390", "sha256": "7feacb8851dd913c741c1058a76dd8ae32458eb7c2cc2a5c674afc2a7b1ca74e" }, "downloads": -1, "filename": "sparse_dot_topn-0.2.3-cp27-cp27m-macosx_10_12_intel.whl", "has_sig": false, "md5_digest": "e7d5853a1125fe2bdb8de81810b88390", "packagetype": "bdist_wheel", "python_version": "cp27", "requires_python": null, "size": 61520, "upload_time": "2019-05-28T22:27:16", "url": "https://files.pythonhosted.org/packages/05/f3/21de0c0bbe11cd39772a0250872ed356b63829b399f3165bf68b751ab2c8/sparse_dot_topn-0.2.3-cp27-cp27m-macosx_10_12_intel.whl" }, { "comment_text": "", "digests": { "md5": "5e3359825910e4493738a66034008bb3", "sha256": "634d2742fdeabb93820a3498cf4d49548e80f37c90d1095f7ba995ddf9689763" }, "downloads": -1, "filename": "sparse_dot_topn-0.2.3-cp37-cp37m-macosx_10_12_x86_64.whl", "has_sig": false, "md5_digest": "5e3359825910e4493738a66034008bb3", "packagetype": "bdist_wheel", "python_version": "cp37", "requires_python": null, "size": 31197, "upload_time": "2019-05-28T22:27:17", "url": "https://files.pythonhosted.org/packages/5d/a5/032a42957ae31421d79a3b588c31a1722bb30eb7b97975a1cfd76a9e5342/sparse_dot_topn-0.2.3-cp37-cp37m-macosx_10_12_x86_64.whl" } ], "0.2.4": [ { "comment_text": "", "digests": { "md5": "5aa27b17c1e8bc6411dc79334672d267", "sha256": "e117486a734753f6f0b10d902efa21b504c22027fa86704d570dba6c5620f2e2" }, "downloads": -1, "filename": "sparse_dot_topn-0.2.4-cp27-cp27m-macosx_10_12_intel.whl", "has_sig": false, "md5_digest": "5aa27b17c1e8bc6411dc79334672d267", "packagetype": "bdist_wheel", "python_version": "cp27", "requires_python": null, "size": 61576, "upload_time": "2019-05-28T22:53:37", "url": "https://files.pythonhosted.org/packages/41/d9/bde8b1ee7e39097b18ab0f9c47dd7e05f4f8f655485b8271336e3fa5fd8f/sparse_dot_topn-0.2.4-cp27-cp27m-macosx_10_12_intel.whl" }, { "comment_text": "", "digests": { "md5": "ea3278e40bb4ad20db78a6f9b7eaf01a", "sha256": "33f5b915814a25784736f0690ed5cc7d84914a690501321d793ddcab688d1b08" }, "downloads": -1, "filename": "sparse_dot_topn-0.2.4-cp37-cp37m-macosx_10_12_x86_64.whl", "has_sig": false, "md5_digest": "ea3278e40bb4ad20db78a6f9b7eaf01a", "packagetype": "bdist_wheel", "python_version": "cp37", "requires_python": null, "size": 31253, "upload_time": "2019-05-28T22:53:39", "url": "https://files.pythonhosted.org/packages/9b/48/f9b5c94e4f61264d8f61a5790105cd558ad55fc2ef8f2477fd84a47b1a63/sparse_dot_topn-0.2.4-cp37-cp37m-macosx_10_12_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "ccc5cd916420ac999dbbad9eb16f67d1", "sha256": "8fac48ed6577f1e7256091576185bfa65b1ef6cc1914823ad1d0a90e2882b096" }, "downloads": -1, "filename": "sparse_dot_topn-0.2.4.tar.gz", "has_sig": false, "md5_digest": "ccc5cd916420ac999dbbad9eb16f67d1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 54984, "upload_time": "2019-05-28T22:53:40", "url": "https://files.pythonhosted.org/packages/66/af/8c2ff179579e78a76ac694fd50d1f0e7d9ea63bbd7739de9123d94af4503/sparse_dot_topn-0.2.4.tar.gz" } ], "0.2.5": [ { "comment_text": "", "digests": { "md5": "6031e1973c423de05fcf2066834e5a5f", "sha256": "9505a3c194de5cc07a75260cfac7e33b9e4590ede858f2c443763f539c88386e" }, "downloads": -1, "filename": "sparse_dot_topn-0.2.5-cp27-cp27m-macosx_10_12_intel.whl", "has_sig": false, "md5_digest": "6031e1973c423de05fcf2066834e5a5f", "packagetype": "bdist_wheel", "python_version": "cp27", "requires_python": null, "size": 61604, "upload_time": "2019-05-28T23:04:32", "url": "https://files.pythonhosted.org/packages/80/aa/bf6205c1a0a27173bca0a0593dd422af4a5034a2cbb740bd457b94185dd4/sparse_dot_topn-0.2.5-cp27-cp27m-macosx_10_12_intel.whl" }, { "comment_text": "", "digests": { "md5": "91ee1f72a7f85c8c62f9cb07e7af7f7e", "sha256": "c8d2d045d187072c6a8d7e5d872f6d94c758a8e4eb1962c70e2c8316476261f4" }, "downloads": -1, "filename": "sparse_dot_topn-0.2.5-cp37-cp37m-macosx_10_12_x86_64.whl", "has_sig": false, "md5_digest": "91ee1f72a7f85c8c62f9cb07e7af7f7e", "packagetype": "bdist_wheel", "python_version": "cp37", "requires_python": null, "size": 31277, "upload_time": "2019-05-28T23:04:34", "url": "https://files.pythonhosted.org/packages/1c/e6/77f0c556a392d0c0671d74760d4dccd790031307dcfbd4a27efeeef26a2a/sparse_dot_topn-0.2.5-cp37-cp37m-macosx_10_12_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "69010dc9daf7db7cc234c73da57e9021", "sha256": "2028d451d81cf5a73cf9d5fc56de35f80ac8dbd528a6abe3b723bec9c1adcc38" }, "downloads": -1, "filename": "sparse_dot_topn-0.2.5.tar.gz", "has_sig": false, "md5_digest": "69010dc9daf7db7cc234c73da57e9021", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 54974, "upload_time": "2019-05-28T23:04:36", "url": "https://files.pythonhosted.org/packages/7d/09/ae06509912675fec6f6f7aa5d84cf92d7e62ab215534b2cb6bfcc1d7c17b/sparse_dot_topn-0.2.5.tar.gz" } ], "0.2.6": [ { "comment_text": "", "digests": { "md5": "468950fcafef610cc988ca6f774f8f92", "sha256": "2ef2e9d609b137b71281ad4b8e9195925ed0cbef46fce28f703f41c6d8b9fcb2" }, "downloads": -1, "filename": "sparse_dot_topn-0.2.6-cp27-cp27m-macosx_10_14_intel.whl", "has_sig": false, "md5_digest": "468950fcafef610cc988ca6f774f8f92", "packagetype": "bdist_wheel", "python_version": "cp27", "requires_python": null, "size": 68798, "upload_time": "2019-10-02T21:00:28", "url": "https://files.pythonhosted.org/packages/02/30/ef33c40391ae23817e4a410461231f1366f423fd69501b899191700d50e6/sparse_dot_topn-0.2.6-cp27-cp27m-macosx_10_14_intel.whl" }, { "comment_text": "", "digests": { "md5": "455dea8897551e78356142c5c0f281fc", "sha256": "93fc81e001848bc76e8a7bad6ba0b954bcb082615896029b68f519d04b6371a7" }, "downloads": -1, "filename": "sparse_dot_topn-0.2.6-cp37-cp37m-macosx_10_14_x86_64.whl", "has_sig": false, "md5_digest": "455dea8897551e78356142c5c0f281fc", "packagetype": "bdist_wheel", "python_version": "cp37", "requires_python": null, "size": 60727, "upload_time": "2019-10-02T21:00:30", "url": "https://files.pythonhosted.org/packages/f1/1c/364379e54503440dfd854949b719153c7cd49ce913004833cdcaad610f62/sparse_dot_topn-0.2.6-cp37-cp37m-macosx_10_14_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "ce3da810b960d738bc657aba669bece1", "sha256": "8df3e1568c3a445e763f90d59361499228c2f6a195dea31cdbae32b27150a504" }, "downloads": -1, "filename": "sparse_dot_topn-0.2.6.tar.gz", "has_sig": false, "md5_digest": "ce3da810b960d738bc657aba669bece1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 105519, "upload_time": "2019-10-02T21:00:32", "url": "https://files.pythonhosted.org/packages/69/49/6deae8f0500355a0a42d4181747721a10881aee4a757305024b89a9d760f/sparse_dot_topn-0.2.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "468950fcafef610cc988ca6f774f8f92", "sha256": "2ef2e9d609b137b71281ad4b8e9195925ed0cbef46fce28f703f41c6d8b9fcb2" }, "downloads": -1, "filename": "sparse_dot_topn-0.2.6-cp27-cp27m-macosx_10_14_intel.whl", "has_sig": false, "md5_digest": "468950fcafef610cc988ca6f774f8f92", "packagetype": "bdist_wheel", "python_version": "cp27", "requires_python": null, "size": 68798, "upload_time": "2019-10-02T21:00:28", "url": "https://files.pythonhosted.org/packages/02/30/ef33c40391ae23817e4a410461231f1366f423fd69501b899191700d50e6/sparse_dot_topn-0.2.6-cp27-cp27m-macosx_10_14_intel.whl" }, { "comment_text": "", "digests": { "md5": "455dea8897551e78356142c5c0f281fc", "sha256": "93fc81e001848bc76e8a7bad6ba0b954bcb082615896029b68f519d04b6371a7" }, "downloads": -1, "filename": "sparse_dot_topn-0.2.6-cp37-cp37m-macosx_10_14_x86_64.whl", "has_sig": false, "md5_digest": "455dea8897551e78356142c5c0f281fc", "packagetype": "bdist_wheel", "python_version": "cp37", "requires_python": null, "size": 60727, "upload_time": "2019-10-02T21:00:30", "url": "https://files.pythonhosted.org/packages/f1/1c/364379e54503440dfd854949b719153c7cd49ce913004833cdcaad610f62/sparse_dot_topn-0.2.6-cp37-cp37m-macosx_10_14_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "ce3da810b960d738bc657aba669bece1", "sha256": "8df3e1568c3a445e763f90d59361499228c2f6a195dea31cdbae32b27150a504" }, "downloads": -1, "filename": "sparse_dot_topn-0.2.6.tar.gz", "has_sig": false, "md5_digest": "ce3da810b960d738bc657aba669bece1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 105519, "upload_time": "2019-10-02T21:00:32", "url": "https://files.pythonhosted.org/packages/69/49/6deae8f0500355a0a42d4181747721a10881aee4a757305024b89a9d760f/sparse_dot_topn-0.2.6.tar.gz" } ] }