RabbitRedux / features /feature_engineering.py
Canstralian's picture
Create features/feature_engineering.py
83d5018 verified
raw
history blame contribute delete
504 Bytes
from sklearn.preprocessing import StandardScaler
def scale_features(X_train, X_test):
"""
Scale features using StandardScaler.
Args:
X_train (pd.DataFrame): Training features.
X_test (pd.DataFrame): Testing features.
Returns:
X_train_scaled, X_test_scaled: Scaled features.
"""
scaler = StandardScaler()
X_train_scaled = scaler.fit_transform(X_train)
X_test_scaled = scaler.transform(X_test)
return X_train_scaled, X_test_scaled