Created using Colaboratory
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
"metadata": {
|
"metadata": {
|
||||||
"colab": {
|
"colab": {
|
||||||
"provenance": [],
|
"provenance": [],
|
||||||
"authorship_tag": "ABX9TyMaBcw5e/SBWZVAXWbs5YSn",
|
"authorship_tag": "ABX9TyM+98aMABiK5vNFFYAwiPiL",
|
||||||
"include_colab_link": true
|
"include_colab_link": true
|
||||||
},
|
},
|
||||||
"kernelspec": {
|
"kernelspec": {
|
||||||
@@ -301,8 +301,9 @@
|
|||||||
"source": [
|
"source": [
|
||||||
"# Least squares function\n",
|
"# Least squares function\n",
|
||||||
"def least_squares_loss(y_train, y_predict):\n",
|
"def least_squares_loss(y_train, y_predict):\n",
|
||||||
" # TODO Replace the line below to use compute the sum of squared\n",
|
" # TODO Replace the line below to compute the sum of squared\n",
|
||||||
" # differences between the real and predicted values of y\n",
|
" # differences between the real values of y and the predicted values from the model f[x_i,phi]\n",
|
||||||
|
" # (see figure 2.2 of the book)\n",
|
||||||
" # you will need to use the function np.sum\n",
|
" # you will need to use the function np.sum\n",
|
||||||
" loss = 0\n",
|
" loss = 0\n",
|
||||||
"\n",
|
"\n",
|
||||||
|
|||||||
Reference in New Issue
Block a user