Spaces:
Sleeping
Sleeping
from sklearn.preprocessing import LabelEncoder | |
import pickle | |
# These are the categories you need for your app | |
categories = ['PAYMENT', 'TRANSFER', 'CASH_OUT', 'DEBIT', 'CASH_IN', 'Yes', 'No'] | |
# Create the LabelEncoder and fit it | |
le = LabelEncoder() | |
le.fit(categories) | |
# Save the LabelEncoder to a new pickle file | |
with open('label_encoder.pkl', 'wb') as file: | |
pickle.dump(le, file) | |