Professional Documents
Culture Documents
Question 1 (Linear Regression)
Question 1 (Linear Regression)
1. Visualization
2. Journey Mapping
3. Value Chain Analysis
4. Mind Mapping
5. Brainstorming
6. Concept Development
7. Assumption Testing
8. Rapid Prototyping
9. Customer Co-creation
10. Learning Launch
1
• [t,X] = loadData(): loads data from ’housing.data’ data file. t is the target
output and X is the input features.
• X n = normalizeData( X, ref ): Normalizes the data in X using the mean
and variance of the data in ref. If ref=X, then X n is a linear transformation of
X with zero mean and unit variance.
For the following, use these normalized features X n and targets for learning the model.
Have a look at the source code for all provided files. You may be able to use the
structures as hint.
Page 2
(d): [+CODE] Create a MATLAB script polynomial regression reg.m for the
following:
Implement L2 -regularized regression using the first 100 points, and only the 2nd
feature. Fit a degree 8 polynomial using each value in {0, 0.01, 0.1, 1, 10, 100, 1000}
for λ. Use 10-fold cross-validation to decide on the best value of λ. Produce a plot
of average validation set error versus the regularizing constant λ. Use a semilogx
plot, putting the regularizing constant λ on a log scale2 .
Put this plot in your report, and note which regularizing constant λ
you would choose for the cross-validation.
Page 3
Question 2 (Fisher Distance): Imaging X is a random variable generated
from the two classes C1 and C2 , and the data from two classes are Gaussian. Suppose
a is the random variable X|C1 and b is X|C2 :
a ∼ X|C1 ∼ N µ1 , σ12
b ∼ X|C2 ∼ N µ2 , σ22
(c)
:
We define random variable c = a − b. Each sample of c is generated by a random
(b W
): ha
ti
sample from C2 , subtracted from a random sample from C1 .
(a
):
W
ha st
he
W t is pro
ha t he b
ti
st pro abili
he ba ty
dis bil tha
tri i ty tc
bu <
tio that 0
no c= ?
fc 0±
?
?
2 Z x −t2
erf (x) = √ e dt. (1)
π 0
(d): Write down the solution of the last two sections in terms of the Fisher
criteria. Explain why this relation between the Fisher criteria and distribution of
the random variable c = a − b makes sense.
Page 4