NTTS 2021 Ingolf Boettcher Statistics Austria www statistik
NTTS 2021 Ingolf Boettcher Statistics Austria www. statistik. at Classifying transaction and web scraped data We move information
The challenge of product-classification But what if there a lot of objects to classify? https: //flightradar. live/, retrieved 21. 09. 2020 https: //cdn. kstarlive. com/image/1593412020668 -0. jpg www. statistik. at Folie 2 | 24. 01. 2022
The challenge of product-classification DATA STRUCTURE Retailer N STRUCTURE Retailer D J DATA STRUCTURE – Retailer XYZ DATA STRUCTURE Retailer ABC O ITEM Number But what if data comes in DATA STRUCTURE – Retailer G DATA STRUCTURE – Retailer XYZ DATA STRUCTURE Retailer ABC DATA STRUCTURE ITEM – ITEM Retailer Number DATA STRUCTURE –Number Retailer DATA STRUCTURE Retailer DATAGTIN STRUCTURE – Retailer E XYZABC different structures? Number ITEM Number A ITEM DATA STRUCTURE – Retailer XYZ DATA STRUCTURE Retailer ABC ITEM Number DATA STRUCTURE – Retailer M ITEM Number GTIN Number DATA STRUCTURE – Retailer XYZABC DATA STRUCTURE Retailer Number ITEM Number DATA STRUCTURE – Retailer XYZ Description DATA STRUCTURE Retailer L P DATA STRUCTURE Retailer ABC GTIN Number Promotion Code ITEM Number DATA STRUCTURE Retailer H DATA STRUCTURE Retailer ITEM Number Description DATA STRUCTURE – Retailer I DATA STRUCTURE – Retailer XYZ Description DATA STRUCTURE B DATA STRUCTURE Retailer ABC GTIN Number Promotion Code ITEM Number Promotion Code DATA STRUCTURE – Retailer XYZABC Description DATA STRUCTURE Retailer F DATA STRUCTURE Retailer GTIN Number Description ITEM Number Content Quantity ITEM Number Promotion Code CDescription Brand Description DATA STRUCTURE – Retailer XYZ Description ITEM Number DATA STRUCTURE Retailer ABC GTIN Number Content Quantity DATA STRUCTURE – Retailer XYZABC ITEM Number DATA STRUCTURE Retailer ITEM Number Content Quantity ITEM Number Promotion Code Brand Description GTIN Number Brand ITEM Number Content Quantity ITEM Number Promotion Content Quantity DATA STRUCTURE –Code Retailer Description Product Group 1 ITEM Number GTIN Number Brand Description Content Quantity ITEM Number Content Quantity GTIN Number ITEM Promotion Code Product Group 1 Number Content Quantity Product Group 1 Number ITEM Description Product Group 1 GTIN Number Brand Description Content Quantity Promotion Code K Description Product Group 1 Number GTIN Number Brand Product Group 1 2 GTIN Content Quantity Product Group Description Promotion Code Description Content Quantity Product Group 1 Description Product Group 1 Quantity Promotion Code GTIN Brand Product 2 Number Product Group 1 Group Product Group 2 Code Description Content Quantity GTIN Number Content Quantity Product Group 2 Promotion Code Promotion Description Content ITEM Number Product Group 1 Brand Content Quantity Product Group 2 Code Promotion Code Description Product Group 2 Promotion Product Group 1 Brand Promotion Info Content Quantity Brand Content Quantity Product Group 1 Product Group 2 Content Quantity Product Group 2 Brand Promotion Code Description Promotion Info Product Group 2 Promotion Info Content Product Group 1 Group Promotion Product Group 1 Quantity Promotion Info Brand Content Quantity Product 1 Description Product Group 2 Description Product Group 1 Promotion Info Brand Content Quantity Promotion Info Product Group 2 Product Group 1 Description Product Group 1 Product Group 2 Promotion Info Product Group 1 Promotion Info Description Brand Content Quantity Promotion Info Product 1 Product Group 2 Quantity Product Group 2 Group Description Product Group 1 Brand Product Group 2 Content Quantity Promotion Info Content Product Group 2 Description Product Group 1 Quantity Promotion Info Product Group 2 Description Content Quantity Product Group 2 Produkct Group 3 Product Group 2 Content Quantity Description Product Group 1 Group 2 Promotion Info. Product Description Promotion Info Content Quantity Product Group 2 Group Produkct 3 Product Group 1 Produkct Group 3 Promotion Info Content Quantity Product Group 2 Promotion Info Product Group 1 Group Product 1 Info Produkct Group 3 Group Promotion Info Product 1 Product Group 1 Content Product Group 2 Quantity Promotion Content Quantity Product Group 1 Produkct Group 3 Product. Produkct Group 2 Product Group 13 Group Product Group 2 12 Group Product Group 12 12 Produkct Group 3 Product Group 2 Group Product 2 Group Promotion Info Produkct 3 Product Group 2 Group Product Produkct Group Produkct 3 2 32 Group Produkct Group 3 23 Product Group Produkct Group 3 Product Group 3 Group Produkct Group 3 3 Product Group www. statistik. at Folie 3 | 24. 01. 2022
The challenge of product-classification Young Woman But what if there are different right answers? Old Woman www. statistik. at Folie 4 | 24. 01. 2022
The challenge of classification Some products are easy to classify… even for machines! 01. 1. 6. 1 Fresh or chilled fruit www. statistik. at Folie 5 | 24. 01. 2022
The challenge of classification Some products are hard to classify… even for humans! 01. 1. 6. 4 Preserved fruit & fruit-based products preserved fruit and fruit-based products, dietary preparations and culinary ingredients based exclusively on fruit, canned or tinned fruit or 01. 1. 8. 2 Jams, marmalades and honey jams, marmalades, compotes, jellies, fruit purées, and pastes, natural and artificial honey, maple syrup, molasses and parts of plants preserved in sugar https: //pics. me/its-a-bird-s-it-30 th-its-both-its-a-plane-42003647. png www. statistik. at Folie 6 | 24. 01. 2022
The challenge of classification Some products are hard to classify… because of your (users) needs! Milk UHT Raw Skimmed Whole Semi-skimmed Specific low fat organic www. statistik. at Pasteurized raw milk Lactose free Folie 7 | 24. 01. 2022
A multi-method approach Ø Find the ones that are hard to classify/misclassified often Ø Report them for human verification But how? Disagreement vs. consensus of different human judges seams to be an indication. Does it work for different MLmodels too? www. statistik. at http: //2. bp. blogspot. com/_9 RCN 1 r 0 Eal. U/TS 2 ku. Jryrm. I/A AAAAEs/Jpat 0 Wr. JECs/s 1600/scary+optical+illusion s 6. jpg Folie 8 | 24. 01. 2022
Current classification process Precondition: Significant one-off effort of manual classifying of tens/hundreds of thousands of products Current ECOICOP Database 1. Article Number Match (SAS) Current Article Master Tables 2. GTIN and Article Name Matching (Preprocessing, Similarity check - SAS) New Article(number) No Match (Real New Article) 3. ML-Process, ECOICOP Classification (R) Match Consensus Result Updated ECOICOP Database I. Articles for Manual Coding Result without Consensus Updated ECOICOP Database II. 4. Selection of Article with significant Revenue (SAS) www. statistik. at Folie 9 | 24. 01. 2022
ML-Approaches Ø Naive Bayes (NB; library(e 1071)) Ø Support Vector Machine (SVM; library(e 1071)) Ø Random Forrest (RF; library(ranger)) Ø Gradient Boosted Trees/XGBoost (XGB; library(xgboost)) Ø Linear Discriminant Analyses (LDA; SAS) www. statistik. at Folie 10 | 24. 01. 2022
Results Consensus vs. Disagreement Examples Products of a discount supermarket chain - 50% test-/train-split (4. 388 products in test) ✓ ✓ ✓ N = 3. 926 X X X N= 192 ✓ X ✓ N= 151 X ✓ Selected for manual. X classification ✓ X N= 65 X X N= 29 X X N= 19 X X X N= 6 Σ = 270 www. statistik. at Folie 11 | 24. 01. 2022
Range of classification methods • -manual classification (possibly with suggestions based on past classifications) - (semi) supervised classification - probabilistic classification - machine learning methods - word embeddings • www. statistik. at Folie 12 | 24. 01. 2022
NTTS 2021 Ingolf Boettcher Adam Tardos Manuel Koller Statistics Austria Classifying transaction and web scraped data ingolf. boettcher@statistik. gv. at adam. tardos@statistik. gv. at manuel. koller@statistik. gv. at www. statistik. at We move information
- Slides: 13