Volgorde van structurele preprocessing-stappen

Klantsegmentatie in Python

Karolis Urbonas

Head of Data Science, Amazon

Waarom is de volgorde belangrijk?

  • Logtransformatie werkt alleen met positieve data
  • Normaliseren dwingt negatieve waarden af; log werkt dan niet
Klantsegmentatie in Python

Volgorde

  1. Verminder scheefheid: logtransformatie
  2. Centreer rond hetzelfde gemiddelde
  3. Schaal naar dezelfde standaardafwijking
  4. Sla op als aparte array voor clustering
Klantsegmentatie in Python

De volgorde coderen

# Unskew the data
import numpy as np
datamart_log = np.log(datamart_rfm)

# Normalize the variables from sklearn.preprocessing import StandardScaler scaler = StandardScaler() scaler.fit(datamart_log)
# Store for clustering datamart_normalized = scaler.transform(datamart_log)
Klantsegmentatie in Python

Oefenen met RFM-data!

Klantsegmentatie in Python

Preparing Video For Download...