本文采用的训练方法是牛顿法(Newton Method)。 代码 import numpy as np class LogisticRegression(object): """ Logistic Regression Classifier training by Newton Method """ def __init__(self, error: float = 0.7, max_epoch: int = 100): """ :param error: float, if the distance between new weight and old weig