diff --git a/Aufgaben/01 - linear regression - 1 feature.ipynb b/Aufgaben/01 - linear regression - 1 feature.ipynb index 937e5f7..b555913 100644 --- a/Aufgaben/01 - linear regression - 1 feature.ipynb +++ b/Aufgaben/01 - linear regression - 1 feature.ipynb @@ -1066,7 +1066,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.12" + "version": "3.12.8" }, "varInspector": { "cols": { diff --git a/Aufgaben/05 - lineare regression - sklearn.ipynb b/Aufgaben/05 - lineare regression - sklearn.ipynb new file mode 100644 index 0000000..81a6be4 --- /dev/null +++ b/Aufgaben/05 - lineare regression - sklearn.ipynb @@ -0,0 +1,381 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "f19ad4d1", + "metadata": {}, + "source": [ + "# Lineare Regression mit scikit-learn" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "fca110ae", + "metadata": {}, + "outputs": [], + "source": [ + "import numpy as np\n", + "import pandas as pd\n", + "# plotting settings\n", + "pd.plotting.register_matplotlib_converters()\n", + "import matplotlib.pyplot as plt\n", + "%matplotlib inline\n", + "import seaborn as sns\n", + "from sklearn.linear_model import LinearRegression" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "6edf6b65", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + " | BuildingArea | \n", + "Rooms | \n", + "Price | \n", + "
---|---|---|---|
1 | \n", + "79.0 | \n", + "2 | \n", + "1035000.0 | \n", + "
2 | \n", + "150.0 | \n", + "3 | \n", + "1465000.0 | \n", + "
4 | \n", + "142.0 | \n", + "4 | \n", + "1600000.0 | \n", + "
6 | \n", + "210.0 | \n", + "3 | \n", + "1876000.0 | \n", + "
7 | \n", + "107.0 | \n", + "2 | \n", + "1636000.0 | \n", + "
\n", + " | BuildingArea | \n", + "Rooms | \n", + "Price | \n", + "
---|---|---|---|
1 | \n", + "79.0 | \n", + "2 | \n", + "1035000.0 | \n", + "
2 | \n", + "150.0 | \n", + "3 | \n", + "1465000.0 | \n", + "
4 | \n", + "142.0 | \n", + "4 | \n", + "1600000.0 | \n", + "
6 | \n", + "210.0 | \n", + "3 | \n", + "1876000.0 | \n", + "
7 | \n", + "107.0 | \n", + "2 | \n", + "1636000.0 | \n", + "
PolynomialFeatures(degree=4)In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
PolynomialFeatures(degree=4)
Pipeline(steps=[('polynomialfeatures',\n", + " PolynomialFeatures(degree=4, include_bias=False)),\n", + " ('standardscaler', StandardScaler()),\n", + " ('linearregression', LinearRegression())])In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
Pipeline(steps=[('polynomialfeatures',\n", + " PolynomialFeatures(degree=4, include_bias=False)),\n", + " ('standardscaler', StandardScaler()),\n", + " ('linearregression', LinearRegression())])
PolynomialFeatures(degree=4, include_bias=False)
StandardScaler()
LinearRegression()