Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calculate feature matrix can fail when comparing categorical columns with different categories using Equal and NotEqual primitives #2495

Open
thehomebrewnerd opened this issue Feb 23, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@thehomebrewnerd
Copy link
Contributor

Feature matrix calculation can fail in some cases when using Equal and NotEqual primitives to compare categorical columns with different categories. An example is included below using the attached data.

SBAcase_cleaned_train.csv

Code Sample, a copy-pastable example to reproduce your bug.

import pandas as pd
import featuretools as ft

df = pd.read_csv("SBAcase_cleaned_train.csv")

es = ft.EntitySet()

logical_types = {
    "NAICS": "Categorical",
    "NewExist": "Categorical",
}
es.add_dataframe(dataframe_name="df", dataframe=df, index="id", make_index=True, logical_types=logical_types)

ft.dfs(entityset=es, target_dataframe_name="df", trans_primitives=["equal", "not_equal"])
TypeError: Categoricals can only be compared if 'categories' are the same.
@thehomebrewnerd thehomebrewnerd added the bug Something isn't working label Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant