fl4health.feature_alignment.tab_features_info_encoder module

class TabularFeaturesInfoEncoder(tabular_features, tabular_targets)[source]

Bases: object

This class encodes all the information required to perform feature alignment on tabular datasets.

Parameters:
  • tabular_features (list[TabularFeature]) – List of all tabular features.

  • tabular_targets (list[TabularFeature]) – List of all targets.

  • (Note – targets are not included in tabular_features)

static encoder_from_dataframe(df, id_column, target_columns, fill_values=None)[source]
Return type:

TabularFeaturesInfoEncoder

features_by_type(tabular_type)[source]
Return type:

list[TabularFeature]

static from_json(json_str)[source]
Return type:

TabularFeaturesInfoEncoder

get_categories_list()[source]
Return type:

list[dict[str, int] | list[Union[bool, bytes, float, int, str]]]

get_feature_columns()[source]
Return type:

list[str]

get_tabular_features()[source]
Return type:

list[TabularFeature]

get_tabular_targets()[source]
Return type:

list[TabularFeature]

get_target_columns()[source]
Return type:

list[str]

get_target_dimension()[source]
Return type:

int

to_json()[source]
Return type:

str

type_to_features()[source]
Return type:

dict[TabularType, list[TabularFeature]]