Icon

KNIME_​project_​Blankenhorn_​Grupp

1. Data Access from files
2. Data Exploration - Plausibility check

City and country do not match

Product name and category do not match

Single table view: No missing values & no negative values (check via statistic view) & no wrong data types

3. Data Cleaning
4. Building Flatfile & Feature Engineering

Check if discount min and max value lies between 0 and 1 -> YES (via statistic view)

In Sales CSV gibt es eine ProduktID P0000 und P0201, allerdings startet es in der Product CSV bei P0001 und endet bei P0200 -> betrifft 4295 Zeilen (P0000) und 4268 Zeilen (P0201) und damit 0,98% der Daten!

Feature Engineering:

Zeit-Features

  • Saisonalität ("is_holiday"): Ostern, Weihnachten, Valentinstag, Halloween, Muttertag/Vatertag -> Zeitraum vorher relevant!

    • Ostern und Muttertag/Vatertag: Nicht immer am selben Tag!

    • Nicht alle Länder haben dieselben Daten!

      • 2023: 26.03. - 09.04. (Zeitraum von 2 Wochen vorher)

      • 2024: 17.03. - 31.03. (Zeitraum von 2 Wochen vorher)

    • Weihnachten: 01.12. - 24.12. (ganzer Monat wegen Advent)

    • Valentinstag: 07.02. - 14.02. (Zeitraum von 1 Woche vorher)

    • Halloween: 24.10. - 31.10 (Zeitraum von 1 Woche vorher)

    • Muttertag/Vatertag:

      • 2023: 07.05. - 18.05. (Zeitraum von 1 Woche vor Muttertag -> 14.05.)

      • 2024: 02.05. - 12.05. (Zeitraum von 1 Woche vor Vatertag -> 09.05.)

-> mit den Jahren 2025 bis 2027 wird entsprechend genauso verfahren.

  • Wochentag: Wird Schokolade bevorzugt unter der Woche oder am Wochenende gekauft? Welcher Tag unter der Woche wird bevorzugt?

    • Tag der Woche (Montag-Freitag) -> "day of week"

    • Wochenende (ja/nein) -> "is_weekend"

Store-Type Features

  • Ferienzeiten bei Airport Store berücksichtigen?!

Produktkategorie-Features

  • Gift Kategorie: Praline, Truffle -> eher zu Feiertagen gekauft (vsl. dort Peaks)

  • Everyday Kategorie: Dark, White, Milk -> immer gekauft

Lag & Trendfeatures

  • Gleicher Wochentag letzte Woche

  • Zweiwöchiger Rhythmus

  • Monatlicher Rhythmus

  • Monatstrend

Rabatt Features

  • Hat Discount (ja/nein)

Customer Features

  • Ist Loyality Kunde (ja/nein)

  • Alter (kaufen Ältere mehr als Jüngere?)

  • Geschlecht (kaufen Frauen mehr als Männer?)

CREATING TIME FEATURES

  • "is_weekend" = all rows have the same value, so I choose the first

  • "proximity_holiday" = different transactions on the same day could theoretically have different proximity values -> Setting the value to Maximum” ensures that the strongest holiday effect is retained

"Die lineare Regression erreicht ein R² von 0.35, was zeigt dass die Nachfrage nicht durch lineare Zusammenhänge erklärt werden kann. Die nicht-linearen Muster wie Saisonalität und Feiertagseffekte erfordern komplexere Modelle.

Problem: Ich verliere pro Kombination 28 Zeilen, wenn ich Lags verwende! Da gibt es keine Vergangenheitswerte!

Regression Predictor
70/30 partitioning
Table Partitioner
Pre-work for is_holiday feature engineering
Linear Regression Learner
Creating correct reference table for product name-category
Table Creator
Transforming columns into usable format (numeric values instead of strings)
One to Many
Excluding one columnn per "one to many transformation" to avoid multicollinearity
Column Filter
Numeric Scorer
Excluding unnecessary columns
Column Filter
Checking data base
Adding correct Category column
Value Lookup
Checking data base
Adding lag features (demand 7, 14 , 21 and 28 days ago)
Lag Column
Reading in exact holiday dates
CSV Reader
Grouping by day, store and product category
GroupBy
Resorting columns (product name next to correct category)
Column Resorter
Adding correct Country column
Value Lookup
Excluding wrong category column
Column Filter
Excluding wrong country column
Column Filter
Resorting columns (city next to country)
Column Resorter
Reading Calendar
CSV Reader
Reading Customers
CSV Reader
Reading Products
CSV Reader
Reading Stores
CSV Reader
Google Drive Connector
Google Authenticator
Reading Sales
CSV Reader
Renaming "is holiday" to "is in holiday timeframe"
Column Renamer
String to Date&Time
Calculating the date difference between every holiday date and order date
Date&Time Difference
Extracting the date difference to the next holiday date (days to next holiday)
Row Filter
Check if product name matches to cocoa percentage
String to Date&Time
Check if (revenue - costs) matches profit
Joining every row from data table with every row from date table
Cross Joiner
Regression Predictor
Checking data base and deleting wrong product IDs
Grouping to be able to create correct lag columns
Group Loop Start
Specify the degree to which the date falls within the holiday window
Rule Engine
Numeric Scorer
Adding lag features (demand 7, 14 , 21 and 28 days ago)
Lag Column
Transforming year, month, day, week and day of week into string so it doesn't see month 12 as more important than month 1 e.g.!
Number to String
Loop End
Excluding unnecessary columns
Column Filter
Joining tables
Grouping by day, store and product category
GroupBy
Extracting the minimum date difference to the upcoming holiday
GroupBy
Adding the two columns "Date&Time Difference", "date_holiday" and "holiday" to data table
Joiner
Column Filter
Table Partitioner
Lag Column
Creating feature "is_weekend"
Rule Engine
One to Many
Creating correct reference table for city-country
Table Creator
Creating feature "is_holiday"
Rule Engine
Linear Regression Learner

Nodes

Extensions

Links