Skip to content

Instantly share code, notes, and snippets.

Last active Apr 9, 2020
What would you like to do?
# train models
from sklearn.linear_model import LogisticRegression
from sklearn.neighbors import KNeighborsClassifier
# logistic regression
model1 = LogisticRegression()
# knn
model2 = KNeighborsClassifier(n_neighbors=4)
# fit model, y_train), y_train)
# predict probabilities
pred_prob1 = model1.predict_proba(X_test)
pred_prob2 = model2.predict_proba(X_test)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment