Let a multi-armed bandit pick your active learning strategy
libact wraps a dozen active learning strategies in one Python interface and includes a meta-algorithm that dynamically picks the best one so you don't have to guess.

What it does
libact is a Python toolkit for pool-based active learning. It collects roughly a dozen query strategies—uncertainty sampling, core-set diversity, BALD, density-weighted methods, and others—behind a single interface so you can swap algorithms without rebuilding your pipeline. It also ships with lightweight built-in models and adapters that let you wrap scikit-learn estimators for use inside its active learning loop.
The interesting bit
The project’s standout feature is ActiveLearningByLearning, a meta-algorithm that treats each query strategy as an arm in a multi-armed bandit and switches among them dynamically. It is a rare built-in admission that the “best” strategy depends on the dataset and the moment, and that letting an algorithm shop around often beats committing upfront.
Key highlights
- Bundles 12+ query strategies spanning uncertainty, diversity, density, and disagreement-based selection.
- Includes a multi-armed bandit meta-strategy that auto-selects among query algorithms during a run.
- Offers
SklearnAdapterandSklearnProbaAdapterto drop existing scikit-learn classifiers into the loop. - Two strategies (
VarianceReductionandHintSVM) require compiled C extensions; the rest are pure Python. - Supports Python 3.9 through 3.12 and tracks recent numpy/scikit-learn releases.
Caveats
- Native Windows support is explicitly discouraged; the README recommends WSL instead.
- Installing from source requires BLAS/LAPACKE and a meson/ninja/cython toolchain.
- The C extensions for
VarianceReductionandHintSVMadd system-level build friction.
Verdict
Worth a look if you are benchmarking active learning methods or need a plug-and-play loop with strategy swapping. Skip it if you just need a single uncertainty sampler and already own the surrounding data pipeline.
Frequently asked
- What is ntucllab/libact?
- libact wraps a dozen active learning strategies in one Python interface and includes a meta-algorithm that dynamically picks the best one so you don't have to guess.
- Is libact open source?
- Yes — ntucllab/libact is open source, released under the BSD-2-Clause license.
- What language is libact written in?
- ntucllab/libact is primarily written in Python.
- How popular is libact?
- ntucllab/libact has 792 stars on GitHub.
- Where can I find libact?
- ntucllab/libact is on GitHub at https://github.com/ntucllab/libact.