外れ値の除去

Python で学ぶ Machine Learning のための特徴量エンジニアリング

Robert O'Callaghan

Director of Data Science, Ordergroove

外れ値とは?

分布の画像

Python で学ぶ Machine Learning のための特徴量エンジニアリング

分位数に基づく検出

Python で学ぶ Machine Learning のための特徴量エンジニアリング

Pythonでの分位数

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

mask = df['col_name'] < q_cutoff

trimmed_df = df[mask]
Python で学ぶ Machine Learning のための特徴量エンジニアリング

標準偏差に基づく検出

Python で学ぶ Machine Learning のための特徴量エンジニアリング

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)]
Python で学ぶ Machine Learning のための特徴量エンジニアリング

演習に進みましょう!

Python で学ぶ Machine Learning のための特徴量エンジニアリング

Preparing Video For Download...