diff --git a/doc/pub/week35/html/week35-bs.html b/doc/pub/week35/html/week35-bs.html
index d51303b66..e9bf66d4e 100644
--- a/doc/pub/week35/html/week35-bs.html
+++ b/doc/pub/week35/html/week35-bs.html
@@ -374,7 +374,7 @@ MathJax.Hub.Config({
[2] Department of Physics and Astronomy and National Superconducting Cyclotron Laboratory, Michigan State University
-
Sep 2, 2021
+Sep 3, 2021
diff --git a/doc/pub/week35/html/week35-reveal.html b/doc/pub/week35/html/week35-reveal.html
index 6dac064c5..b73fa4832 100644
--- a/doc/pub/week35/html/week35-reveal.html
+++ b/doc/pub/week35/html/week35-reveal.html
@@ -148,7 +148,7 @@ MathJax.Hub.Config({
[2] Department of Physics and Astronomy and National Superconducting Cyclotron Laboratory, Michigan State University
-
Sep 2, 2021
+Sep 3, 2021
@@ -162,9 +162,9 @@ MathJax.Hub.Config({
Plans for week 35, August 30 -September 3
-- Thursday: Review of ordinary Least Squares with applications and discussion of Ridge Regression
+- Thursday: Review of ordinary Least Squares with applications and discussion of Ridge Regression and Singular Value Decomposition
- Video of lecture Thursday.
-- Friday: Analysis of Ridge and Lasso Regression
+- Friday: Analysis of Ridge and Lasso Regression and links with Singular Value Decomposition
@@ -1972,7 +1972,7 @@ If you wish to include the zero singular values, you will need to resize the mat
Video of Lecture from 2020 and handwritten notes
-More material will be added here, see handwritten notes also.
+More material will be added here, see handwritten notes also. Note that this material will be cleaned up after the lecture of Friday September 3. See the handwritten notes from Friday's lecture at https://github.com/CompPhysics/MachineLearning/tree/master/doc/HandWrittenNotes/2021.
diff --git a/doc/pub/week35/html/week35-solarized.html b/doc/pub/week35/html/week35-solarized.html
index a73ad2ca8..1c55e0e31 100644
--- a/doc/pub/week35/html/week35-solarized.html
+++ b/doc/pub/week35/html/week35-solarized.html
@@ -300,7 +300,7 @@ MathJax.Hub.Config({
[2] Department of Physics and Astronomy and National Superconducting Cyclotron Laboratory, Michigan State University
-
Sep 2, 2021
+Sep 3, 2021
@@ -308,9 +308,9 @@ MathJax.Hub.Config({
Plans for week 35, August 30 -September 3
-- Thursday: Review of ordinary Least Squares with applications and discussion of Ridge Regression
+- Thursday: Review of ordinary Least Squares with applications and discussion of Ridge Regression and Singular Value Decomposition
- Video of lecture Thursday.
-- Friday: Analysis of Ridge and Lasso Regression
+- Friday: Analysis of Ridge and Lasso Regression and links with Singular Value Decomposition
@@ -2032,7 +2032,7 @@ If you wish to include the zero singular values, you will need to resize the mat
Video of Lecture from 2020 and handwritten notes
-More material will be added here, see handwritten notes also.
+More material will be added here, see handwritten notes also. Note that this material will be cleaned up after the lecture of Friday September 3. See the handwritten notes from Friday's lecture at https://github.com/CompPhysics/MachineLearning/tree/master/doc/HandWrittenNotes/2021.
diff --git a/doc/pub/week35/html/week35.html b/doc/pub/week35/html/week35.html
index d238835b5..3b8ae81f9 100644
--- a/doc/pub/week35/html/week35.html
+++ b/doc/pub/week35/html/week35.html
@@ -305,7 +305,7 @@ MathJax.Hub.Config({
[2] Department of Physics and Astronomy and National Superconducting Cyclotron Laboratory, Michigan State University
-
Sep 2, 2021
+Sep 3, 2021
@@ -313,9 +313,9 @@ MathJax.Hub.Config({
Plans for week 35, August 30 -September 3
-- Thursday: Review of ordinary Least Squares with applications and discussion of Ridge Regression
+- Thursday: Review of ordinary Least Squares with applications and discussion of Ridge Regression and Singular Value Decomposition
- Video of lecture Thursday.
-- Friday: Analysis of Ridge and Lasso Regression
+- Friday: Analysis of Ridge and Lasso Regression and links with Singular Value Decomposition
@@ -2037,7 +2037,7 @@ If you wish to include the zero singular values, you will need to resize the mat
Video of Lecture from 2020 and handwritten notes
-More material will be added here, see handwritten notes also.
+More material will be added here, see handwritten notes also. Note that this material will be cleaned up after the lecture of Friday September 3. See the handwritten notes from Friday's lecture at https://github.com/CompPhysics/MachineLearning/tree/master/doc/HandWrittenNotes/2021.
diff --git a/doc/pub/week35/ipynb/ipynb-week35-src.tar.gz b/doc/pub/week35/ipynb/ipynb-week35-src.tar.gz
index 112a26988..c6218905a 100644
Binary files a/doc/pub/week35/ipynb/ipynb-week35-src.tar.gz and b/doc/pub/week35/ipynb/ipynb-week35-src.tar.gz differ
diff --git a/doc/pub/week35/ipynb/week35.ipynb b/doc/pub/week35/ipynb/week35.ipynb
index de001d307..1ea40642f 100644
--- a/doc/pub/week35/ipynb/week35.ipynb
+++ b/doc/pub/week35/ipynb/week35.ipynb
@@ -10,7 +10,7 @@
" \n",
"**Morten Hjorth-Jensen**, Department of Physics, University of Oslo and Department of Physics and Astronomy and National Superconducting Cyclotron Laboratory, Michigan State University\n",
"\n",
- "Date: **Sep 2, 2021**\n",
+ "Date: **Sep 3, 2021**\n",
"\n",
"Copyright 1999-2021, Morten Hjorth-Jensen. Released under CC Attribution-NonCommercial 4.0 license\n",
"\n",
@@ -19,11 +19,11 @@
"\n",
"## Plans for week 35, August 30 -September 3\n",
"\n",
- "* Thursday: Review of ordinary Least Squares with applications and discussion of Ridge Regression\n",
+ "* Thursday: Review of ordinary Least Squares with applications and discussion of Ridge Regression and Singular Value Decomposition\n",
"\n",
"* [Video of lecture Thursday](https://www.uio.no/studier/emner/matnat/fys/FYS-STK3155/h21/forelesningsvideoer/LectureSeptember2.mp4?vrtx=view-as-webpage).\n",
"\n",
- "* Friday: Analysis of Ridge and Lasso Regression\n",
+ "* Friday: Analysis of Ridge and Lasso Regression and links with Singular Value Decomposition\n",
"\n",
"## Thursday September 2\n",
"\n",
@@ -400,7 +400,10 @@
{
"cell_type": "code",
"execution_count": null,
- "metadata": {},
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
"outputs": [],
"source": [
"%matplotlib inline\n",
@@ -943,7 +946,10 @@
{
"cell_type": "code",
"execution_count": null,
- "metadata": {},
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
"outputs": [],
"source": [
"# matrix inversion to find beta\n",
@@ -962,7 +968,10 @@
{
"cell_type": "code",
"execution_count": null,
- "metadata": {},
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
"outputs": [],
"source": [
"fit = np.linalg.lstsq(X, Energies, rcond =None)[0]\n",
@@ -979,7 +988,10 @@
{
"cell_type": "code",
"execution_count": null,
- "metadata": {},
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
"outputs": [],
"source": [
"Masses['Eapprox'] = ytilde\n",
@@ -1009,7 +1021,10 @@
{
"cell_type": "code",
"execution_count": null,
- "metadata": {},
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
"outputs": [],
"source": [
"def R2(y_data, y_model):\n",
@@ -1026,7 +1041,10 @@
{
"cell_type": "code",
"execution_count": null,
- "metadata": {},
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
"outputs": [],
"source": [
"print(R2(Energies,ytilde))"
@@ -1042,7 +1060,10 @@
{
"cell_type": "code",
"execution_count": null,
- "metadata": {},
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
"outputs": [],
"source": [
"def MSE(y_data,y_model):\n",
@@ -1062,7 +1083,10 @@
{
"cell_type": "code",
"execution_count": null,
- "metadata": {},
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
"outputs": [],
"source": [
"def RelativeError(y_data,y_model):\n",
@@ -1097,7 +1121,10 @@
{
"cell_type": "code",
"execution_count": null,
- "metadata": {},
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
"outputs": [],
"source": [
"import os\n",
@@ -1150,7 +1177,10 @@
{
"cell_type": "code",
"execution_count": null,
- "metadata": {},
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
"outputs": [],
"source": [
"# equivalently in numpy\n",
@@ -1222,7 +1252,10 @@
{
"cell_type": "code",
"execution_count": null,
- "metadata": {},
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
"outputs": [],
"source": [
"import numpy as np\n",
@@ -1242,7 +1275,10 @@
{
"cell_type": "code",
"execution_count": null,
- "metadata": {},
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
"outputs": [],
"source": [
"from sklearn.datasets import load_boston\n",
@@ -1264,7 +1300,10 @@
{
"cell_type": "code",
"execution_count": null,
- "metadata": {},
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
"outputs": [],
"source": [
"boston = pd.DataFrame(boston_dataset.data, columns=boston_dataset.feature_names)\n",
@@ -1282,7 +1321,10 @@
{
"cell_type": "code",
"execution_count": null,
- "metadata": {},
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
"outputs": [],
"source": [
"# check for missing values in all the columns\n",
@@ -1299,7 +1341,10 @@
{
"cell_type": "code",
"execution_count": null,
- "metadata": {},
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
"outputs": [],
"source": [
"# set the size of the figure\n",
@@ -1320,7 +1365,10 @@
{
"cell_type": "code",
"execution_count": null,
- "metadata": {},
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
"outputs": [],
"source": [
"# compute the pair wise correlation for all columns \n",
@@ -1340,7 +1388,10 @@
{
"cell_type": "code",
"execution_count": null,
- "metadata": {},
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
"outputs": [],
"source": [
"plt.figure(figsize=(20, 5))\n",
@@ -1368,7 +1419,10 @@
{
"cell_type": "code",
"execution_count": null,
- "metadata": {},
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
"outputs": [],
"source": [
"X = pd.DataFrame(np.c_[boston['LSTAT'], boston['RM']], columns = ['LSTAT','RM'])\n",
@@ -1385,7 +1439,10 @@
{
"cell_type": "code",
"execution_count": null,
- "metadata": {},
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
"outputs": [],
"source": [
"from sklearn.model_selection import train_test_split\n",
@@ -1409,7 +1466,10 @@
{
"cell_type": "code",
"execution_count": null,
- "metadata": {},
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
"outputs": [],
"source": [
"from sklearn.linear_model import LinearRegression\n",
@@ -1448,7 +1508,10 @@
{
"cell_type": "code",
"execution_count": null,
- "metadata": {},
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
"outputs": [],
"source": [
"# plotting the y_test vs y_pred\n",
@@ -1575,418 +1638,12 @@
},
{
"cell_type": "code",
- "execution_count": 25,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "
\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " | \n",
- " 0 | \n",
- " 1 | \n",
- " 2 | \n",
- " 3 | \n",
- " 4 | \n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " | 0 | \n",
- " -1.749765 | \n",
- " 0.342680 | \n",
- " 1.153036 | \n",
- " -0.252436 | \n",
- " 0.981321 | \n",
- "
\n",
- " \n",
- " | 1 | \n",
- " 0.514219 | \n",
- " 0.221180 | \n",
- " -1.070043 | \n",
- " -0.189496 | \n",
- " 0.255001 | \n",
- "
\n",
- " \n",
- " | 2 | \n",
- " -0.458027 | \n",
- " 0.435163 | \n",
- " -0.583595 | \n",
- " 0.816847 | \n",
- " 0.672721 | \n",
- "
\n",
- " \n",
- " | 3 | \n",
- " -0.104411 | \n",
- " -0.531280 | \n",
- " 1.029733 | \n",
- " -0.438136 | \n",
- " -1.118318 | \n",
- "
\n",
- " \n",
- " | 4 | \n",
- " 1.618982 | \n",
- " 1.541605 | \n",
- " -0.251879 | \n",
- " -0.842436 | \n",
- " 0.184519 | \n",
- "
\n",
- " \n",
- " | 5 | \n",
- " 0.937082 | \n",
- " 0.731000 | \n",
- " 1.361556 | \n",
- " -0.326238 | \n",
- " 0.055676 | \n",
- "
\n",
- " \n",
- " | 6 | \n",
- " 0.222400 | \n",
- " -1.443217 | \n",
- " -0.756352 | \n",
- " 0.816454 | \n",
- " 0.750445 | \n",
- "
\n",
- " \n",
- " | 7 | \n",
- " -0.455947 | \n",
- " 1.189622 | \n",
- " -1.690617 | \n",
- " -1.356399 | \n",
- " -1.232435 | \n",
- "
\n",
- " \n",
- " | 8 | \n",
- " -0.544439 | \n",
- " -0.668172 | \n",
- " 0.007315 | \n",
- " -0.612939 | \n",
- " 1.299748 | \n",
- "
\n",
- " \n",
- " | 9 | \n",
- " -1.733096 | \n",
- " -0.983310 | \n",
- " 0.357508 | \n",
- " -1.613579 | \n",
- " 1.470714 | \n",
- "
\n",
- " \n",
- "
\n",
- "
"
- ],
- "text/plain": [
- " 0 1 2 3 4\n",
- "0 -1.749765 0.342680 1.153036 -0.252436 0.981321\n",
- "1 0.514219 0.221180 -1.070043 -0.189496 0.255001\n",
- "2 -0.458027 0.435163 -0.583595 0.816847 0.672721\n",
- "3 -0.104411 -0.531280 1.029733 -0.438136 -1.118318\n",
- "4 1.618982 1.541605 -0.251879 -0.842436 0.184519\n",
- "5 0.937082 0.731000 1.361556 -0.326238 0.055676\n",
- "6 0.222400 -1.443217 -0.756352 0.816454 0.750445\n",
- "7 -0.455947 1.189622 -1.690617 -1.356399 -1.232435\n",
- "8 -0.544439 -0.668172 0.007315 -0.612939 1.299748\n",
- "9 -1.733096 -0.983310 0.357508 -1.613579 1.470714"
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "0 -0.175300\n",
- "1 0.083527\n",
- "2 -0.044334\n",
- "3 -0.399836\n",
- "4 0.331939\n",
- "dtype: float64\n",
- "0 1.069584\n",
- "1 0.965548\n",
- "2 1.018232\n",
- "3 0.793167\n",
- "4 0.918992\n",
- "dtype: float64\n"
- ]
- },
- {
- "data": {
- "text/html": [
- "\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " | \n",
- " 0 | \n",
- " 1 | \n",
- " 2 | \n",
- " 3 | \n",
- " 4 | \n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " | 0 | \n",
- " -1.574465 | \n",
- " 0.259153 | \n",
- " 1.197370 | \n",
- " 0.147400 | \n",
- " 0.649382 | \n",
- "
\n",
- " \n",
- " | 1 | \n",
- " 0.689519 | \n",
- " 0.137652 | \n",
- " -1.025709 | \n",
- " 0.210340 | \n",
- " -0.076938 | \n",
- "
\n",
- " \n",
- " | 2 | \n",
- " -0.282727 | \n",
- " 0.351636 | \n",
- " -0.539261 | \n",
- " 1.216683 | \n",
- " 0.340782 | \n",
- "
\n",
- " \n",
- " | 3 | \n",
- " 0.070889 | \n",
- " -0.614808 | \n",
- " 1.074067 | \n",
- " -0.038300 | \n",
- " -1.450257 | \n",
- "
\n",
- " \n",
- " | 4 | \n",
- " 1.794282 | \n",
- " 1.458078 | \n",
- " -0.207545 | \n",
- " -0.442600 | \n",
- " -0.147420 | \n",
- "
\n",
- " \n",
- " | 5 | \n",
- " 1.112383 | \n",
- " 0.647473 | \n",
- " 1.405890 | \n",
- " 0.073598 | \n",
- " -0.276263 | \n",
- "
\n",
- " \n",
- " | 6 | \n",
- " 0.397700 | \n",
- " -1.526744 | \n",
- " -0.712018 | \n",
- " 1.216290 | \n",
- " 0.418506 | \n",
- "
\n",
- " \n",
- " | 7 | \n",
- " -0.280647 | \n",
- " 1.106095 | \n",
- " -1.646283 | \n",
- " -0.956563 | \n",
- " -1.564374 | \n",
- "
\n",
- " \n",
- " | 8 | \n",
- " -0.369139 | \n",
- " -0.751699 | \n",
- " 0.051649 | \n",
- " -0.213103 | \n",
- " 0.967809 | \n",
- "
\n",
- " \n",
- " | 9 | \n",
- " -1.557795 | \n",
- " -1.066837 | \n",
- " 0.401842 | \n",
- " -1.213743 | \n",
- " 1.138775 | \n",
- "
\n",
- " \n",
- "
\n",
- "
"
- ],
- "text/plain": [
- " 0 1 2 3 4\n",
- "0 -1.574465 0.259153 1.197370 0.147400 0.649382\n",
- "1 0.689519 0.137652 -1.025709 0.210340 -0.076938\n",
- "2 -0.282727 0.351636 -0.539261 1.216683 0.340782\n",
- "3 0.070889 -0.614808 1.074067 -0.038300 -1.450257\n",
- "4 1.794282 1.458078 -0.207545 -0.442600 -0.147420\n",
- "5 1.112383 0.647473 1.405890 0.073598 -0.276263\n",
- "6 0.397700 -1.526744 -0.712018 1.216290 0.418506\n",
- "7 -0.280647 1.106095 -1.646283 -0.956563 -1.564374\n",
- "8 -0.369139 -0.751699 0.051649 -0.213103 0.967809\n",
- "9 -1.557795 -1.066837 0.401842 -1.213743 1.138775"
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "text/html": [
- "\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " | \n",
- " 0 | \n",
- " 1 | \n",
- " 2 | \n",
- " 3 | \n",
- " 4 | \n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " | 0 | \n",
- " 0.0 | \n",
- " 0.0 | \n",
- " 0.0 | \n",
- " 0.0 | \n",
- " 0.0 | \n",
- "
\n",
- " \n",
- " | 1 | \n",
- " 0.0 | \n",
- " 0.0 | \n",
- " 0.0 | \n",
- " 0.0 | \n",
- " 0.0 | \n",
- "
\n",
- " \n",
- " | 2 | \n",
- " 0.0 | \n",
- " 0.0 | \n",
- " 0.0 | \n",
- " 0.0 | \n",
- " 0.0 | \n",
- "
\n",
- " \n",
- " | 3 | \n",
- " 0.0 | \n",
- " 0.0 | \n",
- " 0.0 | \n",
- " 0.0 | \n",
- " 0.0 | \n",
- "
\n",
- " \n",
- " | 4 | \n",
- " 0.0 | \n",
- " 0.0 | \n",
- " 0.0 | \n",
- " 0.0 | \n",
- " 0.0 | \n",
- "
\n",
- " \n",
- " | 5 | \n",
- " 0.0 | \n",
- " 0.0 | \n",
- " 0.0 | \n",
- " 0.0 | \n",
- " 0.0 | \n",
- "
\n",
- " \n",
- " | 6 | \n",
- " 0.0 | \n",
- " 0.0 | \n",
- " 0.0 | \n",
- " 0.0 | \n",
- " 0.0 | \n",
- "
\n",
- " \n",
- " | 7 | \n",
- " 0.0 | \n",
- " 0.0 | \n",
- " 0.0 | \n",
- " 0.0 | \n",
- " 0.0 | \n",
- "
\n",
- " \n",
- " | 8 | \n",
- " 0.0 | \n",
- " 0.0 | \n",
- " 0.0 | \n",
- " 0.0 | \n",
- " 0.0 | \n",
- "
\n",
- " \n",
- " | 9 | \n",
- " 0.0 | \n",
- " 0.0 | \n",
- " 0.0 | \n",
- " 0.0 | \n",
- " 0.0 | \n",
- "
\n",
- " \n",
- "
\n",
- "
"
- ],
- "text/plain": [
- " 0 1 2 3 4\n",
- "0 0.0 0.0 0.0 0.0 0.0\n",
- "1 0.0 0.0 0.0 0.0 0.0\n",
- "2 0.0 0.0 0.0 0.0 0.0\n",
- "3 0.0 0.0 0.0 0.0 0.0\n",
- "4 0.0 0.0 0.0 0.0 0.0\n",
- "5 0.0 0.0 0.0 0.0 0.0\n",
- "6 0.0 0.0 0.0 0.0 0.0\n",
- "7 0.0 0.0 0.0 0.0 0.0\n",
- "8 0.0 0.0 0.0 0.0 0.0\n",
- "9 0.0 0.0 0.0 0.0 0.0"
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- }
- ],
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
"source": [
"import sklearn.linear_model as skl\n",
"from sklearn.metrics import mean_squared_error\n",
@@ -2055,7 +1712,10 @@
{
"cell_type": "code",
"execution_count": null,
- "metadata": {},
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
"outputs": [],
"source": [
"np.random.seed()\n",
@@ -2078,7 +1738,10 @@
{
"cell_type": "code",
"execution_count": null,
- "metadata": {},
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
@@ -2129,7 +1792,10 @@
{
"cell_type": "code",
"execution_count": null,
- "metadata": {},
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
"outputs": [],
"source": [
"# Common imports\n",
@@ -2692,7 +2358,10 @@
{
"cell_type": "code",
"execution_count": null,
- "metadata": {},
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
"outputs": [],
"source": [
"import numpy as np\n",
@@ -2762,7 +2431,7 @@
"\n",
"[Video of Lecture from 2020](https://www.uio.no/studier/emner/matnat/fys/FYS-STK4155/h20/forelesningsvideoer/LectureSeptember11.mp4?vrtx=view-as-webpage) and [handwritten notes](https://github.com/CompPhysics/MachineLearning/blob/master/doc/HandWrittenNotes/NotesSeptember11.pdf)\n",
"\n",
- "More material will be added here, see handwritten notes also.\n",
+ "More material will be added here, see handwritten notes also. Note that this material will be cleaned up after the lecture of Friday September 3. See the handwritten notes from Friday's lecture at .\n",
"\n",
"\n",
"## Ridge and LASSO Regression\n",
@@ -3393,20 +3062,12 @@
},
{
"cell_type": "code",
- "execution_count": 26,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "-0.22501987939529708\n",
- "3.4265364730355325\n",
- "[[1.06251574 3.06513214]\n",
- " [3.06513214 9.90295583]]\n"
- ]
- }
- ],
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
"source": [
"# Importing various packages\n",
"import numpy as np\n",
@@ -3435,20 +3096,12 @@
},
{
"cell_type": "code",
- "execution_count": 27,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "0.080263294546264\n",
- "2.011002230765845\n",
- "[[1. 0.7136592]\n",
- " [0.7136592 1. ]]\n"
- ]
- }
- ],
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
"source": [
"import numpy as np\n",
"n = 100\n",
@@ -3490,40 +3143,12 @@
},
{
"cell_type": "code",
- "execution_count": 28,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "[[-0.31787985 -1.14338084]\n",
- " [ 0.04529807 -0.18207237]\n",
- " [ 1.11176315 3.45031813]\n",
- " [-1.91097714 -5.2907413 ]\n",
- " [-0.19918861 1.18654759]\n",
- " [ 0.84454053 2.34712647]\n",
- " [ 0.82299467 1.93582947]\n",
- " [-1.64434822 -5.13289015]\n",
- " [ 1.10923753 3.75337971]\n",
- " [ 0.13855987 -0.92411672]]\n",
- " 0 1\n",
- "0 -0.317880 -1.143381\n",
- "1 0.045298 -0.182072\n",
- "2 1.111763 3.450318\n",
- "3 -1.910977 -5.290741\n",
- "4 -0.199189 1.186548\n",
- "5 0.844541 2.347126\n",
- "6 0.822995 1.935829\n",
- "7 -1.644348 -5.132890\n",
- "8 1.109238 3.753380\n",
- "9 0.138560 -0.924117\n",
- " 0 1\n",
- "0 1.000000 0.968568\n",
- "1 0.968568 1.000000\n"
- ]
- }
- ],
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
"source": [
"import numpy as np\n",
"import pandas as pd\n",
@@ -3551,49 +3176,12 @@
},
{
"cell_type": "code",
- "execution_count": 29,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- " 0 1 2 3 4 5 6 7 \\\n",
- "0 0.0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 \n",
- "1 0.0 0.063613 0.068251 0.071169 0.070546 0.069425 0.067581 0.065899 \n",
- "2 0.0 0.068251 0.073991 0.077286 0.077098 0.076290 0.073977 0.072493 \n",
- "3 0.0 0.071169 0.077286 0.083456 0.083469 0.082851 0.081789 0.080312 \n",
- "4 0.0 0.070546 0.077098 0.083469 0.083869 0.083597 0.082364 0.081188 \n",
- "5 0.0 0.069425 0.076290 0.082851 0.083597 0.083643 0.082304 0.081413 \n",
- "6 0.0 0.067581 0.073977 0.081789 0.082364 0.082304 0.082005 0.080988 \n",
- "7 0.0 0.065899 0.072493 0.080312 0.081188 0.081413 0.080988 0.080245 \n",
- "8 0.0 0.064203 0.070945 0.078766 0.079908 0.080389 0.079865 0.079371 \n",
- "9 0.0 0.062545 0.069397 0.077214 0.078591 0.079301 0.078699 0.078431 \n",
- "10 0.0 0.061809 0.068087 0.076517 0.077496 0.077870 0.078063 0.077474 \n",
- "11 0.0 0.060077 0.066459 0.074794 0.076005 0.076605 0.076675 0.076314 \n",
- "12 0.0 0.058442 0.064904 0.073149 0.074564 0.075366 0.075332 0.075177 \n",
- "13 0.0 0.056909 0.063432 0.071590 0.073188 0.074169 0.074047 0.074077 \n",
- "14 0.0 0.055478 0.062046 0.070123 0.071881 0.073022 0.072826 0.073022 \n",
- "\n",
- " 8 9 10 11 12 13 14 \n",
- "0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 \n",
- "1 0.064203 0.062545 0.061809 0.060077 0.058442 0.056909 0.055478 \n",
- "2 0.070945 0.069397 0.068087 0.066459 0.064904 0.063432 0.062046 \n",
- "3 0.078766 0.077214 0.076517 0.074794 0.073149 0.071590 0.070123 \n",
- "4 0.079908 0.078591 0.077496 0.076005 0.074564 0.073188 0.071881 \n",
- "5 0.080389 0.079301 0.077870 0.076605 0.075366 0.074169 0.073022 \n",
- "6 0.079865 0.078699 0.078063 0.076675 0.075332 0.074047 0.072826 \n",
- "7 0.079371 0.078431 0.077474 0.076314 0.075177 0.074077 0.073022 \n",
- "8 0.078726 0.077994 0.076758 0.075809 0.074861 0.073933 0.073033 \n",
- "9 0.077994 0.077452 0.075974 0.075216 0.074443 0.073672 0.072915 \n",
- "10 0.076758 0.075974 0.075342 0.074315 0.073305 0.072325 0.071384 \n",
- "11 0.075809 0.075216 0.074315 0.073486 0.072655 0.071838 0.071044 \n",
- "12 0.074861 0.074443 0.073305 0.072655 0.071987 0.071318 0.070658 \n",
- "13 0.073933 0.073672 0.072325 0.071838 0.071318 0.070783 0.070245 \n",
- "14 0.073033 0.072915 0.071384 0.071044 0.070658 0.070245 0.069818 \n"
- ]
- }
- ],
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
+ "outputs": [],
"source": [
"# Common imports\n",
"import numpy as np\n",
@@ -3883,7 +3471,10 @@
{
"cell_type": "code",
"execution_count": null,
- "metadata": {},
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
"outputs": [],
"source": [
"x = np.random.rand(100)\n",
@@ -3905,7 +3496,10 @@
{
"cell_type": "code",
"execution_count": null,
- "metadata": {},
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
"outputs": [],
"source": [
"import os\n",
@@ -4100,7 +3694,10 @@
{
"cell_type": "code",
"execution_count": null,
- "metadata": {},
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
"outputs": [],
"source": [
"from mpl_toolkits.mplot3d import Axes3D\n",
@@ -4218,7 +3815,10 @@
{
"cell_type": "code",
"execution_count": null,
- "metadata": {},
+ "metadata": {
+ "collapsed": false,
+ "editable": true
+ },
"outputs": [],
"source": [
"def FrankeFunction(x,y):\n",
@@ -4276,25 +3876,7 @@
]
}
],
- "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.8.5"
- }
- },
+ "metadata": {},
"nbformat": 4,
"nbformat_minor": 4
}
diff --git a/doc/src/week35/week35.do.txt b/doc/src/week35/week35.do.txt
index 16b47061b..13bb7abf1 100644
--- a/doc/src/week35/week35.do.txt
+++ b/doc/src/week35/week35.do.txt
@@ -6,10 +6,10 @@ DATE: today
!split
===== Plans for week 35, August 30 -September 3 =====
-* Thursday: Review of ordinary Least Squares with applications and discussion of Ridge Regression
+* Thursday: Review of ordinary Least Squares with applications and discussion of Ridge Regression and Singular Value Decomposition
* "Video of lecture Thursday":"https://www.uio.no/studier/emner/matnat/fys/FYS-STK3155/h21/forelesningsvideoer/LectureSeptember2.mp4?vrtx=view-as-webpage".
-* Friday: Analysis of Ridge and Lasso Regression
+* Friday: Analysis of Ridge and Lasso Regression and links with Singular Value Decomposition
@@ -1544,7 +1544,7 @@ If you wish to include the zero singular values, you will need to resize the mat
"Video of Lecture from 2020":"https://www.uio.no/studier/emner/matnat/fys/FYS-STK4155/h20/forelesningsvideoer/LectureSeptember11.mp4?vrtx=view-as-webpage" and "handwritten notes":"https://github.com/CompPhysics/MachineLearning/blob/master/doc/HandWrittenNotes/NotesSeptember11.pdf"
-More material will be added here, see handwritten notes also.
+More material will be added here, see handwritten notes also. Note that this material will be cleaned up after the lecture of Friday September 3. See the handwritten notes from Friday's lecture at URL:"https://github.com/CompPhysics/MachineLearning/tree/master/doc/HandWrittenNotes/2021".
!split