File size: 359 Bytes
7223d1a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import joblib
from sklearn.linear_model import LogisticRegression
import numpy as np

# Training data (toy example)
X = np.array([[0], [1], [2], [3], [4], [5]])
y = np.array([0, 1, 0, 1, 0, 1])  # 0 = even, 1 = odd

model = LogisticRegression()
model.fit(X, y)

# Save model
joblib.dump(model, "model.joblib")

print("Model trained and saved as model.joblib")