snorkel.augmentation.ApplyOnePolicy

class snorkel.augmentation.ApplyOnePolicy(n_per_original=1, keep_original=True)[source]

Bases: snorkel.augmentation.policy.core.ApplyAllPolicy

Apply a single TF to each data point.

__init__(n_per_original=1, keep_original=True)[source]

Initialize self. See help(type(self)) for accurate signature.

Return type

None

Methods

__init__([n_per_original, keep_original])

Initialize self.

generate()

Generate indices of all TFs in order.

generate_for_example()

Generate all sequences of TF indices for a single example.

generate()[source]

Generate indices of all TFs in order.

Returns

Indices of all TFs in order.

Return type

List[int]

generate_for_example()[source]

Generate all sequences of TF indices for a single example.

Generates n_per_original sequences, and adds an empty sequence if keep_original is True.

Returns

Sequences of indices of TFs to run on data point in order.

Return type

List[List[int]]