from sklearn.linear_model import LogisticRegression
LR = LogisticRegression()
LR.fit(X_train, y.reshape((y.shape[0],))) # it is preferable to use y of this shape
print('Ceoficients of LogisticRegression from sklearn are in (%i,%i) dimensional matrix' %LR.coef_.shape)
w1_skl= LR.coef_[0,0]
w2_skl= LR.coef_[0,1]
b_skl = LR.intercept_
print('w1 = %f'%w1_skl)
print('w2 = %f'%w2_skl)
print('b = %f'%b_skl)
print(cm_log_reg)