{ "info": { "author": "Vopaaz", "author_email": "liyifan945@163.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# learning-utility\n\n**Assist small-scale machine learning.**\n\nlearning-utility is a package of utilities for small-scale machine\nlearning tasks with scikit-learn.\n\n![image](https://www.travis-ci.org/Vopaaz/learning-utility.svg?branch=master)\n![image](https://codecov.io/gh/Vopaaz/learning-utility/branch/master/graph/badge.svg)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/Lutil)\n[![Downloads](https://pepy.tech/badge/lutil)](https://pepy.tech/project/lutil)\n![PyPI](https://img.shields.io/pypi/v/Lutil)\n\n## Installation\n\n```bash\npip install Lutil\n```\n\n## Key Features\n\n### Cache Intermediate Results\n\n`InlineCheckpoint` can cache the computation result in the first call.\nSince then, if nothing has changed, it retrieves the cache and skips\ncomputation.\n\nSuppose you have such a .py file.\n\n```python\nfrom Lutil.checkpoints import InlineCheckpoint\n\na, b = 1, 2\nwith InlineCheckpoint(watch=[\"a\", \"b\"], produce=[\"c\"]):\n print(\"Heavy computation.\")\n c = a + b\n\nprint(c)\n```\n\nRun the script, you will get:\n\n```text\nHeavy computation.\n3\n```\n\nRun this script again, the with-statement will be skipped. You will get:\n\n```text\n3\n```\n\nOnce a value among `watch` changes or the code inside the with-statement\nchanges, re-calculation takes place to ensure the correct output.\n\n### Save Prediction Result According to the Given Format\n\nLots of machine learning competitions require a .csv file in a given format.\nMost of them provide an example file.\n\nIn example.csv:\n\n```text\nid, pred\n1, 0.25\n2, 0.45\n3, 0.56\n```\n\nRun:\n\n```python\n>>> import numpy as np\n>>> from Lutil.dataIO import AutoSaver\n\n>>> result = np.array([0.2, 0.4, 0.1, 0.5])\n # Typical output of a scikit-learn predictor\n\n>>> ac = AutoSaver(save_dir=\"somedir\", example_path=\"path/to/example.csv\")\n>>> ac.save(result, \"some_name.csv\")\n```\n\nThen in your somedir/some_name.csv:\n\n```text\nid, pred\n1, 0.2\n2, 0.4\n3, 0.1\n4, 0.5\n```\n\nIt also works if the `result` is a pandas DataFrame, Series, 2-dim numpy array, etc.\nAlso, the encoding, seperator, header, index of the example.csv will all be recognized.", "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/Vopaaz/learning-utility", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "Lutil", "package_url": "https://pypi.org/project/Lutil/", "platform": "", "project_url": "https://pypi.org/project/Lutil/", "project_urls": { "Homepage": "https://github.com/Vopaaz/learning-utility" }, "release_url": "https://pypi.org/project/Lutil/0.1.2/", "requires_dist": null, "requires_python": "", "summary": "Assist small-scale machine learning.", "version": "0.1.2" }, "last_serial": 5893929, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "41ce2a4c3e8f49ff3d1466ed92cdcede", "sha256": "c4db03bbd2e47ff2040e9fea77eabc93c3a3e881efead3d532ac9dab8a792878" }, "downloads": -1, "filename": "Lutil-0.1.1.tar.gz", "has_sig": false, "md5_digest": "41ce2a4c3e8f49ff3d1466ed92cdcede", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8405, "upload_time": "2019-08-29T01:52:58", "url": "https://files.pythonhosted.org/packages/65/d8/0c93452bfd89526c7149bbd1b36a92d878591b69ad7ee2fcc6677210cc58/Lutil-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "689266fec64d0d9ab6254188bf20f8ac", "sha256": "98e39bf8029e7405a8d1f9fd22c03c93f3f3f23f3e6942ef1d94fa58dba226d5" }, "downloads": -1, "filename": "Lutil-0.1.2.tar.gz", "has_sig": false, "md5_digest": "689266fec64d0d9ab6254188bf20f8ac", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8574, "upload_time": "2019-09-27T03:42:44", "url": "https://files.pythonhosted.org/packages/62/67/6d7bfef939044b1e1ed213e59ae79e32dac048e8aaab72356ab92469c8cd/Lutil-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "689266fec64d0d9ab6254188bf20f8ac", "sha256": "98e39bf8029e7405a8d1f9fd22c03c93f3f3f23f3e6942ef1d94fa58dba226d5" }, "downloads": -1, "filename": "Lutil-0.1.2.tar.gz", "has_sig": false, "md5_digest": "689266fec64d0d9ab6254188bf20f8ac", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8574, "upload_time": "2019-09-27T03:42:44", "url": "https://files.pythonhosted.org/packages/62/67/6d7bfef939044b1e1ed213e59ae79e32dac048e8aaab72356ab92469c8cd/Lutil-0.1.2.tar.gz" } ] }