2

Starting from a dataframe df, I created some train and test data with this code

X_train, X_test, y_train, y_test = train_test_split(
    X, Y, test_size=.2, random_state=1)

Now I would like to train data and test results, but I’m not sure how to adapt the code using statsmodels

import statsmodels.api as sm
logit_model=sm.Logit(Y,X)
result=logit_model.fit()
print(result.summary2()) 
progster
  • 877
  • 3
  • 15
  • 27

0 Answers0