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.2.tar.gz (92.1 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: hyperlm-0.0.2.tar.gz
  • Upload date:
  • Size: 92.1 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.2.tar.gz
Algorithm Hash digest
SHA256 a7d11b996b343cd4140d9793e49d5a0a29ae6c06b814a886a257dbe32e000eec
MD5 8072cc74541f5522ec6a31e2b947389c
BLAKE2b-256 f108d4c601461f6638727da9fe78b79e0cf1e74be2c6789193190faf084c9999

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hyperlm-0.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 81f49481a78cd2cdf87ef837d6d3c3d58f50c4c5fa576b96d0027357c13e48d8
MD5 1d1b151dafb1dcab6e19418550031d1f
BLAKE2b-256 af0c54819d1ad0480e84fca07a414c95a61417efc5942af041bee9e8e0125863

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