Skip to content

Commit

Permalink
Created using Colaboratory
Browse files Browse the repository at this point in the history
  • Loading branch information
udlbook committed Dec 24, 2023
1 parent 0748270 commit b9ec83d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions Notebooks/Chap08/8_2_Bias_Variance_Trade_Off.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"metadata": {
"colab": {
"provenance": [],
"authorship_tag": "ABX9TyPz1B8kFc21JvGTDwqniloA",
"include_colab_link": true
},
"kernelspec": {
Expand Down Expand Up @@ -185,10 +184,8 @@
" if A[i,j] < 0:\n",
" A[i,j] = 0;\n",
"\n",
" ATA = np.matmul(np.transpose(A), A)\n",
" ATAInv = np.linalg.inv(ATA)\n",
" ATAInvAT = np.matmul(ATAInv, np.transpose(A))\n",
" beta_omega = np.matmul(ATAInvAT,y)\n",
" beta_omega = np.linalg.lstsq(A, y, rcond=None)[0]\n",
"\n",
" beta = beta_omega[0]\n",
" omega = beta_omega[1:]\n",
"\n",
Expand Down

0 comments on commit b9ec83d

Please sign in to comment.