alteryx / alteryx/featuretools

Update CFM so that binary comparisons work for Ordinal columns from aggregations

Aperta
#2,027 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
7.7k
Fork
915
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

There is an issue with several of the binary comparison primitives such as `LessThan` in which comparing an Ordinal column in a base dataframe to an Ordinal column generated from an aggregation primitive can fail. For examples of this refer to this test: https://github.com/alteryx/featuretools/blob/6e819333b7631487f3e30684162abe0a4faf6dc3/featuretools/tests/primitive_tests/test_transform_features.py#L1544

A temporary workaround was added in PR #2025 to prevent CFM from failing on a feature generated automatically by DFS, but a better fix is needed.

The reason the comparison doesn't work is that the intermediate aggregation feature does not have a categorical dtype set as this doesn't happen until Woodwork is initialized at the end of calculating the feature matrix. This causes one of the primitive inputs to be categorical but the other to be something else, such as numeric. As a workaround, the primitives were updated to return `nan` values in cases where one but not both of the two primitive inputs were categorical.

We should update CFM to properly handle these comparisons and compute actual values instead of returning nan values.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.