code_10.py 255 字节
Newer Older
ToTensor's avatar
ToTensor 已提交
1 2 3 4
from sklearn.linear_model import Logistic Regression # 导入Sklearn模型
lr = Logistic Regression() # 逻辑回归模型
history = lr.fit(X_train, y_train) # 训练机器
print("逻辑回归预测准确率 {:.2f}%".format(lr.score(X_test, y_test)*100))