code_23.py 292 字节
Newer Older
ToTensor's avatar
ToTensor 已提交
1 2 3 4
from sklearn.linear_model import Logistic Regression #导入逻辑回归模型
lr = Logistic Regression() # lr, 就代表是逻辑回归模型
lr.fit(X_train, y_train) # fit, 就相当于是梯度下降
print("SK learn逻辑回归测试准确率{:.2f}%".format(lr.score(X_test, y_test)*100))