Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created July 1, 2021 06:50
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 amankharwal/96068fe81387e9419edd63c3da41cfe1 to your computer and use it in GitHub Desktop.
Save amankharwal/96068fe81387e9419edd63c3da41cfe1 to your computer and use it in GitHub Desktop.
from sklearn.datasets import make_classification
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
from sklearn.linear_model import LogisticRegression
nb_samples = 1000
x, y = make_classification(n_samples=nb_samples, n_features=2, n_informative=2, n_redundant=0, n_clusters_per_class=1)
xtrain, xtest, ytrain, ytest = train_test_split(x, y, test_size=0.2, random_state=42)
model = LogisticRegression()
model.fit(xtrain, ytrain)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment