{ "info": { "author": "Simone Boglio", "author_email": "bogliosimone@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Cython", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "

\"similaripy\"

\n\nSimilariPy\n==========\n![PY_PIC]\n[![PYPI_PIC]][PYPI_LINK]\n[![BUILD_STATUS_PIC]][BUILD_STATUS_LINK]\n[![LICENSE_PIC]][LICENSE_LINK]\n[![DOI_PIC]][DOI_LINK]\n\n\n\nThis project provides fast Python implementation of several KNN (K-Nearest Neighbors) similarity algorithms using sparse matrices, useful in Collaborative Filtering Recommender Systems and others.\n\nThe package also include some normalization functions that could be useful in the pre-processing phase before the similarity computation.\n\n#### Similarities\n\nBase similarity models:\n * Dot Product\n * Cosine\n * Asymmetric Cosine\n * Jaccard\n * Dice\n * Tversky\n\n Graph-based similarity models:\n * P3α\n * RP3β\n\n Advanced similarity model:\n * S-Plus\n\n[Similarities Documentation](https://github.com/bogliosimone/similaripy/blob/master/guide/temp_guide.md)\n\nAll models have multi-threaded routines, using Cython and OpenMP to fit the models in parallel among all available CPU cores.\n\n#### Normalizations\n\nThe package contains normalization functions like: l1, l2, max, tf-idf, bm25, bm25+.\n\nAll the functions are compiled at low-level and could operate in-place, on csr-matrixes, if you need to save memory.\n\nFor tf-idf, bm25, bm25+ you could chose the log-base and how the term-frequency (TF) and the inverse document frequency (IDF) are computed.\n\n#### Installation and usage\n\nTo install:\n\n```cmd\npip install similaripy\n```\n\nBasic usage:\n\n```python\nimport similaripy as sim\nimport scipy.sparse as sps\n\n# create a random user-rating matrix (URM)\nurm = sps.random(1000, 2000, density=0.025)\n\n# normalize matrix with bm25\nurm = sim.normalization.bm25(urm)\n\n# train the model with 50 knn per item \nmodel = sim.cosine(urm.T, k=50)\n\n# recommend 100 items to users 1, 14 and 8 filtering the items already seen by each users\nuser_recommendations = sim.dot_product(urm, model.T, k=100, target_rows=[1,14,8], filter_cols=urm)\n\n```\n\n#### Requirements\n\n| Package | Version |\n| --------------------------------|:--------------:| \n| numpy | >= 1.14 | \n| scipy | >= 1.0.0 |\n| tqdm | >= 4.19.6 |\n| cython | >= 0.28.1 |\n\n\nNOTE: In order to compile the Cython code it is required a GCC compiler with OpenMP \n(on OSX it can be installed with homebrew: ```brew install gcc```).\n\nThis library has been tested with Python 3.6 on Ubuntu, OSX and Windows.\n\n(Note: on Windows there are problem with flag *format_output='csr'*, just let it equals to the default value *'coo'*)\n\n#### Optimal Configuration\n\nI recommend configuring SciPy/Numpy to use Intel's MKL matrix libraries.\nThe easiest way of doing this is by installing the Anaconda Python distribution.\n\n#### Future work\n\nI plan to release in the next future some utilities:\n- Utilities for sparse matrices\n- New similarity functions ( good ideas are welcome :) )\n\n#### History\nThe idea of build this library comes from the **[RecSys Challenge 2018](https://recsys-challenge.spotify.com)** organized by Spotify. \n\nMy team, the Creamy Fireflies, had problem in compute very huge similarity models in a reasonable time (66 million of interactions in the user-rating matrix) and using python and numpy were not suitable since a full day was required to compute one single model.\n\nAs a member of the the team I spent a lot of hours to develop these high-performance similarities in Cython to overcome the problem. At the end of the competition, pushed by my team friends, I decide to release my work to help people that one day will encounter our same problem.\n\nThanks to my Creamy Fireflies friends for support me.\n\n#### License\nReleased under the MIT License\n\nCitation information: [![DOI_PIC]][DOI_LINK]\n\n```\n@misc{boglio_simone_similaripy,\n author = {Boglio Simone},\n title = {bogliosimone/similaripy},\n doi = {10.5281/zenodo.2583851},\n url = {https://doi.org/10.5281/zenodo.2583851}\n}\n```\n\n[DOI_PIC]: https://zenodo.org/badge/DOI/10.5281/zenodo.2583851.svg\n[DOI_LINK]: https://doi.org/10.5281/zenodo.2583851\n[LICENSE_PIC]: https://img.shields.io/github/license/bogliosimone/similaripy.svg\n[LICENSE_LINK]: https://github.com/bogliosimone/similaripy/blob/master/LICENSE\n[PYPI_PIC]: https://img.shields.io/pypi/v/similaripy.svg\n[PYPI_LINK]: https://pypi.org/project/similaripy/\n[PY_PIC]: https://img.shields.io/pypi/pyversions/similaripy.svg\n[BUILD_STATUS_PIC]: https://travis-ci.org/bogliosimone/similaripy.svg?branch=master\n[BUILD_STATUS_LINK]: https://travis-ci.org/bogliosimone/similaripy\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": "http://github.com/bogliosimone/similaripy", "keywords": "Similarity,KNN,Nearest Neighbors,Collaborative Filtering,Normalization,Recommender Systems", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "similaripy", "package_url": "https://pypi.org/project/similaripy/", "platform": "", "project_url": "https://pypi.org/project/similaripy/", "project_urls": { "Homepage": "http://github.com/bogliosimone/similaripy" }, "release_url": "https://pypi.org/project/similaripy/0.1.1/", "requires_dist": [ "scipy (>=1.0.0)", "numpy (>=1.14.0)", "tqdm (>=4.19.6)" ], "requires_python": "", "summary": "Fast KNN Similarity Algorithms for Collaborative Filtering Models using sparse matrices", "version": "0.1.1" }, "last_serial": 5140582, "releases": { "0.0.10": [ { "comment_text": "", "digests": { "md5": "0423643ea4d8d653204c4d136b56d11a", "sha256": "f944a552c484832bb4685341e9fd6ee94b7cacc8ddb8d28611f54ae4e975ba2e" }, "downloads": -1, "filename": "similaripy-0.0.10-cp36-cp36m-macosx_10_7_x86_64.whl", "has_sig": false, "md5_digest": "0423643ea4d8d653204c4d136b56d11a", "packagetype": "bdist_wheel", "python_version": "cp36", "requires_python": null, "size": 262251, "upload_time": "2018-10-07T22:54:52", "url": "https://files.pythonhosted.org/packages/ce/59/3c8ed182573d4dc2c4e25b1c2e13d5a317f4990599bdb4d305983ce2efdd/similaripy-0.0.10-cp36-cp36m-macosx_10_7_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "a9cd6580a04531541b66649284a1702c", "sha256": "f715eb349e21b1313cea0cd7d377701c46d92dde5605aeea493e9177bd7edc7b" }, "downloads": -1, "filename": "similaripy-0.0.10.tar.gz", "has_sig": false, "md5_digest": "a9cd6580a04531541b66649284a1702c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 132018, "upload_time": "2018-10-07T22:54:53", "url": "https://files.pythonhosted.org/packages/52/a7/7331c63659427238c6fda302f1350af081551a5447d19f4781c192e70ad1/similaripy-0.0.10.tar.gz" } ], "0.0.11": [ { "comment_text": "", "digests": { "md5": "9fb0e736e0c37b48bf8dcddc078774c1", "sha256": "44ff7a35b8e849d4f782af46a229f22f4c7ba80b4e86a5de3554b9780c8e2247" }, "downloads": -1, "filename": "similaripy-0.0.11-cp36-cp36m-macosx_10_7_x86_64.whl", "has_sig": false, "md5_digest": "9fb0e736e0c37b48bf8dcddc078774c1", "packagetype": "bdist_wheel", "python_version": "cp36", "requires_python": null, "size": 262257, "upload_time": "2019-01-11T14:44:02", "url": "https://files.pythonhosted.org/packages/9f/6c/5e8e5454ed664d95adc71dcc16ea1201324ac8b35897771d75018efd8b94/similaripy-0.0.11-cp36-cp36m-macosx_10_7_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "c2f0d10b4ab7e0e4c16b68580cdf65f3", "sha256": "dd29cb7d9d6c1ce9a0d45539edee5ebeaac5a0bf51c9bf97433e2da827d599b8" }, "downloads": -1, "filename": "similaripy-0.0.11.tar.gz", "has_sig": false, "md5_digest": "c2f0d10b4ab7e0e4c16b68580cdf65f3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 132032, "upload_time": "2019-01-11T14:44:04", "url": "https://files.pythonhosted.org/packages/77/e5/08fb3ad788ad56b9308a3232dcf936d2bc60a8a76b431fc42cdfc8911e09/similaripy-0.0.11.tar.gz" } ], "0.0.12": [ { "comment_text": "", "digests": { "md5": "1f686ad42066949c256e5a723584952e", "sha256": "f283c117e5d1c31d17512bf45c77fcb97eda1e69aeabc9c9bf1d36d2403a17b6" }, "downloads": -1, "filename": "similaripy-0.0.12-cp36-cp36m-macosx_10_7_x86_64.whl", "has_sig": false, "md5_digest": "1f686ad42066949c256e5a723584952e", "packagetype": "bdist_wheel", "python_version": "cp36", "requires_python": null, "size": 680550, "upload_time": "2019-03-05T20:11:06", "url": "https://files.pythonhosted.org/packages/74/73/7a097a918f2154767cd474144cf90c527d03fbfd75b57513f66db18005d3/similaripy-0.0.12-cp36-cp36m-macosx_10_7_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "00f1bb530354d7c79fbcce2d9e52f6ef", "sha256": "3a61a34fe6d7c4dcc94ec2e033b00256c063645b926ba9288002f5f5ab054835" }, "downloads": -1, "filename": "similaripy-0.0.12.tar.gz", "has_sig": false, "md5_digest": "00f1bb530354d7c79fbcce2d9e52f6ef", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 324208, "upload_time": "2019-03-05T20:11:09", "url": "https://files.pythonhosted.org/packages/49/b3/2a620f2bf14167a3c4be2dfb307aa962043ed47ee37436da1c847c2382a4/similaripy-0.0.12.tar.gz" } ], "0.0.13": [ { "comment_text": "", "digests": { "md5": "617e2af55c848b1745fb19e9651a697c", "sha256": "8f91b8e424e943e879bfd520fe289e3cf7406cdc6a8e931f38951cd22e8f9e01" }, "downloads": -1, "filename": "similaripy-0.0.13-cp36-cp36m-macosx_10_7_x86_64.whl", "has_sig": false, "md5_digest": "617e2af55c848b1745fb19e9651a697c", "packagetype": "bdist_wheel", "python_version": "cp36", "requires_python": null, "size": 680706, "upload_time": "2019-03-30T00:15:29", "url": "https://files.pythonhosted.org/packages/6a/81/20ac98fd0e315511bf68621044a6b184a78fb9fbc096eef87878c8b66fdc/similaripy-0.0.13-cp36-cp36m-macosx_10_7_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "a182acd4ab88e223d584cc7279b5a5e0", "sha256": "349b51225eaf942b7479569c7dcbefa2465a82bf6a38c8700c99f5ee434128dd" }, "downloads": -1, "filename": "similaripy-0.0.13.tar.gz", "has_sig": false, "md5_digest": "a182acd4ab88e223d584cc7279b5a5e0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 324431, "upload_time": "2019-03-30T00:15:32", "url": "https://files.pythonhosted.org/packages/c3/09/0419721009b671094bc1841ba4ddb584a340f70cc943a1a63e9153d19169/similaripy-0.0.13.tar.gz" } ], "0.0.14": [ { "comment_text": "", "digests": { "md5": "23f694f519b4c461ab56c4cec2f48362", "sha256": "b2d8fc4f39a95a2504aed9699f08a3587c570b1450226b53b4883d7b715f81e5" }, "downloads": -1, "filename": "similaripy-0.0.14-cp37-cp37m-macosx_10_7_x86_64.whl", "has_sig": false, "md5_digest": "23f694f519b4c461ab56c4cec2f48362", "packagetype": "bdist_wheel", "python_version": "cp37", "requires_python": null, "size": 701833, "upload_time": "2019-04-14T09:43:07", "url": "https://files.pythonhosted.org/packages/52/8a/c78a45679b4d104600a62fc22857bc9592456e117817c27c1213cda60b4e/similaripy-0.0.14-cp37-cp37m-macosx_10_7_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "5134e38dfc588a675ee3dcf6cd0fa51f", "sha256": "f4da1a2f634ae7a5dabf4b4f6faf6b01401eee9034f53d1669d65074488489cb" }, "downloads": -1, "filename": "similaripy-0.0.14.tar.gz", "has_sig": false, "md5_digest": "5134e38dfc588a675ee3dcf6cd0fa51f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 334003, "upload_time": "2019-04-14T09:43:10", "url": "https://files.pythonhosted.org/packages/27/f6/3943b1edfe82813be1c7b8bc15aa89bc06bbd5c94dc5f507c52715634457/similaripy-0.0.14.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "137066971b4daf9459439762b99a17ef", "sha256": "01d51176a45656ecd046a01c9e934f0b00894284c17916244ba51c1d72ba980c" }, "downloads": -1, "filename": "similaripy-0.0.7-cp36-cp36m-macosx_10_7_x86_64.whl", "has_sig": false, "md5_digest": "137066971b4daf9459439762b99a17ef", "packagetype": "bdist_wheel", "python_version": "cp36", "requires_python": null, "size": 262736, "upload_time": "2018-09-24T10:48:07", "url": "https://files.pythonhosted.org/packages/86/59/b8e7beea3375f78af4e5aa2c40d75fbb771d01a774190468558f2151bd46/similaripy-0.0.7-cp36-cp36m-macosx_10_7_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "b506781bef2e1ff20c9e07c5c313977a", "sha256": "02ae925c88fecdd0ef8e85a5318eff02a9fb3dff25afe8e0206de866d9c9357c" }, "downloads": -1, "filename": "similaripy-0.0.7.tar.gz", "has_sig": false, "md5_digest": "b506781bef2e1ff20c9e07c5c313977a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 131958, "upload_time": "2018-09-24T10:48:09", "url": "https://files.pythonhosted.org/packages/22/47/582ff013733ac585c1791d84e9a0855353fe3c67984d344fb6d22afcb27d/similaripy-0.0.7.tar.gz" } ], "0.0.8": [ { "comment_text": "", "digests": { "md5": "310f45f3e001bc2e5dc51833931564a9", "sha256": "d93060c683fb961bd5a78d4df86a633585d42e2526397fa8d437a54921a65ec8" }, "downloads": -1, "filename": "similaripy-0.0.8-cp36-cp36m-macosx_10_7_x86_64.whl", "has_sig": false, "md5_digest": "310f45f3e001bc2e5dc51833931564a9", "packagetype": "bdist_wheel", "python_version": "cp36", "requires_python": null, "size": 262143, "upload_time": "2018-09-25T14:44:05", "url": "https://files.pythonhosted.org/packages/b9/1a/e4fa1851b1d21e52a884c49933fd82bdd38aae63090f62b45e75164a4299/similaripy-0.0.8-cp36-cp36m-macosx_10_7_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "3560e082cf85261618bfa7e90bd91b24", "sha256": "b116876c06214b80484e9878e4e45d62c0dd62cd929d8a7554d4008e52254e2b" }, "downloads": -1, "filename": "similaripy-0.0.8.tar.gz", "has_sig": false, "md5_digest": "3560e082cf85261618bfa7e90bd91b24", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 131843, "upload_time": "2018-09-25T14:44:06", "url": "https://files.pythonhosted.org/packages/40/02/902e4f480a68e2a532a081044455521e5c1b279e8f82b9eb5420a25d211d/similaripy-0.0.8.tar.gz" } ], "0.0.9": [ { "comment_text": "", "digests": { "md5": "02861411a595c908354f96d14f4a5a54", "sha256": "8aa9c3e6f228c0aa4d890ba5e6517454237b72b320e4a5ba32bbd90b9f28237e" }, "downloads": -1, "filename": "similaripy-0.0.9-cp36-cp36m-macosx_10_7_x86_64.whl", "has_sig": false, "md5_digest": "02861411a595c908354f96d14f4a5a54", "packagetype": "bdist_wheel", "python_version": "cp36", "requires_python": null, "size": 262212, "upload_time": "2018-10-07T16:56:03", "url": "https://files.pythonhosted.org/packages/1d/e2/645b389754a24c989e806c6be347be563a80f510fcc1bb7603798ac76289/similaripy-0.0.9-cp36-cp36m-macosx_10_7_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "1c42154a750e39dadbefecc2ec1b09de", "sha256": "1c89e001d324e7286fca68510afa7c512b0bcdbbc4809836022fdf6bf32dd9d6" }, "downloads": -1, "filename": "similaripy-0.0.9.tar.gz", "has_sig": false, "md5_digest": "1c42154a750e39dadbefecc2ec1b09de", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 131962, "upload_time": "2018-10-07T16:56:05", "url": "https://files.pythonhosted.org/packages/73/4d/e8a66d1e56c3cb29d434d4902b2d9f11447cd47f89b81671c213a50f7b77/similaripy-0.0.9.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "c5af132e86e1a397919b88f1e1da41c6", "sha256": "6ec85cf3fe6dc2b0e85aa4732b4ca87ceb0d87b3a3f8aaa74b839a32c3dfb625" }, "downloads": -1, "filename": "similaripy-0.1.0-cp37-cp37m-macosx_10_7_x86_64.whl", "has_sig": false, "md5_digest": "c5af132e86e1a397919b88f1e1da41c6", "packagetype": "bdist_wheel", "python_version": "cp37", "requires_python": null, "size": 701842, "upload_time": "2019-04-14T09:57:24", "url": "https://files.pythonhosted.org/packages/29/b4/b345006262808fbaffd2c5b18c3eda9a8688f8d263296ee863350b03a1e3/similaripy-0.1.0-cp37-cp37m-macosx_10_7_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "48bd1220ca3b2889daf1e2106a11acaa", "sha256": "265650a6269af6237de0ce22433d939f0fb87baf6a65608181ec993ccb0b0209" }, "downloads": -1, "filename": "similaripy-0.1.0.tar.gz", "has_sig": false, "md5_digest": "48bd1220ca3b2889daf1e2106a11acaa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 334040, "upload_time": "2019-04-14T09:57:27", "url": "https://files.pythonhosted.org/packages/de/bc/bc84061c9d911001c8b89c4faa1c812c63586f634140e40cca30556e97b8/similaripy-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "a534138a9b4e94990ef0eaad30c733de", "sha256": "14dba3f5c1722cf4353cd0c52d194830a00082c4966ce8cdeada0dc47788ee98" }, "downloads": -1, "filename": "similaripy-0.1.1-cp37-cp37m-macosx_10_7_x86_64.whl", "has_sig": false, "md5_digest": "a534138a9b4e94990ef0eaad30c733de", "packagetype": "bdist_wheel", "python_version": "cp37", "requires_python": null, "size": 704133, "upload_time": "2019-04-14T11:20:59", "url": "https://files.pythonhosted.org/packages/fa/fb/3a07d6bbbd5da782c7fe11c399d4ff1412becff93735c3beb0bc87cabf30/similaripy-0.1.1-cp37-cp37m-macosx_10_7_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "e67dca24dab7a93ee2c85a94d1d21a2a", "sha256": "cbee775fe8ed7b2bae0f3d54293a52886e8d624dce676a680737e593abdf70cf" }, "downloads": -1, "filename": "similaripy-0.1.1.tar.gz", "has_sig": false, "md5_digest": "e67dca24dab7a93ee2c85a94d1d21a2a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 334327, "upload_time": "2019-04-14T11:21:01", "url": "https://files.pythonhosted.org/packages/9a/3a/44821be2e597c49b9bc5bd066df3729893af54c6209d7b05cafe3d39e448/similaripy-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a534138a9b4e94990ef0eaad30c733de", "sha256": "14dba3f5c1722cf4353cd0c52d194830a00082c4966ce8cdeada0dc47788ee98" }, "downloads": -1, "filename": "similaripy-0.1.1-cp37-cp37m-macosx_10_7_x86_64.whl", "has_sig": false, "md5_digest": "a534138a9b4e94990ef0eaad30c733de", "packagetype": "bdist_wheel", "python_version": "cp37", "requires_python": null, "size": 704133, "upload_time": "2019-04-14T11:20:59", "url": "https://files.pythonhosted.org/packages/fa/fb/3a07d6bbbd5da782c7fe11c399d4ff1412becff93735c3beb0bc87cabf30/similaripy-0.1.1-cp37-cp37m-macosx_10_7_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "e67dca24dab7a93ee2c85a94d1d21a2a", "sha256": "cbee775fe8ed7b2bae0f3d54293a52886e8d624dce676a680737e593abdf70cf" }, "downloads": -1, "filename": "similaripy-0.1.1.tar.gz", "has_sig": false, "md5_digest": "e67dca24dab7a93ee2c85a94d1d21a2a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 334327, "upload_time": "2019-04-14T11:21:01", "url": "https://files.pythonhosted.org/packages/9a/3a/44821be2e597c49b9bc5bd066df3729893af54c6209d7b05cafe3d39e448/similaripy-0.1.1.tar.gz" } ] }