MadLib._internal.feature.feature.Feature

class MadLib._internal.feature.feature.Feature(a_attr: str, b_attr: str)[source]

Bases: ABC

__init__(a_attr: str, b_attr: str)[source]

Methods

__init__(a_attr, b_attr)

build(A, B, cache)

Guarenteed to be called before the features preprocessing is done.

preprocess(data, is_table_a)

preprocess the data, adding the output column to data

preprocess_output_column(for_table_a)

get the name of the preprocessing output column for table A or B

template(**kwargs)

Attributes

a_attr

the name of the attribute from table a used to generate this feature

b_attr

the name of the attribute from table a used to generate this feature

property a_attr

the name of the attribute from table a used to generate this feature

property b_attr

the name of the attribute from table a used to generate this feature

build(A, B, cache)[source]

Guarenteed to be called before the features preprocessing is done. this method should generate and store all of the metadata required to compute the features over A and B, NOTE B may be None

preprocess(data, is_table_a)[source]

preprocess the data, adding the output column to data

preprocess_output_column(for_table_a: bool)[source]

get the name of the preprocessing output column for table A or B

classmethod template(**kwargs)[source]