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

Uploaded Source

Built Distribution

hyperlm-0.0.1-py3-none-any.whl (91.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hyperlm-0.0.1.tar.gz
  • Upload date:
  • Size: 92.0 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.1.tar.gz
Algorithm Hash digest
SHA256 6228c7df416aa134cd24b268f90db29885b169007c76941a9d65c04dce61c592
MD5 1e49d497615c06f1f584ae120409055e
BLAKE2b-256 b707e31c878021dd2c2e6be5f6e3e97dbaa686195997a202f48bcca5cd4e301d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hyperlm-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 91.4 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bf8aae4b7fddf6fee5b047701d9e796305b79f3d28d06ac45e27f4f9b4fbebb1
MD5 abbce59907714f677c684ff71b539203
BLAKE2b-256 6f0c5ced19f1acbb24dbbe54da75c53566cc48effc00646d8df30c45dd72bca2

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