Answers for "implementing logistic regression in python"

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
0

python logistic function

import numpy as np

def logistic(x):
  return 1 / (1 + np.exp(-x))
Posted by: Guest on June-23-2021

Code answers related to "implementing logistic regression in python"

Python Answers by Framework

Browse Popular Code Answers by Language