Coursera Machine Learning 第一周 quiz Linear Regression with One Variable 习题答案

1.Consider the problem of predicting how well a student does in her second year of college/university, given how well she did in her first year.

Specifically, let x be equal to the number of "A" grades (including A-. A and A+ grades) that a student receives in their first year of college (freshmen year). We would like to predict the value of y, which we define as the number of "A" grades they get in their second year (sophomore year).

Here each row is one training example. Recall that in linear regression, our hypothesis is  hθ(x)=θ0+θ1x , and we use  m  to denote the number of training examples.

For the training set given above (note that this training set may also be referenced in other questions in this quiz), what is the value of  m ? In the box below, please enter your answer (which should be a number between 0 and 10).

此题问几个训练集,明显有4个,故答案为4

2.For this question, assume that we are

using the training set from Q1. Recall our definition of the

cost function was  J(θ0,θ1)=12mmi=1(hθ(x(i))y(i))2 .

What is  J(0,1) ? In the box below,

please enter your answer (Simplify fractions to decimals when entering answer, and '.' as the decimal delimiter e.g., 1.5).

把公式写出,代入即可 答案为0.5

Suppose we set  θ0=1,θ1=0.5 . What is  hθ(4) ?

把公式写出,代入即可 答案为1

4.In the given figure, the cost function 

J(θ0,θ1)  has been plotted against  θ0  and  θ1 , as shown in 'Plot 2'. The contour plot for the same cost function is given in 'Plot 1'. Based on the figure, choose the correct options (check all that apply).

Point P (the global minimum of plot 2) corresponds to point A of Plot 1.          左图A点对应右图B点,最终收敛在A处故选择A、C答案

If we start from point B, gradient descent with a well-chosen learning rate will eventually help us reach at or near point A, as the value of cost function  J(θ0,θ1)  is maximum at point A.

If we start from point B, gradient descent with a well-chosen learning rate will eventually help us reach at or near point A, as the value of cost function  J(θ0,θ1)  is minimum at A.

Point P (The global minimum of plot 2) corresponds to point C of Plot 1.

If we start from point B, gradient descent with a well-chosen learning rate will eventually help us reach at or near point C, as the value of cost function  J(θ0,θ1)  is minimum at point C.


5.Suppose that for some linear regression problem (say, predicting housing prices as in the lecture), we have some training set, and for our training set we managed to find some  θ0 θ1  such that  J(θ0,θ1)=0 .

Which of the statements below must then be true? (Check all that apply.)

We can perfectly predict the value of  y  even for new examples that we have not yet seen.即使我们的代价函数为0,页不能肯定的预测未看到的房价

(e.g., we can perfectly predict prices of even new houses that we have not yet seen.)

For these values of  θ0  and  θ1  that satisfy  J(θ0,θ1)=0 ,

we have that  hθ(x(i))=y(i)  for every training example  (x(i),y(i))根据定义知正确

For this to be true, we must have  θ0=0  and  θ1=0

so that  hθ(x)=0 如果两个都为0我们得不到h(x)=0除非 y为0,不过这样的预测就没有意义了

This is not possible: By the definition of  J(θ0,θ1) , it is not possible for there to exist

θ0  and  θ1  so that  J(θ0,θ1)=0

可能,如果完美拟合训练数据,可能出现这样情况
故答案为B





  • 4
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
Coursera机器学习是由斯坦福大学教授Andrew Ng主讲的一门在线课程,旨在向学习者介绍机器学习的基本概念、算法和应用。该课程涵盖了监督学习、无监督学习、深度学习等多个方面,通过理论讲解和实践编程作业,帮助学习者掌握机器学习的基本原理和实践技能。该课程是Coursera平台上最受欢迎的课程之一,也是机器学习领域入门的重要资源之一。 ### 回答2: Coursera机器学习是由斯坦福大学Andrew Ng教授设计并教授的在线课程。这门课程被认为是公认的机器学习入门教材之一,也是Coursera平台最受欢迎的课程之一。 这门课程涵盖了机器学习领域中最基础的知识和技术,包括监督学习、无监督学习以及神经网络等。学生可以通过该课程了解到如何采集和处理数据、如何训练模型、如何评估模型的性能等。此外,课程还涉及到机器学习中一些实用的技术,如正则化、梯度下降等。 该课程受到了全球范围内的认可和青睐,许多学生、工程师、数据科学家等都受益于该课程。由于该课程的知识点全面、深入浅出、容易理解和学习,在业内和学术界都广受赞誉,拥有较高的知名度和价值。 总之,Coursera机器学习是一门非常好的课程,对于那些对机器学习感兴趣的人来说,它是一个不可错过的机会。课程教材内容丰富、难度适中,且教学相对轻松愉悦,难怪在学习资源上产生了广泛的影响。
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值