Skip to content

Machine Learning Quizzes

Quiz 1

Question

y=Ax+v, where v is a Gaussian noise.

  1. What is the optimal solution for x?
  2. What is the optimal solution for x if vN(0,R)?
  3. What is the optimal solution for x if vN(0,R) and XN(0,aI)?
  4. A and X are unknown, what is the optimal solution for x?

Answer

  1. J(x)=12(yAx)T(yAx), Jx=0, x=(ATA)1ATy
  2. J(x)=12(yAx)TR1(yAx), Jx=0, x=(ATR1A)1ATR1y
  3. J(x)=12(yAx)TR1(yAx)+12xT(aI)1x, Jx=0, x=(ATR1A+aI)1ATR1y
  4. We can distinguish two cases:
    1. For x: J(x)=12(yAx)TR1(yAx)+12xT(aI)1x, Jx=0, x=(ATR1A+aI)1ATR1y
    2. For A: YT=XTAT J(A)=12(YXA)TR1(YXA), JA=0, AT=(XR1XT)1XR1YT

Quiz 2

Question

Y=AX+ω, where ωN(0,Q) and XN(μ0,Σ0)

  1. What is p(Y|X)?
  2. What is p(Y)?
  3. What is p(X|Y)?
  4. What is p(Y|Y)?

Answer

  1. p(Y|X)N(AX,Q) We regard X as a constant under conditional probability.
  2. p(Y)p(Y|X)p(X)dxN(Aμ0,AΣ0AT+Q).var[Y]=var[AX]+var[ω]=AΣ0AT+Q
  3. Assume that p(X|Y)N(m,L), then we can use the equality of quadratic from to solve the problems.
    1. p(X|Y)p(Y|X)p(X)=N(Y|AX,Q)N(X|μ0,Σ9)
    2. 12(xm)TL1(xm)12(yAx)TQ1(yAx)12(xμ0)TΣ01(xμ0)
    3. We can get the result:
    L1=ATQ1A+Σ01L1m=ATQ1y+Σ01μ0
    1. By applying [A+BCD]1=A1A1B[C1+DA1B]1DA1
    L=(IKA)Σ0m=μ0+K(yAμ0)where K=Σ0AT(ATΣ0A+Q)1
  4. p(Y|Y)p(Y|X)p(X|Y)dxN(Am,ALAT+Q). The same format as question 2.

Quiz 3

TIP

  1. Learning: p(θ|D)p(D|θ)p(θ)
  2. Prediction: p(Dnew|D)=p(Dnew|θ)p(θ|D)dθ
  3. Evaluation: p(D)=p(D|θ)p(θ)dθ

Question

Given t=Φ(x)ω+v where Φ(x)=[1,x,x...,xM] and vN(0,β1), D={[x1,...,xN],[t1,...,tN]}

  1. What is the solution of ωML?
  2. What is the solution of ωMAP if ωN(0,α1I)?
  3. What is the predictive distribution if Dnew={xnew,tnew}?
  4. What is the model evaluation?

Answer

  1. J(ω)=β2(TΦω)T(TΦω)ωML=(ΦTΦ)1ΦTT
  2. J(ω)=β2(TΦω)T(TΦω)+α2ωTωωMAP=(βΦTΦ+αI)1βΦTT
  3. N(Φ(xnew)ωMAP,Φ(xnew)ΣMAPΦ(xnew)T+βI)
  4. N(0,α1ΦΦT+β1I)

Quiz 4

Question

For y=σ(Φ(x)w), and D={[x1,...,xN],[t1,...,tN]}, where σ(x)=11+ex.

  1. What is the solution of wML?
  2. What is the solution of wMAP if wN(m0,S0)?
  3. What is the predictive distribution if Dnew={xnew,tnew=1}?
  4. What is the model evaluation?

Answer

  1. J(w)=n=1N{tnlogyn+(1tn)log(1yn)} b=J(w)=n=1NϕT(yntn) H=J(w)=n=1Nyn(1yn)ϕnTϕ

    Because σ is not a linear function, there are no explicit solution to find wML. We can use the gradient descent method to find the solution.

    w+\larrwH1b

  2. J(w)=n=1N{tnlogyn+(1tn)log(1yn)}+12(wm0)TS01(wm0)

    Therefore, $b = \triangledown J(w) = \sum_{n=1}^N \phi^T(y_n - t_n) + S_0^{-1}(w - m_0) $ and H=J(w)=n=1Nyn(1yn)ϕnTϕ+S01

  3. p(tnew=1|xnew,D)=p(tnew=1|w)p(w|D)dw=σ(ϕneww)N(wMAP,H1)dw

    σ(κ(σa2)μa)

  4. n=1N[tnlnyn+(1tn)ln(1yn)]MAP12(wMAPm0)TS01(wMAPm0)+M2ln2π12ln|H|MAP