【发布时间】:2020-03-02 01:32:54
【问题描述】:
这个问题是这个post的后续问题:
我可以解决第一部分的疑问,但之后又出现了另一个问题。
我想得到groupby_trans_primitives:Diff和TimeSincePrevious(天),但只在录音实体中,不包括其他实体:'vendedores','produtos',cliente','produto_cliente'
我尝试了以下代码以不成功地排除这些实体:
from featuretools.primitives import TimeSincePrevious
time_since_previous = TimeSincePrevious(unit = "days")
fm, features = ft.dfs(entityset=es,
target_entity='recordings',
trans_primitives = [],
agg_primitives = [],
max_depth=2,
verbose=True,
groupby_trans_primitives=['Diff',time_since_previous],
primitive_options={'time_since_previous': {'ignore_groupby_entities': ['vendedores','produtos','cliente']}})
因为代码返回了以下特性:
Built 38 features
Elapsed: 00:38 | Progress: 100%|██████████
[<Feature: CODIGO_CLIENTE>,
<Feature: NOME_VENDEDOR>,
<Feature: CODIGO_PRODUTO>,
<Feature: QUANTIDADE>,
<Feature: VALOR_TOTAL>,
<Feature: PRODUTO_CLIENTE>,
<Feature: DIFF(QUANTIDADE) by PRODUTO_CLIENTE>,
<Feature: DIFF(QUANTIDADE) by CODIGO_PRODUTO>,
<Feature: DIFF(QUANTIDADE) by NOME_VENDEDOR>,
<Feature: DIFF(QUANTIDADE) by CODIGO_CLIENTE>,
<Feature: DIFF(VALOR_TOTAL) by PRODUTO_CLIENTE>,
<Feature: DIFF(VALOR_TOTAL) by CODIGO_PRODUTO>,
<Feature: DIFF(VALOR_TOTAL) by NOME_VENDEDOR>,
<Feature: DIFF(VALOR_TOTAL) by CODIGO_CLIENTE>,
<Feature: TIME_SINCE_PREVIOUS(DATA_NOTA, unit=days) by PRODUTO_CLIENTE>,
<Feature: TIME_SINCE_PREVIOUS(DATA_NOTA, unit=days) by CODIGO_PRODUTO>,
<Feature: TIME_SINCE_PREVIOUS(DATA_NOTA, unit=days) by NOME_VENDEDOR>,
<Feature: TIME_SINCE_PREVIOUS(DATA_NOTA, unit=days) by CODIGO_CLIENTE>,
<Feature: cliente.CLASSIFICACAO>,
<Feature: cliente.REDE>,
<Feature: cliente.CIDADE>,
<Feature: cliente.UF>,
<Feature: TIME_SINCE_PREVIOUS(vendedores.first_recordings_time, unit=days) by PRODUTO_CLIENTE>,
<Feature: TIME_SINCE_PREVIOUS(vendedores.first_recordings_time, unit=days) by CODIGO_PRODUTO>,
<Feature: TIME_SINCE_PREVIOUS(vendedores.first_recordings_time, unit=days) by NOME_VENDEDOR>,
<Feature: TIME_SINCE_PREVIOUS(vendedores.first_recordings_time, unit=days) by CODIGO_CLIENTE>,
<Feature: TIME_SINCE_PREVIOUS(produto_cliente.first_recordings_time, unit=days) by PRODUTO_CLIENTE>,
<Feature: TIME_SINCE_PREVIOUS(produto_cliente.first_recordings_time, unit=days) by CODIGO_PRODUTO>,
<Feature: TIME_SINCE_PREVIOUS(produto_cliente.first_recordings_time, unit=days) by NOME_VENDEDOR>,
<Feature: TIME_SINCE_PREVIOUS(produto_cliente.first_recordings_time, unit=days) by CODIGO_CLIENTE>,
<Feature: TIME_SINCE_PREVIOUS(cliente.first_recordings_time, unit=days) by PRODUTO_CLIENTE>,
<Feature: TIME_SINCE_PREVIOUS(cliente.first_recordings_time, unit=days) by CODIGO_PRODUTO>,
<Feature: TIME_SINCE_PREVIOUS(cliente.first_recordings_time, unit=days) by NOME_VENDEDOR>,
<Feature: TIME_SINCE_PREVIOUS(cliente.first_recordings_time, unit=days) by CODIGO_CLIENTE>,
<Feature: TIME_SINCE_PREVIOUS(produtos.first_recordings_time, unit=days) by PRODUTO_CLIENTE>,
<Feature: TIME_SINCE_PREVIOUS(produtos.first_recordings_time, unit=days) by CODIGO_PRODUTO>,
<Feature: TIME_SINCE_PREVIOUS(produtos.first_recordings_time, unit=days) by NOME_VENDEDOR>,
<Feature: TIME_SINCE_PREVIOUS(produtos.first_recordings_time, unit=days) by CODIGO_CLIENTE>]
而且我不知道为什么在我的代码中创建了以下功能以排除这些实体:
<Feature: TIME_SINCE_PREVIOUS(vendedores.first_recordings_time, unit=days) by PRODUTO_CLIENTE>,
<Feature: TIME_SINCE_PREVIOUS(vendedores.first_recordings_time, unit=days) by CODIGO_PRODUTO>,
<Feature: TIME_SINCE_PREVIOUS(vendedores.first_recordings_time, unit=days) by NOME_VENDEDOR>,
<Feature: TIME_SINCE_PREVIOUS(vendedores.first_recordings_time, unit=days) by CODIGO_CLIENTE>,
<Feature: TIME_SINCE_PREVIOUS(produto_cliente.first_recordings_time, unit=days) by PRODUTO_CLIENTE>,
<Feature: TIME_SINCE_PREVIOUS(produto_cliente.first_recordings_time, unit=days) by CODIGO_PRODUTO>,
<Feature: TIME_SINCE_PREVIOUS(produto_cliente.first_recordings_time, unit=days) by NOME_VENDEDOR>,
<Feature: TIME_SINCE_PREVIOUS(produto_cliente.first_recordings_time, unit=days) by CODIGO_CLIENTE>,
<Feature: TIME_SINCE_PREVIOUS(cliente.first_recordings_time, unit=days) by PRODUTO_CLIENTE>,
<Feature: TIME_SINCE_PREVIOUS(cliente.first_recordings_time, unit=days) by CODIGO_PRODUTO>,
<Feature: TIME_SINCE_PREVIOUS(cliente.first_recordings_time, unit=days) by NOME_VENDEDOR>,
<Feature: TIME_SINCE_PREVIOUS(cliente.first_recordings_time, unit=days) by CODIGO_CLIENTE>,
<Feature: TIME_SINCE_PREVIOUS(produtos.first_recordings_time, unit=days) by PRODUTO_CLIENTE>,
<Feature: TIME_SINCE_PREVIOUS(produtos.first_recordings_time, unit=days) by CODIGO_PRODUTO>,
<Feature: TIME_SINCE_PREVIOUS(produtos.first_recordings_time, unit=days) by NOME_VENDEDOR>,
<Feature: TIME_SINCE_PREVIOUS(produtos.first_recordings_time, unit=days) by CODIGO_CLIENTE>]
我将不胜感激任何形式的帮助!谢谢!
【问题讨论】:
标签: python-3.x jupyter-notebook feature-extraction featuretools