{"id":13712510,"url":"https://github.com/ntucllab/libact","last_synced_at":"2025-05-06T22:31:16.238Z","repository":{"id":44329100,"uuid":"47506240","full_name":"ntucllab/libact","owner":"ntucllab","description":"Pool-based active learning in Python","archived":false,"fork":false,"pushed_at":"2023-06-18T01:38:20.000Z","size":1939,"stargazers_count":782,"open_issues_count":44,"forks_count":173,"subscribers_count":57,"default_branch":"master","last_synced_at":"2025-04-17T23:08:57.178Z","etag":null,"topics":["active-learning","machine-learning","machine-learning-library","uncertainty-sampling"],"latest_commit_sha":null,"homepage":"http://libact.readthedocs.org/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ntucllab.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2015-12-06T17:24:38.000Z","updated_at":"2025-04-13T13:58:58.000Z","dependencies_parsed_at":"2024-01-15T18:47:12.386Z","dependency_job_id":"cc25a1e0-02e9-4443-b2bc-ac028ccb0d6f","html_url":"https://github.com/ntucllab/libact","commit_stats":{"total_commits":595,"total_committers":22,"mean_commits":"27.045454545454547","dds":"0.38655462184873945","last_synced_commit":"1079085b27bcb5d929ab3d9d0bbc2a132ec8cbdc"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntucllab%2Flibact","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntucllab%2Flibact/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntucllab%2Flibact/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntucllab%2Flibact/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ntucllab","download_url":"https://codeload.github.com/ntucllab/libact/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252779012,"owners_count":21802865,"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":["active-learning","machine-learning","machine-learning-library","uncertainty-sampling"],"created_at":"2024-08-02T23:01:19.295Z","updated_at":"2025-05-06T22:31:16.154Z","avatar_url":"https://github.com/ntucllab.png","language":"Python","readme":"# libact: Pool-based Active Learning in Python\n\nauthors: [Yao-Yuan Yang](http://yyyang.me), Shao-Chuan Lee, Yu-An Chung, Tung-En Wu, Si-An Chen, [Hsuan-Tien Lin](http://www.csie.ntu.edu.tw/~htlin)\n\n[![Build Status](https://travis-ci.org/ntucllab/libact.svg)](https://travis-ci.org/ntucllab/libact)\n[![Documentation Status](https://readthedocs.org/projects/libact/badge/?version=latest)](http://libact.readthedocs.org/en/latest/?badge=latest)\n[![PyPI version](https://badge.fury.io/py/libact.svg)](https://badge.fury.io/py/libact)\n[![codecov.io](https://codecov.io/github/ntucllab/libact/coverage.svg?branch=master)](https://codecov.io/github/ntucllab/libact?branch=master)\n\n# Introduction\n\n`libact` is a Python package designed to make active learning easier for\nreal-world users. The package not only implements several popular active learning strategies, but also features the [active-learning-by-learning](http://www.csie.ntu.edu.tw/~htlin/paper/doc/aaai15albl.pdf)\nmeta-algorithm that assists the users to automatically select the best strategy\non the fly. Furthermore, the package provides a unified interface for implementing more strategies, models and application-specific labelers. The package is open-source along with issue trackers on github, and can be easily installed from Python Package Index repository.\n\n# Documentation\n\nThe technical report associated with the package is on [arXiv](https://arxiv.org/abs/1710.00379), and the documentation for the latest release is available on [readthedocs](http://libact.readthedocs.org/en/latest/).\nComments and questions on the package is welcomed at `libact-users@googlegroups.com`. All contributions to the documentation are greatly appreciated!\n\n# Basic Dependencies\n\n* Python 3.9, 3.10, 3.11\n  * _Note._ We will soon release Python 2.7, 3.3, 3.4, 3.5, and 3.6 installations in the new branch.\n\n* Debian (\u003e= 7) / Ubuntu (\u003e= 14.04)\n```\nsudo apt-get install build-essential gfortran libatlas-base-dev liblapacke-dev python3-dev\n```\n\n* Python dependencies\n```\npip install -r requirements.txt\n```\n\n* Arch\n```\nsudo pacman -S lapacke\n```\n\n* macOS\n```\nbrew install openblas\n```\n\n# Installation\n\nAfter resolving the dependencies, you may install the package via pip (for all users):\n```\nsudo pip install libact\n```\n\nor pip install in home directory:\n```\npip install --user libact\n```\n\nor pip install from github repository for latest source:\n```\npip install git+https://github.com/ntucllab/libact.git\n```\n\nTo build and install from souce in your home directory:\n```\npython setup.py install --user\n```\n\nTo build and install from souce for all users on Unix/Linux:\n\n**(This is the recommended method for Python 3.10 users)**\n```\npip install -e .\n```\n\n## Installation Options\n\n- `LIBACT_BUILD_HINTSVM`: set this variable to 1 if you would like to build\n  hintsvm c-extension. If set to 0, you will not be able to use the HintSVM\n  query strategy. Default=1.\n- `LIBACT_BUILD_VARIANCE_REDUCTION`: set this variable to 1 if you would like to\n  build variance reduction c-extension. If set to 0, you will not be able to use\n  the VarianceReduction query strategy. Default=1.\n\nExample:\n```\nLIBACT_BUILD_HINTSVM=1 pip install git+https://github.com/ntucllab/libact.git\n```\n\n# Usage\n\nThe main usage of `libact` is as follows:\n\n```python\nqs = UncertaintySampling(trn_ds, method='lc') # query strategy instance\n\nask_id = qs.make_query() # let the specified query strategy suggest a data to query\nX, y = zip(*trn_ds.data)\nlb = lbr.label(X[ask_id]) # query the label of unlabeled data from labeler instance\ntrn_ds.update(ask_id, lb) # update the dataset with newly queried data\n```\n\nSome examples are available under the `examples` directory. Before running, use\n`examples/get_dataset.py` to retrieve the dataset used by the examples.\n\nAvailable examples:\n\n  - [plot](examples/plot.py) : This example performs basic usage of libact. It splits\n    a fully-labeled dataset and remove some label from dataset to simulate\n    the pool-based active learning scenario. Each query of an unlabeled dataset is then equivalent to revealing one labeled example in the original data set.\n  - [label_digits](examples/label_digits.py) : This example shows how to use libact in the case\n    that you want a human to label the selected sample for your algorithm.\n  - [albl_plot](examples/albl_plot.py): This example compares the performance of ALBL\n    with other active learning algorithms.\n  - [multilabel_plot](examples/multilabel_plot.py): This example compares the performance of\n    algorithms under multilabel setting.\n  - [alce_plot](examples/alce_plot.py): This example compares the performance of\n    algorithms under cost-sensitive multi-class setting.\n\n# Running tests\n\nTo run the test suite:\n\n```\npython -m unittest -v\n```\n\nTo run pylint, install pylint through ```pip install pylint``` and run the following command in root directory:\n\n```\npylint libact\n```\n\nTo measure the test code coverage, install coverage through ```pip install coverage``` and run the following commands in root directory:\n\n```\npython -m coverage run --source libact --omit */tests/* -m unittest\npython -m coverage report\n```\n\n# Citing\nIf you find this package useful, please cite the original works (see Reference of each strategy) as well as the following\n\n```\n@techreport{YY2017,\n  author = {Yao-Yuan Yang and Shao-Chuan Lee and Yu-An Chung and Tung-En Wu and Si-An Chen and Hsuan-Tien Lin},\n  title = {libact: Pool-based Active Learning in Python},\n  institution = {National Taiwan University},\n  url = {https://github.com/ntucllab/libact},\n  note = {available as arXiv preprint \\url{https://arxiv.org/abs/1710.00379}},\n  month = oct,\n  year = 2017\n}\n```\n\n\n# Acknowledgments\n\nThe authors thank Chih-Wei Chang and other members of the [Computational Learning Lab](https://learner.csie.ntu.edu.tw/) at National Taiwan University for valuable discussions and various contributions to making this package better.\n","funding_links":[],"categories":["scientific publications","Table of Contents","Python","3.3 AL in AI Fields - 人工智能背景中的主动学习"],"sub_categories":["Sampling as a step of the publication","**Tutorials - 教程**"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fntucllab%2Flibact","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fntucllab%2Flibact","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fntucllab%2Flibact/lists"}