Skip to main content

A Python Framework for Deep Active Learning

Project description

Zeef: Active Learning for Data-Centric AI

PyPI PyPI - Downloads Testing FOSSA Status

An active learning framework that can be applied to real-world scenarios that leak labeled data.

Installation

pip install zeef

For the local development, you can install from the Anaconda environment by

conda env create -f environment.yml

Quick Start

We can start from the easiest example: random select data points from an unlabeled data pool.

from sklearn import svm

from zeef.data import Pool
from zeef.learner.sklearn import Learner
from zeef.strategy import RandomSampling

learner = Learner(net=svm.SVC(probability=True))  # define the learner.
data_pool = Pool(unlabeled_data)  # generate the data pool.
strategy = RandomSampling(data_pool, learner=learner)  # define the sampling strategy.

query_ids = strategy.query(1000)  # query 1k samples for labeling.
strategy.update(query_ids, data_labels)  # label the 1k samples.
strategy.learn()  # train the model using all the labeled data.
strategy.infer(test_data)  # evaluate the model.

A quick MNIST CNN example can be found in here. Run

python main_torch.py

to start the quick demonstration.

License

Apache License 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zeef-0.1.2.tar.gz (13.0 kB view hashes)

Uploaded Source

Built Distribution

zeef-0.1.2-py3-none-any.whl (16.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page