code_20.py 222 字节
Newer Older
ToTensor's avatar
ToTensor 已提交
1 2 3
y_pred = predict(X_test, weight_history[-1], bias_history[-1]) # 预测测试集
testing_acc = 100 - np.mean(np.abs(y_pred - y_test))*100 # 计算准确率
print("逻辑回归测试准确率: {:.2f}%".format(testing_acc))