Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a4a742e

Browse files
authored
Merge branch 'dylewsky:master' into master
2 parents a247fb8 + ca8091d commit a4a742e

28 files changed

+116
-116
lines changed

CH01/CH01_SEC04_1_Linear.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@
2929
"a = a.reshape(-1, 1)\n",
3030
"b = x*a + np.random.randn(*a.shape) # Add noise\n",
3131
"\n",
32-
"plt.plot(a, x*a, Color='k', LineWidth=2, label='True line') # True relationship\n",
33-
"plt.plot(a, b, 'x', Color='r', MarkerSize = 10, label='Noisy data') # Noisy measurements\n",
32+
"plt.plot(a, x*a, color='k', linewidth=2, label='True line') # True relationship\n",
33+
"plt.plot(a, b, 'x', color='r', MarkerSize = 10, label='Noisy data') # Noisy measurements\n",
3434
"\n",
3535
"U, S, VT = np.linalg.svd(a,full_matrices=False)\n",
3636
"xtilde = VT.T @ np.linalg.inv(np.diag(S)) @ U.T @ b # Least-square fit\n",
3737
"\n",
38-
"plt.plot(a,xtilde * a,'--',Color='b',LineWidth=4, label='Regression line')\n",
38+
"plt.plot(a,xtilde * a,'--',color='b',linewidth=4, label='Regression line')\n",
3939
"\n",
4040
"plt.xlabel('a')\n",
4141
"plt.ylabel('b')\n",

CH01/CH01_SEC04_2_Cement.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
"U, S, VT = np.linalg.svd(A,full_matrices=0)\n",
3434
"x = VT.T @ np.linalg.inv(np.diag(S)) @ U.T @ b\n",
3535
"\n",
36-
"plt.plot(b, Color='k', LineWidth=2, label='Heat Data') # True relationship\n",
37-
"plt.plot(A@x, '-o', Color='r', LineWidth=1.5, MarkerSize=6, label='Regression')\n",
36+
"plt.plot(b, color='k', linewidth=2, label='Heat Data') # True relationship\n",
37+
"plt.plot(A@x, '-o', color='r', linewidth=1.5, markersize=6, label='Regression')\n",
3838
"plt.legend()\n",
3939
"plt.show()"
4040
]

CH01/CH01_SEC04_3_Housing.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,16 @@
4242
"fig = plt.figure()\n",
4343
"ax1 = fig.add_subplot(121)\n",
4444
"\n",
45-
"plt.plot(b, Color='k', LineWidth=2, label='Housing Value') # True relationship\n",
46-
"plt.plot(A@x, '-o', Color='r', LineWidth=1.5, MarkerSize=6, label='Regression')\n",
45+
"plt.plot(b, color='k', linewidth=2, label='Housing Value') # True relationship\n",
46+
"plt.plot(A@x, '-o', color='r', linewidth=1.5, markersize=6, label='Regression')\n",
4747
"plt.xlabel('Neighborhood')\n",
4848
"plt.ylabel('Median Home Value [$1k]')\n",
4949
"plt.legend()\n",
5050
"\n",
5151
"ax2 = fig.add_subplot(122)\n",
5252
"sort_ind = np.argsort(H[:,-1])\n",
53-
"plt.plot(b[sort_ind], Color='k', LineWidth=2, label='Housing Value') # True relationship\n",
54-
"plt.plot(A[sort_ind,:]@x, '-o', Color='r', LineWidth=1.5, MarkerSize=6, label='Regression')\n",
53+
"plt.plot(b[sort_ind], color='k', linewidth=2, label='Housing Value') # True relationship\n",
54+
"plt.plot(A[sort_ind,:]@x, '-o', color='r', linewidth=1.5, markersize=6, label='Regression')\n",
5555
"plt.xlabel('Neighborhood')\n",
5656
"plt.legend()\n",
5757
"\n",
@@ -122,7 +122,7 @@
122122
"name": "python",
123123
"nbconvert_exporter": "python",
124124
"pygments_lexer": "ipython3",
125-
"version": "3.7.5"
125+
"version": "3.8.5"
126126
}
127127
},
128128
"nbformat": 4,

CH01/CH01_SEC05_1_PCAGaussian.ipynb

Lines changed: 10 additions & 10 deletions
Large diffs are not rendered by default.

CH01/CH01_SEC05_2_OvarianCancer.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
"name": "python",
9797
"nbconvert_exporter": "python",
9898
"pygments_lexer": "ipython3",
99-
"version": "3.7.3"
99+
"version": "3.8.5"
100100
}
101101
},
102102
"nbformat": 4,

CH01/CH01_SEC06_2_3_4.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@
214214
"PCACoordsP1 = U[:,PCAmodes-np.ones_like(PCAmodes)].T @ P1\n",
215215
"PCACoordsP2 = U[:,PCAmodes-np.ones_like(PCAmodes)].T @ P2\n",
216216
"\n",
217-
"plt.plot(PCACoordsP1[0,:],PCACoordsP1[1,:],'d',Color='k',label='Person 2')\n",
218-
"plt.plot(PCACoordsP2[0,:],PCACoordsP2[1,:],'^',Color='r',label='Person 7')\n",
217+
"plt.plot(PCACoordsP1[0,:],PCACoordsP1[1,:],'d',color='k',label='Person 2')\n",
218+
"plt.plot(PCACoordsP2[0,:],PCACoordsP2[1,:],'^',color='r',label='Person 7')\n",
219219
"\n",
220220
"plt.legend()\n",
221221
"plt.show()"

CH01/CH01_SEC07_1.ipynb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,10 @@
173173
"\n",
174174
"fig1,ax1 = plt.subplots(1)\n",
175175
"\n",
176-
"ax1.semilogy(S,'-o', color='k', LineWidth=2)\n",
177-
"ax1.semilogy(np.diag(S[:(r+1)]),'o', color='r', LineWidth=2)\n",
178-
"ax1.plot(np.array([-20, N+20]),np.array([cutoff, cutoff]),'--', color='r', LineWidth=2)\n",
179-
"rect = patches.Rectangle((-5,20),100,200,LineWidth=2,LineStyle='--',FaceColor='none',EdgeColor='k')\n",
176+
"ax1.semilogy(S,'-o', color='k', linewidth=2)\n",
177+
"ax1.semilogy(np.diag(S[:(r+1)]),'o', color='r', linewidth=2)\n",
178+
"ax1.plot(np.array([-20, N+20]),np.array([cutoff, cutoff]),'--', color='r', linewidth=2)\n",
179+
"rect = patches.Rectangle((-5,20),100,200,linewidth=2,linestyle='--',facecolor='none',edgecolor='k')\n",
180180
"ax1.add_patch(rect)\n",
181181
"plt.xlim((-10,610))\n",
182182
"plt.ylim((0.003,300))\n",
@@ -185,22 +185,22 @@
185185
"\n",
186186
"fig2,ax2 = plt.subplots(1)\n",
187187
"\n",
188-
"ax2.semilogy(S,'-o', color='k', LineWidth=2)\n",
189-
"ax2.semilogy(np.diag(S[:(r+1)]),'o', color='r', LineWidth=2)\n",
190-
"ax2.plot(np.array([-20, N+20]),np.array([cutoff, cutoff]),'--', color='r', LineWidth=2)\n",
188+
"ax2.semilogy(S,'-o', color='k', linewidth=2)\n",
189+
"ax2.semilogy(np.diag(S[:(r+1)]),'o', color='r', linewidth=2)\n",
190+
"ax2.plot(np.array([-20, N+20]),np.array([cutoff, cutoff]),'--', color='r', linewidth=2)\n",
191191
"plt.xlim((-5,100))\n",
192192
"plt.ylim((20,200))\n",
193193
"ax2.grid()\n",
194194
"plt.show()\n",
195195
"\n",
196196
"fig3,ax3 = plt.subplots(1)\n",
197-
"ax3.plot(cdS,'-o',color='k',LineWidth=2)\n",
198-
"ax3.plot(cdS[:(r90+1)],'o',color='b',LineWidth=2)\n",
199-
"ax3.plot(cdS[:(r+1)],'o',color='r',LineWidth=2)\n",
197+
"ax3.plot(cdS,'-o',color='k',linewidth=2)\n",
198+
"ax3.plot(cdS[:(r90+1)],'o',color='b',linewidth=2)\n",
199+
"ax3.plot(cdS[:(r+1)],'o',color='r',linewidth=2)\n",
200200
"plt.xticks(np.array([0, 300, r90, 600]))\n",
201201
"plt.yticks(np.array([0, 0.5, 0.9, 1]))\n",
202202
"plt.xlim((-10,610))\n",
203-
"ax3.plot(np.array([r90, r90, -10]),np.array([0, 0.9, 0.9]),'--',color='b',LineWidth=2)\n",
203+
"ax3.plot(np.array([r90, r90, -10]),np.array([0, 0.9, 0.9]),'--',color='b',linewidth=2)\n",
204204
"\n",
205205
"ax3.grid()\n",
206206
"plt.show()\n",

CH01/CH01_SEC08_RSVD.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,14 @@
136136
" [1,0,0],\n",
137137
" [2/3,0,0]])\n",
138138
"\n",
139-
"plt.plot(S,'o-',color='k',LineWidth=2,label='SVD')\n",
139+
"plt.plot(S,'o-',color='k',linewidth=2,label='SVD')\n",
140140
"\n",
141141
"Y = X\n",
142142
"for q in range(1,6):\n",
143143
" Y = X.T @ Y\n",
144144
" Y = X @ Y\n",
145145
" Uq, Sq, VTq = np.linalg.svd(Y,full_matrices=0)\n",
146-
" plt.plot(Sq,'-o',color=tuple(color_list[2*q+1]),LineWidth=2,label='rSVD, q = '+str(q))\n",
146+
" plt.plot(Sq,'-o',color=tuple(color_list[2*q+1]),linewidth=2,label='rSVD, q = '+str(q))\n",
147147
"\n",
148148
"plt.legend()\n",
149149
"plt.show()"

CH01/CH01_SEC09_Tensor.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77464,9 +77464,9 @@
7746477464
"A1, A2, A3 = parafac(A,2)\n",
7746577465
"\n",
7746677466
"fig, axs = plt.subplots(3,1)\n",
77467-
"axs[0].plot(y,A1,LineWidth=2)\n",
77468-
"axs[1].plot(x,A2,LineWidth=2)\n",
77469-
"axs[2].plot(t,A3,LineWidth=2)\n",
77467+
"axs[0].plot(y,A1,linewidth=2)\n",
77468+
"axs[1].plot(x,A2,linewidth=2)\n",
77469+
"axs[2].plot(t,A3,linewidth=2)\n",
7747077470
"plt.show()"
7747177471
]
7747277472
},
@@ -77501,7 +77501,7 @@
7750177501
"name": "python",
7750277502
"nbconvert_exporter": "python",
7750377503
"pygments_lexer": "ipython3",
77504-
"version": "3.7.3"
77504+
"version": "3.8.5"
7750577505
}
7750677506
},
7750777507
"nbformat": 4,

CH02/CH02_SEC01_0_InnerProduct.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@
4040
"ff = f_interp(xf) \n",
4141
"gf = g_interp(xf)\n",
4242
"\n",
43-
"plt.plot(xf[10:-10],ff[10:-10],color='k',LineWidth=2)\n",
43+
"plt.plot(xf[10:-10],ff[10:-10],color='k',linewidth=2)\n",
4444
"plt.plot(x[1:-2],f[1:-2],'o',color='b')\n",
4545
"\n",
46-
"plt.plot(xf[10:-10],gf[10:-10],color='k',LineWidth=2)\n",
46+
"plt.plot(xf[10:-10],gf[10:-10],color='k',linewidth=2)\n",
4747
"plt.plot(x[1:-2],g[1:-2],'o',color='r')\n",
4848
"\n",
4949
"plt.show()\n"

0 commit comments

Comments
 (0)