Spaces:
Sleeping
Sleeping
File size: 372 Bytes
beae064 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
# utils/encoders.py
import joblib
def load_encoder(path):
"""Load a saved sklearn OneHotEncoder."""
return joblib.load(path)
def load_scaler(path):
"""Load a saved StandardScaler."""
return joblib.load(path)
def safe_category(value, known_values):
"""Replace unseen categories with 'Other'."""
return value if value in known_values else "Other"
|