Skip to content

Instantly share code, notes, and snippets.

@samyumobi
Created October 5, 2021 15:46
Show Gist options
  • Select an option

  • Save samyumobi/297396db172dd9e6c1c1219b72811ed0 to your computer and use it in GitHub Desktop.

Select an option

Save samyumobi/297396db172dd9e6c1c1219b72811ed0 to your computer and use it in GitHub Desktop.
from sklearn.model_selection import train_test_split
# Creating the training and testing data
X_train, X_test, Y_train, Y_test = train_test_split(X, y, test_size=0.33)
# Initializing an logistic regression object
clf = LogisticRegression()
# Fit the model to training and test sets
clf.fit(X_train,Y_train)
# Accuracy score of the logistic regression model
clf.score(X_test, Y_test)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment