การปรับขนาดและการแปลงข้อมูล

Feature Engineering สำหรับ Machine Learning ใน Python

Robert O'Callaghan

Data Scientist

การปรับขนาดข้อมูล

Feature Engineering สำหรับ Machine Learning ใน Python

การปรับขนาดแบบ Min-Max

ย่อด้วย Minmax

Feature Engineering สำหรับ Machine Learning ใน Python

การปรับขนาดแบบ Min-Max

Feature Engineering สำหรับ Machine Learning ใน Python

การปรับขนาดแบบ Min-Max ใน Python

from sklearn.preprocessing import MinMaxScaler

scaler = MinMaxScaler()

scaler.fit(df[['Age']])

df['normalized_age'] = scaler.transform(df[['Age']])
Feature Engineering สำหรับ Machine Learning ใน Python

การทำ Standardization

Feature Engineering สำหรับ Machine Learning ใน Python

การทำ Standardization ใน Python

from sklearn.preprocessing import StandardScaler

scaler = StandardScaler()

scaler.fit(df[['Age']])

df['standardized_col'] = scaler\
                        .transform(df[['Age']])
Feature Engineering สำหรับ Machine Learning ใน Python

การแปลงด้วย Log

ภาพ log

Feature Engineering สำหรับ Machine Learning ใน Python

การแปลงด้วย Log ใน Python

from sklearn.preprocessing import PowerTransformer

log = PowerTransformer()

log.fit(df[['ConvertedSalary']])

df['log_ConvertedSalary'] = 
     log.transform(df[['ConvertedSalary']])
Feature Engineering สำหรับ Machine Learning ใน Python

มาฝึกกันเถอะ!

Feature Engineering สำหรับ Machine Learning ใน Python

Preparing Video For Download...