Created
February 13, 2022 20:40
-
-
Save Mgancita/e93f73cd37cef4715e376bbd0dbce961 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
from sklearn.linear_model import LogisticRegression | |
log = LogisticRegression() | |
train_x = [[0, 0], [1, 1]] | |
train_y = [0, 1] | |
log.fit(train_x, train_y) | |
print(f"Coefficient: {log.coef_}") | |
# Coefficient: [[0.40105276 0.40105276]] | |
print(f"Y-Intercept: {log.intercept_}") | |
# Y-Intercept: [-0.40103584] | |
test_x = [[2, 2]] | |
print(f"Prediction: {log.predict(test_x)}") | |
# Prediction: [1] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment