Giter Site home page Giter Site logo

libact's Introduction

libact: Pool-based Active Learning in Python

authors: Yu-An Chung, Shao-Chuan Lee, Yao-Yuan Yang, Tung-En Wu, Hsuan-Tien Lin

Build Status

Introduction

libact is a python package designed to make active learning easier for real-world users. The package not only implements several popular active learning strategies, but also features the active learning by learning meta-strategy that allows the machine to automatically learn the best strategy on the fly. The package is designed for easy extension in terms of strategies, models and labelers. In particular, libact models can be easily obtained by interfacing with the models in scikit-learn.

Comments on the package is welcomed at (temporarily) [email protected]. If you find this package useful, please cite the original works (see Reference of each strategy) as well as (temporarily)

@Misc{libact,
  author =   {Yu-An Chung and Shao-Chuan Lee and Yao-Yuan Yang and Tung-En Wu and Hsuan-Tien Lin},
  title =    {Pool-based Active Learning in Python},
  howpublished = {\url{https://github.com/ntucllab/libact}},
  year = {2015}
}

Basic Dependencies

Python3 dependencies

pip3 install -r requirements.txt

Debian (>= 7) / Ubuntu (>= 14.04)

sudo apt-get install build-essential gfortran libatlas-base-dev liblapacke-dev

MacOS

brew tap homebrew/science
brew install openblas

Installation

One of the query strategies (hintsvm) depends on the HintSVM package that requires special installation. If you are not using the strategy, please simply follow the section on general installation. Otherwise please follow the section on HintSVM.

General Installation

After resolving the dependencies, it should be fairly simple to install the package in your home directory:

python setup.py install --user

To install for all users on Unix/Linux:

python setup.py build
sudo python setup.py install

Special Installation for HintSVM

For HintSVM, you would have to install the hintsvm package first.

Before running, you need to make sure the path to the library and python code of hintsvm are set in the environment variables:

export LD_LIBRARY_PATH=/path/to/hintsvm:$LD_LIBRARY_PATH
export PYTHONPATH=/path/to/hintsvm/python:$PYTHONPATH

Usage

The main usage of libact is as follows:

qs = UncertaintySampling(trn_ds, method='lc') # query strategy instance

ask_id = qs.make_query() # let the specified query strategy suggest a data to query
X, y = zip(*trn_ds.data)
lb = lbr.label(X[ask_id]) # query the label of unlabeled data from labeler instance
trn_ds.update(ask_id, lb) # update the dataset with newly queried data

Some examples are available under the examples directory. Before running, use examples/get_dataset.py to retrieve the dataset used by the examples.

Available examples:

  • examples/plot.py: This example performs basic usage of libact. It splits a fully-labeled dataset and remove some label from dataset to simulate 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.

Acknowledgments

The authors thank Chih-Wei Chang and other members of the Computational Learning Lab at National Taiwan University for valuable discussions and various contributions to making this package better.

libact's People

Contributors

yangarbiter avatar lsc36 avatar iamyuanchung avatar tungen avatar hsuantien avatar lazywei avatar

Watchers

Alex avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.