Ramdevs_Fraud_Detector / label_encoder.pkl
kkhushisaid's picture
Create label_encoder.pkl
1241fd6 verified
raw
history blame contribute delete
351 Bytes
from sklearn.preprocessing import LabelEncoder
import pickle
# Sample data
categories = ['PAYMENT', 'TRANSFER', 'CASH_OUT', 'DEBIT', 'CASH_IN', 'Yes', 'No']
# Initialize and fit the LabelEncoder
le = LabelEncoder()
le.fit(categories)
# Save the fitted LabelEncoder to a pickle file
with open('label_encoder.pkl', 'wb') as f:
pickle.dump(le, f)