text_plain_output_2.png text_plain_output_1.png
from sklearn.linear_model import LogisticRegression

import pickle

LR_Model = LogisticRegression(C=0.1, max_iter=20, fit_intercept=True, n_jobs=3, solver='liblinear')
LR_Model.fit(Xtrain, Ytrain)

Pkl_Filename = 'Pickle_RL_Model.pkl'
with open(Pkl_Filename, 'wb') as file:
    pickle.dump(LR_Model, file)

with open(Pkl_Filename, 'rb') as file:
    Pickled_LR_Model = pickle.load(file)
Pickled_LR_Model

score = Pickled_LR_Model.score(Xtest, Ytest)
print('Test score: {0:.2f} %'.format(100 * score))
Ypredict = Pickled_LR_Model.predict(Xtest)
Ypredict