Answers for "python logistic regression step by step"

9

logistic regression algorithm in python

# import the class
from sklearn.linear_model import LogisticRegression

# instantiate the model (using the default parameters)
logreg = LogisticRegression()

# fit the model with data
logreg.fit(X_train,y_train)

#
y_pred=logreg.predict(X_test)
Posted by: Guest on May-23-2020
1

logistic regression algorithm in python

print("Accuracy:",metrics.accuracy_score(y_test, y_pred))
print("Precision:",metrics.precision_score(y_test, y_pred))
print("Recall:",metrics.recall_score(y_test, y_pred))
Posted by: Guest on May-23-2020

Code answers related to "python logistic regression step by step"

Python Answers by Framework

Browse Popular Code Answers by Language