思维导图 最小二乘法 class LR(): def __init__(self): self.w = None def fit(self, x, y): self.w = np.linalg.inv(x.T.dot(x)).dot(x.T).dot(y) def predict(self, x): return x.dot(self.w) if __name__ ==