File size: 326 Bytes
6ae852e
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
from sklearn.preprocessing import StandardScaler, MinMaxScaler, MaxAbsScaler, RobustScaler


def scale_transform(features, scaler: type[StandardScaler, MinMaxScaler, MaxAbsScaler, RobustScaler]):
    scaler = scaler()
    features = scaler.fit_transform(features)
    features = scaler.transform(features)
    return features