Commit 078d1851 authored by Marvin Kastner's avatar Marvin Kastner
Browse files

Add Wohnungsgrundstück-Preise

parent 4b09cf4f
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Boston Wohnungsgrundstueck-Preise\n",
"\n",
"Hier wird exemplarisch gezeigt, wie scikit-learn für eine Aufgabe wie eine lineare Regression eingestetzt werden kann."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import sklearn\n",
"import sklearn.datasets\n",
"import sklearn.linear_model\n",
"import sklearn.metrics\n",
"import sklearn.model_selection\n",
"\n",
"import matplotlib.pyplot as plt"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Das Modul `sklearn` heißt in Lang `scikit-learn` und beinhaltet bereits einige Datensätze.\n",
"Die Hauspreise von Boston sind nun ein Beispiel."
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Boston House Prices dataset\n",
"===========================\n",
"\n",
"Notes\n",
"------\n",
"Data Set Characteristics: \n",
"\n",
" :Number of Instances: 506 \n",
"\n",
" :Number of Attributes: 13 numeric/categorical predictive\n",
" \n",
" :Median Value (attribute 14) is usually the target\n",
"\n",
" :Attribute Information (in order):\n",
" - CRIM per capita crime rate by town\n",
" - ZN proportion of residential land zoned for lots over 25,000 sq.ft.\n",
" - INDUS proportion of non-retail business acres per town\n",
" - CHAS Charles River dummy variable (= 1 if tract bounds river; 0 otherwise)\n",
" - NOX nitric oxides concentration (parts per 10 million)\n",
" - RM average number of rooms per dwelling\n",
" - AGE proportion of owner-occupied units built prior to 1940\n",
" - DIS weighted distances to five Boston employment centres\n",
" - RAD index of accessibility to radial highways\n",
" - TAX full-value property-tax rate per $10,000\n",
" - PTRATIO pupil-teacher ratio by town\n",
" - B 1000(Bk - 0.63)^2 where Bk is the proportion of blacks by town\n",
" - LSTAT % lower status of the population\n",
" - MEDV Median value of owner-occupied homes in $1000's\n",
"\n",
" :Missing Attribute Values: None\n",
"\n",
" :Creator: Harrison, D. and Rubinfeld, D.L.\n",
"\n",
"This is a copy of UCI ML housing dataset.\n",
"http://archive.ics.uci.edu/ml/datasets/Housing\n",
"\n",
"\n",
"This dataset was taken from the StatLib library which is maintained at Carnegie Mellon University.\n",
"\n",
"The Boston house-price data of Harrison, D. and Rubinfeld, D.L. 'Hedonic\n",
"prices and the demand for clean air', J. Environ. Economics & Management,\n",
"vol.5, 81-102, 1978. Used in Belsley, Kuh & Welsch, 'Regression diagnostics\n",
"...', Wiley, 1980. N.B. Various transformations are used in the table on\n",
"pages 244-261 of the latter.\n",
"\n",
"The Boston house-price data has been used in many machine learning papers that address regression\n",
"problems. \n",
" \n",
"**References**\n",
"\n",
" - Belsley, Kuh & Welsch, 'Regression diagnostics: Identifying Influential Data and Sources of Collinearity', Wiley, 1980. 244-261.\n",
" - Quinlan,R. (1993). Combining Instance-Based and Model-Based Learning. In Proceedings on the Tenth International Conference of Machine Learning, 236-243, University of Massachusetts, Amherst. Morgan Kaufmann.\n",
" - many more! (see http://archive.ics.uci.edu/ml/datasets/Housing)\n",
"\n"
]
}
],
"source": [
"boston = sklearn.datasets.load_boston()\n",
"print(boston.DESCR)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Der Datensatz wird nun in einen Trainings-Datensatz und einen Test-Datensatz aufgeteilt."
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"X_train, X_test, Y_train, Y_test = sklearn.model_selection.train_test_split(\n",
" boston.data, boston.target, test_size=0.33)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Exploration des Trainings-Datensatzes\n",
"\n",
"Zunächst visualisieren wir die Werte.\n",
"`Y_train` ist die Zielvariable, also `MEDV`, sprich \"Median value of owner-occupied homes in $1000's\""
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXUAAAD8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l02Wjb63/b+PpqNfjaW1vLI5mt5/EMNoLIh2TtgMeN7OIjIhIi8BeB3AdzCcNZxS1aUU287aHf39FwAaf0Zh0mZVHbX1f43a+ksickHS5ojctg5B1NNGUV9Ldm5Q1a0AbgZwt4h8qG2DKuJz2/8FgH8E4AMATgD40+h1b2wWkXcD2AfgHlX9+7y3przmi83et7OqLqvqBwCsx3C28Btpb4v+98LupM0isgXA5wH8YwC/BeBSAPdGb7eyOQRRnwdwVez39QCOt2RLLqp6PPr/dQDfwNDBfj6aKkX/v96ehZlk2eht26vqz6OOMQDwlzg39ffCZhFZjaE4PqyqT0cve93OaTb73s5xVPUUgOcwzDtfIiKjx3XGbTtrd/T3fwjz1J5zYjb/bpQCU1V9B8D/RMm2DkHUXwTwvmg1ew2GixvfbNmmFYjIr4nIxaOfAXwMwGEMbb0zetudAPa3Y2EuWTZ+E8C/jlbftwP4xSh90DaJnOK/wrCtgaHNd0RVDlcDeB+AFxq2TQB8BcArqvpnsT95285ZNvvczpF9l4vIJdHPFwK4CcP1gAMAbovelmzr0TW4DcD3NFqNbIoMm/9fbMAXDNcA4m1t7h9Nr/yW+Yfh6u9rGObK/rhtezJs3IxhNcAPAbw8shPDfN13Afxt9P+lLdv5KIbT6DMYRgB3ZdmI4bTvwajdfwxgyiOb/1dk048ip18Xe/8fRza/CuDmFuz9ZxhOj38E4KXo38d9buccm71t58iGfwLgbyL7DgPYHb2+GcNB5giAJwFcEL3+ruj3I9HfN3tk8/eitj4M4H/jXIWMlX/wjlJCCOkQIaRfCCGEGEJRJ4SQDkFRJ4SQDkFRJ4SQDkFRJ4SQDkFRJ4SQDkFRJ4SQDkFRJ4SQDvH/AXHMu3IKJsVoAAAAAElFTkSuQmCC\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plt.plot(Y_train, \".\")\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Auf der X-Achse wird Eintrag für Eintrag einfach geplottet.\n",
"Die Reihenfolge der verschiedenen Nachbarschaften ist willkürlich.\n",
"\n",
"Um zu überprüfen, welcher Verteilung die Preise folgen, können sie einfach sortiert werden."
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAFiJJREFUeJzt3X+sZGV9x/H3d+7di6IUluVHV5bdZQVNhaYKN3gTbIu/WrXoWqsWNXabQjdNbFJim4I12RrSP7BNW9uE1GzVlDYgKEqWmNCoBGpMXCqDoteisK5c2O6Whe0VMTTs3r1P/5hzYO4wc2fu7Pw458z7lWxm5uxc9+tk+Oyz3+c5zxMpJSRJ5VcbdwGSpMEw0CWpIgx0SaoIA12SKsJAl6SKMNAlqSIMdEmqCANdkirCQJekipge5R92xhlnpK1bt47yj5Sk0qvX60+llM7s9r6RBvrWrVu5//77R/lHSlLpRcRCL++z5SJJFWGgS1JFGOiSVBEGuiRVhIEuSRXR0yqXiHgUeAY4DiyllGYj4nTgNmAr8Cjw/pTS4nDKlCR1s5Zli29MKT3V9Po64O6U0g0RcV32+tqBVidJJVBfWGTv/iOsP3mGxWePrnicP/g0Abzn4k1csmX9UOs4kXXo24HLs+c3AfdioEuaMPWFRT70mb08d2yZBASseMx9sX6Az//h3FBDvdceegK+GhH1iNiZXTs7pXQIIHs8q90PRsTOiLg/Iu5/8sknT7xiSSqQvfuPcHRp+fnwbn3MHVtaZu/+I0OtpdcR+mUppYMRcRbwtYj4Ya9/QEppN7AbYHZ21hOpJVXK3LYNzEzXOHpsmWU6j9DXTdeY27ZhqLX0FOgppYPZ4+GIuAO4FHgiIjamlA5FxEbg8BDrlKRC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MEUTE24BrgXellJ5tun5mRExlz7cBFwD7x1Pli63yvbgTuDIiToqI82jU/Z+jrm9gxj0r28svGjP/D9P4W//j466nQ41voPFPte8B381+vQP4N+D72fU7gY3jrrWl7m00ZvkfBH6Qf77ABuBu4JHs8fRx19qm9pOBI8CpTdcK93nT+AvnEHCMxojwqk6fL40WwI3Zd/37wGzB6t5Ho+ecf8c/nb33d7Lvz4PAA8A7C1Z3x+8F8PHs8/4R8PZxf19O5Jd3ikpSRZSh5SJJ6oGBLkkVYaBLUkUY6JJUEQa6JFWEgS5JFWGgS1JFGOiSVBH/D1BlEfxOfUsSAAAAAElFTkSuQmCC\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"Y_test_sorted = Y_test.copy()\n",
"Y_test_sorted.sort()\n",
"plt.plot(Y_test_sorted, \".\")\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Die Grafik zeigt, dass die günstigen bis mittelteuren Nachbarschaften sich im Preis nur langsam steigern,\n",
"die teureren Nachbarschaften aber sich deutlicher vom Preis her voneinander abgrenzen."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Lineare Regression\n",
"\n",
"Mit einer Linearen Regression kann man eine Menge von Einflussfaktoren zusammenfassen und für die Vorhersage der Zielvariablen einsetzen.\n",
"\n",
"Zunächst wird das Lineare Modell trainiert."
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"LinearRegression(copy_X=True, fit_intercept=True, n_jobs=1, normalize=True)"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"lm = sklearn.linear_model.LinearRegression(normalize=True)\n",
"lm.fit(X_train, Y_train)"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Feature\t\tKoeffizient\n",
"CRIM \t\t -0.10713600565589226\n",
"ZN \t\t 0.06097016779368792\n",
"INDUS \t\t 0.0005083977424205782\n",
"CHAS \t\t 1.8682690085463167\n",
"NOX \t\t -16.745654751792745\n",
"RM \t\t 3.793085149471118\n",
"AGE \t\t -0.009104990716615653\n",
"DIS \t\t -1.6642303286745026\n",
"RAD \t\t 0.3231030326729435\n",
"TAX \t\t -0.013577585346755638\n",
"PTRATIO \t\t -0.9315409884707704\n",
"B \t\t 0.011874489878575242\n",
"LSTAT \t\t -0.44814833805425885\n"
]
}
],
"source": [
"print(\"Feature\\t\\tKoeffizient\")\n",
"for feature, coefficient in zip(boston.feature_names, lm.coef_):\n",
" print(feature, \"\\t\\t\", coefficient)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Nun kann mithilfe des Test-Sets evaluiert werden, wie genau diese Vorhersage-Methode ist.\n",
"Weil die Attribute zu viele Dimensionen haben, kann man nicht einfach den linearen Zusammenhang zwischen zwei Variablen darstellen.\n",
"Stattdessen kann man bspw. den vorhergesagten Wert ggü. dem tatsächlichen Wert plotten."
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAHC5JREFUeJzt3W1sneV5B/D/5ZMTOIaqJxTTwUlTZxJKui7FVqyOyftA0pegwahVoLTKpkyqFGnaB2DMrdmHQSaquopW8pmWqpHatWGEhpdMShEJ6xoB1XGdlGZJxFhJVCci6RJ3XePSE/vah/M89vHx836e1/v5/yRkn+Njn9sP8XXuc93Xfd2iqiAiouLry3oAREQUDwZ0IiJDMKATERmCAZ2IyBAM6EREhmBAJyIyBAM6EZEhGNCJiAzBgE5EZIhVaT7ZjTfeqI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zPURkLYC7AHzTui0o6bXwkPjfCgN6eB9U1fNAO8gBuCnj8aRORAYBDAN4AyW+HlaK4RiACwBeBvA2gFlVvWo95Jdov+iVwR4AXwKwYN3+AMp7LYD2i/sPRWRKRHZa9yX+t8IDLigUEbkewH4AD6nq/7YnYuWkqvMAhkSkDuAHAD7i9LB0R5U+EbkbwAVVnRKRO+y7HR5q/LXoMKqq50TkJgAvi8ipNJ6UM/Tw3hWRmwHA+ngh4/GkRkSqaAfz76rqc9bdpb0eNlWdBfAq2msLdRGxJ0prAZzLalwpGgVwj4i8A+D7aKda9qCc1wIAoKrnrI8X0H6x/zhS+FthQA/vBQA7rM93AHg+w7GkxsqJPg3gpKp+veNLZb0eA9bMHCJSA/BJtNcVjgC4z3pYKa6Hqj6qqmtVdRDA5wEcVtXtKOG1AAARuU5E3md/DuDTAH6OFP5WuLHIg4h8D8AdaHdKexfAYwAOAHgGwDoAZwHcr6rdC6fGEZE/A/AfAN7EUp70H9DOo5fxenwM7YWtCtoTo2dU9Z9E5A/RnqXeAGAawF+q6nvZjTRdVsrl71X17rJeC+v3/oF1cxWAf1HVr4jIB5Dw3woDOhGRIZhyISIyBAM6EZEhGNCJiAzBgE5EZAgGdCIiQzCgExEZggGdiMgQDOhERIb4fx/101qXrpSXAAAAAElFTkSuQmCC\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"Y_pred = lm.predict(X_test)\n",
"plt.scatter(Y_test, Y_pred)\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Eine andere Form der Visualisierung ist, den Fehler zu analysieren."
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAD8CAYAAAB0IB+mAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxp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O68wNgH/AfEyt3Yb0A7sm293PAB+quL2X+6U5bEZGOaENKR0RExqCALyLSEQr4IiIdoYAvItIRCvgiIh2hgC8i0hEK+CIiHaGALyLSEf8KfsAzBaMV4EQAAAAASUVORK5CYII=\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plt.plot(Y_test - Y_pred, \".\")\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Mean absolute error: 3.36\n"
]
}
],
"source": [
"print(\"Mean absolute error: %.2f\" % sklearn.metrics.mean_absolute_error(Y_test, Y_pred))"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Mean squared error: 25.17\n"
]
}
],
"source": [
"print(\"Mean squared error: %.2f\" % sklearn.metrics.mean_squared_error(Y_test, Y_pred))"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.5"
},
"varInspector": {
"cols": {
"lenName": 16,
"lenType": 16,
"lenVar": 40
},
"kernels_config": {
"python": {
"delete_cmd_postfix": "",
"delete_cmd_prefix": "del ",
"library": "var_list.py",
"varRefreshCmd": "print(var_dic_list())"
},
"r": {
"delete_cmd_postfix": ") ",
"delete_cmd_prefix": "rm(",
"library": "var_list.r",
"varRefreshCmd": "cat(var_dic_list()) "
}
},
"types_to_exclude": [
"module",
"function",
"builtin_function_or_method",
"instance",
"_Feature"
],
"window_display": false
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment