摘要: 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 阅读全文
posted @ 2022-10-17 10:35 华小电 阅读(495) 评论(0) 推荐(0) 编辑
摘要: 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( 阅读全文
posted @ 2022-10-17 10:16 华小电 阅读(130) 评论(0) 推荐(0) 编辑