Escalonamento e transformações

Feature Engineering for Machine Learning in Python

Robert O'Callaghan

Data Scientist

Escalonar dados

Feature Engineering for Machine Learning in Python

Escalonamento Min-Max

Encolher com Min-Max

Feature Engineering for Machine Learning in Python

Escalonamento Min-Max

Feature Engineering for Machine Learning in Python

Escalonamento Min-Max em Python

from sklearn.preprocessing import MinMaxScaler

scaler = MinMaxScaler()

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

df['normalized_age'] = scaler.transform(df[['Age']])
Feature Engineering for Machine Learning in Python

Padronização

Feature Engineering for Machine Learning in Python

Padronização em Python

from sklearn.preprocessing import StandardScaler

scaler = StandardScaler()

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

df['standardized_col'] = scaler\
                        .transform(df[['Age']])
Feature Engineering for Machine Learning in Python

Transformação logarítmica

imagem de log

Feature Engineering for Machine Learning in Python

Transformação logarítmica em Python

from sklearn.preprocessing import PowerTransformer

log = PowerTransformer()

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

df['log_ConvertedSalary'] = 
     log.transform(df[['ConvertedSalary']])
Feature Engineering for Machine Learning in Python

Slide final

Feature Engineering for Machine Learning in Python

Preparing Video For Download...