featuretools icon indicating copy to clipboard operation
featuretools copied to clipboard

Allow relationships to be given custom names

Open CJStadler opened this issue 5 years ago • 0 comments

This could be useful when there are multiple relationships between two entities. For example:

games.home_team_id -> teams.id
games.away_team_id -> teams.id

Currently we disambiguate by using the child_variable_id, generating features with names like the following

Forward:
  teams[home_team_id].MEAN(...)
  teams[away_team_id].MEAN(...)

Backward:
  MEAN(games[home_team_id].home_score)
  MEAN(games[away_team_id].away_score)

It would be clearer if each direction of each relationship had its own name, allowing the above to be rendered as

Forward:
  home_team.MEAN(...)
  away_team.MEAN(...)

Backward:
  MEAN(home_games.home_score)
  MEAN(away_games.away_score)

We could allow names like this to be specified through an API like the following:

relationship.rename(parent_name='home_team', child_name='home_games')

The above situation may not be common enough to make this enhancement worthwhile – further discussion is needed.

See #543

CJStadler avatar Jul 01 '19 19:07 CJStadler