{ "cells": [ { "cell_type": "markdown", "id": "9dd8f8d0", "metadata": {}, "source": [ "# Exercises week 36\n", "\n", "## Deriving and Implementing Ridge Regression" ] }, { "cell_type": "markdown", "id": "6b5c366c", "metadata": {}, "source": [ "**Python Code can be found at https://github.uio.no/larsbog/FYS-STK4155**" ] }, { "cell_type": "markdown", "id": "e5cc5739", "metadata": {}, "source": [ "## Learning goals\n", "\n", "After completing these exercises, you will know how to\n", "- Take more derivatives of simple products between vectors and matrices\n", "- Implement Ridge regression using the analytical expressions\n", "- Scale data appropriately for linear regression\n", "- Evaluate a model across two different hyperparameters" ] }, { "cell_type": "markdown", "id": "427d9b9d", "metadata": {}, "source": [ "## Exercise 1 - Choice of model and degrees of freedom" ] }, { "cell_type": "markdown", "id": "ff6ebdb5", "metadata": {}, "source": [ "**a)** How many degrees of freedom does an OLS model fit to the features $x, x^2, x^3$ and the intercept have?\n" ] }, { "cell_type": "markdown", "id": "b4ea1834", "metadata": {}, "source": [ "