Skip to content

Instantly share code, notes, and snippets.

@kylegallatin
Created November 18, 2022 01:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kylegallatin/ec2a5df5f2c2f3092821710ddc3727be to your computer and use it in GitHub Desktop.
Save kylegallatin/ec2a5df5f2c2f3092821710ddc3727be to your computer and use it in GitHub Desktop.
import pickle
from sklearn.datasets import make_classification
from sklearn.linear_model import LogisticRegression
x, y = make_classification(n_samples=100,
n_features=3,
n_informative=2,
n_classes=2,
n_redundant=0,
n_repeated=0,)
lr = LogisticRegression()
lr.fit(x,y)
with open('model.pickle', 'wb') as f:
pickle.dump(lr, f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment