COMP9417 – Machine Learning Homework 0: Revision
Introduction The goal of this homework is to review some important mathematical concepts that are used regularly in machine learning, and which are assumed knowledge for the course. If you find yourself strug- gling significantly with any aspects of this homework, please reach out to course staff so that we can better help you prepare for the course. Please also note that we have posted some helpful resources under the Week 0 tab on Moodle which may be of use to you for this homework.
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 any question in which you use code, provide a copy of your code at the bottom of the relevant section.
Copyright By PowCoder代写 加微信 powcoder
• You are free to format your work in any way you think is appropriate. This can include using LATEX, or taking pictures of handwritten work, or writing your solutions up using a tablet. Please ensure that your work is neat, and start each question on a new page.
When and Where to Submit
• Due date: Friday June 4th, 2021 by 5:00pm.
• For this homework, we will not accept late submissions.
• Submissions must be through Moodle – email submissions will be ignored.
Question 1. (Calculus Review)
(a) Consider the function
f(x,y)=a1x2y2 +a4xy+a5x+a7 compute all first and second order derivatives of f with respect to x and y.
(b) Consider the function
f(x,y)=a1x2y2 +a2x2y+a3xy2 +a4xy+a5x+a6y+a7 compute all first and second order derivatives of f with respect to x and y.
(c) Consider the logistic sigmoid:
showthatσ′(x)=∂σ =σ(x)(1−σ(x)) ∂x
σ(x) = 1 1+e−x
(d) Consider the following functions:
• y1 = 4×2 − 3x + 3
• y2 = 3×4 − 2×3 √
•y3=4x+ 1−x
• y4 =x+x−1
Using the second derivative test, find all local maximum and minimum points.
Question 2. (Probability Review)
(a) A manufacturing company has two retail outlets. It is known that 20% of potential customers buy products from Outlet I alone, 10% buy from both I and II, and 40% buy from neither. Let A denote the event that a potential customer, randomly chosen, buys from outel I, and B the event that the customer buys from outlet II. Compute the following probabilities:
P(A), P(B), P(A ∪ B), P(A ̄B ̄)
(b) Let X, Y be two discrete random variables, with joint probability mass function P (X = x, Y = y)
displayed in the table below:
Compute the following quantities: (i) r
(ii) P(X=2,Y =3)
(iii) P(X =3)andP(X =3|Y =2) (iv) E[X], E[Y ] and E[XY ]
(v) E[X2], E[Y 2] (vi) Cov(X,Y)
(vii) Var(X) and Var(Y ) (viii) Corr(X,Y)
123 1 1/6 1/12 1/12
x 2 1/6 0 1/6 30r0
(ix) E[X+Y],E[X+Y2],Var(X+Y)andVar(X+Y2). Question 3. (Linear Algebra Review)
(a) Write down the dimensions of the following objects:
1 1 3 1 0 2 1
1 T A=11412, b=3, A
11152 3
(b) Consider the following objects:
1 3 4 2 4 7 3 3 4 2 1 2 A=2 2 1, B=1 1, C=2 1 1, D=4 6, u=3, v=4
Compute the following: (i) AB and BA
(ii) AC and CA
(iii) AD and DA
(iv) DCandCDandDTC
(v) Bu and uB (vi) Au
(vii) Av and vA (viii) Av + Bv
(c) Consider the following objects:
Compute the following:
(i) ∥u∥1 , ∥u∥2 , ∥u∥2 , ∥u∥∞
(ii) ∥v∥1,∥v∥2,∥v∥2,∥v∥∞
(iii) ∥v+w∥1,∥v+w∥2,∥v+w∥∞
(iv) ∥Av∥2,∥A(v−w)∥∞
1 2 1 A=2 2 1, u= 3 , v=4, w=−2.
1 3 4 64312
(d) Consider the following vectors in R2
u=2, v=1, w=1/2
1 1 −1
Compute the dot products between all pairs of vectors. Note that the dot product may be written
using the following equivalent forms:
⟨x, y⟩ = x · y = xT y. Then compute the angle between the vectors and plot.
(e) Dotproductsareextremelyimportantinmachinelearning,explainwhatitmeansforadotproduct to be zero, positive or negative.
(f) Consider the 2 × 2 matrix:
Compute the inverse of A.
(g) Consider the 2 × 2 matrix
1 3 A=41
3 3 A=44
Compute its inverse A−1.
(h) Let X be a matrix (of any dimension), show that XT X is always symmetric.
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com