Spaces:
Sleeping
Sleeping
Create lapse_model.pkl
Browse files- lapse_model.pkl +16 -0
lapse_model.pkl
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from xgboost import XGBClassifier
|
2 |
+
from sklearn.model_selection import train_test_split
|
3 |
+
import pandas as pd
|
4 |
+
import pickle
|
5 |
+
|
6 |
+
# Example dataset
|
7 |
+
df = pd.read_csv("lapse_training_data.csv")
|
8 |
+
|
9 |
+
X = df[["policy_term", "policy_age", "payment_mode_encoded", "communication_score"]]
|
10 |
+
y = df["lapse_label"]
|
11 |
+
|
12 |
+
model = XGBClassifier()
|
13 |
+
model.fit(X, y)
|
14 |
+
|
15 |
+
# Save model
|
16 |
+
pickle.dump(model, open("lapse_model.pkl", "wb"))
|