Skip to main content

A hyper label model to aggregate weak labels from multiple weak supervision sources to infer the ground-truth labels in a single forward pass

Project description

Hyper label model

A hyper label model to aggregate weak labels from multiple weak supervision sources to infer the ground-truth labels in a single forward pass.

For more details, see our paper Learning Hyper Label Model for Programmatic Weak Supervision

** To reproduce experiments of our paper or to re-train the model from scratch, please switch to the paper_experiments branch.

How to use

  1. Install the package

    pip install hyperlm

  2. Import and create an instance

   from hyperlm import HyperLabelModel
   hlm = HyperLabelModel()
  1. Unsupervised label aggregation. Given an weak label matrix X, e.g. X=[[0, 0, 1], [1, 1, 1], [-1, 1, 0], [0, 1, 0]], you can infer the labels by:
   pred = hlm.infer(X)

Note in X, -1 represents abstention, 0 and 1 represent classes. Each row of X includes the weak labels for a data point, and each column of X includes the weak labels from a labeling function (LF).

  1. Semi-supervised label aggregation. Let's say the gt labels are provided for the examples at index 1 and 3, i.e. y_indices=[1,3], and the gt labels are y_vals=[1, 0]. We can incorporate the provided partial ground-truth with:
   pred = hlm.infer(X, y_indices=y_indices,y_vals=y_vals)

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

hyperlm-0.0.3.tar.gz (92.2 kB view details)

Uploaded Source

Built Distribution

hyperlm-0.0.3-py3-none-any.whl (91.5 kB view details)

Uploaded Python 3

File details

Details for the file hyperlm-0.0.3.tar.gz.

File metadata

  • Download URL: hyperlm-0.0.3.tar.gz
  • Upload date:
  • Size: 92.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.12

File hashes

Hashes for hyperlm-0.0.3.tar.gz
Algorithm Hash digest
SHA256 897cc175ca936fd574d0c61e61e98c69e8008e8809a575d1b1ae672f1924da41
MD5 abe50ebbd1fbc5b05e8aba95fd395836
BLAKE2b-256 acd0e4170597aa24681cf7051a4ad2dc68825fa2c42428e12207adf1e73012ad

See more details on using hashes here.

File details

Details for the file hyperlm-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: hyperlm-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 91.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.12

File hashes

Hashes for hyperlm-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8056681c7899113ef72ab1558bb7875d7126793c45825c8d8b5e36cf76513b44
MD5 5cb4b4d3fd359156d83f305a2ce41819
BLAKE2b-256 18349f7c06683b3af44120d3d44f866b19474139aed92fcbcf9f50524ddefc3e

See more details on using hashes here.

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