{ "cells": [ { "cell_type": "markdown", "id": "69e07ae5", "metadata": {}, "source": [ "(lecture05:models-are-functions)=\n", "# Models are functions\n", "\n", "Let's now make our first model.\n", "A model is always some kind of function.\n", "It takes some input variables an it maps them to an output quantity of interest.\n", "A good model is one in which the input variables are the causes of the output quantity of interest.\n", "Let's make our first model for the `temperature_raw.xlsx` dataset of {ref}`lecture03:homework`." ] }, { "cell_type": "code", "execution_count": 1, "id": "bf8958c5", "metadata": { "tags": [ "hide-input", "hide-output" ] }, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", "%matplotlib inline\n", "import seaborn as sns\n", "sns.set(rc={\"figure.dpi\":100, 'savefig.dpi':300})\n", "sns.set_context('notebook')\n", "sns.set_style(\"ticks\")\n", "from IPython.display import set_matplotlib_formats\n", "set_matplotlib_formats('retina', 'svg')" ] }, { "cell_type": "markdown", "id": "dc72019d", "metadata": {}, "source": [ "Download, and load the data:" ] }, { "cell_type": "code", "execution_count": 8, "id": "c14d18dc", "metadata": { "tags": [ "hide-input" ] }, "outputs": [ { "data": { "text/html": [ "
\n", " | household | \n", "date | \n", "score | \n", "t_out | \n", "t_unit | \n", "hvac | \n", "
---|---|---|---|---|---|---|
0 | \n", "a1 | \n", "2018-01-07 | \n", "100.0 | \n", "4.283373 | \n", "66.693229 | \n", "246.473231 | \n", "
1 | \n", "a10 | \n", "2018-01-07 | \n", "100.0 | \n", "4.283373 | \n", "66.356134 | \n", "5.492116 | \n", "
2 | \n", "a11 | \n", "2018-01-07 | \n", "58.0 | \n", "4.283373 | \n", "71.549132 | \n", "402.094327 | \n", "
3 | \n", "a12 | \n", "2018-01-07 | \n", "64.0 | \n", "4.283373 | \n", "73.429514 | \n", "211.692244 | \n", "
4 | \n", "a13 | \n", "2018-01-07 | \n", "100.0 | \n", "4.283373 | \n", "63.923937 | \n", "0.850536 | \n", "