牛顿法 # coding:utf-8 import matplotlib.pyplot as plt import numpy as np def dataN(length):#生成数据 x = np.ones(shape = (length,3)) y = np.zeros(length) for i in np.arange(0,length/100,0.02): x[100*i][0]=1 x[100*i][1]=i x[100*i][2]=i + 1 + np.random.unifor