Sequenza dei passaggi di pre‑processing strutturale

Customer Segmentation in Python

Karolis Urbonas

Head of Data Science, Amazon

Perché l’ordine conta?

  • La trasformazione log funziona solo con dati positivi
  • La normalizzazione genera valori negativi e log non funziona
Customer Segmentation in Python

Sequenza

  1. Riduci l’asimmetria: trasformazione log
  2. Porta alla stessa media
  3. Scala alla stessa deviazione standard
  4. Salva come array separato per il clustering
Customer Segmentation in Python

Codificare la sequenza

# 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)
Customer Segmentation in Python

Esercizio sui dati RFM!

Customer Segmentation in Python

Preparing Video For Download...