You have to demonstrate an understanding of what the typical goals of a logistic regression are (classification, prediction, etc. and bring up a few examples and use cases.
from sklearn.linear_model import LogisticRegression
model = LogisticRegression(random_state=1) # using default parameters
model.fit(train_data, target_var)
y_pred = model.predict(test_data) # will give you the class
y_pred_prob = model.predict_proba(test_data) # will give class probabilities
Answers ( 2 )
You have to demonstrate an understanding of what the typical goals of a logistic regression are (classification, prediction, etc. and bring up a few examples and use cases.
from sklearn.linear_model import LogisticRegression
model = LogisticRegression(random_state=1) # using default parameters
model.fit(train_data, target_var)
y_pred = model.predict(test_data) # will give you the class
y_pred_prob = model.predict_proba(test_data) # will give class probabilities