Spaces:
Build error
Build error
Download utils/preprocessing.py from Junaid-EEE11/Streamlit_code: direct link, hf CLI and curl.
- Browser
- Download file 375 Bytes
-
https://huggingface.co/spaces/Junaid-EEE11/Streamlit_code/resolve/386a3385ed7a4fdbc00a6a5d77d2cf0ce460239d/utils/preprocessing.py
- Command line
-
hf download hf://spaces/Junaid-EEE11/Streamlit_code@386a3385ed7a4fdbc00a6a5d77d2cf0ce460239d/utils/preprocessing.py
-
curl -L -o preprocessing.py https://huggingface.co/spaces/Junaid-EEE11/Streamlit_code/resolve/386a3385ed7a4fdbc00a6a5d77d2cf0ce460239d/utils/preprocessing.py
375 Bytes
| # 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 | |