KeyError: 'NAME_EDUCATION_TYPE_CODE_GENDER_AMT_CREDIT_min' while running the code
KartikKannapur opened this issue ยท 2 comments
Solution Version: solution 5 | sunflower ๐ป
Command used to run the code: neptune run --config configs/neptune.yaml main.py train_evaluate_predict_cv --pipeline_name lightGBM
Error Message: KeyError: 'NAME_EDUCATION_TYPE_CODE_GENDER_AMT_CREDIT_min'
The pops up in the feature_extraction.py file, under the GroupbyAggregateDiffs
class and _add_diff_features
method.
While iterating through self.groupby_aggregations
, using this line of code for groupby_cols, specs in self.groupby_aggregations:
, the contents of this - self.groupby_aggregations
are:
[(['NAME_EDUCATION_TYPE', 'CODE_GENDER'], [('AMT_CREDIT', 'min'), ('AMT_CREDIT', 'mean'), ('AMT_CREDIT', 'max'), ('AMT_CREDIT', 'sum'), ('AMT_CREDIT', 'var'), ('AMT_ANNUITY', 'min'), ('AMT_ANNUITY', 'mean'), ('AMT_ANNUITY', 'max'), ('AMT_ANNUITY', 'sum'), ('AMT_ANNUITY', 'var'), ('AMT_INCOME_TOTAL', 'min'), ('AMT_INCOME_TOTAL', 'mean'), ('AMT_INCOME_TOTAL', 'max'), ('AMT_INCOME_TOTAL', 'sum'), ('AMT_INCOME_TOTAL', 'var'), ('AMT_GOODS_PRICE', 'min'), ('AMT_GOODS_PRICE', 'mean'), ('AMT_GOODS_PRICE', 'max'), ('AMT_GOODS_PRICE', 'sum'), ('AMT_GOODS_PRICE', 'var'), ('EXT_SOURCE_1', 'min'), ('EXT_SOURCE_1', 'mean'), ('EXT_SOURCE_1', 'max'), ('EXT_SOURCE_1', 'sum'), ('EXT_SOURCE_1', 'var'), ('EXT_SOURCE_2', 'min'), ('EXT_SOURCE_2', 'mean'), ('EXT_SOURCE_2', 'max'), ('EXT_SOURCE_2', 'sum'), ('EXT_SOURCE_2', 'var'), ('EXT_SOURCE_3', 'min'), ('EXT_SOURCE_3', 'mean'), ('EXT_SOURCE_3', 'max'), ('EXT_SOURCE_3', 'sum'), ('EXT_SOURCE_3', 'var'), ('OWN_CAR_AGE', 'min'), ('OWN_CAR_AGE', 'mean'), ('OWN_CAR_AGE', 'max'), ('OWN_CAR_AGE', 'sum'), ('OWN_CAR_AGE', 'var'), ('REGION_POPULATION_RELATIVE', 'min'), ('REGION_POPULATION_RELATIVE', 'mean'), ('REGION_POPULATION_RELATIVE', 'max'), ('REGION_POPULATION_RELATIVE', 'sum'), ('REGION_POPULATION_RELATIVE', 'var'), ('DAYS_REGISTRATION', 'min'), ('DAYS_REGISTRATION', 'mean'), ('DAYS_REGISTRATION', 'max'), ('DAYS_REGISTRATION', 'sum'), ('DAYS_REGISTRATION', 'var'), ('CNT_CHILDREN', 'min'), ('CNT_CHILDREN', 'mean'), ('CNT_CHILDREN', 'max'), ('CNT_CHILDREN', 'sum'), ('CNT_CHILDREN', 'var'), ('CNT_FAM_MEMBERS', 'min'), ('CNT_FAM_MEMBERS', 'mean'), ('CNT_FAM_MEMBERS', 'max'), ('CNT_FAM_MEMBERS', 'sum'), ('CNT_FAM_MEMBERS', 'var'), ('DAYS_ID_PUBLISH', 'min'), ('DAYS_ID_PUBLISH', 'mean'), ('DAYS_ID_PUBLISH', 'max'), ('DAYS_ID_PUBLISH', 'sum'), ('DAYS_ID_PUBLISH', 'var'), ('DAYS_BIRTH', 'min'), ('DAYS_BIRTH', 'mean'), ('DAYS_BIRTH', 'max'), ('DAYS_BIRTH', 'sum'), ('DAYS_BIRTH', 'var'), ('DAYS_EMPLOYED', 'min'), ('DAYS_EMPLOYED', 'mean'), ('DAYS_EMPLOYED', 'max'), ('DAYS_EMPLOYED', 'sum'), ('DAYS_EMPLOYED', 'var')]), (['NAME_FAMILY_STATUS', 'NAME_EDUCATION_TYPE'], [('AMT_CREDIT', 'min'), ('AMT_CREDIT', 'mean'), ('AMT_CREDIT', 'max'), ('AMT_CREDIT', 'sum'), ('AMT_CREDIT', 'var'), ('AMT_ANNUITY', 'min'), ('AMT_ANNUITY', 'mean'), ('AMT_ANNUITY', 'max'), ('AMT_ANNUITY', 'sum'), ('AMT_ANNUITY', 'var'), ('AMT_INCOME_TOTAL', 'min'), ('AMT_INCOME_TOTAL', 'mean'), ('AMT_INCOME_TOTAL', 'max'), ('AMT_INCOME_TOTAL', 'sum'), ('AMT_INCOME_TOTAL', 'var'), ('AMT_GOODS_PRICE', 'min'), ('AMT_GOODS_PRICE', 'mean'), ('AMT_GOODS_PRICE', 'max'), ('AMT_GOODS_PRICE', 'sum'), ('AMT_GOODS_PRICE', 'var'), ('EXT_SOURCE_1', 'min'), ('EXT_SOURCE_1', 'mean'), ('EXT_SOURCE_1', 'max'), ('EXT_SOURCE_1', 'sum'), ('EXT_SOURCE_1', 'var'), ('EXT_SOURCE_2', 'min'), ('EXT_SOURCE_2', 'mean'), ('EXT_SOURCE_2', 'max'), ('EXT_SOURCE_2', 'sum'), ('EXT_SOURCE_2', 'var'), ('EXT_SOURCE_3', 'min'), ('EXT_SOURCE_3', 'mean'), ('EXT_SOURCE_3', 'max'), ('EXT_SOURCE_3', 'sum'), ('EXT_SOURCE_3', 'var'), ('OWN_CAR_AGE', 'min'), ('OWN_CAR_AGE', 'mean'), ('OWN_CAR_AGE', 'max'), ('OWN_CAR_AGE', 'sum'), ('OWN_CAR_AGE', 'var'), ('REGION_POPULATION_RELATIVE', 'min'), ('REGION_POPULATION_RELATIVE', 'mean'), ('REGION_POPULATION_RELATIVE', 'max'), ('REGION_POPULATION_RELATIVE', 'sum'), ('REGION_POPULATION_RELATIVE', 'var'), ('DAYS_REGISTRATION', 'min'), ('DAYS_REGISTRATION', 'mean'), ('DAYS_REGISTRATION', 'max'), ('DAYS_REGISTRATION', 'sum'), ('DAYS_REGISTRATION', 'var'), ('CNT_CHILDREN', 'min'), ('CNT_CHILDREN', 'mean'), ('CNT_CHILDREN', 'max'), ('CNT_CHILDREN', 'sum'), ('CNT_CHILDREN', 'var'), ('CNT_FAM_MEMBERS', 'min'), ('CNT_FAM_MEMBERS', 'mean'), ('CNT_FAM_MEMBERS', 'max'), ('CNT_FAM_MEMBERS', 'sum'), ('CNT_FAM_MEMBERS', 'var'), ('DAYS_ID_PUBLISH', 'min'), ('DAYS_ID_PUBLISH', 'mean'), ('DAYS_ID_PUBLISH', 'max'), ('DAYS_ID_PUBLISH', 'sum'), ('DAYS_ID_PUBLISH', 'var'), ('DAYS_BIRTH', 'min'), ('DAYS_BIRTH', 'mean'), ('DAYS_BIRTH', 'max'), ('DAYS_BIRTH', 'sum'), ('DAYS_BIRTH', 'var'), ('DAYS_EMPLOYED', 'min'), ('DAYS_EMPLOYED', 'mean'), ('DAYS_EMPLOYED', 'max'), ('DAYS_EMPLOYED', 'sum'), ('DAYS_EMPLOYED', 'var')]), (['NAME_FAMILY_STATUS', 'CODE_GENDER'], [('AMT_CREDIT', 'min'), ('AMT_CREDIT', 'mean'), ('AMT_CREDIT', 'max'), ('AMT_CREDIT', 'sum'), ('AMT_CREDIT', 'var'), ('AMT_ANNUITY', 'min'), ('AMT_ANNUITY', 'mean'), ('AMT_ANNUITY', 'max'), ('AMT_ANNUITY', 'sum'), ('AMT_ANNUITY', 'var'), ('AMT_INCOME_TOTAL', 'min'), ('AMT_INCOME_TOTAL', 'mean'), ('AMT_INCOME_TOTAL', 'max'), ('AMT_INCOME_TOTAL', 'sum'), ('AMT_INCOME_TOTAL', 'var'), ('AMT_GOODS_PRICE', 'min'), ('AMT_GOODS_PRICE', 'mean'), ('AMT_GOODS_PRICE', 'max'), ('AMT_GOODS_PRICE', 'sum'), ('AMT_GOODS_PRICE', 'var'), ('EXT_SOURCE_1', 'min'), ('EXT_SOURCE_1', 'mean'), ('EXT_SOURCE_1', 'max'), ('EXT_SOURCE_1', 'sum'), ('EXT_SOURCE_1', 'var'), ('EXT_SOURCE_2', 'min'), ('EXT_SOURCE_2', 'mean'), ('EXT_SOURCE_2', 'max'), ('EXT_SOURCE_2', 'sum'), ('EXT_SOURCE_2', 'var'), ('EXT_SOURCE_3', 'min'), ('EXT_SOURCE_3', 'mean'), ('EXT_SOURCE_3', 'max'), ('EXT_SOURCE_3', 'sum'), ('EXT_SOURCE_3', 'var'), ('OWN_CAR_AGE', 'min'), ('OWN_CAR_AGE', 'mean'), ('OWN_CAR_AGE', 'max'), ('OWN_CAR_AGE', 'sum'), ('OWN_CAR_AGE', 'var'), ('REGION_POPULATION_RELATIVE', 'min'), ('REGION_POPULATION_RELATIVE', 'mean'), ('REGION_POPULATION_RELATIVE', 'max'), ('REGION_POPULATION_RELATIVE', 'sum'), ('REGION_POPULATION_RELATIVE', 'var'), ('DAYS_REGISTRATION', 'min'), ('DAYS_REGISTRATION', 'mean'), ('DAYS_REGISTRATION', 'max'), ('DAYS_REGISTRATION', 'sum'), ('DAYS_REGISTRATION', 'var'), ('CNT_CHILDREN', 'min'), ('CNT_CHILDREN', 'mean'), ('CNT_CHILDREN', 'max'), ('CNT_CHILDREN', 'sum'), ('CNT_CHILDREN', 'var'), ('CNT_FAM_MEMBERS', 'min'), ('CNT_FAM_MEMBERS', 'mean'), ('CNT_FAM_MEMBERS', 'max'), ('CNT_FAM_MEMBERS', 'sum'), ('CNT_FAM_MEMBERS', 'var'), ('DAYS_ID_PUBLISH', 'min'), ('DAYS_ID_PUBLISH', 'mean'), ('DAYS_ID_PUBLISH', 'max'), ('DAYS_ID_PUBLISH', 'sum'), ('DAYS_ID_PUBLISH', 'var'), ('DAYS_BIRTH', 'min'), ('DAYS_BIRTH', 'mean'), ('DAYS_BIRTH', 'max'), ('DAYS_BIRTH', 'sum'), ('DAYS_BIRTH', 'var'), ('DAYS_EMPLOYED', 'min'), ('DAYS_EMPLOYED', 'mean'), ('DAYS_EMPLOYED', 'max'), ('DAYS_EMPLOYED', 'sum'), ('DAYS_EMPLOYED', 'var')]), (['CODE_GENDER', 'ORGANIZATION_TYPE'], [('AMT_ANNUITY', 'mean'), ('AMT_INCOME_TOTAL', 'mean'), ('DAYS_REGISTRATION', 'mean'), ('EXT_SOURCE_1', 'mean')]), (['CODE_GENDER', 'REG_CITY_NOT_WORK_CITY'], [('AMT_ANNUITY', 'mean'), ('CNT_CHILDREN', 'mean'), ('DAYS_ID_PUBLISH', 'mean')]), (['CODE_GENDER', 'NAME_EDUCATION_TYPE', 'OCCUPATION_TYPE', 'REG_CITY_NOT_WORK_CITY'], [('EXT_SOURCE_1', 'mean'), ('EXT_SOURCE_2', 'mean')]), (['NAME_EDUCATION_TYPE', 'OCCUPATION_TYPE'], [('AMT_CREDIT', 'mean'), ('AMT_REQ_CREDIT_BUREAU_YEAR', 'mean'), ('APARTMENTS_AVG', 'mean'), ('BASEMENTAREA_AVG', 'mean'), ('EXT_SOURCE_1', 'mean'), ('EXT_SOURCE_2', 'mean'), ('EXT_SOURCE_3', 'mean'), ('NONLIVINGAREA_AVG', 'mean'), ('OWN_CAR_AGE', 'mean'), ('YEARS_BUILD_AVG', 'mean')]), (['NAME_EDUCATION_TYPE', 'OCCUPATION_TYPE', 'REG_CITY_NOT_WORK_CITY'], [('ELEVATORS_AVG', 'mean'), ('EXT_SOURCE_1', 'mean')]), (['OCCUPATION_TYPE'], [('AMT_ANNUITY', 'mean'), ('CNT_CHILDREN', 'mean'), ('CNT_FAM_MEMBERS', 'mean'), ('DAYS_BIRTH', 'mean'), ('DAYS_EMPLOYED', 'mean'), ('DAYS_ID_PUBLISH', 'mean'), ('DAYS_REGISTRATION', 'mean'), ('EXT_SOURCE_1', 'mean'), ('EXT_SOURCE_2', 'mean'), ('EXT_SOURCE_3', 'mean')])]
I am assuming that this is where it is combining 'NAME_EDUCATION_TYPE', 'CODE_GENDER', 'AMT_CREDIT', 'min' and the key is missing.
I tried to isolate the error message, but the code base is quite large. I figured a community based approach to resolve the bug might be ideal.
@KartikKannapur which version of steppy are you using? We had a similar problem with the newest pip-installed version 0.1.6 (maybe I won't go into details, but I can try if you like - generally the saving behaviour of steps changed a little bit), and downgrading it to 0.1.5 solved the problem.
Thank you so much @kstrzala
I downgraded the version of steppy to 0.1.5 and the issue was resolved.