alteryx / alteryx/autonormalize

Variable types not preserved after call to normalize_entity()

Aperta
#10 7 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
117
Fork
15
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Reproducible example:
```python
import pandas as pd
import featuretools as ft

from featuretools.variable_types import IPAddress
from autonormalize import autonormalize as an

input_df = pd.DataFrame(
{
'ip_address': ['128.101.101.101', '1.120.0.0', '17.86.21.0', '23.1.23.255'],
'length': [900, 60, 20, 30],
'city': ['adl', 'syd', 'adl', 'syd'],
'country': ['aus', 'aus', 'aus', 'aus'],
'is_threat': [True, False, False, False]
}
)

variable_types = {'ip_address': IPAddress}

es = ft.EntitySet()
es.entity_from_dataframe(entity_id='data',
dataframe=input_df,
index='index',
variable_types=variable_types,
make_index=True)
```
Column ip_address is set to dtype featuretools.variable_types.IPAddress:
```python
print(es['data'].variables)

[,
,
,
,
,
]
```
After normalisation, ip_address resolves back to categorical:
```python
normalized_es = an.normalize_entity(es)

for entity in normalized_es.entity_dict:
print(normalized_es.entity_dict[entity].variables)
```
```
Entity: index
[,
,
,
,
]
Entity: city
[, ]
```

To get the desired features, the variable types need to be preserved so the right primitives can be applied when running dfs. My question is whether this should be the desired behaviour or do the variable types need to be set manually again?

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.