Categorical Encoding
Target Encoding
from sklearn.preprocessing import TargetEncoderLabel Encoding
One Hot Encoder
Feature Binning
Time and Date Transformation
df['hr_sin'] = np.sin(df.hr*(2.*np.pi/24))
df['hr_cos'] = np.cos(df.hr*(2.*np.pi/24))
df['mnth_sin'] = np.sin((df.mnth-1)*(2.*np.pi/12))
df['mnth_cos'] = np.cos((df.mnth-1)*(2.*np.pi/12))Last updated