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))