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

[get_foodGroupFromToDF] Add possibility to select group aggregation level #9

Closed
frgfm opened this issue Jan 24, 2019 · 0 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@frgfm
Copy link
Member

frgfm commented Jan 24, 2019

As we aggregate the balanced split at groupAlim_1, we need to pass an argument selecting groupAlim_1 or groupAlim_2 to get_foodGroupFromToDF.

First fix attempt didn't work as many entries go through model matching
https://github.com/dataforgoodfr/batch5_phenix_happymeal/blob/master/preprocessing/categorization.py#L111-L114

Instruction

    input_listing = ct.get_foodGroupFromToDF(input_listing,
                                             EAN_col='EAN',
                                             product_name_col='Produit_Nom',
                                             mapping_file=mapping_file,
                                             model_classifier_file=model_classifier_file,
                                             model_matching_file=model_matching_file,
                                             group_name='labelAlim_1')

Current behaviour

input_listing.columns
Index(['Produit_Nom', 'EAN', 'VALEUR EN STOCK UNITAIRE (HT) ', 'quantity',
       'TOTAL (HT)', 'phenix_grams', 'off_grams', 'weight_grams',
       'labelAlim_2', 'statutAlim_2'],
      dtype='object')

Thus the meal grouping algo fails on all cases where the group isn't in the level 1 list.

Expected behaviour

input_listing.columns
Index(['Produit_Nom', 'EAN', 'VALEUR EN STOCK UNITAIRE (HT) ', 'quantity',
       'TOTAL (HT)', 'phenix_grams', 'off_grams', 'weight_grams',
       'labelAlim_1', 'statutAlim_1'],
      dtype='object')
@frgfm frgfm added the bug Something isn't working label Jan 24, 2019
@sarima sarima closed this as completed in 1226997 Jan 26, 2019
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

2 participants