{ "info": { "author": "Nimrod Morag, Yuval Nissan", "author_email": "nimrod.morag@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7" ], "description": "## KSU Compression Algorithm Implementation ##\n\nAlgortihm 1 from [Nearest-Neighbor Sample Compression: Efficiency, Consistency, Infinite Dimensions](https://arxiv.org/abs/1705.08184)\n\nInstallation\n------------\n* With pip: `pip install ksu`\n* From source:\n * `git clone --depth=1 https://github.com/nimroha/ksu_classifier.git`\n * `cd ksu_classifier`\n * `python setup.py install`\n\nUsage\n -----\n\n ##### Command Line #####\n\nThis package provides two command line tools: `e-net` and `ksu`:\n\n* `e-net` constructs an [epsilon net](https://en.wikipedia.org/wiki/Delone_set) for a given epsilon\n* `ksu` runs the full algorithm\n\nBoth provide the -h flag to specify the arguments, and both can save the result to the disk in [numpy's .npz](https://docs.scipy.org/doc/numpy/reference/generated/numpy.savez.html) format\n\n
\n\n ##### Code #####\n\n This package provides a class `KSU(Xs, Ys, metric, [gram, prune, logLevel, n_jobs])`\n\n `Xs` and `Ys` are the data points and their respective labels as [numpy arrays](https://docs.scipy.org/doc/numpy/reference/generated/numpy.array.html) \n\n `metric` is either a callable to compute the metric or a string that names one of our provided metrics (print `KSU.METRICS.keys()` for the full list)\n\n `gram` _(optional, default=None)_ a precomputed [gramian matrix](http://mathworld.wolfram.com/GramMatrix.html), will be calculated if not provided.\n\n `prune` _(optional, default=False)_ a boolean indicating whether to prune the compressed set or not (Algorithm 2 from [Near-optimal sample compression for nearest neighbors](https://arxiv.org/abs/1404.3368))\n\n `logLevel` _(optional, default='CRITICAL')_ a string indicating the logging level (set to 'INFO' or 'DEBUG' to get more information)\n\n `n_jobs` _(optional, default=1)_ an integer defining how many cpus to use (scipy logic), pass -1 to use all. For n_jobs below -1, (n_cpus + 1 + n_jobs) are used. Thus for n_jobs = -2, all CPUs but one are used.\n\n
\n\n `KSU` provides a method `compressData([delta, minCompress, maxCompress, greedy, stride, logLevel, numProcs])`\n\n Which selects the subset with the lowest estimated error with confidence `1 - delta`. Can take arguments:\n\n `delta` _(optional, default=0.1)_ confidence for error upper bound\n\n `minCompress` _(optional, default=0.05)_ minimal compression ratio\n\n `maxCompress` _(optional, default=0.1)_ maximum compression ratio\n\n `greedy` _(optional, default=True)_ whether to use greedy or hierarichal strategy for net construction\n\n `stride` _(optional, default=200)_ how many gammas to skip between each iteration (since similar gammas will produce similar nets)\n\n `logLevel` _(optional, default='CRITICAL')_ a string indicating the logging level (set to 'INFO' or 'DEBUG' to get more information)\n\n `numProcs` _(optional, default=1)_ number of processes to use\n\n
\n\n You can then run `getClassifier()` which returns a 1-NN Classifer (based on [sklearn's K-NN](http://scikit-learn.org/stable/modules/generated/sklearn.neighbors.KNeighborsClassifier.html)) fitted to the compressed data.\n\n Or, run `getCompressedSet()` to get the compressed data as a tuple of numpy arrays `(compressedXs, compressedYs)`.\n\n
\n\n See `scripts/` for example usage\n\n\n ##### Built-in metrics #####\n\n ['chebyshev', 'yule', 'sokalmichener', 'canberra', 'EarthMover', 'rogerstanimoto', 'matching', 'dice', 'EditDistance', 'braycurtis', 'russellrao', 'cosine', 'cityblock', 'l1', 'manhattan', 'sqeuclidean', 'jaccard', 'seuclidean', 'sokalsneath', 'kulsinski', 'minkowski', 'mahalanobis', 'euclidean', 'l2', 'hamming', 'correlation', 'wminkowski']\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/nimroha/ksu_classifier", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "ksu", "package_url": "https://pypi.org/project/ksu/", "platform": "", "project_url": "https://pypi.org/project/ksu/", "project_urls": { "Homepage": "https://github.com/nimroha/ksu_classifier" }, "release_url": "https://pypi.org/project/ksu/0.3.0/", "requires_dist": [ "numpy", "sklearn", "scipy", "psutil", "editdistance", "mnist", "tqdm", "requests-toolbelt" ], "requires_python": ">=2.7.0", "summary": "Implementation of the KSU compression algorithm https://www.cs.bgu.ac.il/~karyeh/compression-arxiv.pdf", "version": "0.3.0" }, "last_serial": 4176693, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "cf7f27ce3d753fac2c62c58f9d07b529", "sha256": "f21e8f39b40cf683899652fe6caa3a313b9b0d69861b3c3ad634199c0fee4886" }, "downloads": -1, "filename": "ksu-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "cf7f27ce3d753fac2c62c58f9d07b529", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7.0", "size": 7874, "upload_time": "2018-05-29T07:10:51", "url": "https://files.pythonhosted.org/packages/26/c0/bfba85c0abb6ffa30b26e9f51e47deb90a77212f67b92f7afe13186c3458/ksu-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "280fd231d666f43d204999762f3c3e8e", "sha256": "311110b4c9824980fbe094baf6bc4bbf215288ed981ccb26c5b7e0a5279d4ec4" }, "downloads": -1, "filename": "ksu-0.1.0.tar.gz", "has_sig": false, "md5_digest": "280fd231d666f43d204999762f3c3e8e", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7.0", "size": 7677, "upload_time": "2018-05-29T07:10:51", "url": "https://files.pythonhosted.org/packages/49/2b/18799b5398df5d62b582333fd11236a1446b744bc9480b50176eb588a9e0/ksu-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "8f8fc1740f952030954cad87c71d2030", "sha256": "fc2b3b97697942bce637dc548ae87eec0f434e31f1352163fb060c26155ca395" }, "downloads": -1, "filename": "ksu-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "8f8fc1740f952030954cad87c71d2030", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7.0", "size": 7953, "upload_time": "2018-05-29T07:30:45", "url": "https://files.pythonhosted.org/packages/5f/ac/895d8c63a5a3ee9a7a46e2540a07fc3e5d1002738febdeb936a11f1b5fa3/ksu-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0d2be61fd0dc352a94a0f3dd9d7965e7", "sha256": "f32ff43ae7f234ec747fe166b743ea623e58232e9662925a7dccba56ac51598b" }, "downloads": -1, "filename": "ksu-0.1.1.tar.gz", "has_sig": false, "md5_digest": "0d2be61fd0dc352a94a0f3dd9d7965e7", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7.0", "size": 7693, "upload_time": "2018-05-29T07:30:46", "url": "https://files.pythonhosted.org/packages/43/2c/015fbdd55aab35b0f716fabd740f01b94fb9a69fd1aa66b18e0d551c6710/ksu-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "1c4073f4ae201f2d6b6a3ee4cba9ad83", "sha256": "bc1aa2ffc26d6d5239dea09827a400d7aac6deffa08764e54263fb4213ead42a" }, "downloads": -1, "filename": "ksu-0.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1c4073f4ae201f2d6b6a3ee4cba9ad83", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7.0", "size": 8653, "upload_time": "2018-06-03T08:53:08", "url": "https://files.pythonhosted.org/packages/d7/4c/d3b0d22f61382bdb71703c174d27f9b960e9987085c777d883cbfeb9234f/ksu-0.1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7c6b58cd5d078e547c7b5b385d1f6a9e", "sha256": "84005a8f3b99f44fbdae3024d9dd8b0b09b62c95e5b8e47ea41a44740d0aecb4" }, "downloads": -1, "filename": "ksu-0.1.2.tar.gz", "has_sig": false, "md5_digest": "7c6b58cd5d078e547c7b5b385d1f6a9e", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7.0", "size": 8366, "upload_time": "2018-06-03T08:53:10", "url": "https://files.pythonhosted.org/packages/0d/f7/3203dba85d8607fce5817d0ebe21958242fcf8263aeedc54609860ebbf09/ksu-0.1.2.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "27a6ce5c970e606779be5dd1e9479bb1", "sha256": "2f151577254d1fff452a0f54fff38832a016f0918c6845c01013d075c39c941a" }, "downloads": -1, "filename": "ksu-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "27a6ce5c970e606779be5dd1e9479bb1", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7.0", "size": 14218, "upload_time": "2018-07-09T19:05:26", "url": "https://files.pythonhosted.org/packages/ba/80/40a7b13f75e478de68dd18d2909126f98d98bb797109b26fad272c8c39b1/ksu-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0dfdeef72b54e1cdb45ebc115762bd5a", "sha256": "813b483c84ab0369cf96492d053685ca22e247bef0ee7c83df1b8c460c27ae59" }, "downloads": -1, "filename": "ksu-0.2.0.tar.gz", "has_sig": false, "md5_digest": "0dfdeef72b54e1cdb45ebc115762bd5a", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7.0", "size": 11544, "upload_time": "2018-07-09T19:05:28", "url": "https://files.pythonhosted.org/packages/8a/d1/0822690c3eff4275904ada9a34a1b37e0cc0d6ab62194de5b7f9cc68be41/ksu-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "d48e58a1d9935b31160a867ce4eafb17", "sha256": "a01c75719d9eaca233c58314d49d8dd2c71e78f01050bba9dc76352928984b5e" }, "downloads": -1, "filename": "ksu-0.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "d48e58a1d9935b31160a867ce4eafb17", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7.0", "size": 14543, "upload_time": "2018-07-15T10:57:49", "url": "https://files.pythonhosted.org/packages/16/2c/985d37304c14e2f42455846c20c13e9c845600b18d39262143a7470d58fa/ksu-0.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6761b43e97216a1d791aaaa3f0bb05a3", "sha256": "09f4016e09c8d24be5762b14408a1ca6a7eb4188fe44fc19e74ba39b54c69529" }, "downloads": -1, "filename": "ksu-0.2.1.tar.gz", "has_sig": false, "md5_digest": "6761b43e97216a1d791aaaa3f0bb05a3", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7.0", "size": 13034, "upload_time": "2018-07-15T10:57:51", "url": "https://files.pythonhosted.org/packages/20/29/285b75c7c9a03c461908ae274981ac1e2a1b9f3f7cce8966e039b491b53b/ksu-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "ec83cb12f047e78dbb2933d8823e3e89", "sha256": "48930b2f3857bf024dbd45627f8d9a1cf4a164428ad7e9a6f528fef80bc227be" }, "downloads": -1, "filename": "ksu-0.2.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ec83cb12f047e78dbb2933d8823e3e89", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7.0", "size": 14785, "upload_time": "2018-07-15T13:56:56", "url": "https://files.pythonhosted.org/packages/b5/e1/5bfc68bd40f3b28324c478355291b3ab3d538752f5f804260cc1dd1fe24c/ksu-0.2.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b6c0c13c1b5e106b4a2150491c0f5551", "sha256": "ea569a0ce8ee72ae734626470196087c9a1840dc06f33accfec40bfb018d5f09" }, "downloads": -1, "filename": "ksu-0.2.2.tar.gz", "has_sig": false, "md5_digest": "b6c0c13c1b5e106b4a2150491c0f5551", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7.0", "size": 13118, "upload_time": "2018-07-15T13:56:58", "url": "https://files.pythonhosted.org/packages/85/a2/b51ad132e2187ae8f90a92e5bb77336fd5cd22c8dc429b748060a648d9db/ksu-0.2.2.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "2d4e81089fee0781f5dc823d8d2cc9a5", "sha256": "7f926dbf3533d689699427c3069785755053d2c13661834d1242b245b454ae5b" }, "downloads": -1, "filename": "ksu-0.3.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2d4e81089fee0781f5dc823d8d2cc9a5", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7.0", "size": 19766, "upload_time": "2018-08-16T13:55:24", "url": "https://files.pythonhosted.org/packages/14/20/1d1839f3d65140e25853dc32e6ab828a70760f3894e89c4150d133a63734/ksu-0.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "24d5e78b653197b1d9c0cb3f38fd09d1", "sha256": "5e70f377321d007c354ae87444c3c5f5ba0f18c0fdc0052ba5898cccd93bee77" }, "downloads": -1, "filename": "ksu-0.3.0.tar.gz", "has_sig": false, "md5_digest": "24d5e78b653197b1d9c0cb3f38fd09d1", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7.0", "size": 15817, "upload_time": "2018-08-16T13:55:27", "url": "https://files.pythonhosted.org/packages/16/09/68bee7bd201fd7fd11621f184e9be3a01040f2471c0ec000f2b5408c4b23/ksu-0.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2d4e81089fee0781f5dc823d8d2cc9a5", "sha256": "7f926dbf3533d689699427c3069785755053d2c13661834d1242b245b454ae5b" }, "downloads": -1, "filename": "ksu-0.3.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2d4e81089fee0781f5dc823d8d2cc9a5", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7.0", "size": 19766, "upload_time": "2018-08-16T13:55:24", "url": "https://files.pythonhosted.org/packages/14/20/1d1839f3d65140e25853dc32e6ab828a70760f3894e89c4150d133a63734/ksu-0.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "24d5e78b653197b1d9c0cb3f38fd09d1", "sha256": "5e70f377321d007c354ae87444c3c5f5ba0f18c0fdc0052ba5898cccd93bee77" }, "downloads": -1, "filename": "ksu-0.3.0.tar.gz", "has_sig": false, "md5_digest": "24d5e78b653197b1d9c0cb3f38fd09d1", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7.0", "size": 15817, "upload_time": "2018-08-16T13:55:27", "url": "https://files.pythonhosted.org/packages/16/09/68bee7bd201fd7fd11621f184e9be3a01040f2471c0ec000f2b5408c4b23/ksu-0.3.0.tar.gz" } ] }