Skip to main content

Optimal Asymptotic Sequential Importance Sampling

Project description

https://travis-ci.org/ngmarchant/oasis.svg?branch=master https://img.shields.io/badge/License-MIT-yellow.svg https://badge.fury.io/py/oasis.svg

OASIS is a tool for evaluating binary classifiers when ground truth class labels are not immediately available, but can be obtained at some cost (e.g. by asking humans). The tool takes an unlabelled test set as input and intelligently selects items to label so as to provide a precise estimate of the classifier’s performance, whilst minimising the amount of labelling required. The underlying strategy for selecting the items to label is based on a technique called adaptive importance sampling, which is optimised for the classifier performance measure of interest. Currently, OASIS supports estimation of the weighted F-measure, which includes the F1-score, precision and recall.

Example

See the Jupyter notebook under docs/tutorial/tutorial.ipynb:

>>> import oasis
>>> data = oasis.Data()
>>> data.read_h5('Amazon-GoogleProducts-test.h5')
>>> def oracle(idx):
>>>     return data.labels[idx]
>>> smplr = oasis.OASISSampler(alpha, data.preds, data.scores, oracle)
>>> smplr.sample_distinct(5000) #: query labels for 5000 distinct items
>>> print("Current estimate is {}.".format(smplr.estimate_[smplr.t_ - 1]))

License and disclaimer

The code is released under the MIT license. Please see the LICENSE file for details.

Project details


Release history Release notifications

Download files

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

Files for oasis, version 0.1.2
Filename, size File type Python version Upload date Hashes
Filename, size oasis-0.1.2-py2.py3-none-any.whl (31.0 kB) File type Wheel Python version py2.py3 Upload date Hashes View hashes
Filename, size oasis-0.1.2.tar.gz (16.6 MB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page