作业6 线性 岭回归 多项式
This commit is contained in:
parent
633e4ab5ed
commit
4ba30640fb
@ -8,7 +8,11 @@ from sklearn.preprocessing import PolynomialFeatures
|
|||||||
|
|
||||||
def f1(x, e):
|
def f1(x, e):
|
||||||
return math.exp(-x) * math.sin(x) \
|
return math.exp(-x) * math.sin(x) \
|
||||||
+ random.normalvariate(0, e ** 2)
|
+ random.normalvariate(0, e)
|
||||||
|
|
||||||
|
|
||||||
|
def f2(x, y, e):
|
||||||
|
return math.exp(-x ** 2 - y ** 2) * math.sin(x * y) + random.normalvariate(0, e)
|
||||||
|
|
||||||
|
|
||||||
def solve1(x, y):
|
def solve1(x, y):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user