{"id":15063991,"url":"https://github.com/vopaaz/learning-utility","last_synced_at":"2025-04-10T11:43:11.176Z","repository":{"id":62577155,"uuid":"200059613","full_name":"Vopaaz/learning-utility","owner":"Vopaaz","description":"Assist small-scale machine learning.","archived":false,"fork":false,"pushed_at":"2022-07-25T00:35:13.000Z","size":159,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-21T08:42:35.367Z","etag":null,"topics":["data-science","machine-learning","pandas","python3","scikit-learn"],"latest_commit_sha":null,"homepage":"https://learning-utility.readthedocs.io/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Vopaaz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-01T13:51:44.000Z","updated_at":"2022-07-26T19:39:23.000Z","dependencies_parsed_at":"2022-11-03T19:11:56.043Z","dependency_job_id":null,"html_url":"https://github.com/Vopaaz/learning-utility","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vopaaz%2Flearning-utility","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vopaaz%2Flearning-utility/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vopaaz%2Flearning-utility/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vopaaz%2Flearning-utility/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vopaaz","download_url":"https://codeload.github.com/Vopaaz/learning-utility/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248212050,"owners_count":21065884,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-science","machine-learning","pandas","python3","scikit-learn"],"created_at":"2024-09-25T00:09:54.272Z","updated_at":"2025-04-10T11:43:11.151Z","avatar_url":"https://github.com/Vopaaz.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Unmaintained\n\n**This project is unmaintained and the checkpoint functionality has been ported to the [checkpointing](https://github.com/Vopaaz/checkpointing) project.**\n\n\n# 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\u003e\u003e\u003e import numpy as np\n\u003e\u003e\u003e from Lutil.dataIO import AutoSaver\n\n\u003e\u003e\u003e result = np.array([0.2, 0.4, 0.1, 0.5])\n       # Typical output of a scikit-learn predictor\n\n\u003e\u003e\u003e ac = AutoSaver(save_dir=\"somedir\", example_path=\"path/to/example.csv\")\n\u003e\u003e\u003e 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.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvopaaz%2Flearning-utility","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvopaaz%2Flearning-utility","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvopaaz%2Flearning-utility/lists"}