snorkel.slicing.SlicingFunction

class snorkel.slicing.SlicingFunction(name, f, resources=None, pre=None, fault_tolerant=False)[source]

Bases: snorkel.labeling.lf.core.LabelingFunction

Base class for slicing functions.

See snorkel.labeling.lf.LabelingFunction for details.

__init__(name, f, resources=None, pre=None, fault_tolerant=False)[source]

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

Return type

None

Methods

__init__(name, f[, resources, pre, …])

Initialize self.

__call__(x)[source]

Label data point.

Runs all preprocessors, then passes to LF. If an exception is encountered and the LF is in fault tolerant mode, the LF abstains from voting.

Parameters

x (Any) – Data point to label

Returns

Label for data point

Return type

int