File size: 375 Bytes
60daf05
 
dcda405
60daf05
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
# utils/preprocessing.py
import pandas as pd
from sklearn.preprocessing import StandardScaler

def preprocess_data_for_streamlit(data_path):
    df = pd.read_csv(data_path)
    df = feature_engineering(df)  # Assuming feature_engineering is defined
    X = df.drop('label', axis=1)
    scaler = StandardScaler()
    X_scaled = scaler.fit_transform(X)
    return df, X_scaled