Andrew Ng Machine Learning 第二周

前言

网易云课堂(双语字幕,不卡):https://study.163.com/course/courseMain.htm?courseId=1004570029
Coursera:https://www.coursera.org/learn/machine-learning
本人初学者,先在网易云课堂上看网课,再去Coursera上做作业,开博客以记录,文章中引用图片皆为课程中所截,或者大佬笔记中所截。

多元线性回归Multivariate Linear Regression)

1.假设函数与代价函数

在这里插入图片描述

2.代价函数特征缩放

在这里插入图片描述
Tips:u1为x1的平均数,s1为x1max-x1min

3.学习率

根据J(θ)来判断α的大小是否合适

在这里插入图片描述
在这里插入图片描述

4.特征

在这里插入图片描述
简单来说,多项式中的多个变量可以简化成单一变量的变化形式。
Tips:根号形式保证图形不是二次函数,防止出现x增大而下降的情况

5.正规方程

方程式

在这里插入图片描述
在这里插入图片描述
y为n维向量,则在这里插入图片描述

6.正规方程和梯度下降的选用

在这里插入图片描述

题目

Question 1.

在这里插入图片描述
解答:(89-(89+72+94+69)/4)/(94-69)=0.32

Question 2.

You run gradient descent for 15 iterations with α=0.3 and compute J(θ) after each iteration. You find that the value of J(θ) increases over time. Based on this, which of the following conclusions seems most plausible?

解答:A

Question 3.

Suppose you have m = 23 training examples with n = 5 features (excluding the additional all-ones feature for the intercept term, which you should add). The normal equation is θ= (XTX)(-1)*XTy.For the given values of mm and nn, what are the dimensions of θ, XX, and yy in this equation?
在这里插入图片描述
解答:D,X是n+1列,θ是n+1行,y是一列

Question 4.

Suppose you have a dataset with m = 50 examples and n = 200000 features for each example. You want to use multivariate linear regression to fit the parameters θ to our data. Should you prefer gradient descent or the normal equation?
在这里插入图片描述
解答:A,n过大

Question 5.

在这里插入图片描述
解答:D

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值