加勒比久久综合,国产精品伦一区二区,66精品视频在线观看,一区二区电影

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

代寫COMP9417、Python程序設計代做

時間:2024-06-17  來源:合肥網hfw.cc  作者:hfw.cc 我要糾錯



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.
請加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp













 

掃一掃在手機打開當前頁
  • 上一篇:拿護照去越南怎樣辦理簽證(拿護照申請越南簽證申請流程)
  • 下一篇:代做4CM507、代寫c++,Java程序語言
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    2025年10月份更新拼多多改銷助手小象助手多多出評軟件
    2025年10月份更新拼多多改銷助手小象助手多
    有限元分析 CAE仿真分析服務-企業(yè)/產品研發(fā)/客戶要求/設計優(yōu)化
    有限元分析 CAE仿真分析服務-企業(yè)/產品研發(fā)
    急尋熱仿真分析?代做熱仿真服務+熱設計優(yōu)化
    急尋熱仿真分析?代做熱仿真服務+熱設計優(yōu)化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發(fā)動機性能
    挖掘機濾芯提升發(fā)動機性能
    海信羅馬假日洗衣機亮相AWE  復古美學與現代科技完美結合
    海信羅馬假日洗衣機亮相AWE 復古美學與現代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
  • 短信驗證碼 目錄網 排行網

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    久久久久久久欧美精品 | 日韩电影免费一区| 精品极品在线| 免费日韩一区二区| 91精品天堂福利在线观看| 综合伊思人在钱三区| 国产一区高清| www.色在线| 亚洲欧美日韩一区在线观看| 欧美综合精品| 日产国产高清一区二区三区| 国产精品分类| 久久一日本道色综合久久| 久草在线资源福利站| 99热这里只有精品8| 久久高清精品| 成人在线免费观看视频| 国内精品久久久久久久久电影网 | 色婷婷精品视频| 视频在线一区| 亚洲日产av中文字幕| 91精品一区| 亚洲精品护士| 日本在线不卡一区| ww久久综合久中文字幕| 亚洲女同av| 欧美xxav| 免费观看在线综合色| 一本久道综合久久精品| 亚洲电影影音先锋| 国产精品99一区二区| 久久久久国产| 久久久久久久久国产一区| 欧美激情影院| 青青一区二区| 久久97久久97精品免视看秋霞| 18国产精品| 91成人在线精品视频| 一区二区三区高清在线观看| 日韩高清二区| 99精品中文字幕在线不卡| 一区二区三区在线免费看| 日韩精品久久久久久久软件91| 久久av导航| 日本亚洲免费观看| 日韩精品一区二区三区免费视频| 午夜先锋成人动漫在线| 国产探花一区| 日本最新不卡在线| 69精品国产久热在线观看| 91欧美极品| 欧美自拍一区| 激情综合网站| 性欧美长视频| 97人人精品| 日韩中文视频| 久久永久免费| 中文字幕日韩一区二区不卡| 综合久久伊人| 亚洲v天堂v手机在线| 日韩精品中文字幕吗一区二区| 麻豆视频久久| 精品中文字幕一区二区三区av| 日韩视频久久| 日韩精品一卡| 国产一区二区三区的电影| 国产精品一国产精品k频道56| 一区二区三区福利| 亚洲最大黄网| 国产日本亚洲| 99久久夜色精品国产亚洲1000部| 国产主播精品| 蜜臀久久久久久久| 91福利精品在线观看| 肉色丝袜一区二区| 久久99国内| 欧美调教在线| 国产精品入口| 日韩欧美二区| 老司机免费视频一区二区三区| 亚洲网站三级| 精品一区电影| 午夜在线观看免费一区| 男人最爱成人网| 麻豆精品在线观看| 国产日韩中文在线中文字幕| 久久中文字幕av| 成人亚洲一区| 一区二区三区导航| 日韩二区三区四区| 亚洲成人一区| se01亚洲视频| 国产aⅴ精品一区二区三区久久| 99久久人爽人人添人人澡| 亚洲成人一区| 秋霞国产精品| 国产在线不卡一区二区三区| 国内视频在线精品| 免费黄网站欧美| 日本在线播放一区二区三区| 日韩成人一级片| 最新国产乱人伦偷精品免费网站| 天堂中文av在线资源库| www.91精品| 久久精品99久久无色码中文字幕| 色999日韩| 国产精品videossex久久发布| 国产伦理久久久久久妇女| 国产一区二区高清| 久久精品一区| 色88888久久久久久影院| 久久久久免费| 欧美精品大片| 亚洲第一伊人| 日韩欧美三区| 大型av综合网站| 国产精品13p| 亚洲久草在线| 亚洲经典一区| 欧美亚洲一区二区三区| 国产精品自在| 日韩在线二区| 日产国产欧美视频一区精品| 国产亚洲午夜| 国内一区二区三区| 免费观看久久av| 国产精品主播| 美女呻吟一区| 香蕉成人在线| 欧美三级自拍| 国产精品久久亚洲不卡| 国产日韩一区二区三免费高清| 免费亚洲电影在线| 国产成人一区| 久久午夜影视| 欧美三级不卡| 99riav国产精品| 国产乱码精品一区二区三区亚洲人 | 丝瓜av网站精品一区二区| 亚洲一区色图| 免费国产自线拍一欧美视频| 99精品在线免费观看| 尹人成人综合网| 91成人短视频在线观看| 亚洲作爱视频| 国产精久久一区二区| 图片小说视频色综合| 欧美日本二区| 在线亚洲观看| 国产日产精品一区二区三区四区的观看方式 | 麻豆一区二区| 四虎精品在线观看| 婷婷成人综合| 一区二区日韩欧美| 国产农村妇女精品一二区| 综合色一区二区| 国产精品日韩| 日本一区二区三区电影免费观看| caoporn视频在线| 成人在线免费观看91| 久久精品国产99国产| 午夜久久久久| 国内成人自拍| av高清一区| 免费不卡中文字幕在线| 99精品国产九九国产精品| 免费看欧美美女黄的网站| 日韩一区二区三区精品视频第3页| 伊人久久av| 欧美日韩在线播放视频| 亚洲一区二区三区| 伊人网在线播放| 久久蜜桃资源一区二区老牛| 影音先锋中文字幕一区| 男男视频亚洲欧美| 精品视频高潮| 99精品女人在线观看免费视频 | 激情国产在线| 99久久这里只有精品| 亚洲人metart人体| 中文在线аv在线| 亚洲一级特黄| 日韩成人精品在线观看| 精精国产xxxx视频在线播放| japanese国产精品| 久久在线观看| 麻豆精品视频在线观看视频| 另类激情亚洲| 亚洲不卡av不卡一区二区| 欧美日韩黄色| 欧美成人xxxx| 免费成人性网站| 香蕉一区二区| 日韩精品一级| 亚洲人www| 神马久久资源| 蜜桃免费网站一区二区三区| 久久久久一区| 国产欧美视频在线| 综合色一区二区|