snorkel.slicing.SlicingFunction

class snorkel.slicing.SlicingFunction(name, f, resources=None, pre=None)[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)[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 preprocessed data point to LF.

Parameters

x (Any) – Data point to label

Returns

Label for data point

Return type

int