SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2111.00980 · NeurIPS · 2021

Mixture Proportion Estimation and PU Learning: A Modern Approach

Saurabh Garg, Yifan Wu, Sivaraman Balakrishnan, Zachary Lipton, Alex Smola

arXiv · PDF · Open in the Atlas

Code that ran

6 of 6 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 4 failures of our instrument; 0 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2111.00980.json · badge: /api/ran/2111.00980.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
acmi-lab/pu_learning canonical (classifier label)
classifier basis: classifier_2025
6 ran · 0 no recorded run
FunctionStatusWhere it lives
BBE_estimator Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
acmi-lab/pu_learning/estimator.py
code served (permissive licence) · get_code("a437f68d6167d4ae")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Set random seed for reproducibility
np.random.seed(0)

# Create small sample data for BBE_estimator
# pdata_probs: 1D array of probabilities from positive data
pdata_probs = np.array([0.9, 0.8, 0.7, 0.6, 0.5, 0.4])

# udata_probs: 2D array where first column contains probabilities from unlabeled data
udata_probs = np.array([
    [0.85],
    [0.75],
    [0.65],
    [0.55],
    [0.45],
    [0.35]
])

# udata_targets: 1D array of binary targets for unlabeled data
udata_targets = np.array([1, 1, 0, 1, 0, 0])

ARGS = {
    "pdata_probs": pdata_probs,
    "udata_probs": udata_probs,
    "udata_targets": udata_targets
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
DKW_bound Ran
ran, violated the contract we drafted
acmi-lab/pu_learning/estimator.py
code served (permissive licence) · get_code("c82c001b12ff9e3e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Analyze the function to understand parameter usage:
# - x: not used in the function body
# - y: used in division (y / n), should be numeric
# - t: used in arithmetic (t - bound, t + bound), should be numeric
# - m: used in sqrt(np.log(4 / delta) / 2 / m), should be numeric > 0
# - n: used in sqrt(np.log(4 / delta) / 2 / n), should be numeric > 0
# - delta: used in np.log(4 / delta), should be numeric > 0
# - gamma: used in multiplication (1 + gamma), should be numeric

# Create valid arguments
x = np.array([1.0, 2.0, 3.0, 4.0])  # Not used but required parameter
y = 100.0  # Used in division, should be positive
t = 0.5  # Estimate value, used in arithmetic
m = 50  # Sample size, used in denominator
n = 75  # Sample size, used in denominator
delta = 0.1  # Confidence parameter
gamma = 0.01  # Adjustment parameter

ARGS = {
    "x": x,
    "y": y,
    "t": t,
    "m": m,
    "n": n,
    "delta": delta,
    "gamma": gamma,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
p_probs Ran
ran, honoured the contract we drafted
acmi-lab/pu_learning/estimator.py
code served (permissive licence) · get_code("36e4b190d1f22912")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned ndarray, ndim 1, dtype family float, shape (4,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import numpy as np

torch.manual_seed(0)

# Build a minimal neural network that outputs logits
class MinimalNet(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 2)  # 4 input features, 2 classes
    
    def forward(self, x):
        return self.linear(x)

# Create the network
net = MinimalNet()

# Set device
device = torch.device('cpu')

# Create a minimal data loader
# Each batch item is (batch_idx, inputs, targets)
# The function unpacks as: batch_idx, inputs, targets = item
p_loader = [
    (0, torch.randn(2, 4), torch.randint(0, 2, (2,))),
    (1, torch.randn(2, 4), torch.randint(0, 2, (2,))),
]

ARGS = {
    'net': net,
    'device': device,
    'p_loader': p_loader,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (4,) — shape (4,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
ramp_loss Ran
ran; our contract draft was wrong, not the code
acmi-lab/pu_learning/algorithm.py
code served (permissive licence) · get_code("6be2aa1992b29077")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Tensor, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create small tensors for the function
batch_size = 2
out = torch.randn(batch_size, dtype=torch.float)
y = torch.randint(0, 2, (batch_size,), dtype=torch.float)
device = torch.device('cpu')

ARGS = {
    'out': out,
    'y': y,
    'device': device
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
sigmoid_loss Ran
ran; our contract draft was wrong, not the code
acmi-lab/pu_learning/algorithm.py
code served (permissive licence) · get_code("f79eaa8260cc169c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Tensor, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Construct arguments for sigmoid_loss(out, y)
# The function calls:
# - out.gather(1, 1 - y.unsqueeze(1))
# - .mean()
# This means:
# - out must be a 2D tensor (batch_size, num_classes)
# - y must be a 1D tensor of class indices (batch_size,)
# - 1 - y produces binary labels (0 or 1)
# - gather(1, ...) gathers along dimension 1

batch_size = 2
num_classes = 4

# out: shape (batch_size, num_classes) - logits or scores
out = torch.randn(batch_size, num_classes)

# y: shape (batch_size,) - binary labels (0 or 1)
y = torch.tensor([0, 1])

ARGS = {
    "out": out,
    "y": y,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
u_probs Ran
ran; our contract draft was wrong, not the code
acmi-lab/pu_learning/estimator.py
code served (permissive licence) · get_code("6c57210f621bfbdb")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import numpy as np

torch.manual_seed(0)

# Create a minimal neural network that outputs logits
class SimpleNet(nn.Module):
    def __init__(self, num_classes=3):
        super().__init__()
        self.linear = nn.Linear(4, num_classes)
    
    def forward(self, x):
        return self.linear(x)

# Create the network
net = SimpleNet(num_classes=3)

# Set device
device = torch.device('cpu')

# Create a minimal data loader
# Each batch item is: (_, inputs, _, targets)
# where inputs is a tensor and targets is a tensor
u_loader = [
    (None, torch.randn(2, 4), None, torch.tensor([0, 1])),
    (None, torch.randn(2, 4), None, torch.tensor([2, 0])),
]

ARGS = {
    'net': net,
    'device': device,
    'u_loader': u_loader,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 4 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 4 later) and 2 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
p_probs 1 other paper
1 later
2311.13718 (2023-11)
A Unified Approach to Count-Based Weakly-Supervised Learning
ramp_loss 1 other paper
1 later
2311.13718 (2023-11)
A Unified Approach to Count-Based Weakly-Supervised Learning
sigmoid_loss 1 other paper
1 later
2311.13718 (2023-11)
A Unified Approach to Count-Based Weakly-Supervised Learning
u_probs 1 other paper
1 later
2311.13718 (2023-11)
A Unified Approach to Count-Based Weakly-Supervised Learning

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Given only positive examples and unlabeled examples (from both positive and negative classes), we might hope nevertheless to estimate an accurate positiveversus-negative classifier. Formally, this task is broken down into two subtasks: (i) Mixture Proportion Estimation (MPE)-determining the fraction of positive examples in the unlabeled data; and (ii) PU-learning-given such an estimate, learning the desired positive-versus-negative classifier. Unfortunately, classical methods for both problems break down in high-dimensional settings. Meanwhile, recently proposed heuristics lack theoretical coherence and depend precariously on hyperparameter tuning. In this paper, we propose two simple techniques: Best Bin Estimation (BBE) (for MPE); and Conditional Value Ignoring Risk (CVIR), a simple objective for PU-learning. Both methods dominate previous approaches empirically, and for BBE, we establish formal guarantees that hold whenever we can train a model to cleanly separate out a small subset of positive examples. Our final algorithm (TED) n , alternates between the two procedures, significantly improving both our mixture proportion estimator and classifier 1 .

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2111.00980")
get_code_for_paper("2111.00980")
have("2111.00980")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2111.00980.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2111.00980.svg)](https://syntology.ai/paper/2111.00980)

Connect an agent — have() is free.