摘要:
import matplotlib.pyplot as plt from scipy.optimize import curve_fit import numpy as np def func(x, a, b, c): # 拟合的方程 return a * np.exp(-b * x) + c de 阅读全文
摘要:
1.数据 x = np.random.uniform(-5, 5 ,size=100) X = x.reshape(-1, 1) y = x**2 + x +2 + np.random.normal(0, 1, size = 100) 2. 拟合 ploy = PolynomialFeatures( 阅读全文