Skip to content

Instantly share code, notes, and snippets.

@aniruddha27

aniruddha27/AUC-ROC2.py

Last active Apr 9, 2020
Embed
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
model1.fit(X_train, y_train)
model2.fit(X_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