From e2bc1883ab7477fe15e6dc429a5f84940a61924a Mon Sep 17 00:00:00 2001 From: Morten Hjorth-Jensen Date: Wed, 10 Sep 2025 06:48:35 +0200 Subject: [PATCH] Update week37.ipynb --- doc/pub/week37/ipynb/week37.ipynb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/pub/week37/ipynb/week37.ipynb b/doc/pub/week37/ipynb/week37.ipynb index 93dd115a2..943b10a1d 100644 --- a/doc/pub/week37/ipynb/week37.ipynb +++ b/doc/pub/week37/ipynb/week37.ipynb @@ -3518,7 +3518,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 10, "id": "2ed0cafc", "metadata": { "collapsed": false, @@ -3627,7 +3627,7 @@ "y_offset = np.average(y, axis=0)\n", "X_offset = np.average(X, axis=0)\n", "\n", - "theta = fit_theta(X - X_offset, y)# - y_offset)\n", + "theta = fit_theta(X - X_offset, y)#-y_offset)\n", "intercept = np.mean(y_offset - X_offset @ theta)\n", "\n", "print(f\"Manual intercept: {intercept}\")\n", @@ -3745,7 +3745,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 11, "id": "4f9b1fa0", "metadata": { "collapsed": false, @@ -3943,7 +3943,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 12, "id": "a731e32c", "metadata": { "collapsed": false, @@ -4109,6 +4109,7 @@ "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)\n", "\n", "#For our own implementation, we will need to deal with the intercept by centering the design matrix and the target variable\n", + "\n", "X_train_mean = np.mean(X_train,axis=0)\n", "#Center by removing mean from each feature\n", "X_train_scaled = X_train - X_train_mean \n",