99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

合肥生活安徽新聞合肥交通合肥房產(chǎn)生活服務(wù)合肥教育合肥招聘合肥旅游文化藝術(shù)合肥美食合肥地圖合肥社保合肥醫(yī)院企業(yè)服務(wù)合肥法律

代寫(xiě)COMP9417、Python程序設(shè)計(jì)代做

時(shí)間:2024-06-17  來(lái)源:合肥網(wǎng)hfw.cc  作者:hfw.cc 我要糾錯(cuò)



COMP9417 - Machine Learning
Homework 2: Bias, Variance and an application of Gradient
Descent
Introduction In this homework we revisit the notion of bias and variance as metrics for characterizing the
behaviour of an estimator. We then take a look at a new gradient descent based algorithm for combining
different machine learning models into a single, more complex, model.
Points Allocation There are a total of 28 marks.
What to Submit
 A single PDF file which contains solutions to each question. For each question, provide your solution
in the form of text and requested plots. For some questions you will be requested to provide screen
shots of code used to generate your answer — only include these when they are explicitly asked for.
 .py file(s) containing all code you used for the project, which should be provided in a separate .zip
file. This code must match the code provided in the report.
1
 You may be deducted points for not following these instructions.
 You may be deducted points for poorly presented/formatted work. Please be neat and make your
solutions clear. Start each question on a new page if necessary.
 You cannot submit a Jupyter notebook; this will receive a mark of zero. This does not stop you from
developing your code in a notebook and then copying it into a .py file though, or using a tool such as
nbconvert or similar.
 We will set up a Moodle forum for questions about this homework. Please read the existing questions
before posting new questions. Please do some basic research online before posting questions. Please
only post clarification questions. Any questions deemed to be fishing for answers will be ignored
and/or deleted.
 Please check Moodle announcements for updates to this spec. It is your responsibility to check for
announcements about the spec.
 Please complete your homework on your own, do not discuss your solution with other people in the
course. General discussion of the problems is fine, but you must write out your own solution and
acknowledge if you discussed any of the problems in your submission (including their name(s) and
zID).
 As usual, we monitor all online forums such as Chegg, StackExchange, etc. Posting homework ques-
tions on these site is equivalent to plagiarism and will result in a case of academic misconduct.
 You may not use SymPy or any other symbolic programming toolkits to answer the derivation ques-
tions. This will result in an automatic grade of zero for the relevant question. You must do the
derivations manually.
When and Where to Submit
 Due date: Week 5, Friday June 28th, 2024 by 5pm. Please note that the forum will not be actively
monitored on weekends.
 Late submissions will incur a penalty of 5% per day from the maximum achievable grade. For ex-
ample, if you achieve a grade of 80/100 but you submitted 3 days late, then your final grade will be
80? 3× 5 = 65. Submissions that are more than 5 days late will receive a mark of zero.
 Submission must be made on Moodle, no exceptions.
Page 2
Question 1. Bias of Estimators
Let γ > 0 and suppose that X1, . . . , Xn
You may use the following two facts without proof:
(F1) X and S2 are independent.
(F2) X and c?S are both unbiased estimators of γ.1
What to submit: for all parts (a)-(e), include your working out, either typed or handwritten. For all parts, you
must show all working for full credit. Answers without working will receive a grade of zero.
(a) Consider the estimator:
T1 = aX + (1? a)c?S.
Show that for any choice of constant a, T1 is unbiased for γ.
(b) What choice of a gives you the best (in the sense of MSE) possible estimator? Derive an explicit
expression for this optimal choice of a. We refer to this estimator as T ?1 .
(c) Consider now a different estimator:
T2 = a1Xˉ + a2(c?S),
and we do not make any assumptions about the relationship between a1 and a2. Find the con-
stants a1, a2 explicitly that make T2 best (from the MSE perspective), i.e. choose a1, a2 to minimize
MSE(T2) = E(T2 ? γ)2. We refer to this estimator as T ?2 .
(d) Show that T ?2 has MSE that is less than or equal to the MSE of T ?1 .
(e) Consider the estimator V+ = max{0, T ?2 }. Show that the MSE of V+ is smaller than or equal to the
MSE of T ?2 .
Question 2. Gradient Descent for Learning Combinations of Models
In this question, we discuss and implement a gradient descent based algorithm for learning combina-
tions of models, which are generally termed ’ensemble models’. The gradient descent idea is a very
powerful one that has been used in a large number of creative ways in machine learning beyond direct
minimization of loss functions.
The Gradient-Combination (GC) algorithm can be described as follows: Let F be a set of base learning
algorithms2. The idea is to combine the base learners in F in an optimal way to end up with a good
learning algorithm. Let `(y, y?) be a loss function, where y is the target, and y? is the predicted value.3
Suppose we have data (xi, yi) for i = 1, . . . , n, which we collect into a single data set D0. We then set
the number of desired base learners to T and proceed as follows:
1You do not need to worry about knowing or calculating c? for this question, it is just some constant.
2For example, you could take F to be the set of all regression models with a single feature, or alternatively the set of all regression
models with 4 features, or the set of neural networks with 2 layers etc.
3Note that this set-up is general enough to include both regression and classification algorithms.
Page 3
(I) Initialize f0(x) = 0 (i.e. f0 is the zero function.)
(II) For t = 1, 2, . . . , T :
(GC1) Compute:
rt,i = ? ?
?f(xi)
n∑
j=1
`(yj , f(xj))
∣∣∣∣
f(xj)=ft?1(xj), j=1,...,n
for i = 1, . . . , n. We refer to rt,i as the i-th pseudo-residual at iteration t.
(GC2) Construct a new pseudo data set, Dt, consisting of pairs: (xi, rt,i) for i = 1, . . . , n.
(GC3) Fit a model to Dt using our base class F . That is, we solve
ht = arg min
f∈F
n∑
i=1
`(rt,i, f(xi))
(GC4) Choose a step-size. This can be done by either of the following methods:
(SS1) Pick a fixed step-size αt = α
(SS2) Pick a step-size adaptively according to
αt = arg min
α
n∑
i=1
`(yi, ft?1(xi) + αht(xi)).
(GC5) Take the step
ft(x) = ft?1(x) + αtht(x).
(III) return fT .
We can view this algorithm as performing (functional) gradient descent on the base class F . Note that
in (GC1), the notation means that after taking the derivative with respect to f(xi), set all occurences
of f(xj) in the resulting expression with the prediction of the current model ft?1(xj), for all j. For
example:
?
?x
log(x+ 1)
∣∣∣∣
x=23
=
1
x+ 1
∣∣∣∣
x=23
=
1
24
.
(a) Consider the regression setting where we allow the y-values in our data set to be real numbers.
Suppose that we use squared error loss `(y, y?) = 12 (y? y?)2. For round t of the algorithm, show that
rt,i = yi ? ft?1(xi). Then, write down an expression for the optimization problem in step (GC3)
that is specific to this setting (you don’t need to actually solve it).
What to submit: your working out, either typed or handwritten.
(b) Using the same setting as in the previous part, derive the step-size expression according to the
adaptive approach (SS2).
What to submit: your working out, either typed or handwritten.
(c) We will now implement the gradient-combination algorithm on a toy dataset from scratch, and we
will use the class of decision stumps (depth 1 decision trees) as our base class (F), and squared error
loss as in the previous parts.4. The following code generates the data and demonstrates plotting
the predictions of a fitted decision tree (more details in q1.py):
4In your implementation, you may make use of sklearn.tree.DecisionTreeRegressor, but all other code must be your
own. You may use NumPy and matplotlib, but do not use an existing implementation of the algorithm if you happen to find one.
Page 4
1 np.random.seed(123)
2 X, y = f_sampler(f, 160, sigma=0.2)
3 X = X.reshape(-1,1)
4
5 fig = plt.figure(figsize=(7,7))
6 dt = DecisionTreeRegressor(max_depth=2).fit(X,y) # example model
7 xx = np.linspace(0,1,1000)
8 plt.plot(xx, f(xx), alpha=0.5, color=’red’, label=’truth’)
9 plt.scatter(X,y, marker=’x’, color=’blue’, label=’observed’)
10 plt.plot(xx, dt.predict(xx.reshape(-1,1)), color=’green’, label=’dt’) # plotting
example model
11 plt.legend()
12 plt.show()
13
The figure generated is
Your task is to generate a 5 x 2 figure of subplots showing the predictions of your fitted gradient-
combination model. There are 10 subplots in total, the first should show the model with 5 base
learners, the second subplot should show it with 10 base learners, etc. The last subplot should be
the gradient-combination model with 50 base learners. Each subplot should include the scatter of
data, as well as a plot of the true model (basically, the same as the plot provided above but with
your fitted model in place of dt). Comment on your results, what happens as the number of base
learners is increased? You should do this two times (two 5x2 plots), once with the adaptive step
size, and the other with the step-size taken to be α = 0.1 fixed throughout. There is no need to
split into train and test data here. Comment on the differences between your fixed and adaptive
step-size implementations. How does your model perform on the different x-ranges of the data?
What to submit: two 5 x 2 plots, one for adaptive and one for fixed step size, some commentary, and a screen
shot of your code and a copy of your code in your .py file.
Page 5
(d) Repeat the analysis in the previous question but with depth 2 decision trees as base learners in-
stead. Provide the same plots. What do you notice for the adaptive case? What about the non-
adaptive case? What to submit: two 5 x 2 plots, one for adaptive and one for fixed step size, some commen-
tary, and a copy of your code in your .py file.
(e) Now, consider the classification setting where y is taken to be an element of {?1, 1}. We consider
the following classification loss: `(y, y?) = log(1 + e?yy?). For round t of the algorithm, what is the
expression for rt,i? Write down an expression for the optimization problem in step (GC3) that is
specific to this setting (you don’t need to actually solve it).
What to submit: your working out, either typed or handwritten.
(f) Using the same setting as in the previous part, write down an expression for αt using the adaptive
approach in (SS2). Can you solve for αt in closed form? Explain.
What to submit: your working out, either typed or handwritten, and some commentary.
(g) In practice, if you cannot solve for αt exactly, explain how you might implement the algorithm.
Assume that using a constant step-size is not a valid alternative. Be as specific as possible in your
answer. What, if any, are the additional computational costs of your approach relative to using a
constant step size ?
What to submit: some commentary.
請(qǐng)加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp













 

掃一掃在手機(jī)打開(kāi)當(dāng)前頁(yè)
  • 上一篇:拿護(hù)照去越南怎樣辦理簽證(拿護(hù)照申請(qǐng)?jiān)侥虾炞C申請(qǐng)流程)
  • 下一篇:代做4CM507、代寫(xiě)c++,Java程序語(yǔ)言
  • 無(wú)相關(guān)信息
    合肥生活資訊

    合肥圖文信息
    急尋熱仿真分析?代做熱仿真服務(wù)+熱設(shè)計(jì)優(yōu)化
    急尋熱仿真分析?代做熱仿真服務(wù)+熱設(shè)計(jì)優(yōu)化
    出評(píng) 開(kāi)團(tuán)工具
    出評(píng) 開(kāi)團(tuán)工具
    挖掘機(jī)濾芯提升發(fā)動(dòng)機(jī)性能
    挖掘機(jī)濾芯提升發(fā)動(dòng)機(jī)性能
    海信羅馬假日洗衣機(jī)亮相AWE  復(fù)古美學(xué)與現(xiàn)代科技完美結(jié)合
    海信羅馬假日洗衣機(jī)亮相AWE 復(fù)古美學(xué)與現(xiàn)代
    合肥機(jī)場(chǎng)巴士4號(hào)線
    合肥機(jī)場(chǎng)巴士4號(hào)線
    合肥機(jī)場(chǎng)巴士3號(hào)線
    合肥機(jī)場(chǎng)巴士3號(hào)線
    合肥機(jī)場(chǎng)巴士2號(hào)線
    合肥機(jī)場(chǎng)巴士2號(hào)線
    合肥機(jī)場(chǎng)巴士1號(hào)線
    合肥機(jī)場(chǎng)巴士1號(hào)線
  • 短信驗(yàn)證碼 豆包 幣安下載 AI生圖 目錄網(wǎng)

    關(guān)于我們 | 打賞支持 | 廣告服務(wù) | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責(zé)聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網(wǎng) 版權(quán)所有
    ICP備06013414號(hào)-3 公安備 42010502001045

    99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

          9000px;">

                色综合一区二区| 国产成人无遮挡在线视频| 日韩专区在线视频| 欧美日韩情趣电影| 日本不卡不码高清免费观看| 日韩欧美资源站| 国产福利一区二区三区视频在线| 日韩黄色免费电影| 欧美亚洲国产怡红院影院| 欧美性感一区二区三区| 成人性视频免费网站| 成人av网站在线观看免费| 中文字幕亚洲精品在线观看| 亚洲主播在线播放| 久久99精品久久久久| 一区二区三区四区国产精品| 国产精品高潮久久久久无| 欧美亚一区二区| 欧美制服丝袜第一页| gogo大胆日本视频一区| 91蝌蚪porny| 日韩高清在线一区| 日韩不卡手机在线v区| 亚洲精品国产视频| 国产精品天美传媒| 蜜桃久久久久久| 欧洲国内综合视频| 国产精品不卡在线| eeuss鲁片一区二区三区| 天天操天天干天天综合网| 国产综合成人久久大片91| 欧美情侣在线播放| 久久精品国产久精国产| 午夜不卡av免费| 91成人免费在线视频| 亚洲精品免费一二三区| 精品在线免费观看| 久久久久久久久久久久久女国产乱| 亚洲国产精品黑人久久久| 国产传媒日韩欧美成人| 欧美精品日韩综合在线| 国产精品一二三四| 久久美女高清视频| 精品一区二区精品| 99精品视频中文字幕| 久久综合九色综合欧美98| 久久er99精品| 精品国产乱码久久久久久蜜臀 | 奇米影视一区二区三区| 日本亚洲电影天堂| 粉嫩aⅴ一区二区三区四区五区| 欧美日韩精品综合在线| 一区二区三区精品在线观看| 色哦色哦哦色天天综合| 欧美国产亚洲另类动漫| 日本va欧美va瓶| 亚洲精品老司机| 午夜激情一区二区| 欧美三级视频在线观看| 午夜精品在线视频一区| 日韩无一区二区| kk眼镜猥琐国模调教系列一区二区 | 日本v片在线高清不卡在线观看| 亚洲精品在线一区二区| 中文幕一区二区三区久久蜜桃| 国产aⅴ精品一区二区三区色成熟| 日本一区二区三区四区| 欧美亚男人的天堂| 成人97人人超碰人人99| 午夜精品久久久久| 中文字幕在线视频一区| 日韩精品影音先锋| 91亚洲精品久久久蜜桃网站| 久久精品视频在线免费观看| 丁香亚洲综合激情啪啪综合| 精品国产一区二区在线观看| 在线欧美日韩国产| 精品亚洲国内自在自线福利| 中文字幕日本乱码精品影院| 中文av一区特黄| 精品美女被调教视频大全网站| 国产精品久久久久久久久免费樱桃| 成人动漫av在线| 另类综合日韩欧美亚洲| 自拍偷拍国产亚洲| 午夜精品久久一牛影视| 精品一区二区三区视频| 日韩欧美成人一区二区| 欧美人伦禁忌dvd放荡欲情| 91精品国产麻豆国产自产在线 | 国产精品1区二区.| 成人av电影在线播放| 中文在线一区二区 | 亚洲成av人片在线| 蜜桃一区二区三区在线观看| 99久久精品99国产精品| 日韩网站在线看片你懂的| 亚洲美女在线一区| 色呦呦日韩精品| 精品久久久久久久久久久久久久久久久| 亚洲激情校园春色| proumb性欧美在线观看| 蜜桃一区二区三区在线观看| 亚洲精品菠萝久久久久久久| 粉嫩aⅴ一区二区三区四区 | 日韩中文字幕91| 欧美视频日韩视频| 亚洲国产一二三| 欧美伦理视频网站| 麻豆免费精品视频| 欧美精品一区二| 91麻豆.com| 国产又黄又大久久| 精品久久久久久久人人人人传媒| 成人欧美一区二区三区白人| 日韩女优电影在线观看| 欧美在线视频日韩| 中文一区在线播放| 亚洲午夜视频在线观看| 九色|91porny| www久久久久| 99re热这里只有精品视频| 一区二区三区蜜桃| 在线不卡a资源高清| 国产成人精品午夜视频免费| 欧美影视一区二区三区| 日韩欧美国产麻豆| 一区二区三区欧美日韩| 久久这里都是精品| 亚洲欧美日本在线| 日本免费新一区视频 | 欧美人妇做爰xxxⅹ性高电影| 欧美人妇做爰xxxⅹ性高电影 | 精品国产一区二区三区不卡| 亚洲天天做日日做天天谢日日欢 | 欧美色图一区二区三区| 日产精品久久久久久久性色| 国产精品资源网站| 久久久不卡网国产精品二区| 成人黄页毛片网站| 中文字幕一区二区三区蜜月| 色综合欧美在线视频区| 亚洲一卡二卡三卡四卡 | 欧美剧情片在线观看| 久久成人麻豆午夜电影| 国产精品久久综合| 精品sm捆绑视频| 精品一区免费av| 欧美一区二区三区免费在线看 | 欧美在线观看18| 久久久国产精品午夜一区ai换脸| 亚洲一区免费视频| 欧美影院一区二区| 亚洲精品国产成人久久av盗摄| 国产最新精品精品你懂的| 欧美色综合久久| 日韩在线一区二区三区| 日韩视频免费观看高清完整版| 中文字幕在线免费不卡| 国产精品一区在线观看你懂的| 日韩一二在线观看| 欧美视频精品在线| 国产精品欧美经典| 成人精品视频一区二区三区| 一本高清dvd不卡在线观看| 亚洲三级电影全部在线观看高清| 国产很黄免费观看久久| 亚洲最快最全在线视频| 精品少妇一区二区三区日产乱码 | 91丨九色丨黑人外教| 麻豆91在线播放| 在线视频国内一区二区| 亚洲欧美一区二区三区极速播放| 日韩欧美中文一区二区| 午夜精品一区二区三区免费视频| 欧美本精品男人aⅴ天堂| 欧日韩精品视频| 99久久夜色精品国产网站| 欧美aⅴ一区二区三区视频| 亚洲国产精品久久久久秋霞影院 | 九色综合狠狠综合久久| 亚洲丝袜美腿综合| 日韩一区二区免费高清| 欧美自拍丝袜亚洲| 成人午夜精品一区二区三区| 日韩 欧美一区二区三区| 亚洲成a人片在线观看中文| 国产精品福利av| 国产精品国产三级国产a| 中文一区在线播放| 亚洲天堂av一区| 亚洲一区精品在线| 久久国产精品99久久久久久老狼| 免费成人在线观看| 国产一区二区成人久久免费影院| 久久电影网站中文字幕| 久久国产精品露脸对白| 黑人巨大精品欧美一区| 国产成人在线视频网址| 国产一区二区三区|