Batch15 Individual Assignment - MLSL2
Batch15 Individual Assignment - MLSL2
Instructions:
- There are four questions
- Each question carries 25 points.
Y Z
- Dataset: We will learn the local linear embedding for the following function:
o https://en.wikipedia.org/wiki/Ricker_wavelet
- The code to generate this data is given here:
o http://www.southampton.ac.uk/~fangohr/training/python/snippets/lecture09/mex
hat-numpy.py
- Generate this data once and plot it y against x and see if you get the same curve.
- [11 points] Write a function to train such a local linear regression model recursively
o [best_model, best_partition] = LLE(xy_dataset, min_x, max_x, rmse_threshold)
o Store this model so you now where it is in the tree structure
o rmse_threshold determines how deep you go – it’s a hyper-parameter
-
- Note: Ultimately you don’t need all intermediate models, you just need final models:
o Min_x and Max_x value for each model
o Linear coefficients for each model
- When we get a new data point, we first check which model it should go to based on its x
value (and the Min_x, Max_x of each model) and then estimate the y value based on the
selected linear model.
- [6 points] Write a function to predict the y value for a given input using the above structure.
- [8 points] Play with it to see how rmse_threshold affects the “number of linear models” you
get.