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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for hyperlm-0.0.4.tar.gz
Algorithm Hash digest
SHA256 50610aa694126df62e27f679e7bc1a76f3d72e16decc0b865c9eaa8ad8dde2b8
MD5 1c1afb0e21b694735e0baffd7b086a12
BLAKE2b-256 bc3b00ebe716fb96205005dbc21fd3a1c3301845faf88f0556f4ab1f5762e753

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hyperlm-0.0.4-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.9.16

File hashes

Hashes for hyperlm-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e5453d423debfc44f3bce1b37b41912d8a6dda754b4be328d6d988de959adab1
MD5 072aaa6630c529a1c3e047cc726d73a3
BLAKE2b-256 278e037125e3e2290cc68e00a5d58074944832d41366e90df9b356f07d7375aa

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