算法实现
ElonZhou99
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
算法实现——多元梯度
y = 2 + 3✖️size - 4✖️years + 2✖️floors #y = theta_0 + theta_1 * size - theta_2 * years + theta_3 * floors import numpy as np m = 10 size = np.random.randint(80,120,10) years = np.random.randint(1,10,10) floors = np.random.randint(1,20,10) labels = 2 + 3*si原创 2020-10-19 09:31:43 · 226 阅读 · 0 评论 -
算法实现——梯度下降python实现
y=theta0∗x+theta1y = theta0 *x + theta1y=theta0∗x+theta1 y=2∗x+96y = 2 * x + 96y=2∗x+96 # 构造数据集 X=list(range(1,21)) Y=[98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136] m = len(X) def sgd(m, theta0, theta1, X, Y, lr): gra原创 2020-10-15 15:32:04 · 184 阅读 · 0 评论
分享