pyreal.transformers.Mappings.generate_mappings#

static Mappings.generate_mappings(categorical_to_one_hot=None, one_hot_to_categorical=None, dataframe=None)[source]#

Generate a new Mappings object using one of the input formats All but one keyword should be None

Parameters:
  • categorical_to_one_hot – {categorical_feature_name : {OHE_feature_name : value, …}, … }

  • one_hot_to_categorical – {OHE_feature_name : (categorical_feature_name, value), …}

  • dataframe – DataFrame with three columns named [categorical, one_hot_encoded, values] ie., [[“A_a”, “A”, “a”], [“A_b”, “B”, “b”]]

Returns:

Mappings

A Mappings objects representing the column relationships