From ad95e8def131d45f925dd31eed48371587b18895 Mon Sep 17 00:00:00 2001
From: Mirko Birbaumer <mirko.birbaumer@hslu.ch>
Date: Mon, 31 Mar 2025 09:27:39 +0000
Subject: [PATCH] added conclusions to LR_7_2

---
 notebooks/Linear Regression/LR_7_2.ipynb | 36 +++++++++++++++++++++++-
 1 file changed, 35 insertions(+), 1 deletion(-)

diff --git a/notebooks/Linear Regression/LR_7_2.ipynb b/notebooks/Linear Regression/LR_7_2.ipynb
index a868167..3801238 100644
--- a/notebooks/Linear Regression/LR_7_2.ipynb	
+++ b/notebooks/Linear Regression/LR_7_2.ipynb	
@@ -29,7 +29,9 @@
    "cell_type": "code",
    "execution_count": 5,
    "id": "a76946c6-bb24-4032-9b40-35a2303dec27",
-   "metadata": {},
+   "metadata": {
+    "scrolled": true
+   },
    "outputs": [
     {
      "name": "stdout",
@@ -53,6 +55,14 @@
     "print(werbung.head())"
    ]
   },
+  {
+   "cell_type": "markdown",
+   "id": "c83160ba-4388-46e2-9655-94a97ddfc42f",
+   "metadata": {},
+   "source": [
+    "Wir ermitteln den $ R^{2} $-Wert zuerst für das lineare Regressionsmodell mit den Prädiktorvariablen `TV`, `Radio` und `Zeitung`:"
+   ]
+  },
   {
    "cell_type": "code",
    "execution_count": 6,
@@ -152,6 +162,14 @@
     "print(\"R²:\", r2)"
    ]
   },
+  {
+   "cell_type": "markdown",
+   "id": "67580aab-6f1d-47ac-bace-3212033a0e40",
+   "metadata": {},
+   "source": [
+    "Nun bestimmen wir den $R^2$ Wert für das lineare Regressionsmodell mit den Prädiktorvariablen `TV` und `Radio`:"
+   ]
+  },
   {
    "cell_type": "code",
    "execution_count": 9,
@@ -249,6 +267,22 @@
     "r2 = 1 - (ss_residual / ss_total)\n",
     "print(\"R²:\", r2)"
    ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "c52232c9-90eb-4fed-ae84-35b29d30f6c6",
+   "metadata": {},
+   "source": [
+    "Die beiden Modelle haben beinahe den identischen $R^2$-Wert, d.h., wir können auf die Prädiktorvariable `Zeitung` ohne Einbusse an der Güte des Modells verzichten."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "d07bbeb8-05d2-4e61-a806-b9dbce147722",
+   "metadata": {},
+   "outputs": [],
+   "source": []
   }
  ],
  "metadata": {
-- 
GitLab