Last active
April 9, 2020 12:49
-
-
Save aniruddha27/d89165cb685c26102b5883c75ebada5e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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