Odstraňování odlehlých hodnot

Feature Engineering for Machine Learning in Python

Robert O'Callaghan

Director of Data Science, Ordergroove

Co jsou odlehlé hodnoty?

Obrázek rozdělení

Feature Engineering for Machine Learning in Python

Detekce pomocí kvantilů

Feature Engineering for Machine Learning in Python

Kvantily v Pythonu

q_cutoff = df['col_name'].quantile(0.95)

mask = df['col_name'] < q_cutoff

trimmed_df = df[mask]
Feature Engineering for Machine Learning in Python

Detekce pomocí směrodatné odchylky

Feature Engineering for Machine Learning in Python

Detekce pomocí směrodatné odchylky v Pythonu

mean = df['col_name'].mean()
std = df['col_name'].std()

cut_off = std * 3 lower, upper = mean - cut_off, mean + cut_off
new_df = df[(df['col_name'] < upper) & (df['col_name'] > lower)]
Feature Engineering for Machine Learning in Python

Pojďme si procvičit!

Feature Engineering for Machine Learning in Python

Preparing Video For Download...