Eliminarea valorilor aberante

Ingineria caracteristicilor pentru Machine Learning în Python

Robert O'Callaghan

Director of Data Science, Ordergroove

Ce sunt valorile aberante?

Imaginea distribuției

Ingineria caracteristicilor pentru Machine Learning în Python

Detectare bazată pe cuantile

Ingineria caracteristicilor pentru Machine Learning în Python

Cuantile în Python

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

mask = df['col_name'] < q_cutoff

trimmed_df = df[mask]
Ingineria caracteristicilor pentru Machine Learning în Python

Detectare bazată pe abaterea standard

Ingineria caracteristicilor pentru Machine Learning în Python

Detectare prin abatere standard în Python

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)]
Ingineria caracteristicilor pentru Machine Learning în Python

Să exersăm!

Ingineria caracteristicilor pentru Machine Learning în Python

Preparing Video For Download...