Ex Ml-Basics
Ex Ml-Basics
https://slds-lmu.github.io/i2ml/ ML Basics
Imagine you work at a second-hand car dealer and are tasked with finding for-sale vehicles your company can
acquire at a reasonable price. You decide to address this challenge in a data-driven manner and develop a model
that predicts adequate market prices (in EUR) from vehicles’ properties.
a) Characterize the task at hand: supervised or unsupervised? Regression or classification? Learning to explain
or learning to predict? Justify your answers. [only for lecture group B]
b) How would you set up your data? Name potential features along with their respective data type and state the
target variable.
c) Assume now that you have data on vehicles’ age (days), mileage (km), and price (EUR). Explicitly define the
feature space X and target space Y.
d) You choose to use a linear model (LM) for this task. The LM models the target as a linear function of the
features with Gaussian error term.
State the hypothesis space for the corresponding model class. For this, assume the parameter vector θ to include
the intercept coefficient.
e) Which parameters need to be learned? Define the corresponding parameter space Θ.
f) State the loss function for the i-th observation using L2 loss.
g) Now you need to optimize this risk to find the best parameters, and hence the best model, via empirical risk
minimization. State the optimization problem formally and list the necessary steps to solve it.
Consider the following function performing matrix-vector multiplication: f (x) = Ax, where A ∈ Rm×n , x ∈ Rn×1 .
a) What is the dimension of f (x)? Explicitly state the calculation for the i-th component of f (x).
df (x)
b) Now, consider the gradient (derivative generalized to multivariate functions) dx (a.k.a. ∇x f (x)).
df (x)
i) What is the dimension of dx ?
df (x)
ii) Compute dx .