4.1. Mathematical Interpretation of Ordinary Least Squares¶
@@ -850,7 +851,7 @@ It is used for the calculation of the inverse for singular or near singular matr
\[
\boldsymbol{A}_{\mathrm{PI}}= \boldsymbol{V}\boldsymbol{D}_{\mathrm{PI}}\boldsymbol{U}^T,
\]
-
where \(\boldsymbol{D}_{\mathrm{PI}}\) can be calculated by creating a diagonal matrix from \(\boldsymbol{Sigma}\) where we only keep the singular values (the non-zero values). The following code computes the pseudoinvers of the matrix based on the SVD.
+
where \(\boldsymbol{D}_{\mathrm{PI}}\) can be calculated by creating a diagonal matrix from \(\boldsymbol{\Sigma}\) where we only keep the singular values (the non-zero values). The following code computes the pseudoinvers of the matrix based on the SVD.
importnumpyasnp
@@ -983,11 +984,6 @@ decomposition of the design matrix.
\boldsymbol{X}^T\boldsymbol{X}=\boldsymbol{V}\boldsymbol{\Sigma}^T\boldsymbol{\Sigma}\boldsymbol{V}^T.
\]
We define \(\boldsymbol{\Sigma}^T\boldsymbol{\Sigma}=\tilde{\boldsymbol{\Sigma}}^2\) which is a diagonal matrix containing only the singular values squared. It has dimensionality \(p \times p\).
-
This means, using the orthogonality of \(\boldsymbol{V}\), that we get
where we wrote $\(\boldsymbol{C}[\boldsymbol{x}_0,\boldsymbol{x}_1] = \boldsymbol{C}[\boldsymbol{x}]\)\( to indicate that this is the covariance of the vectors \)\boldsymbol{x}\( of the design/feature matrix \)\boldsymbol{X}$.
+
where we wrote \(\boldsymbol{C}[\boldsymbol{x}_0,\boldsymbol{x}_1]=\boldsymbol{C}[\boldsymbol{x}]\) to indicate
+that this is the covariance of the vectors \(\boldsymbol{x}\) of the
+design/feature matrix \(\boldsymbol{X}\).
It is easy to generalize this to a matrix \(\boldsymbol{X}\in {\mathbb{R}}^{n\times p}\).
@@ -1880,7 +1878,7 @@ Training MSE for OLS
3.0
-
+
We see here that we reach a plateau for the Ridge results. Writing out the coefficients \(\boldsymbol{\beta}\), we that they are getting smaller and smaller and our error stabilizes since the predicted values of \(\tilde{\boldsymbol{y}}\) approach zero.
@@ -2156,7 +2154,7 @@ Training MSE for OLS
[ 0. -0.]
-
+
We bring then back our exponential function example and study all
@@ -2259,305 +2257,14 @@ Test MSE OLS
0.008675369724975977
-
+
Both these example send a clear message. The addition of a
shrinkage/regularization term implies that we need to perform a search
for the optimal values of \(\lambda\). We will see this throughout these
series of lectures.
-
As a small addendum, we note that you can also solve this problem using the convex optimization package CVXOPT. This requires, in addition to having installed CVXOPT, you need to download the file l1regl.py.
-The following code example solves the simpler problem we discussed above, where we have added the latter python file.
-
-
-
fromcvxoptimportmatrix,spdiag,mul,div,sqrt,normal,setseed
-fromcvxoptimportblas,lapack,solvers,sparse,spmatrix
-importmath
-
-try:
- importmosek
- importsys
- __MOSEK=True
-except:__MOSEK=False
-
-if__MOSEK:
-
- defl1regls_mosek(A,b):
- """
-
- Returns the solution of l1-norm regularized least-squares problem
-
- minimize || A*x - b ||_2^2 + e'*u
-
- subject to -u <= x <= u
-
- """
-
- m,n=A.size
-
- env=mosek.Env()
- task=env.Task(0,0)
- task.set_Stream(mosek.streamtype.log,lambdax:sys.stdout.write(x))
-
- task.appendvars(2*n)# number of variables
- task.appendcons(2*n)# number of constraints
-
- # input quadratic objective
- Q=matrix(0.0,(n,n))
- blas.syrk(A,Q,alpha=2.0,trans='T')
-
- I=[]
- foriinrange(n):
- I.extend(range(i,n))
-
- J=[]
- foriinrange(n):
- J.extend((n-i)*[i])
-
- task.putqobj(I,J,list(Q[matrix(I)+matrix(J)*n]))
- task.putclist(range(2*n),list(-2*A.T*b)+n*[1.0])# setup linear objective
-
- # input constraint matrix row by row
- foriinrange(n):
- task.putarow(i,[i,n+i],[1.0,-1.0])
- task.putarow(n+i,[i,n+i],[1.0,1.0])
-
- # setup bounds on constraints
- task.putboundslice(mosek.accmode.con,
- 0,n,n*[mosek.boundkey.up],n*[0.0],n*[0.0])
- task.putboundslice(mosek.accmode.con,
- n,2*n,n*[mosek.boundkey.lo],n*[0.0],n*[0.0])
-
- # setup variable bounds
- task.putboundslice(mosek.accmode.var,
- 0,2*n,2*n*[mosek.boundkey.fr],2*n*[0.0],2*n*[0.0])
-
- # optimize the task
- task.putobjsense(mosek.objsense.minimize)
- task.optimize()
- task.solutionsummary(mosek.streamtype.log)
- x=n*[0.0]
- task.getsolutionslice(mosek.soltype.itr,mosek.solitem.xx,0,n,x)
-
- returnmatrix(x)
-
- defl1regls_mosek2(A,b):
- """
-
- Returns the solution of l1-norm regularized least-squares problem
-
- minimize w'*w + e'*u
-
- subject to -u <= x <= u
-
- A*x - w = b
-
- """
-
- m,n=A.size
-
- env=mosek.Env()
- task=env.Task(0,0)
- task.set_Stream(mosek.streamtype.log,lambdax:sys.stdout.write(x))
-
- task.appendvars(2*n+m)# number of variables
- task.appendcons(2*n+m)# number of constraints
-
- # input quadratic objective
- task.putqobj(range(2*n,2*n+m),range(2*n,2*n+m),m*[2.0])
-
- task.putclist(range(2*n+m),n*[0.0]+n*[1.0]+m*[0.0])# setup linear objective
-
- # input constraint matrix row by row
- foriinrange(n):
- task.putarow(i,[i,n+i],[1.0,-1.0])
- task.putarow(n+i,[i,n+i],[1.0,1.0])
-
- foriinrange(m):
- task.putarow(2*n+i,range(n)+[2*n+i],list(A[i,:])+[-1.0])
-
- # setup bounds on constraints
- task.putboundslice(mosek.accmode.con,
- 0,n,n*[mosek.boundkey.up],n*[0.0],n*[0.0])
- task.putboundslice(mosek.accmode.con,
- n,2*n,n*[mosek.boundkey.lo],n*[0.0],n*[0.0])
- task.putboundslice(mosek.accmode.con,
- 2*n,2*n+m,m*[mosek.boundkey.fx],list(b),list(b))
-
- # setup variable bounds
- task.putboundslice(mosek.accmode.var,0,2*n+m,(2*n+m)*[mosek.boundkey.fr],
- (2*n+m)*[0.0],(2*n+m)*[0.0])
-
- # optimize the task
- task.putobjsense(mosek.objsense.minimize)
- task.optimize()
- task.solutionsummary(mosek.streamtype.log)
- x=n*[0.0]
- task.getsolutionslice(mosek.soltype.itr,mosek.solitem.xx,0,n,x)
-
- returnmatrix(x)
-
-defl1regls(A,b):
- """
-
- Returns the solution of l1-norm regularized least-squares problem
-
- minimize || A*x - b ||_2^2 + || x ||_1.
-
- """
-
- m,n=A.size
- q=matrix(1.0,(2*n,1))
- q[:n]=-2.0*A.T*b
-
- defP(u,v,alpha=1.0,beta=0.0):
- """
- v := alpha * 2.0 * [ A'*A, 0; 0, 0 ] * u + beta * v
- """
- v*=beta
- v[:n]+=alpha*2.0*A.T*(A*u[:n])
-
-
- defG(u,v,alpha=1.0,beta=0.0,trans='N'):
- """
- v := alpha*[I, -I; -I, -I] * u + beta * v (trans = 'N' or 'T')
- """
-
- v*=beta
- v[:n]+=alpha*(u[:n]-u[n:])
- v[n:]+=alpha*(-u[:n]-u[n:])
-
- h=matrix(0.0,(2*n,1))
-
-
- # Customized solver for the KKT system
- #
- # [ 2.0*A'*A 0 I -I ] [x[:n] ] [bx[:n] ]
- # [ 0 0 -I -I ] [x[n:] ] = [bx[n:] ].
- # [ I -I -D1^-1 0 ] [zl[:n]] [bzl[:n]]
- # [ -I -I 0 -D2^-1 ] [zl[n:]] [bzl[n:]]
- #
- # where D1 = W['di'][:n]**2, D2 = W['di'][:n]**2.
- #
- # We first eliminate zl and x[n:]:
- #
- # ( 2*A'*A + 4*D1*D2*(D1+D2)^-1 ) * x[:n] =
- # bx[:n] - (D2-D1)*(D1+D2)^-1 * bx[n:] +
- # D1 * ( I + (D2-D1)*(D1+D2)^-1 ) * bzl[:n] -
- # D2 * ( I - (D2-D1)*(D1+D2)^-1 ) * bzl[n:]
- #
- # x[n:] = (D1+D2)^-1 * ( bx[n:] - D1*bzl[:n] - D2*bzl[n:] )
- # - (D2-D1)*(D1+D2)^-1 * x[:n]
- #
- # zl[:n] = D1 * ( x[:n] - x[n:] - bzl[:n] )
- # zl[n:] = D2 * (-x[:n] - x[n:] - bzl[n:] ).
- #
- # The first equation has the form
- #
- # (A'*A + D)*x[:n] = rhs
- #
- # and is equivalent to
- #
- # [ D A' ] [ x:n] ] = [ rhs ]
- # [ A -I ] [ v ] [ 0 ].
- #
- # It can be solved as
- #
- # ( A*D^-1*A' + I ) * v = A * D^-1 * rhs
- # x[:n] = D^-1 * ( rhs - A'*v ).
-
- S=matrix(0.0,(m,m))
- Asc=matrix(0.0,(m,n))
- v=matrix(0.0,(m,1))
-
- defFkkt(W):
-
- # Factor
- #
- # S = A*D^-1*A' + I
- #
- # where D = 2*D1*D2*(D1+D2)^-1, D1 = d[:n]**-2, D2 = d[n:]**-2.
-
- d1,d2=W['di'][:n]**2,W['di'][n:]**2
-
- # ds is square root of diagonal of D
- ds=math.sqrt(2.0)*div(mul(W['di'][:n],W['di'][n:]),
- sqrt(d1+d2))
- d3=div(d2-d1,d1+d2)
-
- # Asc = A*diag(d)^-1/2
- Asc=A*spdiag(ds**-1)
-
- # S = I + A * D^-1 * A'
- blas.syrk(Asc,S)
- S[::m+1]+=1.0
- lapack.potrf(S)
-
- defg(x,y,z):
-
- x[:n]=0.5*(x[:n]-mul(d3,x[n:])+
- mul(d1,z[:n]+mul(d3,z[:n]))-mul(d2,z[n:]-
- mul(d3,z[n:])))
- x[:n]=div(x[:n],ds)
-
- # Solve
- #
- # S * v = 0.5 * A * D^-1 * ( bx[:n] -
- # (D2-D1)*(D1+D2)^-1 * bx[n:] +
- # D1 * ( I + (D2-D1)*(D1+D2)^-1 ) * bzl[:n] -
- # D2 * ( I - (D2-D1)*(D1+D2)^-1 ) * bzl[n:] )
-
- blas.gemv(Asc,x,v)
- lapack.potrs(S,v)
-
- # x[:n] = D^-1 * ( rhs - A'*v ).
- blas.gemv(Asc,v,x,alpha=-1.0,beta=1.0,trans='T')
- x[:n]=div(x[:n],ds)
-
- # x[n:] = (D1+D2)^-1 * ( bx[n:] - D1*bzl[:n] - D2*bzl[n:] )
- # - (D2-D1)*(D1+D2)^-1 * x[:n]
- x[n:]=div(x[n:]-mul(d1,z[:n])-mul(d2,z[n:]),d1+d2)\
- -mul(d3,x[:n])
-
- # zl[:n] = D1^1/2 * ( x[:n] - x[n:] - bzl[:n] )
- # zl[n:] = D2^1/2 * ( -x[:n] - x[n:] - bzl[n:] ).
- z[:n]=mul(W['di'][:n],x[:n]-x[n:]-z[:n])
- z[n:]=mul(W['di'][n:],-x[:n]-x[n:]-z[n:])
-
- returng
-
- returnsolvers.coneqp(P,q,G,h,kktsolver=Fkkt)['x'][:n]
-
-
-
-
-
---------------------------------------------------------------------------
-ModuleNotFoundErrorTraceback (most recent call last)
-<ipython-input-12-d670a873ab0c>in<module>
-----> 1fromcvxoptimportmatrix,spdiag,mul,div,sqrt,normal,setseed
-2fromcvxoptimportblas,lapack,solvers,sparse,spmatrix
-3importmath
-4
-5try:
-
-ModuleNotFoundError: No module named 'cvxopt'
-
-
-
-
-
Then we call the above functions and solve the problem, as done here
As a small addendum, we note that you can also solve this problem using the convex optimization package CVXOPT. This requires, in addition to having installed CVXOPT, you need to download the file l1regl.py.
4.11. Linking the regression analysis with a statistical interpretation¶
Let us write out the values of the coefficients \(\beta_i\) as functions
@@ -3032,6 +2747,228 @@ large variance (normally for higher orders in the polynomial).
+
+
+
+
+
+
+
+
beta
+
+
+
+
+
0
+
0.986699
+
+
+
1
+
-0.606760
+
+
+
2
+
1.280573
+
+
+
3
+
-0.850164
+
+
+
4
+
0.000000
+
+
+
+
+
+
+
+
+
+
beta
+
+
+
+
+
0
+
0.978553
+
+
+
1
+
-0.511888
+
+
+
2
+
1.051418
+
+
+
3
+
-0.701370
+
+
+
4
+
0.000000
+
+
+
+
+
+
+
+
+
+
beta
+
+
+
+
+
0
+
0.946957
+
+
+
1
+
-0.162246
+
+
+
2
+
0.221921
+
+
+
3
+
-0.167787
+
+
+
4
+
0.000000
+
+
+
+
+
+
+
+
+
+
beta
+
+
+
+
+
0
+
0.906747
+
+
+
1
+
0.017665
+
+
+
2
+
-0.029483
+
+
+
3
+
-0.053849
+
+
+
4
+
0.000000
+
+
+
+
+
+
+
+
+
+
beta
+
+
+
+
+
0
+
0.718165
+
+
+
1
+
0.156956
+
+
+
2
+
0.040102
+
+
+
3
+
-0.001880
+
+
+
4
+
0.000000
+
+
+
+
As an exercise, repeat these calculations with ordinary least squares
only with and without noise. Calculate thereafter the variance of the
@@ -3074,8 +3011,7 @@ already modeled and an unknown prior, we are now ready to make
additional models for the prior.
We can, based on our discussions of the variance of \(\boldsymbol{\beta}\) and
the mean value, assume that the prior for the values \(\boldsymbol{\beta}\) is
-given by a Gaussian with mean value zero and variance \(\tau^2\), that
-is
+given by a Gaussian with mean value zero and variance \(\tau^2\), that
\[
p(\boldsymbol{\beta})=\prod_{j=0}^{p-1}\exp{\left(-\frac{\beta_j^2}{2\tau^2}\right)}.
diff --git a/doc/LectureNotes/_build/html/searchindex.js b/doc/LectureNotes/_build/html/searchindex.js
index ce1ccc582..e3985b5a7 100644
--- a/doc/LectureNotes/_build/html/searchindex.js
+++ b/doc/LectureNotes/_build/html/searchindex.js
@@ -1 +1 @@
-Search.setIndex({docnames:["chapter1","chapter10","chapter11","chapter12","chapter13","chapter2","chapter3","chapter4","chapter5","chapter6","chapter7","chapter8","chapter9","chapteroptimization","clustering","intro","linalg","schedule","statistics","teachers","textbooks"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":4,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":3,"sphinx.domains.rst":2,"sphinx.domains.std":2,"sphinx.ext.intersphinx":1,sphinx:56},filenames:["chapter1.ipynb","chapter10.ipynb","chapter11.ipynb","chapter12.ipynb","chapter13.ipynb","chapter2.ipynb","chapter3.ipynb","chapter4.ipynb","chapter5.ipynb","chapter6.ipynb","chapter7.ipynb","chapter8.ipynb","chapter9.ipynb","chapteroptimization.ipynb","clustering.ipynb","intro.md","linalg.ipynb","schedule.md","statistics.ipynb","teachers.md","textbooks.md"],objects:{},objnames:{},objtypes:{},terms:{"0":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,18,19],"00":[0,1,3,5,6,11,18],"000":[1,3],"0000":[],"00000":[],"000000":[5,11],"00000000e":5,"0000e":3,"0001":[1,3],"000148":[],"00019998":5,"00024087":5,"00028369228101198006":[],"00029012":5,"0003043256065368937":9,"00031535148309580783":6,"0003153514830958081":[],"0003153514830958126":[],"0003153514830958235":6,"00034944":5,"000417932":2,"00042089":5,"000464088":2,"00050694":5,"00058016":6,"000599":[],"00060705":[],"00060708":6,"00061058":5,"00062582":6,"00062595":[],"00066668":6,"00068734":6,"00068941":6,"00069103":[],"00073541":5,"00076495":6,"00076919":6,"00076925":[],"0007698473260556325":6,"0007698473260556334":[],"0007698473260556339":[],"0007698473260556344":6,"00079123":[],"00079130":6,"00079968":5,"00084705":[],"00084711":6,"00085883":6,"00085884":[],"00087697":6,"00088573":5,"00092645":6,"00092646":[],"00096314":5,"001":[1,2,8,13],"00100519":6,"0010479245355337968":[],"0010479245887943952":6,"00105081":6,"00106677":5,"00107405":6,"00111756":6,"0011526":6,"00115999":5,"0011828302640124":[],"00118504":6,"00118527":[],"001263":[],"00128479":5,"001323":6,"00137823":6,"00137835":[],"00139705":5,"00149311":6,"00149956":6,"00152117":6,"00154733":5,"00156379":[],"00156382":6,"00168251":5,"00174276":6,"00175331":6,"00186347":5,"001988":[],"00198806":[],"00200":8,"00202624":5,"00202756":6,"00217499":6,"00224413":5,"00228741":6,"0023548":6,"002381316302584885":[],"002381316302584886":6,"0023813163025848865":6,"00242999":6,"00243186":6,"0024401":5,"00249435":6,"002526":[],"00266858":2,"00270244":5,"00274989":6,"00275135":[],"00289724":6,"00293838":5,"002948":[],"0030828":[],"003083":[],"00310113":2,"00312361":6,"00315593":6,"003215318065760509":[],"0032153180657605125":6,"00323332":6,"0032542":5,"003301":6,"003395515459204093":6,"0033955154592040944":[],"00353823":5,"0036237":6,"0036367":6,"00369758":6,"003704":[],"003717":[],"003759":[],"003774":[],"003788":[],"0038335":6,"00390021":[],"003909404072811217":6,"003909404072811231":[],"00391839":5,"0039987":6,"004":5,"004091940707753948":6,"0040919407077539514":[],"00410387":6,"00410478":6,"004113634617443116":6,"0041136346174431284":[],"004113634617443131":6,"004113634617443135":[],"00411363461744314":6,"004113634617443141":[],"004155986345861364":6,"004155986345861374":[],"00415763":[],"00424909":2,"00424967":6,"00426027":5,"00433417":11,"00440346":6,"00443743":6,"00445655":11,"004579219539673834":6,"004579219539673836":[],"00458878":6,"004610275230656187":6,"004610275230656294":[],"00462287":6,"00471782":5,"00472199":6,"00472512":6,"0049544":6,"004999999999999984":[],"004999999999999994":[],"004999999999999996":[],"005000000000000011":0,"00512927":5,"00517114":6,"00526348":6,"0053018":6,"00554552":6,"00556826":6,"0056799":5,"00577441":[],"00579953":6,"00588657":6,"00607783":6,"006162":6,"00617499":5,"00630331":6,"00642221":6,"00660427":6,"00672607":6,"00673393":13,"00673407":6,"00676387":6,"0068011":6,"00683748":5,"00683964":6,"007012403613997257":[],"007024126888936694":[],"0070241268889382116":6,"00719176":6,"00727646693":0,"007315":[],"0074331":5,"00751823":[],"00759119":6,"00784393":6,"00803064":6,"0080866254785146":[],"00813803":6,"00817631":6,"00823002":5,"00827728":6,"00831018":6,"00834567":6,"00848904":6,"0086649156":0,"008675369724975977":5,"008675369724976501":[],"00894639":5,"00905423":6,"009163470508352211":[],"009163470508352218":5,"009164545680330616":6,"00917248":6,"00934499":6,"009450756365829578":[],"0096208":6,"00990475":5,"00992331":6,"00996754":6,"00it":6,"01":[0,1,2,5,6,9,11,13,18,20],"010018312644139205":6,"010018312644139347":[],"0100706":6,"010331721306655144":6,"01033172130665515":[],"010516485576646513":6,"010516485576652856":[],"01066519":6,"01076611":5,"0110":18,"0110407067093945":[],"01104071":[],"011076219011339788":[],"01107621901137465":6,"011225":2,"0113104":6,"01179792":6,"01191824":5,"01199624e":18,"012073649439965807":[],"012073649472576395":6,"01212754811385597":18,"01219292":6,"01223198":6,"01231917":6,"012633802944855959":[],"01290947":6,"01295356":5,"013121573975499602":[],"013121573975499604":[],"01312157406137079":6,"013121574061370796":6,"01318643":6,"01347916":6,"01348565":6,"01367553":6,"01397146":6,"01405935":6,"01416528":6,"014209325470380275":[],"01433809":5,"014436800088896274":6,"014436800088969727":[],"01449782":6,"01458337":6,"0146081":6,"01463049":6,"015072388895177088":[],"0150723888951771":6,"015072388895177109":[],"015072388895177239":6,"01509543":13,"01530715721129232":[],"01531845":6,"01538461538462":[],"01549377":6,"01558197":5,"016285782696017055":6,"016285782696075054":[],"01633913":6,"01640891":6,"01655318":6,"016587414993037307":[],"016587414993045405":6,"01691985":6,"01708781":6,"01708852":6,"01713366":6,"01724499":5,"01735584819559184":[],"017355848195591845":[],"017355848195593354":6,"01756972":[],"01799917e":18,"01817152":[],"018232":[],"01831036e":6,"01831130e":[],"01831200e":[],"01831207e":6,"01866537":6,"01869785e":18,"01873344":11,"01873869":5,"01898855":6,"01905883":6,"01908936":6,"019587":[],"01963611":6,"01969145":6,"019754165271682844":6,"01975416527179247":[],"01975848":6,"02":[0,4,6,7,12,18],"02024962":6,"02054837e":6,"02068067":6,"02073509":5,"0209518407597062":18,"02098261":6,"02123176":6,"021250026482402":11,"02159270458799264":[],"021592704587992645":[],"021592704588021164":6,"021592704588021167":6,"02198702e":6,"022022882954618364":[],"02208512":6,"02228115":6,"02229529":6,"02252765":5,"022556":11,"02255619":11,"02299949826036602":[],"0229994982603662":6,"02348765":6,"02365049":6,"0245528":6,"02492265":5,"02493054":[],"02498832":6,"02503753":6,"02511518":6,"02522069":6,"025709":11,"02586427":6,"0260906":6,"02625193":8,"02625928":13,"026408391362671896":[],"02642055e":18,"026605727637176654":[],"02660572763718461":6,"026605727637184613":6,"02707227":5,"02723445":6,"027609773491022314":[],"027609773491022387":6,"027609773491022407":6,"02786488":11,"027865":11,"02857":4,"02917662":11,"029177":11,"02926396":[],"029613363972682966":[],"029733":[],"02976145":6,"02994311":5,"02f":6,"03":[1,6],"03032441e":6,"03056589":[],"030566":[],"03071040e":18,"03076923076924":[],"03077640549":4,"03099776":5,"031":5,"03187339273559067":[],"03196357":6,"03251863":5,"03256632e":1,"03267527":6,"03278964":[],"032790":[],"03279636":6,"0330308045180234":[],"0330308045183163":[],"0330308045183219":6,"0330308045190182":6,"033657685071527485":[],"033657685071527624":6,"03382304823545749":11,"03447512":6,"03562355":6,"03568439":6,"03570747":0,"0358909447132981":[],"0359565":5,"03630548":6,"03707133":11,"037559":11,"03755944":11,"03761519":[],"03781367141738885":[],"03781367141738886":[],"037813671417388985":6,"03781367141738899":6,"03794112":16,"03814292":6,"03815288":6,"038300":11,"03850557":11,"038506":11,"039039":5,"03981057":16,"0399676689527968":6,"0399676689527975":6,"04":[1,6,11,18],"04010697":6,"04063602":6,"041":[],"041148729430502":6,"041148729430523":6,"0411487294305246":[],"0411487294305746":[],"04179719":[],"041797190646905":[],"04220758":6,"04284519":[],"043":[],"04315108":5,"0433816":[],"04346721":5,"04355837":6,"04362":[],"04368707":16,"0437499":2,"04389027":6,"043927769551648":[],"04423486":6,"044334":[],"0444119":[],"044613":6,"04483457":[],"04537385":6,"04543942":6,"04566964":6,"0458":9,"04615384615386":[],"04621521":[],"04648335":5,"0466":[],"04683565":5,"04775904":16,"04784395":6,"04818727730430296":[],"048187277304303056":6,"048653428302840175":16,"04892055":6,"04909093":6,"04912436":6,"04930820e":18,"0495569966278238":6,"0495569966278269":6,"0495569966278315":[],"04it":[],"05":[1,3,4,6,13],"05009826":6,"05087958":[],"05100875":6,"051649":11,"0517473":5,"05227921801205691":[],"05227921801205692":[],"052279218012057004":6,"05255759":[],"05263":[],"05290417684691035":[],"05302":[],"05364854":8,"05383795":6,"05434571":16,"05447415":6,"054585":[],"054785":[],"054963":[],"05505310046362":[],"05505310046363":2,"055137":[],"055320":[],"05533":[],"055676":[],"05614483":5,"05623":[],"05648":[],"05651951":6,"056528":11,"05667":[],"057088709963182":[],"057163681553428394":6,"05716368155351588":[],"0572":[],"05756733":[],"05785343":6,"05789007":6,"057899":11,"05796251":6,"05807125":6,"05883":[],"05884":[],"059013":5,"059294":11,"059378":11,"059601":5,"059783":[],"05999":[],"06":[6,13],"060080":[],"060183":[],"06020587":6,"06021285":[],"060213":[],"060228":11,"060309":5,"06043581":6,"060507":[],"060655":[],"060781":[],"060841":[],"061025":[],"061048":[],"061149":5,"061321":[],"061390":[],"061509":[],"061604":[],"06160438":[],"061701":[],"061745":[],"061898":[],"061917":[],"061923":11,"06200174":5,"06208238634231944":6,"06208238634231953":[],"062136":5,"062142":[],"062292565":4,"062294":[],"062391":[],"062409":11,"062411":11,"062435":[],"062451":[],"062534":[],"062676":11,"062706":11,"062834":[],"062884":[],"063052":5,"063078":[],"063250":[],"063343":[],"063364":5,"063513":[],"063631":5,"063657":[],"063752":11,"063851":5,"063872":[],"063874":5,"06388888888888888":[],"064052":[],"064108":[],"064110":5,"064184":[],"064274":5,"064384":[],"06444":[],"064469":[],"06453579006728315":[],"06453579006728322":6,"064538":11,"064604":11,"064648":[],"064658":5,"064681":[],"064838":5,"06491736":6,"064918":[],"064931":11,"064964":[],"06497046":[],"065020":5,"065106":[],"065249":11,"065314":11,"065348":5,"06547790180152352":6,"06547790180152353":6,"06547790180152357":[],"06547790180152363":[],"065514":[],"065557":[],"065575":[],"065641":11,"065730":11,"065826":5,"065892":[],"065974":5,"06602663":[],"066110":[],"066194":[],"066309":[],"06637":[],"066449":5,"066558":5,"066609":[],"066670":11,"0666807":2,"066729":11,"066753":[],"066789":5,"066837":11,"066954":[],"067079":[],"067213":5,"067236":[],"067240":5,"06724062":5,"067282":11,"067392":11,"067402":11,"067432":11,"067544":[],"067597":5,"067599":5,"067612":5,"067620":5,"067622":5,"067675":[],"067714":[],"067723":5,"067769":5,"067956":11,"068059":11,"068093":11,"068094":[],"068103":[],"068120":[],"068318":5,"068363":5,"068376":5,"06844519414009438":[],"06844519414009442":6,"06844519414009444":6,"068461":11,"068538":11,"06858699":[],"068608":5,"068642":5,"068659":[],"068735":5,"068806":5,"068809":[],"068831":[],"068937":[],"068965":5,"068991":5,"068992":5,"069085":11,"069091":[],"069181":5,"069275":11,"069408":5,"069409":5,"069441":5,"069455":[],"069584":[],"069672":[],"069685":11,"069754":[],"069796":5,"069847":5,"069877":11,"069884":11,"069888":5,"069912":[],"06it":6,"07":6,"070028":[],"070043":[],"070071":[],"070074":5,"070150":5,"07016":[],"070163":11,"07017":[],"070343":11,"070379":[],"07039":[],"070419":11,"070429":11,"070491":5,"070492":11,"070576":[],"070612":[],"07062318":6,"070630":5,"070635":[],"070889":11,"070911":[],"070950":11,"070972":11,"07099747918547346":[],"071022":11,"071086":[],"071112":5,"071136":5,"07115":[],"07129539":[],"0712953943627344":[],"0713":0,"071387":[],"07145103":11,"071467":5,"0714956":16,"071529":5,"07160048164232467":6,"07160048164248561":[],"071614":5,"071632":5,"071698":[],"071705":[],"071767":5,"071921":5,"071935":[],"07201957":[],"072216":11,"072242":[],"072348":[],"072442":11,"072492":[],"072530":[],"072617":[],"072620":[],"072750":[],"07285":3,"0728785":[],"07291729":18,"072928":[],"073016":[],"073062":11,"073136":11,"073225":[],"073230":11,"073280":11,"073362":[],"073368":[],"073423":[],"073436":11,"073449":5,"07345504":[],"073531":[],"073575":11,"073583":[5,11],"073598":11,"073629":11,"073695":[],"073699":5,"073719":5,"073761":11,"073810":11,"073816":5,"073827":11,"073907":[],"073949":5,"074034":5,"074067":11,"074111":11,"07413172":[],"074149":11,"07421084":5,"074237":5,"074336":[],"074375":5,"074488":[],"074530":11,"07456491":5,"074573":11,"074666":[],"074693":5,"07490892":6,"074945":[],"075195":5,"075241":5,"075573":[],"075594":5,"075760":5,"075820":[],"075959":5,"076130":11,"076204":[],"076216":11,"076338":5,"0764924":6,"07656896":[],"076589":5,"076604":11,"076628":5,"07678":[],"076780":11,"076804":11,"076895":11,"076905":11,"076938":11,"076955":5,"077003":5,"077013":11,"077015":11,"077022":[],"077083":11,"077211":11,"077349":11,"07735703":16,"077402":5,"077425":5,"077452":11,"077467":[],"07777777777777778":1,"077793":5,"078040":5,"0782":6,"07820":[],"078253":[],"078254":11,"078269":11,"078299":11,"078314":11,"078436":11,"078548":[],"07864":[],"078667":[],"07871":[],"07878641":16,"078911":[],"078992":[],"07903849":16,"079157":5,"079281":5,"079347":[],"079383":5,"079389":5,"079405":5,"079406":[],"07944154":16,"07968918676726029":[],"0796891867672603":6,"079729":[],"079839":[],"079847":[],"079893":[],"07989327":[],"07999999999998":[],"07e":17,"08":[13,18],"080106":[],"080137":[],"080256":[],"080297":5,"080312":[],"080319":5,"080334":[],"080347":[],"080370":[],"080406":[],"080410":[],"08041015":[],"08043851":5,"080517":[],"080582":11,"080593":11,"080647":11,"080706":11,"080738":11,"080801":[],"080847":5,"08085812":[],"080916":[],"080984":11,"081046":11,"081072":11,"081140":[],"081144":11,"081233":5,"081253":5,"08131003":6,"081388":11,"081431":[],"081483":[],"081533":5,"081540":[],"08156108":6,"081773":[],"082174":[],"082183":[],"082295":11,"0823185":[],"082451":[],"082503":11,"08251519":6,"082536":11,"082896":11,"082900":[],"08299273e":6,"083015":5,"083053":[],"08318298e":1,"083220":[],"083227":[],"083276":11,"08328216846752691":11,"08333333333333333":1,"08336233266":4,"083404":[],"083441":[],"083506":[],"083527":[],"083600":[],"083692":[],"08376632":6,"083766322923899":6,"0837663229239016":[],"0837663229239025":[],"0837663229239043":6,"083799":[],"083829":[],"083977":[],"084000":[],"084101":[],"084184":[],"084224":[],"084226":[],"08426840630693411":[],"08426840630693412":6,"08426840630693413":6,"08428156":16,"084282":[],"084364":[],"084400":[],"084408":[],"084414":5,"084444":[],"084484":11,"084536":[],"084549":[],"08455":[],"084570":[],"084604":[],"084629":[],"08464758160254343":5,"084670":[],"084683":[],"084702":5,"08474":[],"084777":[],"084862":[5,11],"084904":5,"084909":5,"084965":[],"085018":5,"085044":[],"085163":11,"085167":[],"085184":[],"085185":[],"085361":[],"085416":[],"08551306":6,"085764":[],"08576932":6,"085879":11,"08593216":6,"086074":11,"086076":5,"08611111111111111":1,"086112":11,"086303":[],"08630331":[],"086567":[],"08673755293381497":[],"086807":5,"086872":5,"086890":11,"08690":[],"086956":11,"087501":[],"08758":[],"08759":[],"087834":[],"08816688":[],"088176":[],"0881981":5,"088212":5,"088526":11,"088611":[],"088631":[],"08871404":5,"088809":[],"088816":[],"088825":[],"088853":[],"08888888888888889":1,"088926":[],"08902":[],"089059":[],"08917679":5,"089177":5,"089212":[],"089329":[],"089425":[],"089501":11,"089614":[],"0896981":6,"08996":[],"09":1,"090028":[],"090229":[],"09085624":16,"090929":[],"091051":11,"091060":[],"09117221":[],"091224":[],"091236":[],"091340":[],"091349":[],"091363":[],"091414":[],"091416":[],"091426":[],"09149881":[],"091630":[],"09166666666666666":1,"091696":11,"0917":9,"09170751":[],"09172408":6,"091891":[],"092066":16,"09216046":[],"0923":[],"09251":[],"09297039":[],"093247":[],"0934597075922044":[],"0938":[],"094082198961999e":6,"0940821989624095e":[],"094082198966615e":6,"0940821989673748e":[],"09440475":18,"094404754965417":18,"09444444444444444":1,"094472507965532":11,"095510":[],"095702":[],"095871":[],"09609807":5,"096173":[],"096472":11,"096623":[],"09672929714683368":[],"097360":[],"09744":[],"09744272":6,"09780":[],"09791":[],"09849763":11,"098498":11,"09856879":16,"09861229":16,"098802859381565":16,"099":[],"09903804":8,"0991919894927399":6,"099191989493334":[],"09951287404314545":1,"0n":0,"0s":[3,4],"0x11da42d90":13,"0x11e031e50":13,"0x7fad10f9a280":[],"0x7fad20f69be0":[],"0x7fd098df3280":[],"0x7fd0a9063be0":[],"1":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17,18,19,20],"10":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,16,18],"100":[0,1,2,3,4,5,6,7,8,9,10,11,13,14,16,18,19],"1000":[0,1,2,4,5,8,11,13,14,15,18],"10000":[2,5,6,10,11,18],"100000":8,"10001":10,"1001":18,"1002":18,"1003":18,"10030":[],"10044225464078282":[],"1005":18,"10077114273548984":6,"1009":18,"1011":18,"1013":18,"1013904243":18,"10141413e":6,"1015":18,"102":3,"1022233262115424":[],"10222333":[],"1023":18,"10230":[],"1023111":16,"1024":3,"1026":18,"1027":18,"1028":[],"103":1,"1030":18,"10302062":16,"10340":[],"1037":18,"10378326e":1,"1038":18,"10391807":6,"10398646080125035":[],"10398646080125036":6,"10398646080125037":6,"1040":18,"10405456":11,"10430":[],"104411":[],"10455924":[],"1047":18,"10505137":16,"10520":[],"10555555555555556":1,"1056":[],"10589577":5,"106":[],"106095":11,"10620135":16,"108":6,"109":[],"10913":6,"10931453":6,"10960":[],"1096767776832326":18,"10967678":18,"10th":9,"10x":0,"11":[0,2,3,4,5,6,7,8,9,10,11,12,13,16,18,20],"110":[],"1100":18,"1101":18,"11022302e":5,"11046771":16,"111":[1,7,12],"11100":[],"1122558214":[],"112383":11,"1124":[],"1125":3,"11297834":[],"1136":3,"11362930e":[],"11388888888888889":1,"1139":3,"11390":[],"114":3,"11402309":16,"114437":[],"11462415":5,"11482289e":6,"11499517":[],"11507992e":1,"11547777218875695":6,"11547777218875696":6,"11547777218940905":[],"11547777218940906":[],"115822":6,"11590":[],"11598862":18,"11598862273198":18,"11604844":[],"116048442683864":[],"11660":[],"11666666666666667":1,"11674401539815678":18,"117":8,"11744554e":6,"11780":[],"11790868":[],"117986":[],"118":2,"1182":[],"1183":[],"118318":[],"1184":4,"11840":[],"1185":[],"1186":[],"11890":[],"119":2,"1199":[],"119936":2,"119999999999976":[],"11it":6,"12":[0,1,2,3,4,5,6,8,9,11,12,13,16,18,20],"120":[2,3],"1203":[],"1203284":8,"1206":8,"12069773":16,"121":[2,8,9,10],"12182967":6,"12196674":[],"122":[2,8,9,10],"12222222222222222":1,"122439":[],"1224392":[],"12288563":5,"122886":5,"123":[],"12318726e":6,"12333649":6,"12345260617257443":9,"123459876":[],"123711":6,"12380":[],"124":0,"12400":[],"125":[],"1250":[],"125000":[],"12552073e":6,"126":[],"1261":[],"12618549":5,"1265":[],"127":4,"1270":[],"127043":[],"1271":6,"1277":6,"127773":[],"12777777777777777":1,"12788968":[],"12790":[],"128":[3,4,13],"128664":6,"12898627064868978":[],"12937662":[],"12945452":[],"1297":[],"1298":9,"12adb44b1c20":7,"12m":3,"13":[0,2,4,5,6,9,11,12,13,16,18],"130":[],"13003291":6,"13055555555555556":1,"131":[],"13117061":[],"1314":[],"132":[],"13220608e":6,"13229545716505003":16,"132360":[],"1323603":[],"1326":[],"13280":[],"133":7,"13333333333333333":[],"135":[],"13519106":[],"13535942":6,"136":[],"1360":[],"13609760e":18,"1361":[],"1362":[],"1363":[],"1364":[],"13646574":5,"13661243e":6,"13679863":6,"1371":6,"13740":[],"137400784702911":[],"137652":11,"1378":[],"1382":[3,4],"1383":[3,4],"1384":[3,4],"1385":[3,4],"1386":[3,4],"13865173":5,"13876586436927824":5,"138775":11,"1388888888888889":1,"13890":[],"1392559581788775e":[],"1392559584983597e":[],"1392559585048734e":6,"13925595925919e":6,"14":[0,2,4,5,6,8,9,10,11,12,13,16,18,20],"140":[],"14021063":6,"1404":[],"14042769":[],"140428":[],"141":2,"14100":[],"1416398":6,"14174745":6,"1418":[],"142":2,"14250":[],"142857":[],"143":[2,7],"1435666":[],"14360598":[],"1437":1,"144":2,"14400":[],"1440501043841336":1,"14440":[],"1446729567":4,"14484695":16,"145":2,"146":[],"147":[],"14710":[],"14722222222222223":1,"147400":11,"14741468":[],"147420":11,"14783702":[],"1479":[],"148":[3,4],"14812206":6,"14818":[],"1484256":[],"148564":6,"14859":6,"148768":[],"149":[3,4],"149213":6,"14932651":[],"14988578":[],"149886":[],"14g":6,"14it":6,"15":[0,2,4,6,7,8,9,12,13,16,18],"150":[3,4,8],"15005476":5,"15098090e":6,"151":[3,4],"15130074e":6,"151986":[],"152":[3,4],"15200":[],"15258907":[],"1527777777777778":1,"153036":[],"153106":[],"1533795":[],"153760":[],"15384615384616":[],"154":[],"15454301":[],"154720":[],"15483121":[],"154911":[],"155":[],"155491":[],"155687":[],"155883":[],"156":[],"1562":[],"15629539":[],"15680777":16,"157":[],"15717291":16,"1575":[],"158":[],"1583767":16,"15843769515580663":18,"1586300629904382":[],"1587":[],"15891336":16,"159":[],"1590":[],"15990":[],"15g":6,"15it":[],"16":[1,2,3,4,5,6,8,9,10,13,18],"160":[],"1603":3,"1604":[],"1605":[],"160539":[],"1606":[],"1607":[],"16111111111111112":1,"1612":[],"16211139":5,"16220":[],"16231451":4,"1625":[],"1628":[],"163":[],"1630775253":[],"16342407":5,"16343471":6,"16384":3,"16500":[],"166":[],"16660817":[],"166667":[],"167":[],"16740002":16,"168":[],"16805821e":6,"16807":[],"16827044":[],"16832385":[],"16b8e3cda33a":1,"17":[1,2,4,5,6,8,13,18],"17084902":[],"1709":[],"17174962e":1,"17222222222222222":1,"1726":[],"17300":[],"1731":[],"17339342":[],"17446471":6,"1752":[],"175300":[],"17641709":6,"176880142835407":[],"17777777777777778":1,"17801022":5,"17861098":6,"17917768":5,"17930649":16,"17949575":5,"17953942":11,"1797":[1,3],"18":[2,4,6,7,8,9,10,13,18],"180":[],"18029127":5,"1807":4,"1809":[],"181":[],"1810":4,"1812":[],"18156717":16,"1821":[],"18276924":[],"18327677":[],"18333333333333332":1,"18393678":[],"184":[],"184519":[],"184895":[],"185":[],"1851":[3,4],"1852":[3,4],"18526":[],"185278747229417":[],"1853":[3,4],"1854":[3,4],"1855":[3,4],"186":[],"1860":[],"1861":[],"18611111111111112":1,"18613217e":6,"18660":[],"18673098":11,"18682538":[],"1887":6,"18912963":16,"189496":[],"189622":[],"18it":[],"19":[2,4,6,13,18],"19003":6,"191262820314401":[],"19166666666666668":1,"19207979":5,"19213479":[],"19220":[],"193":[],"19354258":[],"19379506":[],"19394283":[],"194":[],"1940":0,"19404282648955e":6,"194042826653172e":[],"194042826815498e":[],"1940428268204826e":6,"1943":12,"1944":[],"19444444444444445":[],"19466812":[],"1950915150":[],"1954":[],"1956":[],"19569961":6,"1961":[],"1962":[],"1963":[],"1964":[],"1965":[],"1970":16,"1973":9,"197370":11,"19740":[],"1979":6,"19800":[],"19853775e":18,"1989":[],"199":[],"19937":[],"19994371":6,"1_1":12,"1_2":12,"1_3":12,"1cm":[0,8,10,18],"1d":[1,2,3],"1e":[1,2,3,4,14],"1e10":14,"1e4":6,"1f":1,"1k":16,"1n":0,"1s":3,"1x":0,"2":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,20],"20":[0,1,2,4,6,7,8,13,18],"200":[0,2,3,4,8,9,10],"2000":0,"200000":[],"20015436":6,"2004":13,"2006":20,"2010":1,"2011":1,"2014":4,"2015":1,"2016":0,"20174121":16,"2018":[0,6],"2018906331":[],"2019":[],"2021":[6,14],"2022":17,"2027":[],"20277777777777778":1,"203":6,"20320502":[],"20375361":[],"203753611274545":[],"20500":[],"20509391":[],"206":[],"2060":[],"20661216":[],"2069":[],"207545":11,"20756638":[],"20833333333333334":1,"20867052175006306":6,"20867052175109335":[],"20980":[],"21":[0,1,2,4,5,6,7,9,12,13,16,18],"210340":11,"21058097":5,"21130":[],"2116753732":4,"21169159e":6,"21265216":[],"213":6,"213103":11,"213743":11,"21472683":16,"2147483647":[],"21519063":16,"21596432":6,"216290":11,"216683":11,"21786964":16,"2188":[],"21919813":[],"21944444444444444":[],"2195":3,"21985165":13,"21997099":16,"22":[0,1,2,4,5,6,12,13,16],"22044605e":5,"220506557673408":18,"22094791":[],"221":8,"221180":[],"2216":[],"2218":[],"221805":2,"222400":[],"2225":3,"225":4,"2259440937":[],"226124657522696":[],"22612466":[],"22690428":5,"2284246870217459":6,"22842468702288576":[],"22842468702288582":[],"22847924":5,"22929905e":18,"2299":3,"22it":6,"23":[1,2,4,6,7,12,13,16],"23002365e":6,"23014274e":18,"231":[],"23103285":[],"2315033":[],"23167717":5,"2321528":5,"232153":5,"232435":[],"23297056":[],"23333333333333334":1,"233528":5,"234":6,"23522201":[],"2357089093":[],"2360682191515046":[],"2361111111111111":[],"2364":[],"237038":5,"23703839":5,"2379":6,"2397":[],"24":[0,1,2,4,6,13,16],"24140":[],"2416":[],"24175744e":6,"2419":[],"24276315":16,"2430":[],"24390":[],"24444444444444444":1,"244858":[],"24485843":[],"24512498":16,"246":2,"2470":[],"24770094":6,"24829908":5,"24906604e":6,"24924624":[],"2495":[],"25":[2,3,4,5,6,7,8,9,11,13],"250":[2,4,7,9],"2500":[],"25000":0,"250000":[],"250154":[],"2517560119":[],"251879":[],"252436":[],"25259666":16,"2526":3,"252866":[],"25286618":[],"253775":[],"255":3,"255001":[],"256":[2,4],"25617654e":6,"25617657e":[],"25617658e":6,"256962":[],"257":[],"2572":[],"2572495066":[],"2572e3a4b38d":1,"2575":[],"25792767":16,"25845e8df859":6,"259153":11,"2597":[],"25976336":[],"26":[2,4,6,13],"26079358":[],"26153846153846":[],"26186844":16,"2619":[],"26290036":[],"26294938":[],"2629493813057833":[],"26301436":5,"26306244":[],"264":4,"26409315307910025":6,"2640931530791003":[],"2640931530791005":[],"26409315307910053":6,"265":[],"2650":[],"265109911":4,"26531223e":18,"2654":[],"266":[],"26610075":[],"26666667":13,"26710969":5,"26780278":5,"268":[],"268227":[],"26822717":[],"269":[],"27":[0,1,2,4,6,13],"270":[],"2703":3,"27092897":6,"2750":[],"275341":[],"27562809e":18,"27621662e":18,"276263":11,"27692307692308":[],"27700":[],"2772":3,"2775623201":[],"27760":[],"278036":5,"27803645":5,"27n_":18,"28":[1,3,4,6],"28001319":[],"28047021":16,"280647":11,"28067036":16,"28097861":5,"280979":5,"2812":[],"282727":11,"283":[],"2830637392":4,"28336218e":6,"2836":[],"28390":[],"28475098":8,"28590743":[],"2861":18,"28634473":11,"286345":11,"2871":[],"2873":9,"2882":18,"2886":18,"2886847885377843":[],"28868479":[],"28875373":16,"2890":0,"2892":18,"28967287":16,"29":[4,6,7],"29149329":[],"2915":18,"29167186":5,"29229741":13,"2923076923077":[],"29512284":11,"295123":11,"2954":[3,4],"2955":[3,4],"2956":[3,4],"2957":[3,4],"2958":[3,4],"29588901":13,"29592539":[],"296247":[],"297":[],"2971492148":[],"2972":[],"29822833":6,"298273":[],"298375":[],"299267190588216":11,"299748":[],"2_":12,"2_1":12,"2_2":12,"2_3":12,"2_i":12,"2_m":[6,18],"2_t":13,"2_x":18,"2b":18,"2cm":8,"2d":[1,3,11,12,15],"2e":6,"2f":[0,7,9,10,11,12],"2ff97f4bf03b":[],"2g":2,"2g_i":2,"2k":3,"2m":6,"2n":[0,2,3],"2nd":9,"2p":18,"2pt":4,"2s":4,"2x":[0,3,8,13],"2x_ix_jy_iy_j":8,"2x_j":8,"2y_i":10,"2y_j":8,"3":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,19],"30":[0,1,4,6,7,10,13],"30000":0,"30010":[],"30119421":8,"3017":[],"3018":[],"3019":[],"301927":[],"3020":[],"3021":[],"30258509":16,"302m":4,"303":6,"3037":[],"3038":[],"30384239":16,"3039":[],"303m":4,"3040":[],"3041":[],"30466214e":6,"304m":4,"30535506":[],"30552077":16,"30559547":[],"305m":4,"3063":[],"306m":4,"3072":3,"30761405e":18,"30787294":6,"307m":4,"308m":4,"309":0,"30940":[],"30b53504a633":0,"31":[4,6,12,16,18],"310":0,"311":0,"311m":4,"312":0,"3120271598582915":18,"3123314713548606":6,"31276579e":6,"312m":4,"313":0,"31318084":5,"314":[],"31457796":5,"315":6,"3155":[0,5,6],"316":[],"31605061":16,"31614188e":18,"317":[],"31718909":11,"317367":11,"317m":4,"31866499":13,"31896852":8,"319m":4,"32":[3,4,6,12,13,16,18],"3200":1,"32039227e":18,"32047562":[],"3208":2,"320m":4,"32149601703519115":6,"3214960170351912":6,"3215":[],"32179365":[],"32309075":[],"32320052":16,"324":2,"32458459":[],"324m":4,"3250":[1,6],"32512":[],"326238":[],"326m":4,"32721178":11,"327212":11,"32750531e":18,"32816737":[],"32903042":[],"3297":[],"32992274":[],"329923":[],"33":[3,4,12,14,16],"3303":[],"33066907e":5,"3310":[],"33166055e":5,"331939":[],"331m":4,"332331":[],"333":7,"3331":[],"33327369":[],"333274":[],"33333333":13,"3337":[],"33611111111111114":[],"33711888":[],"3384":[],"33900713":[],"33m":4,"34":[4,7,16],"3403":[],"34040204e":18,"340782":11,"34114547":5,"341m":4,"342680":[],"34305928":[],"3436":0,"3437":0,"3456":[],"34568872":16,"34569596":5,"3457":[],"3458":[],"34585355":16,"3459":[],"3460":[],"346810":[],"3469819128513336":[],"34740615":[],"3498":[],"34it":6,"35":[0,2,4,6,7],"3514":[],"35140":[],"35147135":16,"351636":11,"35182854":5,"35203688":16,"3522":[],"3525":[],"3528556":[],"352856":[],"3529":[],"3530606977":[],"3538":[],"35396404e":18,"35401056e":18,"3543":[],"3544313922":[],"3546":[],"35470445e":5,"3548":[],"355":[],"3551":[],"35533773":6,"35533774":[],"3556":[],"35562617e":18,"3558":[],"3560":[],"356399":[],"3567":[],"3572":[],"35724288e":18,"3575":[],"357508":[],"3576":[],"3577":[],"35771842":6,"3581341341":4,"3585":[],"3587":[],"35892474":16,"359":5,"3593":[],"3594821":13,"3595":[],"3598":[],"359999999999985":[],"36":[0,2,4,5,6,7,18],"360":1,"3604":[],"3605":[],"3606":[],"360688":[],"3609":[],"36102113":[],"36117602":[],"3613":[],"3615":[],"361556":[],"3617":[],"3621311":5,"3624":[],"3627":[],"3628":[],"363295916323784e":6,"363295916414895e":[],"3632959170548605e":[],"363295924430451e":6,"363834":11,"36383443":11,"3643":[],"364418e97433":1,"3645":[],"3646":[],"3647":[],"3655":[],"3655222":5,"3659":[],"3668":[],"36689784":[],"366898":[],"3669":[],"367":2,"3672":[],"3673":[],"3674":[],"3679":[],"3684":[],"3687":[],"3688":[],"368m":4,"369139":11,"36it":[],"37":[2,4,6,7],"3704":[],"370782966":4,"3711":[],"3713":[],"3718":[],"3721":[],"3722":[],"3725":[],"3729":[],"37307168":16,"3739":[],"37396662":6,"37415316":16,"374291":5,"37429133":5,"3748":[],"3749":[],"3753":[],"3759":[],"3760":[],"3765":[],"376559":[],"37655936":[],"37692363":[],"37703055":[],"3772":[],"3773":[],"37732":[],"3776":[],"3777801602":[],"3779":[],"37835429e":[],"3784":[],"37900111":6,"3791":[],"3794":[],"379647":11,"37964744":11,"37992857":[],"38":[2,4,7,18],"380":[],"3802":[],"3803":[],"3804":[],"3805":[],"380739":5,"38073947":5,"3811":[],"38135733e":6,"3815":4,"381627865854956":[],"38162787":[],"3817475779":[],"3818":[],"3819":[],"3820":[],"38246359":[],"3827":[],"382951":11,"38295101":11,"3830":4,"3833":[],"38336316":16,"3834":4,"3837":4,"3838":4,"3839":4,"3842":[],"3850":[],"3851":4,"38533184":6,"3854":[],"3858":4,"386":[],"3861":4,"3862":4,"38629436":16,"3864":4,"3867":[],"3869":4,"387":[],"3871":4,"3872":4,"387482":5,"38748219":5,"3876":[],"388":[],"3881":4,"3882":[],"3885":[],"38868469":16,"3888":4,"3889":4,"389":[],"38901478":[],"3891":4,"38916861e":6,"38962192e":6,"3898":[],"39":[0,2,4,13,19],"390":[],"3906":4,"39095416":[],"3914":4,"3915":4,"3916":4,"391602":[],"3917":4,"3922":4,"3925515884752442":[],"3928":4,"3931":[],"39311435":16,"3943":4,"3944":4,"39456996":16,"3950":4,"3955":4,"39560937":16,"39579407":5,"3958":[],"3960":4,"3962":4,"3970":4,"39706038":5,"39724390e":18,"3975":4,"397700":11,"39789527":16,"3979":4,"39794864e":18,"3980313467":[],"3983":4,"3994":4,"3996":4,"399836":[],"3d":[2,3,4,6,13],"3f":[1,3,9],"3n":16,"3x":[2,8],"3x_i":2,"3y":8,"4":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,18],"40":[1,4,6,19],"400":4,"4000":20,"4005":4,"4011":4,"40116777":[],"401168":[],"4012":4,"4017":4,"401842":11,"40214433":16,"4022":[],"40236901e":18,"4027":4,"4030":4,"40340043":[],"4034668048":[],"4038":4,"4039":4,"404":[],"4045":4,"4048":4,"4055":4,"405890":11,"4059":4,"40599799":[],"4068":4,"4069":4,"4075":4,"4077":[],"408":2,"4082":[4,6],"4084":4,"4087":[],"4088":4,"4089":4,"409":2,"40927184e":6,"40a38ad763f1":6,"41":[2,4,16],"410":2,"4100":4,"4107":[],"411":2,"4115":4,"4117":4,"412":2,"4128":4,"4131":4,"41357064":[],"4143":4,"41433969":5,"4144":4,"4146":4,"41511965e":1,"4155":2,"4162706317":[],"4167":4,"4176":4,"4177":4,"418506":11,"4186":4,"41876267":5,"418763":5,"41882036e":6,"41882037e":6,"4192423635":[],"41958102e":18,"4198":4,"41990268":[],"41it":6,"42":[0,1,2,4,8,9,10,16],"420":[],"42037468e":18,"42078103":[],"421":2,"4212":4,"422":2,"4224":4,"423":2,"42340403e":18,"42394972":16,"424":2,"42441033":5,"42449643":[],"42450":[],"425":2,"4255":[],"4258989918":[],"426":[6,7],"42615374e":18,"42631342":[],"427017":11,"4275":4,"43":[0,1,2,4,7,16],"43054282":5,"43135183":16,"43294696e":18,"43330971e":6,"434932":11,"43493232":11,"435163":[],"43552433":16,"43579948e":6,"436462435":4,"43761347":[],"43766686":11,"4379":4,"438060758":[],"438136":[],"439230":6,"44":[0,1,2,4,16],"44089210e":5,"4410":[],"4411":[],"442600":11,"443217":[],"444":[],"44688507e":18,"44970586e":1,"45":[2,4,19],"450":[],"450257":11,"4504":[],"45290829":16,"45393214e":18,"4543859":[],"4557763":11,"455947":[],"456":[],"456418966187335":[],"457":[2,4],"457770268480242":[],"458027":[],"458078":11,"45960079":5,"46":[2,4,19],"4601":[],"461":[],"461175":16,"462":7,"46383925e":6,"464424":[],"4644244":[],"46508305":16,"46567887":16,"466":[],"46602982":[],"46696223":[],"469":[],"46932688":[],"4694":[],"46984697e":6,"469868":[],"46986815":[],"47":[4,19],"4703":4,"47042744":5,"470714":[],"47075725":6,"47116868e":6,"47125748":5,"47132891":5,"47387858":[],"47400238":[],"47432993":[],"4744":[],"47478057":[],"47485224":[],"475311":[],"47531107":[],"47610036":6,"47815203":11,"47920156":[],"47942814":5,"479465113":4,"48":4,"48089797":[],"48133064":[],"481979":6,"48212873":16,"48257387":19,"48316523e":18,"483257001":[],"4837":[],"48420165":[],"48476997":11,"48574149":16,"486873":[],"48687342":[],"489":[],"48994188":5,"49":[4,5,6,11,13],"490":[],"491":[],"49152":3,"492":[],"493":[],"49385454e":18,"4940954":0,"4959161509356135e":6,"495916150936645e":6,"495916150936654e":[],"495916150938325e":[],"49614357":18,"49636583":[],"497":[3,4],"498":[3,4],"499":[3,4],"4990":18,"4992":18,"4997":18,"49992743e":18,"4c4c7f":[9,10],"4d":3,"4f":6,"4y":8,"4y_i":10,"5":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,18],"50":[1,2,3,4,6,7,8,10,13],"500":[1,3,4,6,9,10,13],"500000":[],"50000455":5,"50000553":5,"50000718":5,"50000855":5,"50000969":5,"50001063":5,"50001142":5,"50001207":5,"50001261":5,"50001306":5,"50001343":5,"50001374":5,"500014":5,"50001414":5,"50001422":5,"50001439":5,"50001454":5,"50001466":5,"50001476":5,"50001485":5,"50001492":5,"50001498":5,"50001502":5,"50001506":5,"5000151":5,"50001512":5,"50001515":5,"50001517":5,"50001518":5,"50001519":5,"50001521":5,"50001522":5,"50001523":5,"50001524":5,"50001525":5,"501":[3,4],"50105159":[],"5018":18,"50227564e":6,"5031474174499113":18,"50314742":18,"50321091":5,"504167":[],"50416731":[],"506":0,"50680321e":18,"50727059":16,"50769230769231":[],"507d50":[9,10],"50846111e":6,"50846112e":6,"50it":6,"50j":13,"50x10":1,"51":[4,10],"510":1,"51004249":16,"51126895e":18,"512132":[],"51214899":6,"51265232":16,"51289697":11,"512897":11,"5138":[],"51389553":16,"514219":[],"51561271":16,"517350858882083":[],"5177783846":4,"518030":11,"51803019":11,"519842":[],"52":[3,4,13],"5222222222222223":1,"522758":[],"52307692307693":[],"5260627":[],"526744":11,"52723079":[],"52773051":[],"52799362":11,"528115":11,"52811546":11,"52874252":5,"529":[],"52911941":[],"52945798e":[],"53":[3,4,9],"5303329":11,"5305555555555556":1,"5312":[],"531280":[],"53189647":[],"53312754":16,"53423784":16,"53603432":[],"53611562":[],"53697476":[],"53703498":6,"5378811":11,"53794784":11,"537948":11,"53846153846155":[],"539261":11,"54":[3,4,6,18],"540":[],"54016188":11,"540162":11,"54039921":5,"54041041e":5,"541605":[],"54163136":13,"544439":[],"546166676":[],"54780216":[],"54it":[],"55":[1,3,4],"5501":[3,4,14],"550321":[],"5539":[],"55505907":16,"5555555555555556":1,"55578041":[],"5566":[],"557795":11,"55854694":11,"5594":6,"56":[1,3,4],"56033697":5,"561":[],"5611":[],"5615":[],"56198284":5,"5625":[],"56302854":16,"5639":[],"564":[],"564374":11,"565":[],"56536":0,"566":[],"56636616e":6,"567":[],"568":[],"569":1,"56912044e":6,"56939714":5,"56992937":[],"57":[0,4,8,19],"570":[],"5700":[],"571":5,"571105947979336e":6,"571105947979394e":6,"571105947979395e":[],"571105947979439e":[],"57154252":[],"57174058":[],"57201944e":6,"57266138":[],"57361898":[],"574465":11,"57673618":16,"57842073e":18,"57it":[],"58":[4,10,19],"583595":[],"58395707":[],"58428804":5,"584804":[],"5888888888888889":1,"589":[],"58986647":[],"59":[2,4],"590":[],"591":[],"591317992":4,"591594":5,"59159438":5,"592":[],"593":[],"5944444444444444":1,"59591979":[],"595920":[],"59592669":[],"59766":5,"597660":5,"59833875":13,"598392":[],"59839245":[],"59955801":13,"5cm":18,"5dd54edf2138":6,"5f":8,"5x":8,"5y":8,"6":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,16,17,18],"60":[1,2,3,4,6],"60000":4,"6019067271":4,"60236938":16,"60293962":5,"60420593":5,"60538875":16,"60619654":6,"6063219":[],"606439":[],"60673226":11,"60685864":6,"60791699":[],"6079169911277265":[],"60943791":16,"61":[2,4,7],"61033524":[],"6111111111111112":1,"612939":[],"613579":[],"61399851":11,"613999":11,"61463451":16,"614808":11,"61576236e":18,"618":[],"61808351":[],"618982":[],"6199381169260247":[],"62":[2,3,4],"62168613":[],"62364974":[],"62373464":11,"625":7,"626635268":[],"62767384":[],"62894215":5,"629961":[],"63":[0,1,2,3,4,6,7],"6300745149331701":[],"630224":[],"63025821e":6,"63207808":18,"63249532e":6,"63270833":[],"63395187":[],"63498144":5,"63675140":[],"6371293350711955":[],"63860687":16,"63901111":[],"63it":[],"64":[1,3,4,7,13,16],"64012627":5,"64113381e":18,"64141716e":18,"64293754":[],"64425009":[],"645":[],"64615384615385":[],"646283":11,"647":6,"64742912e":6,"647473":11,"649339":5,"64933923":5,"649382":11,"64x50":1,"65":[1,2,3,4,7,8,9],"65136857":[],"6530742540053943":[],"6562":[],"65626043":5,"65628853":16,"65885453":5,"659306":[],"66":[2,3,4],"66054752":[],"66087937":[],"66204648":6,"66226149":6,"66247212":[],"6628996975186953":[],"66292841":[],"66310422":[],"6638":[],"66410989":[],"66560":[],"66619972":11,"666200":11,"667":[],"668172":[],"668186":[],"66818635":[],"66it":6,"67":[2,4],"67047975e":6,"671089":[],"672721":[],"67314874e":5,"67588315":[],"67591616":[],"67697934":11,"67838309":[],"67882608":[],"68":[2,4],"68176047e":18,"68192193":5,"68246089":16,"68279358":16,"6834195":[],"68534263e":6,"68542204":5,"68545647e":[],"6869":[],"6887363571":4,"68929213e":6,"68944595":[],"689519":11,"69":[2,4,7,18],"690":[],"690569639355314":[],"69061276":11,"690617":[],"69069n_":18,"692":1,"69295955":[],"69484813e":5,"69493539":16,"69504801":6,"69634577e":6,"69695259":5,"69985355":[],"6999536":11,"69it":[],"6e75736fdab1":6,"6f7a6bd7d79f":6,"6m":[3,4],"6n_":18,"7":[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20],"70":[1,2,4,6,7],"70127680":6,"70179437":[],"70205195":16,"70354373":[],"703716d317a7":8,"70434005":[],"7050":[],"70598996":[],"70653767":4,"70710678":5,"70769586":[],"70831425":[],"70832814":5,"70980493":16,"71":[1,2,4],"71131626":16,"7119":[],"712018":11,"7134":[],"71350226":[],"7151":[],"71721168":[],"718697":5,"71869727":5,"72":[2,4],"72174172":11,"722047011333792":5,"72271878e":6,"72347283":[],"7236674":5,"72373129":[],"724":3,"72522848":[],"72859758":5,"7293182":[],"72981762":8,"73":[4,6],"731000":[],"73174557":[],"73287103e":18,"733096":[],"73406033e":18,"73484667":[],"735738558766299":[],"73573856":[],"73752910":[],"73it":6,"74":[4,6,13],"740":[],"74081822":8,"74368436":16,"743u":[],"7448615806559786":[],"7469898175164704":[],"74840212":5,"749765":[],"75":[4,5,6,8,11],"7501749450963715":[],"750445":[],"750u":[],"75106135":16,"75118364":[],"751699":11,"75170092":5,"753846153846155":[],"75517445":[],"756352":[],"75838233":[],"75it":[],"76":[2,4,19],"76060096":[],"76066069":16,"763u":[],"7643536":13,"765":7,"76529528":[],"76674796":16,"76731400e":18,"76802186":[],"76923076923077":[],"76936315":5,"7694444444444445":1,"77":[2,4,13,19],"77034458":[],"770345":[],"77152076":5,"7718":9,"773329728649545":[],"77332973":[],"77333117e":18,"774300":[],"775":[],"77627886":13,"77632220e":18,"77636e":13,"77662945":[],"7767978193240488":11,"77714169":8,"77754132e":18,"7782028952":4,"77865169":[],"78":[2,4],"78011544":[],"78156479e":5,"78184120e":6,"7846153846154":[],"78941903":5,"78988962e":18,"79":[2,4],"79009329":16,"79093776":[],"79111643":5,"791123":[],"79145214e":18,"793167":[],"79394867":[],"7939646":[],"794282":11,"79449156":[],"79602861":[],"79754246":[],"797e":6,"79856831e":18,"7c394b1e8b71":9,"7d7d58":[9,10],"7f2b3a6174c2":13,"7m":4,"8":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17,18],"80":[0,1,2,4,5,6,8],"800":[4,7],"80315282":5,"803153":5,"80354994":6,"80469739":5,"8055555555555556":1,"80561191":[],"80609615e":6,"80609616e":6,"8064":[],"80734875":[],"807349":[],"80738685":16,"80747253":16,"80842254":11,"808423":11,"80847477e":6,"81":[1,2,4],"81048318e":6,"8108619":[],"81160425":5,"81187794":16,"81333804":6,"81333805":[],"81388724e":18,"814":[7,11],"815563":[],"81633628":11,"816454":[],"81671821":[],"816847":[],"8175":[],"82":[2,4],"8219235992494145":[],"8219236":[],"82198978":5,"82650876":[],"826509":[],"8265786":5,"82747653":[],"827477":[],"82773778":[],"829648415811072":18,"82964842":18,"83":4,"8305555555555556":1,"83512277":5,"836874":5,"83687444":5,"83698677":16,"83999999999999":[],"84":4,"84062065":[],"84228957e":[],"84232163":16,"842436":[],"84292394":[],"842u":[],"84355903e":1,"84443254e":1,"84569271":13,"84780262":6,"84854738":[],"84923989e":6,"84924834":11,"84994524":5,"85":[1,4],"8503720991789538":5,"85091337":[],"85263220":6,"8527777777777777":[],"85278920e":5,"853241":[],"85324115":[],"853u":[],"85601992":5,"85758696":16,"858":[],"8583333333333333":1,"85953586":6,"85959007":[],"86":2,"8608479":[],"860848":[],"861":[],"86117291":5,"86134827":5,"86145244":11,"8638888888888889":1,"86478158":[],"86546962":[],"86623151":13,"86630":[],"8666666666666667":1,"86810":[],"869":0,"86905621":[],"86925797":5,"869258":5,"87":2,"870":0,"8702784034":4,"871":0,"872":0,"8722222222222222":1,"873":0,"87327414":[],"87381451":5,"875":1,"8759":13,"876":6,"87625493":[],"87647541":[],"8768":[],"878297":[],"87836018":[],"87940752":16,"87it":6,"88":[0,2,13],"88017651":11,"880177":11,"88031314":[],"88046261":5,"8805555555555555":1,"88118231":[],"88168312e":6,"881788":[],"883":[],"88336879":5,"884":[],"88477619":[],"885":[],"88512489":[],"88529063e":6,"8855417382991412":[],"88554174":[],"886":[],"88679947":[],"887":[],"8879":6,"88871662":16,"8888888888888888":1,"8894":6,"89":2,"8916666666666667":[],"89274639":16,"89288636":11,"893489":5,"89348922":5,"89410423":5,"8944444444444445":1,"89550839":16,"89565264":[],"8962476":[],"896248":[],"89873772":16,"89876748":[],"8991514":16,"89944994":5,"899450":5,"8f":6,"8g":6,"8n":16,"8x8":1,"9":[0,1,2,3,4,5,6,7,8,9,11,12,13,14,16,18],"90":[1,2,6],"900449":[],"90054363":[],"90075537":5,"9011":6,"90220243":5,"90266948":5,"90268858":[],"9027777777777778":1,"903824":[],"90382431":[],"9040":9,"90475506e":6,"90540529":11,"9055555555555556":1,"9083333333333333":[],"90884627":16,"90895045":16,"90940378":16,"90999452e":18,"91":19,"910":[],"9111111111111111":1,"91128596":5,"912u":[],"913":[3,4],"91379157":[],"913791573406831":[],"91383439":16,"91396388":[],"914":[3,4],"91416375":[],"91479093":[],"91492986e":6,"915":[3,4],"91549644":[],"916":[3,4],"9166666666666666":[],"917":[3,4],"91760278":5,"918":[],"91812702":5,"918992":[],"919":[],"92":[6,19],"92272314":[],"922u":[],"92343595":[],"924018":[],"92477093":[],"924e":6,"925":1,"92507116e":1,"9252772":11,"92578916":5,"92603747":16,"92626212":16,"92754397":[],"927544":[],"9277777777777778":1,"92819235":[],"92857143":7,"93":[],"9305555555555556":1,"930583":11,"931":0,"93155188":5,"93158979":5,"93248252":5,"932483":5,"932u":[],"933":5,"93414191":[],"93492130e":6,"93579127":16,"935u":[],"9361111111111111":[],"937":18,"937082":[],"93799826":5,"938":18,"9387":[],"939":[0,18],"94":[7,18],"9400":[],"941866404575299":[],"94226022e":6,"94284104":5,"94320205":5,"9444444444444444":1,"945":[3,4],"94548496":[],"94591015":16,"946":[3,4],"94639099":11,"94659383":[],"947":[3,4],"9472222222222222":1,"94735055":[],"947903":[],"94790323":[],"948":[3,4],"9482527":5,"949":[3,4],"95":[1,7,11],"95008046":6,"95079764":6,"95231424":5,"9527777777777777":1,"95284275":5,"953065564":[],"95351665":5,"954":18,"9549351910143222":[],"954u":[],"9555555555555556":1,"95569422":[],"955820c21e8b":4,"956563":11,"95684892":5,"95703":13,"95714723":[],"957147232685324":[],"95it":[],"96":[6,7,11],"960":18,"9601304850018328e":6,"960130485007504e":6,"960130485007934e":[],"9601304850213484e":[],"96024953":5,"96032148":16,"96084663":5,"961":18,"962":18,"9637117593816477":6,"9640435":5,"96489434":[],"9649652536":4,"96527903":16,"96551427e":18,"965548":[],"96606158":16,"96653373":[],"96686324e":18,"96688672":5,"9674916":5,"967809":11,"96863851":[],"96987657":[],"96992454":[],"97":7,"97005689":5,"97065296":[],"97108e":13,"9722222222222222":1,"97230501":[],"97243128":5,"97300836":5,"97497404e":6,"975":1,"97507735":5,"97547354":18,"97547354476579":18,"975510299261579":9,"9760832":[],"97705827":5,"977418":5,"97758848":5,"9777777777777777":1,"977880":[],"97788031":[],"9780387310732":20,"9780387848570":20,"9781492032632":20,"97898392":6,"97926491":5,"98":[0,1,7],"980":[],"98017611":13,"98036405":[],"9805555555555555":1,"98091621":5,"981321":[],"98139097":5,"98266587":16,"98275501":5,"983310":[],"98346748":[],"98399675":[],"98413059":5,"98454786":5,"985":18,"98566191":5,"986":18,"9861111111111112":1,"98680716":5,"98716878":5,"98756882":13,"98794823":16,"9879924":[],"98808176":5,"98822371":6,"9888888888888889":1,"989":18,"9890348":5,"9893149172528393":[],"9893447":5,"9898254753574576":[],"98982548":[],"9898ff":[9,10],"99":[6,7,11,13],"990":[],"99009525":5,"9902552771282336":[],"99049330":6,"99088801":5,"991":18,"99115119":5,"99176998":5,"992":18,"99242921":5,"99265097":5,"99274513":0,"993":18,"99316252":5,"99353454":[],"993535":[],"99371056":5,"99389612":5,"993972":[],"99397245":[],"9943201":5,"99435648":[],"9947756":5,"99492986":5,"99519225":13,"99528218":5,"99539415":5,"9955282554647219":[],"99566069":5,"99578809":5,"996":5,"99608161":5,"9963961":5,"99650061":5,"9967458":5,"99700706":5,"99709215":5,"99724883":[],"99729756":5,"99751458":5,"99758326":5,"99775587":5,"99775949":[],"99793613":5,"99799099":5,"99813653":5,"99828624":5,"99829953":[],"9983295":5,"99845267":5,"998577":5,"99861053":5,"99871521":5,"99881845":5,"99884384":5,"99893323":5,"999":[9,18],"99901896":5,"99903755":5,"99911427":5,"99918546":5,"99919837":5,"99926459":5,"9993237":5,"99933188":5,"99938942":5,"9994385":5,"99944272":5,"99949306":5,"99953381":5,"99953475":5,"99957911":5,"99961294":5,"99965056":5,"99967865":5,"99970988":5,"9997332":5,"99975913":5,"99977416":[],"99977849":5,"99980002":5,"9998161":5,"99984732":5,"99987324":5,"99989476":5,"99991263":5,"99992746":5,"99993978":5,"99995":5,"9999555851685968":6,"999955585168597":6,"9999840939906267":[],"9999858320366368":[],"9x":6,"9y":6,"\u00f8yvind":[6,19],"abstract":1,"boolean":4,"break":[0,4,6,11,14],"byte":16,"case":[0,1,2,3,4,5,6,7,11,12,13,14,15,16,17],"catch":0,"char":[],"class":[0,1,3,4,6,7,8,9,11,12,13,18],"const":[],"default":[0,1,2,4,6,7,13,16],"do":[0,2,3,4,5,6,8,9,10,11,12,13,14,16],"ekstr\u00f8m":4,"eng\u00f8i":19,"export":9,"f\u00f8470":19,"final":[0,1,2,3,4,5,6,7,8,9,10,11,13,14,17,18,19],"float":[0,3,4,5,9,11,13,14,16],"function":[2,3,4,5,9,14,15,16],"import":[0,1,2,3,4,6,7,8,9,10,11,12,13,14,18],"int":[0,1,2,3,4,5,6,11,13,14,16,18],"long":[0,1,3,4,12,13],"m\u00f8svatn":6,"new":[0,1,2,3,5,6,7,8,9,10,11,13,14,16],"null":[],"public":[0,15],"return":[0,1,2,3,4,5,6,7,8,9,11,13,14,16,18],"s\u00f8rli":[],"s\u00f8rlie":19,"sch\u00f8yen":[6,19],"short":[4,5],"steinsv\u00e5g":[],"super":[3,5],"switch":0,"throw":[3,6,18],"true":[0,1,2,3,4,5,6,7,8,9,10,12,13,14,16,18],"try":[0,1,2,3,4,5,6,7,8,9,10,11,13,14,15,16,18],"var":[5,6,10,11,18],"while":[0,1,3,4,5,6,7,8,9,11,12,13,18],A:[2,3,5,6,7,10,11,12,13,15,16,17,18,19,20],AND:2,And:[0,3,4,5,6,9,15,18],As:[0,1,2,3,4,5,6,8,10,12,13,16,18],At:[0,4,6,13],BE:0,Be:[2,15],Being:13,But:[0,1,2,3,5,6,9,10,18],By:[0,3,5,6,12,13,16],For:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20],IF:6,IN:20,If:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,15,16,18],In:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,20],Is:11,Ising:[5,12],It:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18],Its:[1,2,4,11],NO:[7,11],No:[3,4,5,6,7,8,9],Not:[0,1,5,6,17],OR:18,Of:18,On:[0,3,17,18,20],One:[0,1,3,4,5,6,7,8,11,12,13,18],Or:[0,1,6],Such:[0,6,12,18],That:[0,5,7,10,11,12,14,18],The:[4,10,13,14,16,17,18,19,20],Then:[0,1,5,6,8,9,10,11,12,13,14,16],There:[0,3,4,5,6,8,9,11,12,14,16,17,18,19],These:[0,3,4,5,8,9,10,11,12,13,14,16,18],To:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,16,18],With:[0,5,6,8,9,10,11,12,14,16,18],_0:[5,8,10,11,13],_1:[2,5,6,8,10,11,12,13,14,16],_2:[2,5,8,11,12,13,16],_3:16,_4:16,_9:13,_:[0,1,2,4,5,6,7,8,9,10,11,12,13,16],_________________________________________________________________:4,__call__:[3,4],__class__:10,__doc__:6,__future__:[8,9],__getitem__:[],__init__:[1,3,4,14],__main__:2,__mosek:5,__name__:[2,10],__traceback__:[3,4],_asarrai:[],_auto10:[6,12],_auto12:6,_auto1:[2,3,4,5,6,7,12,13,16,18],_auto2:[2,3,4,5,6,12,13,16,18],_auto3:[3,4,5,6,12,13,16],_auto4:[4,6,12,13,16],_auto5:[4,6,12,13,16],_auto6:[4,6,12,16],_auto7:[4,6,12,16],_auto8:[6,12],_auto9:[6,12],_ax:[],_base:8,_build:[0,15,17,20],_build_call_output:[3,4],_c:1,_call:[3,4],_call_flat:[3,4],_check_1d:[],_check_optimize_result:[7,11],_compon:11,_coordinate_desc:6,_copy_docstring_and_deprec:[],_decor:0,_depth:9,_fraction:9,_get_lin:[],_getitem_multilevel:[],_handl:[3,4],_i:[0,1,2,5,6,8,11,12,13],_inference_funct:[3,4],_interpolatefunctionerror:[3,4],_is_primit:[],_j:[0,1,2,3,5,6,8,13],_jit_compil:[3,4],_k:13,_l:12,_lambda:6,_leaf:9,_logist:[7,11],_m:10,_make_vjp:[2,13],_maybe_define_funct:[3,4],_multilayer_perceptron:1,_n:[2,5,8,11,13],_node:[2,9,13],_notokstatusexcept:[3,4],_np:[],_num_output:[3,4],_p:[5,8],_plot_arg:[],_process_traceback_fram:[3,4],_r:[3,4],_ratio:11,_sampl:9,_select_forward_and_backward_funct:[3,4],_split:[6,9],_src:[3,4,14],_stateful_fn:[3,4],_stateless_fn:[3,4],_t:13,_test:6,_trace:[2,13],_valu:[2,13],_varianc:11,_weight:9,a0:3,a0faa0:[9,10],a1:0,a2:0,a3:0,a4:0,a_0:0,a_1a:0,a_2a:0,a_3:0,a_3a:0,a_4:0,a_4a:0,a_:[0,1,16],a_h:1,a_i:[0,1,2,12],a_j:[1,12],a_k:[0,1,12],a_ndim:2,aaron:20,ab:[0,2,5,13,14],ab_channel:15,abandon:1,abbrevi:17,abid:18,abil:[0,10],abl:[0,1,4,5,6,7,10,12,13],abort:[],about:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,15,16,20],abov:[0,1,3,4,5,6,7,8,9,10,11,12,13,14,16,18],abovement:6,abscissa:13,absolut:[0,2,5,6,13],acceler:13,accept:[0,3,6,9],access:[0,3,4,11,18],accid:[4,6],accmod:5,accompani:0,accomplish:[8,9,13],accord:[0,1,2,5,6,9,12,13,14,18],accordingli:11,account:[0,3,5,13,18],accumul:[12,18],accur:[0,3,4,6,10,13],accuraci:[0,1,3,4,5,6,7,9,10,11,12],accuracy_scor:[0,1,10],accuracy_score_numpi:1,achiev:[0,1,5,6,8,12,16],aco:18,acquaint:15,acquir:[1,15],acr:0,across:[1,3,6,9,15],act:[1,3,16],action:18,activ:[0,2,3,4,9,17],actual:[0,1,4,5,6,8,11,16,18],ad:[1,3,4,5,8,13,16],ada_clf:10,adaboostclassifi:10,adadelta:13,adagrad:13,adam:[1,3,4],adapt:[4,6,13,20],add:[0,1,2,3,4,5,6,8,10,11,12,18],add_lin:[],add_outgrad:2,add_subplot:[1,7,12,14],addendum:5,addit:[0,2,3,5,6,7,8,9,10,12,13,15,16,18,19,20],addition:[12,13],address:[1,9,11,13,20],adjac:[3,12],adjoint:5,adjust:[0,5,12,13],admir:0,advanc:[4,6,12,20],advantag:[1,3,5,6,10,13,16],affect:3,affin:[0,3,8,11],afford:3,aforement:14,african:0,after:[0,1,2,4,5,6,9,11,12,13,15,16,18],afterward:0,ag:[0,7,17],ag_0:2,again:[0,1,4,5,6,7,8,10,11,12,13,18],against:[1,4,7,10],agegroup:7,agegroupmean:7,aggreg:[9,10],agorithm:10,agre:[5,6,18],ahead:9,ai:[0,20],aid:11,aim:[0,1,4,6,7,11,14,15,16],ainv:5,airplan:3,aka:5,al:[0,2,4,17,20],alarm:5,algebra:[0,3,5,13,15,17],algo:[],algorithm:[0,1,2,4,5,6,7,8,13,14,15,16,17,18,20],align:[0,2,5,6,7,8,13,18],all:[0,1,2,3,4,5,6,7,9,10,11,12,13,14,15,16,17,18,19,20],allevi:[1,13],alloc:[3,16],allow:[0,1,2,3,5,6,8,10,13,15,16],almost:[0,1,6,8,11,13,18],alon:[2,9],along:[2,3,4,5,6,9,10,11,15,16],alpha:[0,1,2,3,4,5,6,7,8,9,10,13,14,18],alpha_0:3,alpha_1:3,alpha_2:3,alpha_:10,alpha_i:[3,13],alpha_k:13,alpha_m:10,alpha_n:3,alpha_opt:13,alreadi:[2,3,4,5,6,10,12,15,16,18],also:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20],alter:1,altern:[0,1,4,5,6,7,8,9,11,13,16],although:[0,1,5,6,8,10,13],alwai:[0,3,5,6,12,13,18],am:4,ame2016:0,american:0,among:[0,3,5,9,10,12,16],amongst:5,amount:[0,1,3,4,6,8,10,14,15],an:[1,2,3,5,6,7,8,9,11,12,13,14,15,16,18,19,20],an_:18,anaconda3:[],anaconda:[0,1,15],analog:13,analys:6,analysi:[1,3,4,7,14,16,17,20],analyt:[2,3,5,6,7,12,13,15],analyz:[0,1,3,4,5,6,18],andrew:1,angl:[0,3,9],anharmon:3,ani:[0,1,2,3,4,5,6,7,8,9,10,12,14,18],anim:[4,12],ann:12,annot:[0,1,3,7,8],anoth:[0,1,3,4,5,6,7,8,10,11,12,13,16,18],anp:2,ans_vspac:2,ansatz:0,answer:[0,1,3,5,6,16],antialias:[2,6],anticip:4,anymor:[1,8],anyon:[4,8],anyth:[1,18],anytim:19,apach:1,apart:[11,13],api:[1,15],appar:2,appear:[0,1,3,13,16,18],append:[1,3,4,8,9,13],appendcon:5,appendvar:5,appli:[0,1,2,3,4,6,7,8,9,10,11,12,13,18,20],applic:[0,1,3,4,5,6,7,9,12,13,16,17,18,20],apply_gradi:4,approach:[1,2,4,5,6,9,10,11,12,13,15,18,20],appropri:[2,6,9,12,13,15,18],approx:[0,2,3,6,10,11,13,18],approxim:[0,1,2,3,4,5,6,7,10,11,13,18],apt:[0,15],aq:18,ar:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20],arang:[1,3,4,6,7,9,10,12],arbitrari:[1,4,6,8,12,13,18],arbitrarili:[0,1,11],arc:6,architectur:[3,4,12,20],area:[0,3,6,20],arg:[0,2,3,4,13],argc:[],argmax:[1,11],argmin:[4,10,14],argnum:[2,13],argnum_0:2,argnum_1:2,argsort:11,argu:[1,13],argument:[0,2,3,5,6,11,12,13],argv:[],argval:2,aris:[0,6,12,13,18],arithmet:[0,13,16],arm:[3,4,6,14],arma:[],armadillo:16,around:[0,1,4,5,6,11,18],arr:2,arrai:[0,1,2,3,4,5,6,7,8,9,11,12,13,14,15,18],arrang:3,arraybox:13,arriv:[0,6,9,11,16,18],arrow:12,arrowprop:8,art3d:13,art:[0,1,15],articl:[0,3,4,6,10],artifici:[0,2,7,12,20],artificialneuron:12,arug:13,arxiv:[3,4],as_fram:[],asarrai:[0,2,6,9],asc:5,ascii:[],ashrafi:19,ask:[5,6,11,12],aspect:[0,6,15],assembl:[0,3],assert:4,assess:[0,6],assici:4,assign:[0,7,8,9,12,13,14,17,20],associ:[0,6,9,12,14,18],assum:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,18],assumpt:[0,3,5,6,9,11,18],ast:[0,5,6],astyp:[4,9,10],asymmetri:0,asymptot:[4,6],async_wait:[3,4],atoi:[],atom:0,attempt:[0,4,6,7,8,10],attend:17,attent:[0,16],attr:[3,4],attract:[0,10],attribut:[0,9],attributeerror:[],audi:0,audio:[3,4],aurelien:[0,17,20],austfjel:6,author:[0,1,10,18],authour:0,auto:[6,9,10,18],autocor:18,autocorrelation_tim:18,autocorrelform:18,autocovari:18,autoencod:[4,15],autoencond:15,autograd:15,autom:[0,15],automac:16,automat:[0,1,2,3,4,11,15,16,17],automobil:3,autonom:[4,20],avail:[0,1,4,6,10,11,15,16,17,20],averag:[0,1,3,6,9,10,13,14,18,19],avg:[],avoid:[0,4,5,6,9,11,13,16],avx2:[],avx:[],awai:[2,3,6],awar:[2,10],award:19,ax:[0,1,2,3,4,6,7,8,9,10,11,12,13,14,16],axes3d:[2,6,13],axes_grid1:6,axessubplot:[],axhlin:8,axi:[0,1,2,3,4,6,7,8,9,10,11,12,13,14,16,18],axiom:5,axlabel:0,axvlin:[4,8],axvspan:4,b1:8,b2:8,b3:8,b:[0,1,2,3,4,5,6,8,9,10,12,13,14,18,19],b_0:0,b_1:[0,2,12,13],b_2:[0,13],b_5:13,b_:[0,1,16],b_group:9,b_i:[0,1,2,12],b_ia_:0,b_ia_i:0,b_index:9,b_is_vec:2,b_j:[1,12],b_k:[0,1,12,13],b_m:12,b_meta:2,b_score:9,b_valu:9,bachelor:17,back:[0,3,4,5,6,8,9,10,16,17,18],backbon:16,backend:[1,4],background:[17,20],backpropag:1,backtrack:9,backup:16,backward:[1,2,4,12,16],backward_pass:2,bad:6,badli:18,bag:[9,15,17],bag_clf:10,baggingboot:10,baggingclassifi:10,baggingtre:10,balanc:6,band:16,bandwidth:16,bar:[0,6,11],barber:20,bare:[4,10],base:[0,1,3,4,5,7,8,9,10,14,15,18,19,20],basi:[5,7,8,10,11,12,13,16],basic:[6,8,12,13,14,15,17,18],batch:[3,4,11,12,13],batch_shap:4,batch_siz:[1,3,4],batchnorm:4,bay:7,bayesian:[5,15,20],bc298b802fe2:6,becaus:[0,1,2,3,4,5,6,8,9,12,13,14],becom:[0,1,2,5,6,7,9,12,13,18],been:[0,1,2,3,4,5,6,11,12,13,15,16],befor:[0,1,2,3,4,5,6,7,8,12,13,14,16,18],beforehand:[0,18],begin:[0,1,2,3,4,5,6,7,8,9,11,12,13,14,16,18],behav:[1,6,13],behavior:[0,1,13],behaviour:12,behind:[0,1,6,8,13],behnoosh:19,being:[0,1,2,3,4,5,7,8,10,11,12,13,18],believ:[9,16],belong:[5,7,8,9,13,14],below:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,16,18],benchmark:10,bendik:[],benefici:[1,13],benefit:[0,1,4,11,13,15],bengio:[1,17,20],benign:[1,7],bennosh:19,besid:[4,5],bessel:5,best:[0,1,2,3,4,5,6,7,8,9,10,12,13,19],beta:[0,1,3,5,6,7,10,11,13],beta_0:[0,1,3,5,6,7,13],beta_0x_:0,beta_1:[0,1,3,5,6,7,10,13],beta_1x_0:0,beta_1x_1:[0,7],beta_1x_2:0,beta_1x_:0,beta_1x_i:[7,13],beta_2:[0,3,13],beta_2x_0:0,beta_2x_1:0,beta_2x_2:[0,7],beta_2x_:0,beta_3:3,beta_:[0,3,6,7,13],beta_i:[0,3,5],beta_j:[0,5,6,13],beta_k:13,beta_linreg:13,beta_m:10,beta_mg_m:10,beta_n:3,beta_p:7,beta_px_p:7,betavalu:5,better:[0,1,2,3,4,6,9,10,11,12,13],between:[0,1,2,3,4,5,6,7,8,9,11,12,13,14,18],beyond:[0,1,5,6,8,13],bf:[13,14,16,18],bgd:13,bia:[0,1,2,3,5,8,9,10,12,13,17],bias:[1,2,3,5,6,9,12],big:[0,1,2,5,6,14],bigger:[1,6],bigr:12,bike:9,bilek:19,billion:[3,12,15],bin:[0,7,18],binari:[0,3,5,7,9,10,12,17],binarycrossentropi:4,bind:0,binomi:[15,18],binsboot:6,bioinformat:0,biolog:[1,12,20],bios1100:15,bird:[0,3],bishop:[17,20],bit:[1,4,16,18],bitwis:18,bivari:2,bk:[0,13],bla:[5,16],black:[8,9,14],blob:17,block:[6,10,15,16,18],blockingavg:[],blockingstd:[],blockingvar:[],blocksiz:[],blocksizemax:[],blocksizemin:[],blogpost:4,blue:[0,3],bmatrix:[0,1,3,5,7,8,11,13,16],bmi:1,bodi:[0,1,4,12],bold:1,boldfac:[0,5],boldsymbol:[0,1,2,3,5,6,7,8,10,11,13,14],boltzmann:[12,15],book:[17,20],boost:[1,9,15,17],boostrap:10,bootavg:[],bootstd:[],bootstrap:[1,13,15,17],bootvar:[],bootvec:[],boston_dataset:0,bot:8,both:[0,1,4,5,6,8,9,10,13,14,15,16,18,19],bottl:7,bound:[0,5,8,12],boundari:[2,4,8,11,12],boundkei:5,box:[2,4,9],boxed_arg:2,boyd:[8,13],bracket:[4,18],brain:[1,7,12],branch:9,breast:[5,7,11],breviti:13,brew:[0,15],brg:8,briefli:0,bring:[0,5,6,10],broad:[0,3,4],brought:15,brownle:4,brute:[3,5,11],bs:[8,9,10],buffer_s:4,bui:4,build:[0,4,5,6,10,13,16,18],built:[0,1,3,4,6],bunch:11,busi:0,bx:5,bzl:5,c1:[8,11],c2:[8,11],c95af3df0cdd:3,c:[0,1,2,4,5,6,7,8,9,10,11,12,13,14,15,16,18,19,20],c_0:18,c_1:12,c_2:12,c_3:12,c_4:12,c_:[0,8,9,10,13,18],c_i:[12,13],c_k:18,ca:1,cabc613b8702:13,cach:10,cal:[0,8,10,12,13],calcul:[0,1,2,4,5,6,8,9,10,11,12,13,14,16,18],california:[],call:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,20],callabl:[3,4],callback:[3,4],calor:0,cambridg:[13,20],can:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,20],cancel:[0,13],cancellation_manag:[3,4],cancer:[5,10],cancerpd:7,candid:[8,9,10],cannot:[0,1,4,5,6,7,8,9,17,18],canopi:[0,15],cap:5,capabl:[0,1,8,13,15],capac:2,capita:0,captur:[4,11,12],captured_input:[3,4],car:[3,4],card:[0,7],cardin:1,care:11,carefulli:13,carlo:[0,6,15,18,20],carri:[2,6,7],cart:10,carvalho:19,casella:20,cast:1,cat:[3,4],categor:[0,1,3,9,11],categori:[0,1,3,7,10,12,14,17],categorical_crossentropi:[1,3],caus:[0,5,6,18],causal:0,causat:0,cax:1,cb:6,cbar:1,cbook:[],cc:[0,1,5,13],ccc:[5,12],cd_fast:6,cdf:18,cdot:[0,2,6,12,13,14,16,18],celebr:13,cell:4,center:[0,1,6,7,8,9,11,14,18],centr:20,central:[0,3,5,6,8,16],centroid:[14,18],centroid_differ:14,centuri:3,certain:[0,3,6,7,9,18],cg:13,cha:0,chain:[0,1,13,15,18],chanc:[1,5,13,18],chang:[0,1,2,3,4,5,6,8,9,11,12,13,14,16,18],channel:3,chapter3:0,chapter:[0,6,10,11,16,17,20],charact:[0,3,5],character:[8,9,10,12,18],characterist:[0,1,3,10,13],charg:0,charl:0,chase:4,chd:7,chddata:7,cheap:5,cheaper:[1,13],check:[0,1,3,4,5,6,11,13,16],checkmark:3,checkpoint:4,checkpoint_dir:4,checkpoint_prefix:4,chemic:[],chen:10,chiaramont:2,choic:[0,1,2,3,4,6,9,12,13,14,16],choleski:[5,16],choos:[2,3,6,9,10,11,13,14],chosen:[0,1,2,6,8,9,10,13,18],chosen_datapoint:1,christian:20,christoph:[17,20],cifar10:3,cifar:3,cin:[],circ:[1,12],circl:[0,8,12],circuit:3,circumfer:9,circumv:[1,5,13],ckpt:4,clariti:18,class_nam:[3,9],class_val:9,class_valu:9,class_weight:[3,4],classic:[7,9,13],classif:[0,3,5,6,7,8,11,12,15,17,20],classifi:[0,1,4,7,9,10,11],classificaton:1,classifii:10,clean:1,clear:[1,5,10,12,13],clearli:[0,3,5,6,7,8,18],clever:[1,10],clf3:0,clf:[0,6,8,9,10],clf_lasso:6,clf_ridg:6,clip:[3,18],close:[0,1,2,4,6,8,9,11,12,13,14,18,20],closer:[3,5,13],closest:[8,11,13,14],closur:15,cloud:15,cluster:[0,1,4,6,11,15,17],cluster_label:14,cm:[1,2,3,6,8,13],cmap:[0,1,2,3,4,6,8,9,10],cmap_arg:6,cmath:[],cmb:17,cmd:9,cmu:[],cn_:18,cnn:[12,17],cnn_kera:3,cntk:15,co:[0,2,3,6,9,13],code:[3,4,6,7,8,13,15,16,17,18,20],coef0:8,coef:0,coef_:[0,5,6,8,9,13],coeff:5,coeffici:[0,3,5,6,7,8,9,13,16],coerc:[0,6],coin:[10,18],coin_toss:10,col:[0,11],colab:15,cold:9,colinear:0,collaps:8,collect:[0,2,6,10,11,15,18,20],collinear:5,color:[0,3,4,6,8,9,10,18],color_channel:3,color_cod:6,colorbar:[1,6],colsample_bytre:10,colsaobject:10,colspec:0,column:[0,1,2,5,6,7,8,9,11,12,16],columntransform:9,com:[3,4,6,14,15,17,20],combin:[1,2,5,6,7,10,18],come:[0,1,3,4,5,12,13,14,17],command:[0,1],comment:[0,4,5,6],commerci:[0,15],commod:0,common:[0,1,3,5,6,7,9,11,13,14,18],commonli:[0,1,4,6,7,9,13,14],commun:[0,12],commut:3,commutatitav:3,compact:[0,1,3,5,6,7,9,11,12,13,14],compair:0,compar:[0,3,4,5,6,11,13,16],comparison:[2,4,13],compat:7,compet:0,competit:10,compil:[0,1,3,4,15,16],complet:[0,2,3,4,9,12],completenn:12,complex:[1,5,8,9,11,12,13],complic:[0,1,9,13],compon:[0,1,3,4,5,6,7,9,14,15,17],components_:11,compos:[9,12,14,15],compphys:[0,6,15,17,20],compress:0,compris:6,compromis:5,compulsori:15,comput:[0,1,2,3,4,5,6,7,8,10,11,12,13,15,16,17,18,20],computation:[0,3,6,9,13,18],con:5,concaten:[2,4,6,14],concav:[1,13],concentr:[0,10],concept:[0,2,15],conceptu:[12,13],concern:[0,1,4,7],conclud:[0,5,13],conclus:1,cond:2,conda:[0,1,15],condit:[0,2,4,5,6,8,9,11,13,18],conduct:15,condwav:2,coneqp:5,confid:[0,5,6,7,8],configur:3,confirm:[5,12],confus:[5,6,10,16],confusion_matrix:9,congruenti:18,conjug:[4,8],conjugaci:13,conjunct:3,connect:[0,1,3,4,9,11,12,13,16],consequ:[5,6,8,10,12,13],conserv:[5,14],consid:[0,1,2,3,5,6,7,8,9,10,12,13,16,18],consider:[0,1,5,13],consist:[0,1,2,3,4,6,12,13,18],constant:[0,2,4,5,6,8,12,13,18],constitu:0,constitut:[2,6],constrain:[1,3,5,7,11],constraint:[5,6,8,13],construct:[0,1,2,3,5,6,7,8,9,10,11,16,18,20],contact:0,contain:[0,2,3,4,5,6,7,8,9,11,12,13,16,18,20],contemporari:20,content:[1,15,16],context:[3,4,6,10,13],contigu:16,continu:[0,1,2,3,4,5,6,7,8,9,10,12,13,16,18],contour:[9,10,13],contourf:[8,9,10],contrast:[1,4,9,10,12],contribut:[0,3,5,13,18],contributor:0,control:[0,1,3,9,13,15],conv2d:[3,4],conv2dtranspos:4,conv:[3,4],conveni:[0,5,6,12,13,16],convent:12,converg:[1,2,4,5,6,7,8,11,13,14],convergencewarn:[1,6,7,8,11],convert:[0,1,4,5,9,11,13,16],converttomatrix:4,convex:[4,5,7],convinc:13,convolut:[1,4,15,17],cool:[4,9],coolwarm:6,coordin:[5,12,14],coorel:0,copi:[0,1,14],core:[2,3,4,10,13],corel:0,coronari:7,corr:[0,5,7,11],correalt:[11,15],correct:[0,1,2,3,4,5,13,16,18],correctli:[1,2,6,10],correl:[0,1,3,5,6,7,10,12,13,15,18],correlation_matrix:[0,5,7,11],correspond:[0,3,5,6,8,9,11,12,15,16,18],cortex:12,cosin:[3,6],cost:[0,2,3,5,6,7,8,9,12,13],cost_deep_grad:2,cost_funct:2,cost_function_deep:2,cost_function_deep_grad:2,cost_function_grad:2,cost_grad:2,cost_sum:2,costol:13,could:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,16,18],coulomb:0,count:[0,9,17,18,19],countor:13,coupl:[4,5,6],cours:[0,1,3,5,11,17],courvil:[17,20],cout:[],cov:[5,6,11,16,18],cov_xi:[5,11],cov_xx:[5,11],cov_yi:[5,11],covari:[0,7,15,16],covariance_matrix:[5,11,14],cover:[0,5,15,17,20],covert:0,covxi:18,covxx:18,covxz:18,covyi:18,covyz:18,covzz:18,cpu:1,cpu_feature_guard:[],craft:3,creat:[1,2,3,4,5,6,9,10,11,12,13,15],create_biases_and_weight:1,create_convolutional_neural_network_kera:3,create_neural_network_kera:1,create_x:[5,11],credit:[0,7],crim:0,crime:0,criteria:[0,4,9,10,14,18],criterion:[9,10,13],critic:6,cross:[0,1,3,7,9,10,13,15,17,18],cross_entropi:4,cross_val_scor:6,cross_valid:[7,10],crossvalid:6,crucial:[1,18],cs231:3,cs:17,csr_matrix:16,cstdlib:[],csv:[0,4,6,7,9],ctnk:1,ctx:[3,4],cubic:0,cumbersom:5,cumsum:[10,11],cumul:[10,18],cumulative_heads_ratio:10,cup:5,current:[1,2,3,4,6,13,14],curs:0,curv:[6,7,10,12],curvatur:13,custom:[5,6,14],custom_cmap2:[9,10],custom_cmap:[9,10],cutpoint:9,cv:[6,7,10],cvxbook:13,cvxopt:[5,8],cyber:20,cycl:[1,12],d1:5,d2:5,d2_g_t:2,d3:5,d670a873ab0c:5,d985fb40c43d:6,d:[1,2,3,4,5,6,7,8,9,10,11,13,14,16,18,19],d_f:13,d_g_t:2,d_net_out:2,da:3,dagger:[5,16],dai:[1,9,15],dalen:[],damp:3,darget:9,darkr:18,dat:0,dat_id:[0,6,7,9],data1:14,data2:14,data3:14,data4:14,data:[2,4,5,8,10,12,13,14,16,20],data_handl:[3,4],data_id:[0,6,7,9],data_indic:1,data_modul:[],data_path:[0,6,7,9],data_url:[],databas:1,datafil:[0,6,7,9],datafram:[0,4,5,7,9,11],datapoint:[1,5,6,7,11,13],dataset:[0,4,6,7,8,9,10,11,13,14],datatyp:4,date:0,daughter:10,david:20,dbh:1,dbo:1,dcomposit:16,ddot:2,dead:1,deadlin:17,deal:[0,1,3,5,6,8,11,13,14,16,18],dealt:0,debt:7,debug:[0,5,6],decad:[0,3],decai:[0,13,18],decemb:17,decent:10,decid:[0,2,3,5,6,9],decim:0,decis:[0,1,8,11,15,17,20],decision_funct:8,decision_tre:9,decisiontreeclassifi:[9,10],decisiontreeregressor:[0,9,10],declar:[0,4,16],decompos:[5,6,16],decomposit:[0,6,12,17],decompost:5,deconvolut:3,decorrel:[10,13],decreas:[1,2,4,5,6,10,11,13],deduc:0,deep:[3,7,12,13,15,17,20],deep_neural_network:2,deep_param:2,deep_tree_clf1:9,deep_tree_clf2:9,deep_tree_clf:[9,10],deepen:[5,15],deeper:[0,3,4],deeplearningbook:20,deer:3,def:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,18],def_covari:18,def_funct:[3,4],default_tim:4,defect:5,defici:5,defin:[0,2,3,4,5,6,7,8,9,10,11,12,13,14,16,18],definit:[1,2,5,6,8,10,11,12,13,16,18],defint:18,defun:[3,4],defvjp:2,degre:[3,5,6,8,9,10,11,18],del:1,delet:6,delimit:4,deliv:17,delta:[0,2,3,6,8,12,13,14],delta_0:3,delta_1:3,delta_2:3,delta_3:3,delta_4:3,delta_5:3,delta_:[1,16],delta_h:[0,1],delta_j:[3,12],delta_k:12,delta_l:[1,3],delta_n:[0,3],delug:15,delv:0,demand:13,demonstr:[0,3,5,6,7,11,12,15],den:4,denomin:[1,5],denot:[1,2,6,7,13,18],dens:[1,3,4],dense_1:4,densiti:[0,2,6,18],depart:19,depend:[0,1,2,4,5,6,7,8,11,12,13,15,16,18],depict:18,deploy:[0,15],deprec:[2,3,6,13],depth:[0,3,9,10,16],deriv:[0,1,2,6,7,8,10,11,13,15],derivati:13,descend:[5,9,11],descent:[0,1,3,7,8,12,17],descr:[],describ:[0,2,4,5,6,8,10,11,12,13,16],descript:[0,8,9],design:[0,1,3,4,5,6,7,10,11,12,13],designmatrix:0,desir:[0,2,4,5,13,14],despit:[1,12],destroi:16,det:[5,16],detail:[0,6,11,13,14,16],detect:[3,8,12],determin:[0,2,3,4,5,6,8,9,10,11,12,13,16,18],determinist:[7,13,18],dev:1,develop:[0,3,5,8,10,11,12,15,16,17],deviat:[0,1,2,4,5,6,18],device_nam:[3,4],devis:12,df:[4,8,11,13],di:[0,5],diag:[5,8],diagnost:[1,10],diagon:[0,5,7,13,16,18],diagonaliz:5,diagram:10,diagsvd:6,dice:[6,18],dict:[6,8],dict_kei:[],dictionari:0,did:[0,1,5,6,7,10,11,14],die:1,diff1:2,diff2:2,diff:2,diff_ag:2,diffeent:8,differ:[0,1,2,3,4,5,6,9,10,11,12,13,14,15,16,18,20],differenti:[0,3,15,16,17],differential_oper:[2,13],difficult:[0,1,6,10,13,18],difficulti:[0,1,13],diffonedim:2,digit:[0,1,3,4,6,17,19],dilemma:13,dilut:1,dim:[4,11,14,16],dimens:[0,1,2,3,4,5,8,11,14,16],dimension:[0,4,5,6,9,11,13,14,15,16],dimensionless:[0,3],diment:16,dimnsion:4,diod:3,direct:[0,1,2,4,11,12,13,14],directli:[1,4,5,6,18],directori:[],disabl:[3,4],disadvantag:0,disappear:[3,6],disc_loss:4,disc_tap:4,discard:[6,11],disciplin:[0,3,12],disclaim:18,discourag:13,discov:0,discover:5,discret:[1,3,5,7,13],discrimin:[4,7,10,11],discriminator_loss:4,discriminator_loss_list:4,discriminator_model:4,discriminator_optim:4,discuss:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20],diseas:7,disguis:6,disord:[1,7],displai:[0,1,3,4,5,6,7,8,9,10,11,12,14,18],displaystyl:[0,5],displot:[],disregard:0,dissimilar:[11,14],dist:14,distanc:[0,8,9,11,14,18],distance_list:9,distinct:[3,7,8,9,10,14],distinctli:8,distinguish:[0,4,7,8,18],distplot:0,distribut:[0,1,4,6,7,10,11,13,14,15,16],distrubut:[0,15],div:5,dive:[0,8,16],diverg:[1,13],divid:[0,1,3,5,6,8,9,11,12,18],divis:[6,8,9,13,16,18],dna:7,dnn1:4,dnn2_gru2:4,dnn:[0,1,2,4,12],dnn_kera:1,dnn_model:1,dnn_numpi:1,dnn_scikit:[0,1],doc:[0,6,15,17,20],document:[4,7,11,13],doe:[0,1,2,3,4,5,6,8,10,11,12,13,16,18],doesn:[3,9,12],dog:[1,3,4],domain:[5,8,13],domin:0,don:[0,1,3,5,6,8,11,13,15],done:[0,2,3,4,5,6,9,10,11,13,16],dot:[0,2,3,5,6,7,8,9,10,11,12,13,16,18],doubl:[3,4,16],doubli:1,down:[0,3,6,9,11,12,13],download:[0,1,3,5,6,16,20],downsampl:3,dozen:1,dq:6,drag:13,dramat:11,drastic:4,draw:[4,6,10,13],drawback:[0,1,3,13],drawn:[1,4,6,7,11,18],drive:[3,4],driven:3,drop:[0,1,5,6,11,13,18],dropna:[0,6],dropout:4,ds:5,dt:[2,3,13,18],dtype:[0,1,2,3,4,14,16],dualiti:6,dub:0,due:[1,2,5,6,8,10,12,13],dummi:0,dure:[0,1,3,4,8,9,11,15],dwell:0,dwh:1,dwo:1,dx:[2,3,8,18],dx_1:18,dx_1p:6,dx_2p:6,dx_mp:6,dx_n:18,dxp:6,dy:[1,8,18],dynam:4,dysth:19,dz:8,e:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,18,19],e_:[0,2],each:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19],eager:[3,4],eapprox:0,earli:[1,3,4,13],earlier:[0,5,7,8,9,11,12,13],earthexplor:6,eas:[6,9,14],easi:[0,5,6,7,8,9,10,11,12,13,15,16],easier:[5,6,8,9,13,18],easiest:13,easili:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,16],eastern:19,ebind:0,eblock:9,economi:5,ecosystem:15,ect:17,edg:3,edgecolor:6,edu:13,educ:0,eface79dac2c:10,eff:18,effect:[1,4,10,13,18],effic:1,effici:[0,3,10,13,15,16,18],efron:6,egrad:13,eig:[5,11,13,16,18],eigen:18,eigenpair:[5,11],eigenvalu:[0,5,8,11,13,16],eigenvector:[5,11,13],eight:16,eigval:[16,18],eigvalu:[11,13],eigvec:[16,18],eigvector:[11,13],eispack:16,either:[1,5,6,7,8,9,10,11,13,18],ekstrom:[],elabor:18,elarn:3,electr:[0,3,12],electur:20,eleg:11,element:[1,2,3,4,5,6,7,8,11,12,13,15,16,17,20],elementari:[10,13,16],elementwis:[3,13],elementwise_grad:[2,13],elif:[2,3,4,14],elim:16,elimin:[3,5,8],els:[1,2,3,4,7,9,12,13,16],elu:1,elus:0,email:[17,19],embed:[0,11],embodi:6,emit:18,emner:[17,20],emphas:[0,10,15],emphasi:[0,15,20],empir:[1,11,18],emploi:[0,1,5,6,11,13,18],employ:0,empti:[6,10],emul:12,en:[15,20],enabl:11,enbodi:6,encod:[0,3,5,9,11,14],encompass:[0,18],encount:[0,1,5,6,7,13,18],end:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,18],end_box:[2,13],end_nod:[2,13],end_valu:[2,13],endl:[],endpoint:[3,6],energi:[0,4,6],enet_coordinate_desc:6,enforc:12,eng:20,engin:[0,1,3,4,15],english:20,enorm:3,enough:[0,6,13],ensembl:[1,9,17],ensur:[0,1,2,3,5,6,11,13,18],ensure_initi:[3,4],enter:[5,6],enthought:[0,15],entir:[1,3,7,9,15,18],entiti:[9,12,16],entri:[0,5,8,11,12,16],entropi:[1,3,7,10,13],enumer:[0,1,2,3,4,6,8],env:[0,1,2,3,4,5,6,7,8,11,13,14,18],environ:[2,15,20],eo:[0,6],eol:0,eosfit:0,epoch:[0,1,3,4,12,13],epsilon:[0,5,6,7,13],epsilon_0:0,epsilon_1:0,epsilon_2:0,epsilon_:0,epsilon_i:0,eq:[3,13,14,16,18],eqnarrai:[3,5,6],equal:[0,1,2,3,4,5,6,8,9,11,12,13,14,16,18],equat:[1,3,4,5,6,7,8,9,10,11,13,14,16,17,18],equilibrium:[2,12],equiv:[3,13,16,18],equival:[0,1,5,8,11,13,15,16],erf:18,err:[0,10],err_:6,err_sqr:2,errat:13,errno:[],erron:2,error:[1,2,4,5,6,7,9,11,12,13,15,16,18],error_estimate_corr_tim:18,error_handl:[3,4],error_hidden:1,error_output:1,escap:13,especi:[1,3,9,12,13],essenti:[0,5,6,9,10,12,14,17,18],establish:[0,6,10,11],estim:[0,1,5,6,7,10,11,13,15,18],estimated_mse_fold:6,estimated_mse_kfold:6,estimated_mse_sklearn:6,et:[0,2,4,17,20],eta0:[8,13],eta:[0,1,3,8,12,13],eta_:13,eta_t:13,eta_v:[0,1,3],etc:[0,1,3,5,7,8,9,11,12,13,14,15,16,18],ethic:15,etsim:6,euclidean:[0,14],evalu:[0,2,3,4,5,6,9,13,18],evalut:13,even:[0,1,3,4,5,6,8,9,10,11,12,13,14,15,16,18],evenli:4,event:[3,4,5,7,10,14,18],eventu:[0,5,6,11,12,13,19],everi:[0,1,2,3,4,5,6,9,10,11,12,13,14,15,18],everyth:[4,12],everywher:[4,13],evolv:0,exact:[0,2,5,11,12,13,16,18],exactli:[0,3,4,6,12,15],examin:6,exampl:[5,11,12,13,15,16,17,18,20],exce:[1,12,13],excel:[0,1,4,5,10,20],except:[3,4,5,6,8,9,16],excess:0,excit:0,exclud:[1,6,12],exclus:[0,1,3,6,18],execut:[2,3,4,5,13],executing_eagerli:[3,4],exemplifi:13,exercis:[5,15,17],exhaust:6,exhibit:[0,5,6,8],exist:[0,1,2,3,5,6,7,8,9,13,16,20],exit:[5,16],exp:[0,1,2,5,6,7,8,10,11,12,13,18],exp_term:1,expand:[5,7,11,13],expans:[0,3,5,8,10,12,13],expect:[0,1,5,6,7,11,12,13,15],expectation_value_of_h_wrt_p:18,expens:[6,10,13],experi:[0,1,6,8,13,15],experiment:[0,3,4,6,9,14,18],experimental_get_tracing_count:[3,4],expert:[1,9],explain:[0,6,9,10,11,13],explained_variance_ratio_:11,explanatori:0,explicit:[0,3,6,13,16],explicitli:[0,4],explod:1,exploit:[0,3,12,13],explor:[1,4,6,8,13,15],expon:1,exponenti:[0,1,5,6,10,13,18],export_graphviz:9,export_text:9,exporttext:9,expos:15,express:[0,2,3,5,6,7,10,12,13,16,18],exptmean:18,exptvari:18,extend:[0,2,5,7,11,13,15],extens:[0,12,15],extent:[0,1,6,20],extern:[3,6,9],extra:[1,3,5],extract:[0,3,5,6,7,8,11,13,16],extrapol:0,extrem:[0,1,4,5,6,7,8,9,13,16],extremum:13,extrins:11,ey:[0,5,6,13,14,16],f11:0,f12:0,f13:0,f1:13,f1_grad:13,f1d:13,f2:13,f2_grad_x1:13,f2_grad_x1_analyt:13,f2_grad_x2:13,f2_grad_x2_analyt:13,f3:13,f3_grad:13,f3_grad_analyt:13,f4:13,f4_grad:13,f4_grad_analyt:13,f5:13,f5_grad:13,f6:13,f6_for:13,f6_for_grad:13,f6_grad_analyt:13,f6_while:13,f6_while_grad:13,f6d7a289d493:[],f7:13,f7_grad:13,f7_grad_analyt:13,f8:13,f8_grad:13,f9:[0,13],f9_altern:13,f9_alternative_grad:13,f9_grad:13,f:[0,1,2,3,4,5,6,7,8,10,12,13,14,16,18,19],f_0:[3,10],f_1:[10,13],f_2:[12,13],f_3:12,f_:10,f_d:18,f_grad:13,f_grad_analyt:13,f_i:[0,6,12],f_m:[3,10],f_n:3,f_raw:2,f_vec:2,f_wrap:2,face:13,facecolor:[6,8,18],facil:[0,15],facilit:12,fact:[0,1,3,5,9,11,12,13],factor:[0,1,3,5,6,9,10,11,13,16,18],factori:13,fade:6,fafab0:[9,10],fail:[0,6,7,8,11,13,19],failur:7,fairli:[1,2,18],fake:4,fake_loss:4,fake_output:4,fall:[8,9,17],fals:[0,1,2,3,4,5,6,7,9,10,13,14,16],famili:[0,7,8,18],familiar:[0,3,5,6,8,15,16,18],famou:[6,12],far:[0,3,4,5,6,8,11,12,13,14],fashion:[0,9,10],fast:[1,3,6,10,12,13,15,18],faster:[1,11,13],fastest:[13,16],favor:7,favorit:18,fc:3,fdf8a5d7c717:2,fdfcc778e1f8:4,fe5b9d300cc0:6,featur:[0,1,3,5,6,7,8,10,11,12,13,15,18],feature_nam:[0,1,7,9],feautur:9,fed:1,feed:[0,2,3,11,15,17],feed_forward:1,feed_forward_out:1,feed_forward_train:1,feedback:4,feeddorward:4,feedforward:[1,4,12],feel:[0,5,6,11,13,15,19],feet:0,fetch:6,fetch_california_h:[],fetch_openml:[],few:[1,3,4,5,9,18],fewer:[0,9,11],ffnn:[1,12],field:[0,3,6,12,15],fifth:[0,6],fig:[0,1,2,3,4,6,7,12,13,14],fig_id:[0,6,7,9],figaxi:18,figsiz:[0,1,2,3,4,6,7,8,9,10],figur:[0,1,2,3,4,5,6,7,8,9,10,12,13,14,15],figure_id:[0,6,7,9],figurefil:[0,6,7,9],file:[0,1,2,4,5,6,7,9],file_prefix:4,filenam:[],filenotfounderror:[],fileout:[],filepath_or_buff:0,fill:[5,9],filter:[3,4],filtered_flat_arg:[3,4],filtered_tb:[3,4],financ:0,find:[0,1,2,3,5,6,7,8,9,10,11,12,13,14,15,18],find_top_boxed_arg:2,fine:[0,14],finish:2,finit:[3,5,6,12,13,18],first:[0,1,2,3,5,6,7,8,9,10,11,13,14,16,17,18,20],firsteigvector:11,fit:[1,3,4,5,6,7,8,9,11,12,13,18],fit_beta:6,fit_intercept:[0,5,6],fit_mod:9,fit_transform:[0,6,8,9,11],fiti:0,five:[0,9],fix:[0,3,4,6,10,11,12,13],fixedformatt:6,fixedloc:6,fkkt:5,flag:4,flat:[12,13],flatten:[1,3,4,5,16],flexibl:[1,6,8,10,12],float32:[4,9],float64:[4,16],flop:[5,16],flow:[1,4,12],fluctuat:5,fly:11,flyvbjerg:[],fm:0,fma:[],fmax:3,fmesh:13,fn:[3,4],focu:[0,3,4,5,6,15,20],focus:[1,6,7,16],fold:[6,9],folder:[0,4,6],follow:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20],font:[0,7,18],fontdict:18,fontsiz:[1,6,8,9,10,18],fontweight:1,footprint:3,foral:8,forc:[0,5,6,10,11],forcast:4,forecast:[4,12],forelesningsvideo:17,forest:[0,1,9,15,17],forget:11,form:[0,3,4,5,6,7,8,9,11,12,13,15,16,18],formal:[3,4,14,18],format:[0,1,2,3,4,6,7,8,9,10,11,15,18,20],format_data:4,formatstrformatt:[6,13],formul:[4,6,11,14],formula:[3,13,18],forth:[4,12],fortran2003:15,fortran90:18,fortran:[0,15,16],fortun:[0,11],forward:[0,3,6,15,16,17],forward_backward:[3,4],found:[1,2,4,5,6,12,13],foundat:15,four:[4,5,6,8,12,16,17],fourier:0,fourierdef1:3,fourierdef2:3,fourierseriessign:3,fourth:12,fr:5,frac:[0,1,2,3,5,6,7,8,9,10,11,12,13,14,16,18],fractal:[],fraction:9,frame:7,framework:[1,8,10,18],frank:[5,11],frankefunct:[5,6,11],free:[0,6,11,13,15,16,18,19,20],freecodecamp:15,freedom:5,freeli:0,frequenc:[3,6,7,18],frequent:[0,8,9,13],frequentist:15,fresh:10,frida:19,fridai:17,friedman:[6,17,20],friendli:4,frog:3,from:[0,1,2,3,4,6,7,8,9,11,13,14,15,16,17,18,19,20],from_cod:9,from_logit:[3,4],from_tensor_slic:4,fromnumer:2,front:[0,4,5],fstream:[],fulfil:[2,5,12],full:[0,1,3,5,7,9,10,13,18],full_matric:5,fulli:[3,6,12,17,18],fun:[2,13,15],fun_nam:[],func:[0,2],functionali:11,fundament:[0,6,15],funtion:2,further:[2,9],furthermor:[0,3,5,6,7,11,12,13,15],futur:[0,4,8,9],futurewarn:[],fx:5,fy:[17,19],g0:2,g42mrgv128v34gnnhxwk9nrc0000gp:[],g:[0,1,2,3,4,5,6,8,9,10,11,13,18],g_0:2,g_1:[2,10],g_2:[2,10],g_:[2,9,10],g_analyt:2,g_dnn_ag:2,g_euler:2,g_i:2,g_m:[3,10],g_n:3,g_re:2,g_t:2,g_t_d2t:2,g_t_d2x:2,g_t_dt:2,g_t_hessian:2,g_t_hessian_func:2,g_t_jacobian:2,g_t_jacobian_func:2,g_trial:2,g_trial_deep:2,g_vec:2,gain:[1,5,9,10,13],galleri:0,game:4,gamma1:8,gamma2:8,gamma:[0,2,8,9,10,11,13],gamma_0:10,gamma_1:10,gamma_1x:10,gamma_:0,gamma_i:[0,8,18],gamma_j:13,gamma_k:13,gamma_m:10,gamma_x:0,gap:[6,8],gate:[4,12],gather:[0,1,12],gaug:12,gaussbacksub:16,gaussian:[4,5,6,8,14,18],gaussian_point:14,gaussian_rbf:8,gave:13,gbc:17,gca:[2,6,8,13],gd:1,gd_clf:10,gdclassiffiercgain:10,gdclassiffierconfus:10,gdclassiffierroc:10,gdm:13,gdregress:10,ge:[1,5,7,18],gemv:5,gen:[],gen_loss:4,gen_tap:4,gender:0,genener:4,gener:[0,1,2,3,5,6,8,10,11,12,13,14,16,18,20],generallay:12,generate_and_save_imag:4,generate_imag:4,generate_latent_point:4,generate_simple_clustering_dataset:14,generated_imag:4,generator_loss:4,generator_loss_list:4,generator_model:4,generator_optim:4,genexpr:[],genom:15,geodes:11,geometr:[0,13],geometri:5,georg:20,geotif:6,geq:[2,5,8,9,13],geron:[0,17,20],get:[0,1,2,3,4,5,6,7,9,10,11,13,15,16,18],get_dummi:9,get_loc:[],get_next_color:[],get_paramet:2,get_split:9,get_yaxi:8,get_yticklabel:6,getsolutionslic:5,getval:[],gg:[],gibb:15,gif:4,gini:10,gini_index:9,git:[0,15],github:[0,3,4,6,14,15,17,20],gitlab:[0,15],give:[0,1,2,3,5,6,7,8,9,10,12,13,14,15,17,18,20],given:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17,18],global:[6,7,13],glorot:1,gmail:[],go:[0,1,3,5,6,8,9,11,12,13],goal:[0,7,9],goe:[0,1,2,5,6,13,14,16],golden:13,gone:5,gong:1,good:[1,3,4,5,6,9,10,11,13,15,17,18,20],goodfellow:[4,17,20],googl:[1,3,4,14,15],got:[1,6],gov:6,gp:20,gpu:[1,15],grad:[2,13],grad_analyt:13,grade:17,gradient:[0,3,4,7,8,9,12,15,17],gradient_desc:3,gradientboostingclassifi:10,gradientboostingregressor:10,gradients_of_discrimin:4,gradients_of_gener:4,gradienttap:4,gradual:[1,14],grai:[4,6],graph:[1,9,11,12,13],graph_from_dot_data:9,graph_funct:[3,4],graphic:[0,1,9],grasp:0,gray_r:[1,3],grayscal:3,great:[5,13],greater:[1,7,18],greatli:13,greedi:9,green:[0,3,9,18],grei:4,grid:[1,3,6,7,8,12,18],grossli:13,ground:0,group:[0,6,7,9,14,15,17],groupbi:0,grow:[1,3,9,10],growth:0,gru:4,guarante:[0,3,4,13,18],guess:[1,4,10,13,14],guestrin:10,guid:1,guilherm:19,h1:2,h21:17,h:[0,1,5,6,8,13,18,20],h_1:[2,13],h_2:[2,13],h_:[0,13],h_m:10,ha:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,18],habit:0,had:[0,1,6,7,13],hadamard:[1,12],half:[1,8,9],halv:10,hand:[0,1,2,3,5,11,12,13,15,16,17,18,20],handi:3,handl:[0,1,2,5,9,11,15],handle_unknown:9,handsid:12,handwrit:12,handwritten:[1,5],happen:[1,2,3,4,5,6,10,13,18],hard:[1,7,8,10,13],hardcopi:15,harder:[0,1],harmon:3,hasn:1,hassl:[0,15],hast:15,hasti:[0,6,17,20],hat:[0,1,5,6,7,9,10,11,12,13,16],have:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18],haven:1,he:7,head:[0,4,10,18],header:0,heads_proba:10,health:0,hear:[0,13],heart:[0,7],heatmap:[0,1,3,7],heavili:0,heavisid:1,height:[1,3,6],held:13,help:[0,1,4,12,13],helper:[4,14],henc:[0,5,6,8,9,10,12,13],her:7,here:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20],hereaft:[0,8,12],hermitian:16,hessenberg:16,hessian:[0,2,5,13],heterogen:[9,10],hi:7,hidden:[1,3,4,12],hidden_bia:1,hidden_bias_gradi:1,hidden_layer_s:[0,1],hidden_neuron:4,hidden_weight:1,hidden_weights_gradi:1,hierarch:5,high:[0,1,2,3,4,5,6,9,10,11,13,14,15,16],higher:[0,1,3,5,6,8,13],highest:[1,2],highli:[0,3,4,10,15,16,20],highwai:0,hing:8,hint:13,hip:15,hire:0,hist:[4,6,7,18],histogram:[0,6,7,18],histor:[7,11],histori:[3,4,12],histplot:[],hit:[],hitherto:5,hjorth:19,hobbi:18,hoc:5,hoff:20,hold:[1,3,6,13,14],holder:0,home:0,homework:[6,13],homogen:[1,3,9,10,13],honchar:2,hopefulli:[0,11,18],horizont:11,hors:[3,7],hot:[1,9],hour:[1,15,17,18,19],house_pric:[],how:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,20],howev:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18],hs:[],hspace:[0,4,8,10,18],hstack:1,htf:17,html:[0,7,11,15,17,20],http:[0,3,4,6,7,11,13,14,15,16,17,20],huang:0,huber:0,huge:[1,3,4,15],human:[0,1,3,6,9,12],humid:9,hundr:1,hungri:1,hybrid:17,hydrogen:0,hyperbol:[1,4,12],hyperparam:8,hyperparamet:[3,4,5,6,9,13],hyperplan:11,i0:0,i1:[0,6,8,12],i2:[0,8,12],i3:[0,12],i5:0,i:[0,2,3,4,5,6,7,8,9,10,11,12,13,14,16,18,19],i_1:[5,6],i_2:[5,6],i_:13,ian:20,ic:1,id:[7,13],ida:19,idea:[0,1,2,3,4,6,9,10,12,13,16],ideal:[0,2,6,8,13,18],idem:6,ident:[5,6,12,13,16],identical:5,identifi:[0,1,7,9,11,12,13,14],idum:[],ieor:18,ifi:20,ifs:15,ignor:[0,1,3,9],ii:[16,18],iii:16,ij:[0,1,3,6,8,12,14,16,18],ik:[0,16],illustr:[5,7,10,12,13,14,15],im:6,imag:[1,3,4,6,9,11,12,14,20],image_at_epoch_:4,image_batch:4,image_height:3,image_path:[0,6,7,9],image_width:3,imageio:6,images_from_seed_imag:4,imagin:1,immedi:[0,3,4,6,15],implement:[0,2,3,4,5,6,8,9,10,11,12,13,14,18],impli:[3,5,6,7,13,16],implicit:3,implicitli:[11,18],importantli:3,impos:[0,6,11,12],imposs:[0,5],impress:[0,12],improv:[0,4,5,9,10,11,13],impur:9,imread:6,imshow:[1,3,4,6],in3050:20,in4080:20,in4300:20,in5400:[3,20],in_out_neuron:4,inaccur:13,inacio:19,inact:12,inadequ:0,inch:6,includ:[0,1,2,3,4,5,6,7,11,12,15,18,19,20],include_bia:[6,9],incom:12,incorrect:1,incoveni:8,increas:[0,1,3,4,5,6,7,8,9,11,12,13,18],increasingli:18,ind:6,inde:[0,2,4,5,6],indefinit:4,indent:[],indentationerror:[],independ:[0,5,6,7,8,12,13,18],index:[0,1,3,4,10,14,15,16,18,20],index_col:0,index_of:[],indic:[0,1,3,4,5,6,9,10,11,13],indispens:6,individu:[1,6,7,10,12,18],indu:0,indx1:2,indx2:2,indx3:2,indx:16,ineffici:[3,13],inequ:8,inequaltii:13,inertia:13,inf1000:15,inf1100:15,inf1100l:15,inf1110:15,inf3000:20,inf4490:20,inf5860:20,infeas:9,infer:[0,1,4,6,20],infer_nrow:0,inferenc:1,infil:[0,6,7,9],infin:[5,6,7,11],infinit:3,infinitesim:18,influenc:[6,10],influenti:1,inform:[0,1,3,4,6,9,11,12,13,14,16,20],infti:[3,6,13,18],ingeni:13,ingrad:2,ingredi:[0,9],inher:6,inherit:16,initi:[0,1,2,6,10,13,14,16,18],initial_epoch:[3,4],initialis:[],initialize_root:[],inject:14,inlin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,18],inner:[0,13],innov:20,inp:4,inplac:13,input:[0,1,3,4,5,6,7,8,9,10,12,13,14,18],input_dim:1,input_shap:[3,4],inputs:1,inputs_shuffl:[0,1],insert:[3,5,6,8,10,18],insid:[0,4,7],insight:[0,1,5,15,20],insist:[6,13],inspir:[0,1,12,20],instabl:2,instal:[0,1,5,6,9],instanc:[0,1,2,4,6,9,11,13],instanti:10,instead:[0,1,2,3,4,5,6,8,9,11,13,14,16,18],institut:1,instruct:[0,1],int32:10,int64:[],int_0:18,int_:[3,6,18],int_a:18,intak:0,integ:[1,2,13,14,16,18],integer_vector:1,integr:[3,6,18],intellig:[0,14,20],intend:10,intens:1,intention:14,interact:[0,6,9,12,15],intercept:[0,6,8,11,13],intercept_:[0,6,8,9,13],interchang:[5,12,16],interconnect:1,interest:[0,1,2,3,4,5,6,7,8,9,12,15,17,18],interfac:[0,1,16],interior:[0,9],intermedi:16,intern:[1,10,12],interpol:[1,3,4,6,12],interpr:5,interpret:[0,1,6,9,10,12,13,16,18],interv:[0,3,5,6,7,13,18],intial:13,intract:[0,4],intrins:[3,11,16,18],intro:[15,20],introduc:[0,1,5,6,8,10,12,13,16,18],introduct:[1,2,4,13,17,20],introductori:[0,4,16,20],intuit:[0,5,6,8,12,13],inv:[0,5,13],invalid:1,invalu:[0,13,15],invari:1,invd:5,inver:8,invers:[0,3,6,13],invers_period:[],inverse_transform:8,invert:[0,5,7,10],invok:[0,8],involv:[0,2,6,7,11,12],io:[0,15,17,20],iomanip:[],iostream:[],ip:[0,8,18],ipca:11,ipykernel_42331:[],ipykernel_42376:[],ipykernel_42449:[],ipykernel_42456:[],ipykernel_42530:[],ipykernel_42541:[],ipykernel_42553:[],ipykernel_42573:[],ipykernel_42580:[],ipykernel_42586:[],ipykernel_47411:[],ipykernel_47448:[],ipykernel_47647:[],ipykernel_47724:[],ipykernel_47735:[],ipynb:15,ipython:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,15],iq:6,iri:[8,9],irreduc:6,irrelev:5,irrespect:0,is_integ:[],isbox:[2,13],iscomplexobj:[],isinst:[2,13],isn:5,isnul:0,isomap:11,issu:[1,3,4,9,14,16],it_arrai:13,item:[0,13],items:16,iter:[1,2,3,4,6,7,8,11,13,14,18],itr:5,its:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,20],itself:[5,6,12,18],ix:[],j1:16,j:[0,1,2,3,4,5,6,8,9,11,12,13,14,16,18,20],j_:6,j_lasso_sk:6,j_ridge_sk:6,j_sk:6,jackknavg:[],jackknif:[6,15],jackknstd:[],jackknvar:[],jackknvec:[],jacobian:[2,13],jacobian_shap:2,jargon:[],jason:4,jax:[3,4,14,15],jensen:19,jerom:20,ji:[12,16],jj:[0,5,6],jk:[0,1,6,12,16],jl:0,jm:16,joao:19,joaogca:19,job:[2,8,10],join:[0,4,6,7,9],joint:[4,5],journal:[],judg:13,judgement:6,julia:[15,16],jump:18,junk:4,jupyt:[0,15,17,20],just:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,18],justif:0,justifi:[3,10],jy:[],jydg2xzka5:17,k0:7,k1:7,k:[0,1,3,5,6,7,8,9,10,11,12,13,14,15,16,18],kaggl:6,kappa_d:18,karim:[],karlsen:[],karush:8,keep:[0,1,4,5,6,11,13,14,16],keepdim:[1,6,10,16],kei:[0,1,3,6,12,20],kept:[4,6,14],kera:[0,4,15],kernel:[0,1,3,15],kernel_regular:[1,3],kernel_s:4,kernelpca:11,kev:0,kevin:20,keyboardinterrupt:[2,3,4],keyerror:[],keyword:[6,13,16],kfold:6,kg:1,ki:16,kick:[1,13],kiener:2,kilomet:6,kind:[0,2,3,4,8,12,13,14],kj:[6,12,16],kjm:15,kkt:[5,8],kktsolver:5,kl0m3:17,kl:18,km:12,kmean:14,kmeanspoint:14,kn_k:14,know:[0,1,2,5,6,8,13,15],knowledg:[0,15],known:[1,3,4,5,6,7,8,9,12,16,18,20],kondev:0,kp:18,kpca:11,kroneck:14,kuhn:8,kwarg:[0,2,3,4,13],kwd:[0,3,4],kwown:0,l0:7,l1:[0,1,3,5,7],l1_l2:[1,3],l1regl:5,l1regls_mosek2:5,l1regls_mosek:5,l2:[1,3],l:[0,1,2,3,5,6,7,8,10,11,12,13,16,18],l_1:7,l_2:[7,13],l_:16,l_j:12,la:13,la_i:12,la_k:12,lab:[15,17],label:[0,1,2,3,4,5,6,7,8,9,10,12,13,14,15,16,18],label_prob:13,labelencod:[7,10],labels:[6,8,9],labels_shuffl:[0,1],laboratori:17,lack:0,lagari:2,lagrang:[8,11],lambda:[0,1,2,3,5,6,7,8,10,12,13,18],lambda_0:11,lambda_1:[5,8,11],lambda_2:[8,11],lambda_:11,lambda_i:[8,11],lambda_iy_i:8,lambda_jy_iy_j:8,lambda_k:8,lambda_n:[5,8],lamda:1,lamdbda:5,land:[0,8],landmark:8,landscap:13,langl:[0,6,11,18],languag:[0,1,4,8,15,16,20],lapack:[5,16],laplac:5,laptop:15,larg:[0,1,2,4,5,6,8,9,10,11,13,15,16,18,20],larger:[0,3,5,6,8,10,11,13,18],largest:[4,8,11],lasso:[0,7,15,17],lasso_sk:6,last:[0,1,2,3,4,5,6,7,8,9,10,12,13,16,17,18],latent:4,latent_dim:4,latent_point:4,latent_space_value_rang:4,later:[0,1,4,6,7,8,12,13,14,15],latest:[4,15],latest_checkpoint:4,latter:[0,3,5,6,7,8,11,13,16,17,18],lattic:12,law:0,layer:[0,4,13],lbfg:[7,9,10,11],lcc:[5,6],lda:11,ldot:[0,6,11],le:[5,7,10,13,18],lead:[0,1,3,5,6,7,8,9,10,11,12,13,16,18],leaf:9,leaki:1,leakyrelu:4,lear:13,learn:[3,4,5,6,7,8,9,10,12,16,17,20],learnabl:3,learner:10,learning_r:[3,8,10],learning_rate_init:[0,1],learning_schedul:13,least:[0,2,7,8,10,11,15,16,17,18],leat:13,leav:[0,1,3,5,6,9,11],lectur:[0,1,5,10,11,12,13,15,16,17,20],lecturenot:[0,15,17,20],lecturenovember11:[],lecturenovember12:[],lecturenovember19:[],lecturenovember25:[],lecturenovember26:[],lecturenovember4:[],lecturenovember5:[],lectureoctober14:17,lectureoctober15:17,lectureoctober1:[],lectureoctober21:[],lectureoctober22:[],lectureoctober28:[],lectureoctober29:[],lectureoctober7:[],lectureoctober8:[],lectureseptember10:[],lectureseptember16firstpart:[],lectureseptember16secondpart:[],lectureseptember17:[],lectureseptember23:[],lectureseptember24:[],lectureseptember2:[],lectureseptember30:[],lectureseptember3:[],lectureseptember9:[],lecturethursdayaugust26:[],lecturethursdayaugust27:[],left:[0,1,2,3,5,6,7,8,9,10,11,12,13,14,16,18],leftarrow:[8,12],legend:[0,2,3,4,5,6,7,8,9,10,13],len:[0,1,2,3,4,5,6,8,9,10,11,12,16],len_index:0,length:[0,1,2,3,4,8,9,13,15],length_of_sequ:4,leq:[0,5,7,8,13,14,18],less:[0,1,3,4,5,6,8,9,13,15,18],lessen:1,let:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,18],letter:[0,16,18],level:[0,1,5,6,9,15,16,17],li:[8,11],lib:[0,1,2,3,4,6,7,8,11,13,14],liblinear:[8,10],librari:[0,1,2,3,4,5,6,9,10,11,16,18,20],licens:[0,1,15],lie:[0,6,11,18],life:[0,1,8,12],lifetim:13,like:[0,1,2,3,4,5,6,7,9,10,11,12,13,15,16,18],likelihood:[0,1,5,9,13],lim_:18,limit:[0,5,6,7,8,11,12,16],lin_clf:8,lin_model:0,lin_reg:9,linalg:[0,2,5,6,8,11,13,16,18],line1:8,line2:8,line2d:13,line3:8,line:[0,1,3,6,8,11,13],linear:[1,3,5,6,7,9,10,11,12,15,17,18],linear_model:[0,5,6,7,8,9,10,11,13],linear_regress:6,linearli:5,linearloc:[6,13],linearregress:[0,6,7,9],linearsvc:8,liner:[1,3],linerar:10,linewidth:[0,2,4,6,8,9,10],link:[0,4,9,12,15],linlag:5,linpack:16,linreg:0,linspac:[0,2,3,4,6,8,9,10,13,16,18],linu:4,linuek:[],linux:[0,1,15],liquid:0,list:[0,1,2,3,4,5,9,15],listcomp:2,listedcolormap:[9,10],literatur:[1,7,14,20],littl:[1,3,9,12],live:8,ll:[0,18],lle:0,lloyd:[4,14],lmb:[0,2,5,6],lmbd:[0,1,3],lmbd_val:[0,1,3],lmbda:13,ln:[1,13],lo:5,load:[0,1,4,6,7,9,10],load_boston:0,load_breast_canc:[1,7,9,10,11],load_data:[3,4],load_digit:[1,3],load_iri:[8,9],loc:[0,3,6,7,8,9,10],local:[0,1,3,7,12,13],locat:[2,3,8],lock:[3,4],log10:[0,5,6],log:[0,1,2,4,5,6,7,9,10,11,13,16],log_:0,log_clf:10,logarithm:[0,5,7,16],logic:[0,1,9],logist:[0,1,2,8,9,10,11,12,15,17],logistic_predict:13,logisticregress:[7,9,10,11],logit:7,logreg:[7,9,10,11],logspac:[0,1,3,5,6],longer:[2,3,8,10,14,16,18],loocv:6,look:[0,1,2,3,4,5,6,7,8,9,10,11,13,16,18],loop:[1,4,6,10,12,14,15,16],lose:1,loss:[0,1,3,4,5,6,7,8,10,11,13,16],loss_fil:4,lossfil:4,lost:4,lot:[0,1,4,6],low:[0,6,9,10,11],lower:[0,1,3,6,9,10,16],lowercas:16,lowest:[9,13,18],lr:[1,3,4,10],lstat:0,lstm:4,lstm_2layer:4,lstsq:0,lt:6,lu:[0,5],lubksb:16,luckili:2,ludcmp:16,lux:16,lvert:1,lw:0,m:[0,1,2,3,5,6,8,9,10,11,12,13,16,17,18,19,20],m_1:14,m_:[9,12],m_h:0,m_k:14,m_l:12,m_n:0,m_p:0,m_t:13,ma:11,mac:[3,4,14],machin:[1,3,4,5,6,7,9,10,11,12,14,16,17,20],machinelearn:[0,6,15,17,20],machinelearningmurphi:17,mackai:20,made:[0,1,3,4,5,6,7,9,11,12],mae:0,magic:4,magnitud:[1,6,7,13],mai:[0,1,2,3,5,6,7,8,9,11,12,13,15,16,18],mail:17,main:[0,1,3,4,5,6,7,9,16,20],mainli:[0,5,6,7,9],maintain:6,major:[1,6,9,10,13,16],make:[1,2,3,4,5,6,7,8,11,12,13,15,16,18,20],make_axes_locat:6,make_moon:[8,9,10],make_pipelin:[0,6,10],make_vjp:[2,13],makedir:[0,6,7,9],makeplot:0,malcondit:16,malign:[1,7,9],mammographi:5,manag:[0,2,3,15],mani:[0,1,3,4,5,6,7,8,9,11,13,14,15,16,18,20],manifold:11,manner:3,manual:6,map:[0,1,2,6,7,8,11,12,14,18],margin:[0,5,8],mari:19,marit:0,marker:[0,7,16],markov:15,marsaglia:18,mask:[],mass:[0,1,5,13],massag:0,masses2016:0,masses2016ol:0,masses2016tre:0,masseval2016:0,master:[6,17],mat1100:15,mat1110:15,mat1120:15,mat3155:[],mat4155:[],mat:15,match:[0,1,4,5,13,14],materi:[4,5,7,13,16],math:[3,7,12,13,16,18,20],mathbb:[0,4,5,6,7,8,11,12,13,14,16,18],mathbf:[0,5,6,7,8,13,16],mathcal:[1,5,6,7,13],matheemat:3,mathemat:[0,6,11,12,13,15,16,17,18,20],mathrm:[0,1,3,4,5,6,7,8,9,10,11,12,13,14,18],matmul:[1,2,5],matmul_adjoint_1:2,matmul_vjp_0:2,matmul_vjp_1:2,matnat:[17,19,20],matplotlib:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18],matplotlibdeprecationwarn:[6,13],matric:[0,1,3,4,6,7,8,11,13,15],matrix:[0,2,3,4,6,7,8,10,13,18],matshow:1,matter:[2,3,13],max:[0,1,2,3,4,9,10,12,13],max_depth:[0,9,10],max_diff1:2,max_diff2:2,max_diff:2,max_it:[0,1,7,8,11,13],max_iter:14,max_leaf_nod:10,max_queue_s:[3,4],max_sampl:10,maxdegre:[0,6,10],maxdepth:10,maxim:[1,4,5,7,8,11],maximum:[0,1,2,3,5,7,8,9,10,13,14],maxpolydegre:[5,6],maxpooling2d:3,mbox:[5,6],mc:[],mcculloch:12,mcint:[],mcintsqr2:[],md:11,mdoel:4,mean:[1,2,3,4,5,6,7,9,10,11,12,13,14,15,16,18],mean_absolute_error:0,mean_divisor:14,mean_i:18,mean_matrix:14,mean_squared_error:[0,4,6,7,10],mean_squared_log_error:0,mean_vector:14,mean_x:18,meaning:[0,4,7],meansquarederror:0,meant:[2,3,7,10,13],meantempvec:[],meanvec:[],measur:[0,1,2,5,6,9,11,12,14,18],mechan:[0,4,18],median:0,medicin:12,medium:[4,8,13],medv:0,meet:[0,19],mehta:0,memori:[3,4,11,12,13,16],mention:[0,12,13,18],mere:0,mersienn:[],meshgrid:[2,5,6,8,9,10,11],messag:[5,13],messi:2,met:[0,3,8],metadata:2,meteorolog:9,meter:6,method:[0,1,2,3,4,5,7,8,11,12,14,15,16,17,18,20],metion:6,metric:[0,1,3,6,7,9,10,14],metropoli:15,mev:[0,18],mgd:13,mglearn:15,mgrid:13,mhjensen:[1,2,3,4,6,7,8,11,14],mi:10,microsoft:20,mid:1,midel:4,midpoint:9,might:[0,1,2,4,6,9,13],mild:9,miller:[],millimet:6,million:0,mimic:12,min:[0,2,5,8,9],min_:[0,2,5,14],min_samples_leaf:9,mind:[0,6,13],mindboard:4,mine:15,mini:[1,11,12,13],minibatch:[1,11,13],minibathc:13,miniforge3:[0,1,2,3,4,6,7,8,11,13,14],minim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14],minima:[0,1,7,13],minimum:[0,1,2,6,8,9,11,13],minmaxscal:0,minor:[6,13,18],minst:1,minu:7,mirror:9,misc:6,misclassif:[8,9,10],misclassifi:[8,10],miser:0,mismatch:1,miss:[0,10],mistak:4,mit:20,mix:[1,2],mixtur:13,mk:[9,16],mkdir:[0,6,7,9],ml:[0,1,10,13,16],mlab:18,mle:[5,7],mline:[],mlir:[],mlir_graph_optimization_pass:[],mlp:1,mlpclassifi:1,mlpregressor:0,mm:16,mn:[12,18,20],mnist:[1,11],mod:18,mode:17,model:[2,3,5,7,8,9,10,11,13,14,15,18,20],model_select:[0,1,3,5,6,7,9,10,11],moder:10,modern:[0,6,7,15],modif:[2,12,13],modifi:[0,1,3,5,7,8,10,12,13],modul:[0,2,3,4,5,6,7,8,9,10,11,13,16],modular:18,modulenotfounderror:[5,7,8,9],modulo:18,moe:[5,11],moment:[5,6,13,18],monitor:13,monoton:[5,12,18],mont:[0,6,15,18,20],montecarlocycl:[],moor:[5,6],more:[0,1,2,4,5,7,8,9,10,11,12,13,14,15,17,18],moreov:[0,3],morten:19,mortenimac:[],mosek:5,most:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,17,18],mostli:[1,11],motion:[0,13],motiv:[1,4],move:[0,4,5,6,7,9,12,13,14,18],mp4:17,mpl:[0,7],mpl_toolkit:[2,6,13],mplot3d:[2,6,13],mplregressor:1,mse:[0,4,5,6,9,10],mse_simpletre:10,mselassopredict:5,mselassotrain:5,mseownridgepredict:6,msepredict:5,mseridgepredict:[0,5,6],msetrain:5,msg:[],msle:0,mt19937_64:[],mt:[7,12],mu0:18,mu1:18,mu2:18,mu:[0,6,11,13,18],mu_:[6,18],mu_i:6,mu_n:11,mu_x:18,much:[0,1,2,3,4,5,6,8,9,10,11,12,13,16,18],mul:5,multi:[0,1,3,7,15],multiclass:[1,7],multidimension:[11,12],multilay:1,multinomi:7,multipl:[2,4,5,6,7,12,13,18],multipli:[3,5,6,11,13,16,18],multiplum:8,multivari:[0,2,10,11,15,18],multivariate_norm:[11,14],murphi:[11,17,20],must:[0,1,2,5,6,8,10,12,13,14,18],mutat:7,mutual:[1,3,6,13],mx_:18,myenv:[0,1,2,3,4,6,7,8,11,13,14],myriad:[0,15],mz1:18,mz2:18,n1:16,n2:16,n:[0,1,2,3,4,5,6,7,8,10,11,12,13,14,16,18],n_0:[12,18],n_:[1,2,3,8,12,18],n_b:[],n_boostrap:[6,10],n_bootstrap:6,n_categori:[1,3],n_cluster:14,n_compon:11,n_epoch:13,n_estim:10,n_examples_to_gener:4,n_featur:1,n_filter:3,n_hidden:2,n_hidden_neuron:[0,1],n_i:18,n_input:[0,1,3],n_instanc:9,n_iter_i:[7,11],n_job:10,n_k:14,n_l:[12,18],n_layer:1,n_m:9,n_neuron:1,n_neurons_connect:3,n_neurons_layer1:1,n_neurons_layer2:1,n_point:14,n_sampl:[6,8,9,10,14],n_split:6,n_step:4,n_t:2,n_x:2,nabla:[1,13],nabla_:[2,13],nabla_w:13,nag:13,naimi:0,naiv:7,naive_kmean:14,nall:0,name:[0,1,3,4,5,6,7,8,9,10,12,13,14,15,16,18,19],nameerror:[6,10],namespac:[],narrow:13,nary_f:[2,13],nary_op_arg:[2,13],nary_op_kwarg:[2,13],nary_oper:[2,13],nation:[1,5],nativ:15,natur:[0,1,4,8,9,12,13,18,20],navier:12,nb:18,nb_:16,nboot:[],nd:14,ndarrai:[2,6],ndim:2,ne:[9,10,16,18],ne_xcl2ctm0:17,nearest:[1,3,6,11],nearli:13,neccesari:6,necess:2,necessari:[0,1,3,4,8,14],necessarili:[0,4,11,18],necesserali:5,neck:7,need:[0,1,2,3,4,5,6,8,9,10,11,12,13,14,16,18],neg:[0,1,3,5,6,7,10,13,16,18],neg_mean_squared_error:6,neglect:18,neglig:18,neighbor:[3,6,11],neither:[4,13],neq:[13,14,18],nervou:12,nest:[2,9,12],nesterov:13,net:[2,4,12],netlib:16,network:[0,9,13,15,17,20],neural:[0,7,13,15,17,20],neural_network:[0,1,2],neuralnetwork:1,neuron:[1,2,3,4,12],neutral:0,neutron:0,never:[1,3,4,6,9,18],new_box:[2,13],new_root:[2,13],new_trac:[2,13],new_tracing_count:[3,4],newaxi:[0,3,6,9],newli:0,newton:[1,7,8,13,18],next:[0,1,2,3,4,5,6,8,9,13,14],next_guess:13,next_input:4,ng:1,ngini:[],ni:14,nian:[],nice:[0,1,5,11],nichola:[],nicholaskarlsen1102:[],niter:13,nitric:0,nlambda:[0,5,6],nlevel:[],nm:18,nm_n:0,nmse:6,nn:[2,5,6,12,16],nn_model:1,nnmin:2,node:[1,2,3,9,10,12],node_constructor:2,nois:[0,4,5,6,8,9,10,13],noise_dimens:4,noisi:[1,6],non:[0,1,3,4,5,6,7,9,10,11,12,13,14,16,18],none:[0,1,2,3,4,5,9,10,13,18],nonlinear:[3,6,8,9,11,12],nonneg:[6,9,13],nonparametr:6,nonsens:18,nonsingular:16,nonumb:[3,7,8,13,16],nor:[1,4,13],norm:[0,1,5,6,8,11,13],normal:[3,4,5,6,7,8,9,10,11,12,13,15,16,18],normali:16,normalize_kwarg:[],norwai:6,notat:[0,2,5,6,13,14,18],note:[0,1,2,3,4,5,6,7,8,11,12,13,14,15,16,17,18,20],notebook:[0,1,3,9,15],noth:[1,2,5,8,12,14,18],notic:[4,5,12,13,16,18],notimplementederror:[],notion:3,notrace_primit:[],novel:[3,6,10],novemb:1,now:[0,2,4,5,6,7,8,10,11,12,13,14,15,16,18],nowadai:[0,1,3,9,15],nox:0,np:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,16,18],npr:2,nsampl:6,nspin:[],nt:2,nthi:0,ntrained_model:6,nu:18,nuclear:5,nuclei:[0,18],nucleon:0,nucleu:0,num:4,num_coordin:2,num_hidden_neuron:2,num_it:2,num_neuron:2,num_neurons_hidden:2,num_output:[3,4],num_point:2,num_tre:10,num_valu:2,number:[1,3,4,5,6,7,8,9,10,11,12,13,14,16,17,19],numberid:7,numberparamet:3,numer:[0,5,6,9,10,11,12,13,15,16,20],numpi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,18],numpy_vjp:2,numpy_wrapp:2,nunmpi:5,nvalu:[],nx:2,nx_test:6,nx_train:6,nx_train_mean:6,ny:18,ny_pr:6,ny_train:6,ny_train_mean:6,o:[0,6,7,8,9,11,16,20],obei:[6,11,13],object:[0,1,2,4,5,6,8,10,13,16],objsens:5,obliqu:5,observ:[0,1,3,5,6,7,8,9,10,11,12,13,14,18],obtain:[0,1,5,6,7,8,9,10,12,13,14,16,18],obviou:[5,6,11,18],obviouli:0,obvious:[0,4,5,6,16],oc:5,occupi:0,occur:[0,6,8,9,16,18],od:0,odd:[0,3,7],odenum:2,odesi:2,oen:0,off:[1,3,4,5,9,13,18],offer:[6,11,15,16,17],offic:19,offici:17,ofil:[],ofstream:[],often:[0,1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18],ofter:16,ol:0,old:[1,5,10,13],ols_sk:6,ols_svd:6,olsbeta:[0,5],omega:[2,3,6],omega_0:3,omit:[0,5],on_train_batch_begin:[3,4],onc:[1,6,9,11,13],one:[0,1,3,4,5,6,7,8,9,10,11,13,14,15,16,18],oneapi:[],onednn:[],onehot:1,onehot_vector:1,onehotencod:9,ones:[0,2,5,6,8,9,10,11,13,16,17],ones_lik:4,onl:3,onli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,18],onlin:[11,17],onto:[5,11],op_nam:[3,4],open:[0,1,4,6,7,9,15,17],oper:[0,1,3,5,6,10,11,12,13,15,18],operation:18,oplu:18,opmiz:13,opportun:0,oppos:[6,13],opposit:[1,5,8],opt:[1,5],optim:[0,2,3,4,5,6,7,9,10,11,14,17],optimis:[1,3],optimizer_v2:3,option:[0,1,3,5,6,7,8,11,16],optionalxlacontext:[3,4],optmiz:[1,8,13],orang:0,order:[0,1,2,3,5,6,7,8,9,10,11,12,13,16,18],ordinari:[0,2,3,7,11,13,15,17],oreilli:20,org:[0,3,4,7,11,15,16,20],organ:[6,7,10,16],orient:[1,5,18],origin:[0,3,5,6,8,11,12,13,16],orthogn:5,orthogon:[0,5,6,8,11,13,16],orthonorm:5,os:[0,1,4,5,6,7,8,9],oscar:1,oscil:[3,13],oslo:[0,15,17,19],osx:[0,15],other:[0,1,2,3,5,6,7,8,10,13,14,15,17,18,20],otherwis:[0,1,4,7,13,16],ouput:[5,7,12],our:[1,2,3,6,7,8,9,10,12,14,15,16,17,18],ourmodel:0,ourselv:[0,5,6,8,11,13],out:[0,1,2,4,5,6,7,8,9,10,11,12,13,15,16,18],out_fil:9,outcom:[0,7,9,10,12,18],outdoor:9,outer:[6,12],outfil:4,outfilenam:[],outgrad:2,outlier:[0,8],outlin:[6,10,11],outlook:9,outperform:10,output:[0,1,3,4,5,6,7,8,9,10,12,13,16,18],output_bia:1,output_bias_gradi:1,output_shap:4,output_weight:1,output_weights_gradi:1,outputlayer1:12,outputlayer2:12,outsid:4,over1:13,over:[0,1,3,4,5,6,9,10,12,13,16],overal:[1,10],overcast:9,overcom:[12,13],overdetermin:0,overfit:[0,1,3,6,9,10,13],overflow:[1,5],overhead:12,overlap:[3,7,8,9],overlin:[0,5,6,9,10,11,14,16],overst:0,overtrain:4,overview:[3,20],own:[4,5,6,8,12,13,15,16],owner:0,ownmsepredict:0,ownmsetrain:0,ownridgebeta:[0,6],ownypredictridg:0,ownytilderidg:0,oxid:0,oyvinssc:19,p0:2,p1:2,p:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,16,18],p_:[2,4,8,9],p_hidden:2,p_i:[5,18],p_j:18,p_n:18,p_output:2,p_x:18,pack:0,packag:[0,1,2,3,4,5,6,7,8,11,13,14,15,18],pad:[3,4],page:[0,15],pai:[0,1,9,13],pair:[0,2,3,9,15,18],panda:[0,4,5,6,7,9,11,15],paper:1,paradigm:0,parallel:[10,15,16],param:[2,4],paramat:2,paramet:[0,1,2,3,4,5,6,7,8,9,10,12,13,18],parameter:[0,6,10],parametr:[0,6],paramt:[3,5],parent:2,parent_argnum:[],park:[],parser:0,part:[0,1,3,5,6,10,16,17,18,20],partial:[0,1,5,6,7,8,10,11,12,13,18],particip:[15,17],particl:[0,4,13,18],particular:[0,1,2,3,5,6,9,10,11,12,13,18,20],particularli:[5,6,8,11,13,18],partit:[1,4,9],partli:6,pass:[2,3,12,14],past:[10,18],patch:[6,18],path:[0,4,6,7,9,15],patient:7,patter:4,pattern:[0,3,4,12,17,20],pauli:0,pc:[11,15],pca:[0,7,15,17],pcolor:6,pcolormesh:6,pd:[0,4,5,6,7,9,11],pde:2,pdf:[0,3,4,5,6,9,17,20],pedagog:0,penal:6,penalti:[6,13],penros:[5,6],pentagon:13,peopl:[0,1,9,13,15],per:[0,1,6,17],percentag:[0,10,11],perceptron:[0,1,7],perfect:[0,1],perfectli:[4,6],perform:[0,2,3,4,5,6,8,10,11,12,13,14,15,16,18],performac:4,perhap:[0,5,13],perimet:1,period:[1,4,18],permut:11,persist:13,person:[5,6,7,17,19],perspect:20,pertin:12,petal:[8,9],peter:20,petersen:[],phantom:18,phase:[6,12],phenomena:18,phi:8,phi_k:8,philip:[],philosophi:13,phone:19,photo:4,phrase:0,physic:[0,1,4,7,12,13,18,19,20],pi:[2,3,5,6,7,9,12,13,18],pick:[1,9,10,11,13,14],pickl:1,pictur:0,pie:15,piec:[11,14],pillow:[0,15],pinv:[5,6,13],pip3:[0,1],pip:[0,1,15],pipelin:[0,6,8,10],pit:4,pitfal:6,pitt:12,pixel:[1,3,4],pixel_height:[1,3],pixel_width:[1,3],place:[0,4,6,8,13,16],plai:[0,3,4,5,6,8,11,15],plain:[8,10,12,13,14],plan:[6,9,19,20],plane:[8,9],plateau:5,platform:15,plausibl:12,pleas:[3,4,6,7,11,13,14],plenti:1,plethora:[3,12],plot:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18],plot_confusion_matrix:[7,10],plot_count:6,plot_cumulative_gain:[7,10],plot_data:1,plot_dataset:8,plot_decision_boundari:[9,10],plot_import:10,plot_max:4,plot_min:4,plot_model:4,plot_numb:4,plot_predict:8,plot_regression_predict:9,plot_result:4,plot_roc:[7,10],plot_surfac:[2,6,13],plot_train:9,plot_tre:[9,10],plt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,18],plu:[0,3,5,7],pm:8,pmatrix:2,pn:3,png:[0,4,6,7,9],point:[0,1,2,3,5,6,7,8,9,10,11,13,14,16,18,19],point_1:4,point_2:4,poisson:[15,18],poli:[6,8],poly100_kernel_svm_clf:8,poly3:0,poly3_plot:0,poly3dcollect:13,poly_featur:[8,9],poly_features10:9,poly_fit10:9,poly_fit:9,poly_kernel_svm_clf:8,polydegre:[0,5,6,10],polygon:13,polym:12,polynomi:[0,5,6,7,8,9,10,11],polynomial_featur:6,polynomial_svm_clf:8,polynomialfeatur:[0,6,8,9],polytrop:[0,6],pool:3,pool_siz:3,poor:[1,13],poorli:0,pop:2,popul:[0,5],popular:[0,1,3,6,7,8,9,11,12,15,16,18],popularli:0,portabl:10,portion:[11,13],pose:[0,4,5,6,11,18],posit:[0,1,2,3,5,7,8,10,11,13,14,16,18],possibl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,15,16,18,19],posterior:5,postpon:0,postul:5,potenti:[0,3,5,6,12,13],potr:5,potrf:5,pott:12,power:[0,1,5,6,8,9,12,13],pp:[5,6],practic:[0,5,6,7,8,17,18],practition:[0,1,3],preced:[1,11,12,18],preceed:4,preceq:8,precis:[0,2,5,11,13,16,18],pred:[6,13],predicit:0,predict:[0,1,5,6,7,8,9,10,15,20],predict_prob:1,predict_proba:[7,10],predictor:[0,5,6,7,9,10,11],prefer:[0,1,6,8,9,11,15],prepar:[0,6,16],preprocess:[0,4,6,7,8,9,10,11],prerequisit:0,presenc:13,present:[0,5,6,9,12,13,16,17,18],preserv:[3,11,16],press:[13,20],pretrain:[1,4],pretti:[0,4,8,9,15],prev_centroid:14,prevent:[13,18],previou:[0,1,2,3,4,5,6,8,10,11,12,13,16,18],previous:[2,3,9,10,18],price:[0,4,9,13],primal:8,primari:[0,7],prime:18,primit:2,princip:[0,5,7,15,17],principl:[0,6,7,8,14],print:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,16,18],print_funct:[8,9],printout:0,prior:[0,5,6],privat:0,prob:[1,18],probabilist:[0,20],probabl:[0,1,3,4,6,7,10,13,15,17],problem:[0,3,4,5,6,7,8,9,10,11,12,14,15,16,17,18],proce:[0,5,6,8,9,10,11,13,16],procedur:[2,4,5,6,8,10,11,13],proceed:16,process:[0,2,4,6,9,10,12,13,15,16,18,20],prod:20,prod_:[1,5,7],produc:[0,3,4,5,6,9,10,11,12,13,15,16,18],product:[0,1,3,5,6,7,8,12,13,15,16],profess:0,program:[0,1,4,5,6,8,12,14,15,16,17,18],programm:16,progress:[1,4,14],prohibit:6,project1:6,project:[0,1,2,3,5,11,13,15,17,19],project_root_dir:[0,6,7,9],promin:12,promis:8,prone:9,pronounc:[13,15],proof:[0,11,12,13],propag:[2,3,13,17],proper:[0,2,6],properli:[1,6,8,10,13],properti:[0,1,3,12,13,16],proport:[0,1,5,9,11,13,18],propos:[1,4,6,10],propto:[5,13],protect:[3,4],proton:0,prove:[3,13],provid:[0,1,3,4,5,6,8,9,10,12,13,15,16,18,20],proxi:[1,13],prune:9,pseudo:[16,18],pseudoinv:5,pseudoinvers:[5,6],pseudorandom:[6,18],psycholog:0,pt:13,ptratio:[],punish:[0,1],pure:[3,9,18],purest:9,puriti:9,purpos:[0,3,10,12,14],put:1,putarow:5,putboundslic:5,putclist:5,putobjsens:5,putqobj:5,py:[0,1,2,3,4,5,6,7,8,11,13,14],pydata:15,pydot:9,pylab:[0,7],pylint:[3,4],pypi:15,pyplot:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,18],pythagora:5,python2:0,python3:[0,1,2,3,4,6,7,8,11,13,14,15],python:[1,2,3,4,5,6,8,11,12,13,14,17,18],pytorch:[0,15],pywrap_tf:[3,4],q:[5,6,8,11,18],qp:8,qquad:[2,11,13,16],qr:[5,6,16],quad:[1,13,16],quadrat:[0,5,8,9,13],qualit:[4,9,18],qualiti:[0,9,15],quantifi:1,quantil:10,quantit:[0,6,9],quantiti:[0,2,5,6,7,9,10,11,12,14,16,18],quantum:[4,12],quartil:0,quench:5,queri:9,question:[0,5,6,9,11,12,13],qugan:4,quick:[4,18],quick_execut:[3,4],quickli:[1,3,9,11,13],quit:[1,5,6,9,10,12],quot:4,r2:[0,5,6],r2_score:0,r2score:0,r:[0,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18],r_1:9,r_2:9,r_j:9,r_m:9,rad:0,radial:[0,8,12],radioact:18,radiu:[0,1],rag:2,rain:9,rais:[0,2,13],ramp:1,ran0:18,ran1:18,ran2:18,ran3:18,rand:[0,4,5,6,9,10,13,16],rand_max:[],randint:[6,9,13],randn:[0,1,2,5,6,9,11,13],random:[0,1,2,3,4,5,6,8,9,13,14,15,16,17],random_devic:[],random_forest_model:10,random_index:13,random_indic:[1,3],random_st:[0,7,8,9,10,11],randomforestclassifi:10,randomli:[1,6,9,13,14],randomnumbergener:[],rang:[0,1,2,3,4,5,6,7,9,10,11,12,13,14,16,18],rangl:[0,6,11,18],rangle_x:18,rank:5,rankdir:4,raphson:[1,8,13],rapidli:0,rare:[1,13],rate:[0,1,2,3,4,8,9,10,12,13],rather:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,16,18],ratio:[4,7,9,10,11],rational:0,ravel:[5,6,7,8,9,10,11,13,16],raw:3,raw_df:[],rbf:[8,11,12],rbf_kernel_svm_clf:8,rbf_pca:11,rc:[0,18],rcond:0,rcparam:[0,1,3,7,8,9,10,18],rd:[],re:[2,4,13],reach:[1,4,5,6,7,9,10,11,12,13,14],read:[0,2,3,4,5,6,7,8,11,12,16,17,18,20],read_csv:[0,6,7,9],read_fwf:0,reader:[0,6,16,18],readi:[0,1,5,6,8,10,11,12,16],readili:1,readthedoc:15,real:[0,1,2,4,7,10,11,12,13,16],real_loss:4,real_output:4,realist:8,realiti:18,realiz:[1,12],realli:[0,1],rearrang:13,reason:[0,1,3,4,10,13,20],reassign:1,rebuild:[],recal:[5,6,9,10,11,12,16,18],recalcul:[],recast:3,receiv:[1,3,10,12,18],recent:[0,2,3,4,5,6,7,8,9,10,13],recept:[3,12],receptive_field:3,recip:[0,6,7,16],reciproc:5,recogn:[0,4,5,10],recognit:[0,1,3,12,17,20],recommend:[0,2,3,4,5,6,8,13,15,16,17,20],reconsid:9,reconstruct:11,record:[10,17],recreat:[],rectangl:[9,13],rectangular:5,rectifi:[1,3,12],recur:[0,15],recurr:[0,1,15,17],recurs:[9,15,16],recycl:[],red:[0,3,4,6,8,9],redefin:[0,10],reduc:[1,3,5,6,9,10,11,13],reduct:[0,10,11,15,18],refer:[0,1,2,3,5,6,7,11,12,13,14,16,20],referenc:2,refin:12,refit:6,reflect:[0,1,4,5,18],refresh:[15,17],reg:[10,11],regard:[1,9,13],regardless:12,region:[3,4,6,9,12],regist:[6,18],reglasso:5,regr_1:[0,9],regr_2:[0,9],regr_3:[0,9],regress:[1,8,11,12,15,16,17],regressor:[0,7,10],regridg:[0,5,6],regular:[0,3,4,5,6,7,9,13],regularis:6,reilli:[0,20],reinforc:[0,8,15],reiter:1,rel:[0,4,6,7,9,12,13,18],relat:[0,1,3,4,5,11,13,14,16,18],relationship:[0,4,9],relativeerror:0,releas:[1,3,4,6,13,15],relev:[0,1,5,7,11,15,17,18],reli:[0,6,8],reliabl:[7,18],relu:[3,4],remain:[1,2,4,6,12,16,18],remaind:18,reman:2,remark:1,rememb:[0,8,13,16],remind:[0,5,11,13,16,17,18],remov:[0,4,5,6],render:0,reorder:[5,7],reorgan:0,repeat:[0,1,3,4,5,6,9,10,11,13,14,16,18],repeated:0,repeatedli:[6,10,13],repet:3,repetit:[6,17],rephras:13,replac:[0,1,3,4,5,6,10,12,13,14,15],replica:6,repositori:[0,4],repres:[0,1,2,3,4,5,6,7,8,9,10,12,13,18],represent:[0,1,3,6,18],representd:3,reproduc:[0,5,6,9,12,15,18],repuls:0,request:[0,13],requir:[0,1,3,4,5,6,8,9,11,12,13,16],res1:2,res2:2,res3:2,res_analyt:2,res_analytical1:2,res_analytical2:2,res_analytical3:2,resaml:6,resampl:[0,7,10,15,17],rescal:[0,11,12],rescu:5,reseach:6,research:[0,4,15,20],resembl:[6,18],reserv:[1,5,6,18],reset:[],reshap:[0,1,2,3,4,6,8,9,10,16],residenti:0,residu:[0,5,13],resiz:5,respect:[0,1,2,3,5,6,7,8,10,11,12,13,14,18],respond:12,respons:[0,7,9,12],rest:[0,5],restat:[0,12],restor:4,restored_discrimin:4,restored_gener:4,restrict:[0,3,9,12],result:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18],result_typ:[],retail:0,retain:[5,6],return_data:14,return_kwarg:[],return_sequ:4,return_x_i:9,reus:[1,3,6],reveal:[0,12],revers:[1,16],review:[15,16,17],revisit:14,reward:[0,4],rewrit:[0,3,5,6,7,8,10,11,12,13,16,18],rewritten:[2,6,8,10,18],rewrot:13,rf:10,rgb:3,rgoj5yh7evk:15,rh:[5,6],rho:[0,10],rho_1:10,rho_2:10,rho_m:10,rich:0,ride:9,rideclass:9,ridedata:9,ridg:[7,11,13,15,17],ridge_sk:6,ridgebeta:5,right:[0,1,2,3,5,6,7,8,9,10,12,13,14,16,18],right_sid:2,rightarrow:[0,1,5,6,8,11,12,13,18],rigor:0,ring:6,rise:0,risk:[0,13],rival:4,river:0,rm:[0,18],rmse:0,rmsporp:13,rmsprop:[1,3,4,13],rnd_clf:10,rng:18,rnn1:4,rnn2:4,rnn:[4,12,17],rnn_2layer:4,rnn_input:4,rnn_output:4,rnn_train:4,rntrick1:18,rntrick2:18,rntrick3:18,rntrick4:18,ro:[0,13],robert:20,robust:0,robustscal:0,roc:10,role:[0,2,5,6,8,15],roll:6,room:[0,19],root:[0,5,9,13,18],rotat:[1,8,9,10],rotation_matrix:9,roughli:[1,3],round:[0,7,9,13],routin:[13,16],row:[0,1,2,5,6,7,9,11,16],rr:5,rrr:5,rthe:5,rug:13,rule:[0,1,5,6,13],run:[0,1,2,3,4,5,6,8,9,11,13,15],runtim:[1,6,14],runtimewarn:[1,6],rust:[0,15,16],rustad:19,rvert:1,rvert_2:1,s:[0,1,2,3,4,5,6,7,9,11,12,13,15,16,17,18,19],s_1:6,s_:[3,6],s_i:[6,7],s_j:6,s_k:6,saddl:13,safe:[],sai:[0,1,2,3,4,5,6,7,8,9,10,11,12,16,18],said:[6,9,13],sake:[0,5,7,11],sale:0,same:[0,1,2,3,4,5,6,8,9,11,12,13,14,16,18],samm:10,sampl:[0,1,2,3,4,5,6,7,8,9,10,13,14,15,16,18],sample_vari:14,sample_weight:[3,4],sampleexptvari:18,sastri:11,satisfactori:0,satisfi:[1,2,3,6,8,13,16,18],satur:[1,6],save:[0,4,6,7,9],save_fig:[0,6,7,9,10],savefig:[0,4,6,7,9,18],savetxt:4,saw:5,scalabl:10,scalar:[2,5,6,10,13],scale:[0,1,3,5,6,7,8,9,10,11,12,13,15,16,19],scale_mean:4,scale_std:4,scalei:[],scaler:[0,7,8,9,10,11],scalex:[],scan:[5,7],scari:5,scatter:[0,1,6,7,8,9,14],scenario:[6,13],schedul:13,scheme:[1,13],schrage:18,scienc:[0,1,10,12,13,15,17,18,20],scientif:[0,15],scientist:0,scikit:[3,5,6,7,8,9,10,13,15,16,17,20],scikit_learn:0,scikitplot:[7,10],scipi:[0,3,5,6,13,15,16],scl:6,score:[0,1,3,6,7,9,10,11,19],scores_kfold:6,scratch:1,sdg:13,seaborn:[0,1,3,6,7],seamless:[0,15],search:[0,1,3,5,9,13],sec:6,second:[0,2,3,4,5,6,7,8,9,11,12,13,14,15,16,18],secondeigvector:11,secondli:12,section:[4,11,16,17,18],sector:0,see:[0,1,2,3,4,5,6,7,8,10,11,12,13,14,15,16,17,18],seed:[0,1,2,3,4,5,6,8,9,11,13,14,18],seed_imag:4,seek:[1,2,8],seem:[1,3,4],seemingli:0,seen:[0,1,3,5,10,12,18],segment:13,seismic:6,seldomli:0,select:[1,5,6,8,9,10,11,17,18,20],self:[1,3,4,5,20],sell:4,semest:[7,17],semi:[8,13],semilogx:6,send:[5,12,13,19],senior:17,sens:[0,4,6,8],sensibl:3,sensit:[0,5,6,9,13],sent:2,sentenc:[4,12],sep:[],separ:[0,1,2,4,6,8,9,12,14,15,18],sequenc:[2,3,4,7,9,10,12,13,15,16,18],sequenti:[1,3,4,10,12,18],seri:[0,1,2,3,4,5,6,10,11,12,13,16,17],serif:[0,7,18],serv:[0,1,2,3,5,7,13,20],session:[1,17],set:[1,4,5,6,7,8,10,11,13,14,15,16,18],set_major_formatt:6,set_major_loc:6,set_stream:5,set_tick:[1,8],set_ticklabel:1,set_titl:[0,1,2,3,7,12,14],set_xlabel:[0,1,2,3,7,12],set_xlim:[7,12],set_xticklabel:1,set_ylabel:[0,1,2,3,7],set_ylim:[7,12],set_ytick:7,set_yticklabel:[1,6],set_zlim:6,seth:4,setiosflag:[],setminu:6,setosa:[8,9],setosa_or_versicolor:8,setp:6,setprecis:[],setse:5,setup:[1,4,5,6,8,15],setw:[],sever:[0,3,5,6,7,8,9,11,12,13,15,16,17,18],sgd:[1,3],sgd_clf:8,sgdclassifi:8,sgdreg:13,sgdregressor:13,sgn:5,sh:[],shallow:13,shape:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,16],share:[1,3],she:7,shift:[1,6,12,18],ship:3,shortcom:13,shorten:4,shorter:18,shortli:16,should:[0,2,3,5,6,8,9,11,12,13,16,18],should_sync:[3,4],show:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,18],show_shap:4,shown:[0,4,5,7,8,11,12,13,16],showpoint:[],shrink:[3,5,6,8,11],shrinkag:[5,6],shrunk:11,shuffl:[0,1,3,4,6,13],side:[0,2,5,8,12,13,16],sigh:15,sigma0:18,sigma1:18,sigma2:18,sigma:[0,1,5,6,7,10,11,12,13,16,18],sigma_0:5,sigma_1:5,sigma_2:5,sigma_:[5,16],sigma_fn:[7,12],sigma_i:[0,5],sigma_j:5,sigma_m:[6,18],sigma_n:[11,18],sigma_t:13,sigma_x:18,sigmoid:[1,2,4,7,8,10,12,13],sigmundson:[6,19],sign:[1,2,7,8,10,18],signal:[1,3,10,12],signatur:[3,4],signifi:4,signific:1,significantli:[1,13,18],sigurd:19,sim:[4,5,6,13,18],similar:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,15,16],similarli:[0,1,3,5,8,10,18],simpl:[1,2,3,5,6,7,8,10,11,12,14,15,16,18],simple_rnn:4,simplepredict:10,simpler:[0,1,5,6,13,15],simplernn:4,simplest:[0,1,3,4,9,10,12,14],simpletre:10,simpli:[0,1,2,4,5,6,8,9,10,11,12,15,16,18],simplic:[2,5,6,7,8,9,10,11,12,14],simplicti:5,simplifi:[0,6,9,15],simplist:[3,6,18],simul:6,simultan:6,sin:[0,1,2,3,4,9,12,13,16],sinc:[0,1,2,3,5,6,7,8,9,10,11,13,16,18,20],sine:[3,12],singl:[0,1,2,3,5,6,7,8,9,12,13,16,18],singular:[0,6,13,16,17],sinusoid:3,site:[0,1,2,3,4,6,7,8,11,13,14,17],situat:[0,4,5,7,13,18],six:[3,18],size:[0,1,2,3,4,5,6,8,9,10,11,13,16,18],sketch:10,ski:9,skill:0,skip:[3,4,11],skiprow:[],skl:[0,6],sklearn:[0,1,3,5,6,7,8,9,10,11,13,14],skplt:[7,10],sl:6,slack:8,slice:[2,16],slide:[0,3,18],slight:[6,13],slightli:[1,2,3,5,6,7,10,18],slope:[8,11,12],slow:[0,2,8,13],slower:[5,16],slowest:16,slowli:12,slp:1,small:[0,1,2,3,5,6,8,9,10,11,12,13,15,16,18],smaller:[0,1,2,5,6,8,9,11,13,18],smallest:[0,4,14],smallest_row_index:14,smooth:[0,3,6,13],sn:[0,1,3,6,7],sne:11,so:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18],soar:6,social:0,soft:[1,7,10,12],soften:8,softmax:[3,7],softwar:[0,8,15,16,17],sol:8,sole:[0,6],solid:[0,7],solitem:5,soltyp:5,solut:[0,1,2,3,5,6,8,10,11,13,16,18],solutionsummari:5,soluton:2,solv:[0,1,3,5,6,8,10,11,12,13,16,17],solve_expdec:2,solve_ode_deep_neural_network:2,solve_ode_neural_network:2,solve_pde_deep_neural_network:2,solveod:2,solveode_popul:2,solver:[2,5,7,8,9,10,11,16],some:[0,1,2,3,4,5,6,7,8,9,10,11,12,14,17,18],some_model:6,somehow:4,someth:[0,1,3,4,7,9,11,18],sometim:[0,1,11,12,13,14],soon:16,sophist:0,sopt:13,sort:[5,6,9,11,18],sound:[3,5],sourc:[0,1,3,6,15,16,18],space:[0,1,4,5,8,9,11,12,13,14,18],span:[0,3,5,9,11,16],spare:1,spars:[3,5,6,16],sparse_mtx:16,sparsecategoricalcrossentropi:3,sparsiti:10,spatial:[1,2,3,12],spdiag:5,speak:18,special:[6,7,10,12,13,16,18],specif:[0,1,2,3,4,5,6,7,8,9,11,12,15,16,18],specifi:[0,3,5,6,7,9,11,13,14,18],specifici:[0,10],spectacular:3,spectral:1,speech:[0,1,3,4,12],speed:[1,2,4,13],spend:18,sphere:0,spin:6,spite:0,spline:8,split:[1,3,4,5,6,8,9,10,11,14,18],splite:0,splitter:[1,10],spmatrix:5,spontan:18,spot:3,spread:[0,11,18],springer:20,spuriou:13,sqquar:5,sqrsignal:3,sqrt:[0,3,4,5,6,8,10,11,13,18],squar:[1,2,3,4,7,8,9,11,13,14,15,16,17,18],squarederror:10,squaredeuclidean:14,squash:12,squeez:2,srand:[],srtm:6,srtm_data_norway_1:6,sse4:[],stabil:5,stabl:[0,4,5,6,7,9,11,15],stack:[2,3,4],stacklevel:0,stage:[5,13],stai:[0,2,4,5,11],stand:[0,5,9,12],standard:[0,1,4,5,6,7,8,10,12,16,18],standard_basi:2,standardscal:[0,6,7,8,9,10,11],stanford:13,start:[0,1,2,3,4,5,6,8,9,10,11,12,13,14,16,17,18],start_box:[2,13],start_nod:[2,13],start_tim:14,startpoint:[],stat:6,state:[1,2,4,5,6,7,8,10,11,12,13,15,18],statement:[0,7,16],statist:[0,1,3,4,7,9,10,11,12,13,14,16,17,20],statu:[0,7,11],stavang:6,std:[0,4,6],stdev:[],stdout:5,steep:13,step:[0,1,2,3,4,6,7,9,10,11,12,13,14,16],step_fn:[7,12],step_length:13,steps_list:9,steps_per_epoch:[3,4],stereo:3,stian:19,still:[0,2,3,5,6,11,13,18],stimuli:12,stk2100:20,stk3155:17,stk4021:20,stk4051:20,stk4155:17,stk5000:20,stk:20,stochast:[0,1,5,6,8,11,12,17],stock:4,stoke:12,stone:[0,7],stop:[1,4,7,9,11,13,14],storag:5,store:[0,1,2,3,6,11,13,18],storehaug:19,str:[1,3,4],straight:[0,6,8,13],straightforward:[0,2,3,5,6,8,9,10,13,16],strategi:[0,1,9],stratifi:6,streamtyp:5,strength:[0,5,14],stretch:11,strict:[8,13],strictli:[8,13],stride:[4,16],strike:6,string:1,stroke:7,strong:[3,6,9,10,12,16,18],strongli:[0,8,15,16],stronli:0,structur:[0,1,2,3,6,9,10,12,15],stuck:[1,13],student:[0,17,19,20],studi:[0,3,4,5,6,7,8,11,12,13,15,20],studier:[17,20],style:[0,7,9,16],sub:[9,12],subarg:[2,13],subdivid:[0,16],subfield:0,subject:[5,6,8,18],subplot:[0,1,3,4,6,7,8,9,10,13,14],subplots_adjust:[8,18],subprogram:16,subract:0,subroutin:0,subscript:1,subsequ:[1,4,5,6,12,16,18],subset:[1,6,9,12,13,15],subspac:[0,8,11],substanti:[9,10],substep:11,substitut:[3,6,12,16],subsubset:9,subtask:6,subtl:1,subtract:[0,4,5,6,11,13,16,18],subtre:9,subval:[2,13],succeed:[0,4],success:[3,7,9,13,18],successfulli:[4,9],sucess:[],sudo:[0,15],suffer:[0,1,2,5,10],suffici:[1,6,8,11,13],suggest:[1,13,20],suit:[8,12],suitabl:[0,18],sum:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,18],sum_:[0,1,2,3,5,6,7,8,9,10,11,12,13,14,16,18],sum_i:[0,2,5,6,8,13],sum_j:6,sum_ja_:0,sum_k:[6,8,12,16],sum_m:3,sum_n:3,sum_nx_:3,summar:[5,6,9],summari:[1,3,4,10,17],summat:[0,3],sunni:9,superfici:3,superscript:[1,12],supervis:[0,5,6,7,9,12,15],supplement:7,support:[0,1,9,10,11,13,15,17],suppos:[0,5,6,7,8,10,11,12,13,16],suppress:[5,13],sure:[0,1,4,6],surf:6,surfac:[0,6],surpass:6,surpris:0,surround:[3,15],survei:[0,5,6],suyrzm0:17,svc:[8,9,10],svd:[0,6,11,17],svdinv:5,svm:[8,9,10,11],svm_clf:[8,10],swap:2,swapax:2,swath:5,sy:[5,13],symbol:[1,5,11,13,15,18],symmeteri:1,symmetr:[0,5,8,11,12,13,16],symmetri:6,sympi:[0,15],synonim:18,syntax:[1,13],syntaxerror:1,syrk:5,system:[0,1,3,4,5,6,7,9,10,12,13,15,16,20],systemat:[4,6],t0:[3,6,13],t1:[2,13],t2:2,t3:2,t:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,19],t_0:[2,9,13],t_1:13,t_:2,t_b:10,t_i:[1,2,12],t_j:[5,12],t_k:9,tabl:[9,18,19],tabul:0,tackl:4,tag:[2,3,4,5,6,7,12,13,14,16,18],taht:0,tail:18,tailor:[2,8,11],taiwan:0,take:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,15,16,18],taken:[0,1,3,6,10,13,16],tan:3,tangent:[1,4,12,13],tanh:[1,4,7,8,12,13],tape:[3,4],target:[0,1,3,4,5,6,7,8,9,10,11,12,13],target_nam:9,task:[0,1,3,5,6,9,11,12,14],tau:[3,5,18],tax:0,taylor:[2,13],taylornr:13,tc:8,team:1,teaser:0,technic:[0,5,6,13],techniqu:[0,1,8,10,13,15,17,18,20],technolog:[0,1],tek5040:20,tell:[0,4,6,10,11,13,18],temp1:1,temp2:1,temp:1,temperatur:[0,9],temporarili:1,ten:3,tend:[3,5,6,8,9,10,12,13,14],tendenc:0,tension:6,tensor:[3,4],tensorflow:[0,2,4,8,14,15,16,17,20],term1:[5,6,11],term2:[5,6,11],term3:[5,6,11],term4:[5,6,11],term:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,18],termin:[0,4,5,9,10,13],terrain1:6,terrain:6,test:[3,4,5,6,7,8,9,10,13,14,16,18],test_acc:3,test_accuraci:[1,3],test_error:6,test_imag:[3,4],test_ind:6,test_input:4,test_label:[3,4],test_loss:3,test_pr:1,test_predict:1,test_rnn:4,test_scor:[7,10],test_siz:[0,1,3,5,6,10],test_split:9,testerror:[0,6],testi:4,testpredict:4,testx:4,text:[0,1,2,4,5,8,9,11,13,16,17,18,20],textbook:17,textual:9,textur:1,tf:[1,3,4,13,14],tfe_py_execut:[3,4],th:[0,1,2,5,6,7,9,12,13,14,16,18],than:[0,1,2,3,4,5,6,7,9,10,11,12,13,15,18],thank:[4,6],theano:[1,15],thei:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18],them:[0,1,3,4,6,8,9,10,11,12,13,16],theme:0,themselv:[0,18],thenc:6,theorem:[2,6,7],theoret:[0,4,10],theori:[0,1,3,8,9,12,13,15,17,20],thereaft:[0,5,6,11,12,16],therebi:[0,5,7,11],therefor:[0,1,2,3,4,6,7,8,11,13,18],therein:11,thereof:[0,6,13],theta:[1,4,13,18],theta_:[1,13],theta_i:1,theta_k:[],theta_linreg:13,theta_t:13,thi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20],thing:[0,1,2,4,5,7,9,18],think:[0,1,3,4,6,9,12,13,14,18],third:[0,3,6,13],thirti:7,those:[0,3,5,6,8,9,10,11,16,17],though:[1,2,3,4,13,16,18],thought:[6,14,18],thousand:[0,1],thread:[3,4],three:[0,1,3,5,6,8,9,12,16,17,18,19],threshold:[1,3,9,10,11,12,13],through:[0,1,2,3,4,5,6,8,11,12,13,14,15,16,18],throughout:[0,4,5,14,15,16,18],thu:[0,1,2,5,6,7,8,10,11,12,13,19],thumb:[0,6],thursdai:17,tibshirani:[6,17,20],tick_param:6,ticker:[6,13,18],tif:6,tight_layout:[1,7],tightli:11,tild:[0,5,6,11,18],till:[0,4,7,8,9,10,12,16],time:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18],timefunct:[],timeit:4,timer:4,tini:1,tip:3,titl:[0,1,2,3,4,6,7,8,9,10,13,18],tmp:13,tmp_log:[3,4],tn:[2,3],to_categor:[1,3,4],to_categorical_numpi:1,to_numer:[0,6],to_str:[],todai:3,togeth:[0,3,6,8,11,15],toi:[13,14],told:13,toler:[2,6,14],tolist:4,tomographi:12,too:[0,2,4,5,6,9,11,13,18,20],took:8,tool:[0,1,3,6,13,15],toolbox:8,top:[0,3,5,6,9,10,15],top_node_typ:2,top_trac:2,topic:[0,5,6,7,8,15,17,20],topolog:[1,3,12],toposort:2,torkjellsdatt:19,toss:[10,18],total:[0,1,2,3,4,6,7,8,10,11,12,13,14,16,18,19],total_loss:4,totalclustervari:14,totalscatt:14,totalvari:[],toward:[1,2,7,12,13],town:0,tp:4,tpng:9,tpu:15,tqdm:6,tr:[],trace:[2,13],trace_stack:[2,13],traceback:[0,2,3,4,5,6,7,8,9,10,13],traceback_util:[3,4],tracer:[2,13],track:[3,13,14,16],tract:0,tractabl:0,trade:[5,9],tradeoff:[0,5,17],tradit:[0,1,4,6],train:[2,3,5,6,8,9,10,11,12,13],train_accuraci:[0,1,3],train_dataset:4,train_end:[0,1],train_error:6,train_funct:[3,4],train_imag:[3,4],train_ind:6,train_label:[3,4],train_pr:1,train_siz:[0,1,3],train_step:4,train_test_split:[0,1,3,5,6,7,9,10,11],train_test_split_numpi:[0,1],trainabl:4,trainable_vari:4,trained_model:6,trainerror:0,traini:4,training_checkpoint:4,training_dataset:4,training_gradi:13,training_gradient_fun:13,training_loss:13,trainingerror:6,trainpredict:4,trainscor:4,trainx:4,trait:0,trajectori:4,tran:5,transfer:9,transform:[0,5,6,7,8,9,10,11,12,13,15,16],transit:[6,12],translat:[1,4,6,10],transpos:[1,5,11,16],travers:[0,5],treat:[0,1,3,6,12,13,18],tree:[0,1,6,15,17],tree_clf:[9,10],tree_clf_:9,tree_clf_sr:9,tree_reg1:9,tree_reg2:9,tree_reg:9,trend:18,trevor:20,tri:[2,3,4,9,13],triain:0,trial:[0,2,4,6,13,18],triangl:13,triangular:16,trick:[3,4,8,11,13,18],trickier:18,tridiagon:16,trillion:15,trivial:[0,1,5,11,18],troubl:[0,8,12],truck:3,true_beta:6,true_divid:1,true_fun:6,tucker:8,tumor:[7,9],tumour:7,tunabl:1,tune:[4,9,13,16],tup:[],tupl:[2,13],turn:[0,1,5,6,7,8,9,10,11,12,13,16,18],tutori:[1,4],tv:2,tveito:2,tweak:[1,4,10,18],twice:13,twist:11,twister:[],two:[0,1,2,4,5,6,7,9,10,11,12,13,16,17,18,20],tx:13,tx_1:13,txt:4,ty:13,type:[0,1,3,6,8,10,13,16,18],typeerror:[2,13],typic:[0,1,2,3,4,5,7,9,10,12,13,18],u:[0,2,5,6,10,11,12,16],u_:16,u_i:12,u_m:10,ua:0,ubuntu:[0,15],uci:0,uio:[17,19,20],un:14,unari:16,unary_f:[2,13],unary_oper:[2,13],unary_to_nari:2,unbalanc:[6,9],unbias:[0,5,6],uncent:6,uncertainti:[0,5],uncertitud:18,unchang:[1,3],uncorrel:[10,18],undefin:5,under:[0,1,5,6,10,13,15],underdetermin:0,underfit:[1,6],underflowproblem:5,undergo:5,undergradu:17,underli:[0,1,9,13,18],underset:[4,14],understand:[0,1,3,5,6,10,13,14,15],understood:[8,13],undesir:8,undetermin:[5,8],undo:4,unexpect:6,unexpected:18,unfair:6,unfortun:[1,8,9,10],unicode_liter:[8,9],uniform:[0,1,5,6,11,13,18],uniform_real_distribut:[],uniformli:[13,18],unifrompdf:18,unimport:13,union:[5,6],uniqu:[0,2,6,13,14,16],unique_cluster_label:14,unit:[0,1,3,4,5,10,12,18],unitari:[5,6,16],unitarili:16,uniti:18,univari:18,univers:[0,1,2,13,15,17,19],unix:1,unknow:[0,16],unknown:[0,1,3,4,5,6,8,10,16],unknowwn:12,unlabel:1,unless:[0,3,6,11,13],unlik:[1,3,8,13],unnecessarili:9,unord:3,unravel:1,unrol:[3,11],unseen:[0,7,9],unstabl:1,unsupervis:[0,1,4,12,15,17],unsymmetr:16,until:[1,2,4,9,12,13,14],untouch:0,unusu:12,up:[1,3,4,5,6,8,10,11,13,14,15,16,17,18],updat:[1,2,10,12,13,14],upload:[15,20],upon:[0,1,6,11,16],upper:[0,8,9,16],uppercas:16,upsampl:4,upscal:4,us:[4,5,6,8,9,10,11,12,14,16,17,18,20],usag:[0,8,15],usd10000:0,usd:0,use_bia:4,use_multiprocess:[3,4],usecol:0,useless:1,user:[0,1,2,3,4,6,7,8,11,14,15,16],userwarn:[3,4,6,14],usetex:18,usg:6,usr:18,usual:[0,3,4,7,12,13,14],ut:5,util:[0,1,3,4,6,7,10,14],ux:16,v0:18,v1:18,v2:18,v:[2,4,5,6,11,13,15],v_0:11,va:1,val:13,val_accuraci:3,val_loss:4,vale:2,valid:[0,1,4,7,9,10,13,15,17,18],validation_batch_s:[3,4],validation_data:[3,4],validation_freq:[3,4],validation_split:[3,4],validation_step:[3,4],valu:[0,1,2,3,4,6,7,8,9,10,12,13,14,15,16,17],valuat:9,valueerror:[0,2],valy:4,van:0,vandenbergh:[8,13],vandermond:0,vanilla:[0,6,11,14],vanish:[1,4,13,18],var_x:18,varabl:8,varepsilon:[5,6],varepsilon_:[5,6],varepsilon_i:[5,6],vari:[0,1,3,5,6,10],variabl:[0,1,2,3,4,5,6,7,8,10,11,12,13,14,16],varianc:[0,1,5,7,9,10,11,13,14,15,16,17,18],variance_i:[5,11],variance_x:[5,11],variant:[0,1,6,8,12,13],variat:[3,4,11],varieti:[0,3,12,15],variou:[1,3,5,6,7,8,9,11,12,13,15,16,18],vartempvec:[],varvec:[],varydimens:4,vastli:3,vaue:1,vault:0,vdot:[2,13],vec:6,vector:[0,1,2,3,4,5,6,7,9,10,11,13,14,15,17],vector_mean:14,ventur:[0,8,15],verbos:[1,3,4],veri:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,18,20],verifi:[3,11,16],versatil:8,versicolor:[8,9],version:[0,3,4,10,13,14,15,16,18],versu:1,vert:[0,1,5,6,7,8,9,11,13],vert_1:[5,6],vert_2:[5,6,11],via:[0,5,6,7,8,9,10,11,12,15,16,17,18],vidal:11,video:[0,1,12,15,17],view:[1,3,5,6,12,13,17,18,20],violat:8,virginica:9,viridi:[0,1,2,3],virtual:1,viscos:13,viscou:13,visibledeprecationwarn:2,vision:[0,3],visual:[0,3,11,12,15],visualis:1,viz:[6,8,18],vjp:[2,13],vjp_0:[],vjp_0_fun:[],vjp_1:[],vjp_1_fun:[],vjp_argnum:[],vjpfun:2,vjpmaker:[],vjpnode:[2,13],vmax:[1,6],vmc:[],vmin:[1,6],voic:3,volum:[0,3],vote:10,voting_clf:10,votingclassifi:10,votingsimpl:10,vrtx:17,vs:[0,4,6],vspace:[2,13],vstack:[5,11,16,18],vt:5,w1:8,w2:[8,11],w3:8,w:[0,1,2,3,4,5,6,7,8,10,11,12,13,14,16,18],w_1:[8,16],w_1x_1:8,w_1x_:8,w_2:[8,16],w_2x_2:8,w_2x_:8,w_3:16,w_4:16,w_:[1,12],w_hidden:2,w_i:[1,2,10],w_ix_i:12,w_j:16,w_m:16,w_output:2,w_px_:8,w_px_p:8,wa:[0,1,3,4,5,6,7,10,11,12,13,14,16],wai:[0,1,2,3,4,5,6,7,8,10,11,12,13,14,16,18],walk:9,walker:18,wang:0,want:[0,1,2,3,4,5,6,8,9,10,11,12,13,14,15,18],warn:[1,3,4,8,14],warrant:6,wast:3,watch:[3,4,15],wave:3,wavelet:8,we:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20],weak:[9,10,14],weather:[1,12],web:[15,17],webpag:17,websit:[6,16,17],wedg:[8,18],wednesdai:17,wee:11,week:[0,5,6,7],weekli:[15,20],weight:[0,1,2,3,6,7,9,10,12,13,18],weigth:2,welcom:[8,15],well:[0,1,2,3,4,5,6,7,8,9,10,12,13,15,16,17,18,20],went:8,were:[0,1,3,4,5,6,7,8,10,11,12,14,18],wessel:0,westbi:19,westby:19,what:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18],whatev:3,when:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,18],whenev:[13,18],where:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,19],wherea:[6,18],wherein:[1,12],whether:[0,3,5,7,9,18],which:[0,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19],whichev:[1,3],white:9,who:[0,17],whole:[1,3,4,5,9,11,13],whose:[0,6,10,18],whow:[5,11],why:[0,1,3,6,13],wide:[0,1,3,6,7,12,15,16],widehat:6,width:[0,3,8,9],wieringen:0,win:10,wind:9,wing:19,winther:2,wiothout:6,wiscons:7,wisconsin:10,wisdom:6,wise:[0,1,5,12,13],wish:[0,2,5,7,8,11,13,14,16],with_std:0,wither:6,within:[0,2,3,4,7,9,12,13,14,18,20],withinclust:14,without:[0,1,5,6,8,9,11,12,13],won:0,wonder:8,word:[0,1,3,4,5,6,14,18],work:[0,1,4,6,7,8,9,13,15,17,18],worker:[3,4],workshop:17,world:[0,8],worldwid:0,wors:[0,1,3,4,6],worst:[],worth:9,would:[0,1,3,5,6,7,8,9,10,11,12,13,16,18],wrap:[2,6,16,17],wrap_util:[2,13],wrapper:0,write:[0,1,2,3,5,6,7,8,12,13,16],written:[0,2,3,5,11,12,13,15,16,18],wrong:[1,8],wrongli:10,wrote:[5,11],wrt:[2,10,13],wth:10,www:[15,16,17,20],wx_1:8,x0:8,x1:[4,8,9,10,13],x1_exampl:8,x1d:8,x2:[8,9,10,13],x2d:[8,11],x2d_train:11,x2dsl:11,x3:8,x:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,18],x_0:[0,5,11,16],x_1:[0,2,5,6,7,8,9,10,11,13,16,18],x_2:[0,2,5,6,7,8,9,10,11,13,16,18],x_3:[8,16,18],x_4:16,x_:[0,2,3,5,6,8,10,11,13,14,16,18],x_center:11,x_data:1,x_data_ful:1,x_hidden:2,x_i:[0,1,2,5,6,7,8,9,10,11,12,13,14,16,18],x_input:2,x_ix_:0,x_iy_i:8,x_j:[0,2,8,9,12,18],x_jy_j:8,x_k:[12,14,16,18],x_l:18,x_m:[6,12,16,18],x_n:[0,2,3,6,8,11,12,13,16,18],x_new:[9,10],x_offset:6,x_output:2,x_p:[3,7,9],x_poli:9,x_poly10:9,x_pred:4,x_prev:2,x_reduc:11,x_scale:8,x_test:[0,1,3,5,6,7,9,10,11],x_test_own:6,x_test_scal:[0,6,7,9,10,11],x_tot:4,x_train:[0,1,3,4,5,6,7,9,10,11],x_train_mean:6,x_train_own:6,x_train_scal:[0,6,7,9,10,11],x_val:1,xarrai:15,xavier:1,xbnew:13,xcode:[0,15],xdclassiffierconfus:10,xdclassiffierroc:10,xg_clf:10,xgb:10,xgbclassifi:10,xgboost:9,xgboot:10,xgbregressor:10,xgparam:10,xgtree:10,xi:[8,13],xi_1:8,xi_:8,xi_i:8,xk:8,xla:15,xlabel:[0,1,2,3,4,5,6,7,8,9,10,13,18],xlim:[6,10],xm:9,xmesh:13,xnew:[0,13],xp:18,xpanda:0,xpd:[5,11],xplot:0,xs:9,xscale:0,xsr:9,xt_x:13,xtest:6,xtick:[3,6,8,9],xtrain:6,xu:0,xx:[0,5,16],xy:[0,6,8,16],xytext:8,xz:16,y1:4,y2:4,y3:4,y:[0,1,3,4,5,6,7,8,9,10,11,12,13,14,16,18],y_0:[0,5,11,16],y_1:[0,5,8,9,11,13,16],y_1y_1:8,y_1y_1k:8,y_1y_2:8,y_1y_2k:8,y_1y_n:8,y_1y_nk:8,y_2:[0,5,8,9,11,16],y_2y_1:8,y_2y_1k:8,y_2y_2:8,y_2y_2k:8,y_3:[0,9,16],y_4:16,y_:[0,1,5,6,10,11,16],y_data:[0,1,5,6],y_data_ful:1,y_decis:8,y_fit:0,y_i:[0,1,5,6,7,8,9,10,11,12,13,16],y_if_:10,y_ix_:0,y_ix_i:[7,8,13],y_iy_jk:8,y_j:[6,8,12],y_k:12,y_m:16,y_model:[0,4,5,6],y_n:[8,13],y_ny_1:8,y_ny_1k:8,y_ny_2:8,y_ny_2k:8,y_ny_n:8,y_ny_nk:8,y_offset:6,y_plot:9,y_pred1:9,y_pred2:9,y_pred:[0,1,4,6,7,8,9,10],y_pred_rf:10,y_pred_tre:10,y_proba:[7,10],y_scaler:6,y_test:[0,1,3,4,5,6,7,9,10,11],y_test_onehot:1,y_test_predict:0,y_tot:4,y_train:[0,1,3,4,5,6,7,9,10,11],y_train_mean:6,y_train_onehot:1,y_train_predict:0,y_train_scal:6,y_val:1,ye:[3,6,7],year:[0,15],yet:[0,1,6,8,11,13],yhd5w:17,yi:13,yield:[0,2,5,6,8,10,12,13,14,16,18],yk:8,ylabel:[0,1,2,3,4,5,6,7,8,9,10,13,18],ylim:[3,6],ym:9,ymesh:13,yn:0,yo:[8,9,10],yoshua:[1,20],you:[0,1,2,3,4,5,6,8,9,10,11,13,15,16,18,20],young:0,your:[1,2,4,5,6,8,11,13,15,16],yourself:[11,13],youtu:17,youtub:15,ypred:6,ypredict2:13,ypredict:[0,13],ypredictlasso:5,ypredictol:[0,5],ypredictown:6,ypredictownridg:6,ypredictridg:[0,5,6],ypredictskl:6,ys:9,ytest:6,ytick:[3,6,8,9],ytild:[0,6],ytildelasso:5,ytildenp:0,ytildeol:[0,5],ytildeownridg:6,ytilderidg:[5,6],ytrain:6,yx:16,yy:16,yz:16,z:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18],z_0:16,z_1:16,z_2:16,z_:[1,2,12,16],z_c:1,z_h:1,z_hidden:2,z_i:[1,12],z_j:[1,12],z_k:12,z_m:1,z_mod:9,z_o:1,z_output:2,zaman:18,zaxi:6,zero:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,18],zeros_lik:4,zfill:4,zip:[2,4,6,13],zl:5,zm_h:0,zn:0,zone:0,zx:16,zy:16,zz:16},titles:["3. Linear Regression","14. Building a Feed Forward Neural Network","15. Solving Differential Equations with Deep Learning","16. Convolutional Neural Networks","17. Recurrent neural networks: Overarching view","4. Ridge and Lasso Regression","5. Resampling Methods","6. Logistic Regression","8. Support Vector Machines, overarching aims","9. Decision trees, overarching aims","10. Ensemble Methods: From a Single Tree to Many Trees and Extreme Boosting, Meet the Jungle of Methods","11. Basic ideas of the Principal Component Analysis (PCA)","13. Neural networks","7. Optimization, the central part of any Machine Learning algortithm","12. Clustering and Unsupervised Learning","Applied Data Analysis and Machine Learning","2. Linear Algebra, Handling of Arrays and more Python Features","Teaching schedule with links to material","1. Elements of Probability Theory and Statistical Data Analysis","Teachers and Grading","Textbooks"],titleterms:{"1":0,"10":17,"11":17,"12":17,"13":[],"14":17,"15":[],"16":17,"17":17,"18":17,"19":17,"2":[0,17],"20":[],"2021":[],"2022":19,"21":17,"22":17,"23":17,"24":17,"25":17,"26":17,"27":[],"28":17,"29":17,"3":[0,17],"30":17,"31":17,"34":17,"35":17,"36":17,"37":17,"38":17,"39":17,"4":[0,17],"40":17,"41":17,"4155":[],"42":17,"43":17,"44":17,"45":17,"46":17,"47":17,"5":[0,17],"6":[],"7":17,"8":[],"9":17,"case":[8,10,18],"do":1,"final":12,"function":[0,1,6,7,8,10,11,12,13,18],"import":[5,16],"new":4,A:[0,1,4,8,9],And:13,Ising:6,The:[0,1,2,3,5,6,7,8,9,11,12,15],With:4,activ:[1,12],actual:[],ad:[0,6],adaboost:10,adam:13,adapt:10,adjust:1,adversari:4,again:[3,9],aim:[8,9],algebra:16,algorithm:[9,10,11,12],algortithm:13,all:8,an:[0,4,10],analys:5,analysi:[0,5,6,11,15,18],analyt:0,ani:13,anoth:9,appli:15,approach:[0,8,14],approxim:12,architectur:1,arrai:16,assist:19,august:17,autocorrel:18,autograd:[2,13],automat:13,back:[1,11,12],background:15,bag:10,base:13,basic:[0,5,7,9,10,11,16],batch:1,bay:5,befor:11,better:8,bia:6,binari:1,binomi:[],bird:10,block:[],boost:10,bootstrap:[6,10],boston:0,breast:1,bring:12,build:[1,3,9],calcul:[],cancer:[1,7,9,11],cart:9,central:[13,15,18],chain:12,chang:10,chi:0,choos:1,cifar01:3,classic:11,classif:[1,9,10],classifi:8,clip:1,cluster:14,cnn:3,code:[0,1,2,5,9,11,12,14],collect:[1,3],compar:[2,10],complex:[0,6],complic:6,compon:11,comput:9,con:9,concept:18,conjug:13,continu:[],convex:[8,13],convolut:[3,12],correl:11,cost:[1,10],cours:[15,20],covari:[5,11,18],cross:6,cumul:[],data:[0,1,3,6,7,9,11,15,18],dataset:[1,3],decai:2,decis:[9,10],decomposit:[5,11,16],deep:[1,2],defin:1,definit:[],degre:0,demonstr:[],dens:0,deriv:[5,12],descent:[2,10,13],detail:3,develop:1,deviat:[],diagon:11,dice:[],differ:8,differenti:[2,13],diffus:2,dimension:[2,3,8],disadvantag:9,discret:18,disguis:[],distribut:[5,18],domain:18,down:1,dropout:1,element:[0,18],elimin:16,ensembl:10,entropi:9,environ:0,equat:[0,2,12],error:[0,10],euler:2,evalu:1,event:[],exampl:[0,1,2,3,4,6,7,8,9,10],exercis:[0,6],expect:18,experi:18,explor:0,exponenti:2,extrapol:4,extrem:10,ey:10,fall:19,famili:1,famou:16,featur:[9,16],feed:[1,12],fine:1,first:[4,12],fit:[0,10],forc:3,forest:10,forward:[1,2,12],fourier:3,frank:6,freedom:0,frequentist:0,from:[5,10,12],full:2,further:[3,5],fy:[],gan:4,gaussian:16,gd:13,gener:[4,9],geometr:11,gini:9,good:0,grade:19,gradient:[1,2,10,13],growth:2,ha:15,handl:16,hidden:2,hous:0,how:[],hyperparamet:1,hyperplan:8,i:1,id3:9,idea:11,implement:1,implic:5,improv:1,includ:13,increment:11,index:9,inform:19,input:2,instal:15,instructor:19,interpret:[5,11],introduc:11,introduct:[0,6,15,16],invers:[5,16],iter:10,its:[],jackknif:[],jungl:10,kera:[1,3],kernel:[8,11],lagrangian:8,lasso:[5,6],later:5,layer:[1,2,3,12],learn:[0,1,2,11,13,14,15],least:[5,6],level:10,librari:15,likelihood:7,limit:[1,13,18],linear:[0,8,13,16],link:[5,11,17,20],logist:[7,13],lu:16,machin:[0,8,13,15],main:18,make:[0,9,10],mani:[10,12],materi:17,math:5,mathemat:[3,5,8],matric:[5,16],matrix:[1,5,11,12,16],matter:0,mean:0,meet:[5,10,18],mercer:8,mersenn:[],method:[6,9,10,13],mlp:12,mnist:[3,4],model:[0,1,4,6,12],moment:[],momentum:13,moon:[8,9],more:[3,6,16],multilay:12,multipl:[1,3],multipli:8,name:[],network:[1,2,3,4,7,12],neural:[1,2,3,4,12],non:8,normal:[0,1],norwai:[],notat:12,novemb:17,now:[1,9],nuclear:0,nueral:7,number:[0,2,18],numer:[2,18],numpi:16,object:3,observ:[],obtain:11,octob:17,od:2,off:6,ol:[5,6,13],one:[2,12],oper:16,optim:[1,8,13,15],ordinari:[5,6],organ:0,oslo:20,other:[4,9,11,12,16],our:[0,4,5,11,13],outcom:15,output:2,overarch:[0,4,8,9],overview:10,own:[0,10,11],packag:16,part:[13,15],partial:2,pass:1,pca:11,pdf:18,perceptron:12,perform:[1,9],period:3,perspect:1,point:4,poisson:2,polynomi:3,popul:2,practic:13,pre:[1,3],predict:4,prerequisit:[3,15],princip:11,principl:3,pro:9,probabl:[5,18],problem:[1,2,13],procedur:9,process:[1,3],program:[2,13],project:6,prop:13,propag:[1,12],properti:[5,18],pseudo:[],python:[0,9,15,16],quick:8,ran0:[],random:[10,11,18],read:9,real:6,recip:[],recurr:[4,12],reduc:0,reduct:3,reformul:2,regress:[0,5,6,7,9,10,13],regular:1,relev:20,relu:1,remark:3,remind:[6,8],requir:[2,15],resampl:6,rescal:6,resourc:2,revisit:13,ridg:[0,5,6],rm:13,rng:[],rule:12,s:[8,10],sampl:11,schedul:17,schemat:9,scheme:2,scikit:[0,1,11],select:[],semest:19,septemb:17,set:[0,2,3,9,12],sgd:13,should:1,simpl:[0,4,9,13],singl:10,singular:[5,11],situat:[],soft:8,softmax:1,solv:2,solver:13,some:[13,16],specifi:2,split:0,squar:[0,5,6,10],standard:13,state:0,statist:[5,6,15,18],steepest:[10,13],stk3155:[],stochast:[13,18],superposit:3,supervis:1,support:8,svd:5,systemat:3,teach:[17,19],teacher:19,techniqu:[6,11],technolog:15,tensorflow:[1,3],test:[0,1],textbook:20,theorem:[5,8,11,12,18],theori:18,three:[],tip:13,togeth:12,top:1,toss:[],toward:11,trade:6,tradeoff:6,train:[0,1,4],transform:3,tree:[9,10],tune:1,two:[3,8,15],type:[2,4,12],uncorrel:[],uniform:[],univers:[12,20],unsupervis:14,up:[0,2,9,12],us:[0,1,2,3,7,13,15],valid:6,valu:[5,11,18],variabl:18,varianc:6,variou:0,vector:[8,12,16],view:[0,4,10],visual:[1,9],vs:3,wai:9,wave:2,week:17,weekli:17,what:0,which:1,why:[],wisconsin:7,write:[4,11],xgboost:10,your:[0,10]}})
\ No newline at end of file
+Search.setIndex({docnames:["chapter1","chapter10","chapter11","chapter12","chapter13","chapter2","chapter3","chapter4","chapter5","chapter6","chapter7","chapter8","chapter9","chapteroptimization","clustering","intro","linalg","schedule","statistics","teachers","textbooks"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":4,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":3,"sphinx.domains.rst":2,"sphinx.domains.std":2,"sphinx.ext.intersphinx":1,sphinx:56},filenames:["chapter1.ipynb","chapter10.ipynb","chapter11.ipynb","chapter12.ipynb","chapter13.ipynb","chapter2.ipynb","chapter3.ipynb","chapter4.ipynb","chapter5.ipynb","chapter6.ipynb","chapter7.ipynb","chapter8.ipynb","chapter9.ipynb","chapteroptimization.ipynb","clustering.ipynb","intro.md","linalg.ipynb","schedule.md","statistics.ipynb","teachers.md","textbooks.md"],objects:{},objnames:{},objtypes:{},terms:{"0":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,18,19],"00":[0,1,3,5,6,11,18],"000":[1,3],"0000":[],"00000":[],"000000":[5,11],"00000000e":5,"0000e":3,"0001":[1,3],"000148":[],"00019998":5,"00024087":5,"00028369228101198006":[],"00029012":5,"0003043256065368937":9,"00031535148309580783":6,"0003153514830958081":[],"0003153514830958126":[],"0003153514830958235":6,"00034944":5,"000417932":2,"00042089":5,"000464088":2,"00050694":5,"00058016":6,"000599":[],"00060705":[],"00060708":6,"00061058":5,"00062582":6,"00062595":[],"00066668":6,"00068734":6,"00068941":6,"00069103":[],"00073541":5,"00076495":6,"00076919":6,"00076925":[],"0007698473260556325":6,"0007698473260556334":[],"0007698473260556339":[],"0007698473260556344":6,"00079123":[],"00079130":6,"00079968":5,"00084705":[],"00084711":6,"00085883":6,"00085884":[],"00087697":6,"00088573":5,"00092645":6,"00092646":[],"00096314":5,"001":[1,2,8,13],"00100519":6,"0010479245355337968":[],"0010479245887943952":6,"00105081":6,"00106677":5,"00107405":6,"00111756":6,"0011526":6,"00115999":5,"0011828302640124":[],"00118504":6,"00118527":[],"001263":[],"00128479":5,"001323":6,"00137823":6,"00137835":[],"00139705":5,"00149311":6,"00149956":6,"00152117":6,"00154733":5,"00156379":[],"00156382":6,"00168251":5,"00174276":6,"00175331":6,"00186347":5,"001880":5,"001988":[],"00198806":[],"00200":8,"00202624":5,"00202756":6,"00217499":6,"00224413":5,"00228741":6,"0023548":6,"002381316302584885":[],"002381316302584886":6,"0023813163025848865":6,"00242999":6,"00243186":6,"0024401":5,"00249435":6,"002526":[],"00266858":2,"00270244":5,"00274989":6,"00275135":[],"00289724":6,"00293838":5,"002948":[],"0030828":[],"003083":[],"00310113":2,"00312361":6,"00315593":6,"003215318065760509":[],"0032153180657605125":6,"00323332":6,"0032542":5,"003301":6,"003395515459204093":6,"0033955154592040944":[],"00353823":5,"0036237":6,"0036367":6,"00369758":6,"003704":[],"003717":[],"003759":[],"003774":[],"003788":[],"0038335":6,"00390021":[],"003909404072811217":6,"003909404072811231":[],"00391839":5,"0039987":6,"004":5,"004091940707753948":6,"0040919407077539514":[],"00410387":6,"00410478":6,"004113634617443116":6,"0041136346174431284":[],"004113634617443131":6,"004113634617443135":[],"00411363461744314":6,"004113634617443141":[],"004155986345861364":6,"004155986345861374":[],"00415763":[],"00424909":2,"00424967":6,"00426027":5,"00433417":11,"00440346":6,"00443743":6,"00445655":11,"004579219539673834":6,"004579219539673836":[],"00458878":6,"004610275230656187":6,"004610275230656294":[],"00462287":6,"00471782":5,"00472199":6,"00472512":6,"0049544":6,"004999999999999984":[],"004999999999999994":[],"004999999999999996":[],"005000000000000011":0,"00512927":5,"00517114":6,"00526348":6,"0053018":6,"00554552":6,"00556826":6,"0056799":5,"00577441":[],"00579953":6,"00588657":6,"00607783":6,"006162":6,"00617499":5,"00630331":6,"00642221":6,"00660427":6,"00672607":6,"00673393":13,"00673407":6,"00676387":6,"0068011":6,"00683748":5,"00683964":6,"007012403613997257":[],"007024126888936694":[],"0070241268889382116":6,"00719176":6,"00727646693":0,"007315":[],"0074331":5,"00751823":[],"00759119":6,"00784393":6,"00803064":6,"0080866254785146":[],"00813803":6,"00817631":6,"00823002":5,"00827728":6,"00831018":6,"00834567":6,"00848904":6,"0086649156":0,"008675369724975977":5,"008675369724976501":[],"00894639":5,"00905423":6,"009163470508352211":[],"009163470508352218":5,"009164545680330616":6,"00917248":6,"00934499":6,"009450756365829578":[],"0096208":6,"00990475":5,"00992331":6,"00996754":6,"00it":6,"01":[0,1,2,5,6,9,11,13,18,20],"010018312644139205":6,"010018312644139347":[],"0100706":6,"010331721306655144":6,"01033172130665515":[],"010516485576646513":6,"010516485576652856":[],"01066519":6,"01076611":5,"0110":18,"0110407067093945":[],"01104071":[],"011076219011339788":[],"01107621901137465":6,"011225":2,"0113104":6,"01179792":6,"01191824":5,"01199624e":18,"012073649439965807":[],"012073649472576395":6,"01212754811385597":18,"01219292":6,"01223198":6,"01231917":6,"012633802944855959":[],"01290947":6,"01295356":5,"013121573975499602":[],"013121573975499604":[],"01312157406137079":6,"013121574061370796":6,"01318643":6,"01347916":6,"01348565":6,"01367553":6,"01397146":6,"01405935":6,"01416528":6,"014209325470380275":[],"01433809":5,"014436800088896274":6,"014436800088969727":[],"01449782":6,"01458337":6,"0146081":6,"01463049":6,"015072388895177088":[],"0150723888951771":6,"015072388895177109":[],"015072388895177239":6,"01509543":13,"01530715721129232":[],"01531845":6,"01538461538462":[],"01549377":6,"01558197":5,"01591355407242949":5,"016285782696017055":6,"016285782696075054":[],"01633913":6,"01640891":6,"01655318":6,"016587414993037307":[],"016587414993045405":6,"01691985":6,"0169643":5,"01708781":6,"01708852":6,"01713366":6,"01724499":5,"01735584819559184":[],"017355848195591845":[],"017355848195593354":6,"01756972":[],"017665":5,"01799917e":18,"01817152":[],"018232":[],"01831036e":6,"01831130e":[],"01831200e":[],"01831207e":6,"01866537":6,"01869785e":18,"01873344":11,"01873869":5,"01898855":6,"01905883":6,"01908936":6,"019587":[],"01963611":6,"01969145":6,"019754165271682844":6,"01975416527179247":[],"01975848":6,"02":[0,4,6,7,12,18],"02024962":6,"02054837e":6,"02068067":6,"02073509":5,"0209518407597062":18,"02098261":6,"02123176":6,"021250026482402":11,"02159270458799264":[],"021592704587992645":[],"021592704588021164":6,"021592704588021167":6,"02198702e":6,"022022882954618364":[],"02208512":6,"02228115":6,"02229529":6,"02252765":5,"022556":11,"02255619":11,"02299949826036602":[],"0229994982603662":6,"02348765":6,"02365049":6,"0245528":6,"02492265":5,"02493054":[],"02498832":6,"02503753":6,"02511518":6,"02522069":6,"025709":11,"02586427":6,"0260906":6,"02625193":8,"02625928":13,"026408391362671896":[],"02642055e":18,"026605727637176654":[],"02660572763718461":6,"026605727637184613":6,"026986":5,"02698605":5,"02707227":5,"02723445":6,"027609773491022314":[],"027609773491022387":6,"027609773491022407":6,"02786488":11,"027865":11,"02857":4,"02917662":11,"029177":11,"02926396":[],"029483":5,"029613363972682966":[],"029733":[],"02976145":6,"02994311":5,"02f":6,"03":[1,6],"03032441e":6,"03056589":[],"030566":[],"03071040e":18,"03076923076924":[],"03077640549":4,"03099776":5,"031":5,"03187339273559067":[],"03196357":6,"03251863":5,"03256632e":1,"03267527":6,"03278964":[],"032790":[],"03279636":6,"0330308045180234":[],"0330308045183163":[],"0330308045183219":6,"0330308045190182":6,"03308408":5,"033657685071527485":[],"033657685071527624":6,"03382304823545749":11,"03447512":6,"03562355":6,"03568439":6,"03570747":0,"0358909447132981":[],"0359565":5,"03630548":6,"03707133":11,"037559":11,"03755944":11,"03761519":[],"03781367141738885":[],"03781367141738886":[],"037813671417388985":6,"03781367141738899":6,"03794112":16,"03814292":6,"03815288":6,"038300":11,"03850557":11,"038506":11,"039039":5,"03981057":16,"0399676689527968":6,"0399676689527975":6,"04":[1,6,11,18],"040102":5,"04010697":6,"04063602":6,"041":[],"041148729430502":6,"041148729430523":6,"0411487294305246":[],"0411487294305746":[],"04179719":[],"041797190646905":[],"04220758":6,"04284519":[],"043":[],"04315108":5,"0433816":[],"04346721":5,"04355837":6,"04362":[],"04368707":16,"0437499":2,"04389027":6,"043927769551648":[],"04423486":6,"044334":[],"0444119":[],"044613":6,"04483457":[],"04537385":6,"04543942":6,"04566964":6,"0458":9,"04615384615386":[],"04621521":[],"04648335":5,"046491":5,"04649105":5,"0466":[],"04683565":5,"04775904":16,"04784395":6,"04818727730430296":[],"048187277304303056":6,"048653428302840175":16,"04892055":6,"04909093":6,"04912436":6,"04930820e":18,"0495569966278238":6,"0495569966278269":6,"0495569966278315":[],"049747":5,"04it":[],"05":[1,3,4,6,13],"05009826":6,"05087958":[],"05100875":6,"051418":5,"051649":11,"0517473":5,"05227921801205691":[],"05227921801205692":[],"052279218012057004":6,"052372":5,"05255759":[],"05263":[],"05290417684691035":[],"05302":[],"05364854":8,"05383795":6,"053849":5,"05434571":16,"05447415":6,"054491":5,"054585":[],"054785":[],"054963":[],"05505310046362":[],"05505310046363":2,"055137":[],"055320":[],"05533":[],"055344":5,"055676":[],"05614483":5,"05623":[],"056235":5,"056468":5,"05648":[],"05651951":6,"056528":11,"05667":[],"057088709963182":[],"057163681553428394":6,"05716368155351588":[],"0572":[],"05756733":[],"05785343":6,"05789007":6,"057899":11,"05796251":6,"058033":5,"058038":5,"05807125":6,"058715":5,"05883":[],"05884":[],"058948":5,"058955":5,"059013":[],"059294":11,"059378":11,"059601":[],"059783":[],"059795":5,"059824":5,"059933":5,"05999":[],"06":[6,13],"060080":[],"060183":[],"06020587":6,"06021285":[],"060213":[],"060228":11,"060309":[],"06043581":6,"060507":[],"060655":[],"060781":[],"060841":[],"060963":5,"061025":[],"061048":5,"061149":[],"061321":[],"061390":[],"061509":[],"061538":5,"061604":[],"06160438":[],"061685":5,"061701":[],"061716":5,"061745":[],"061765":5,"061898":[],"061917":[],"061923":11,"06200174":5,"062061":5,"062062":5,"06208238634231944":6,"06208238634231953":[],"062136":[],"062142":[],"062292565":4,"062294":[],"062391":[],"062409":11,"062411":11,"062435":[],"062451":[],"062534":[],"062551":5,"062640":5,"062676":11,"062706":11,"062773":5,"062834":[],"062884":[],"062888":5,"063052":[],"063078":[],"063192":5,"063250":[],"063343":[],"063364":[],"063401":5,"063493":5,"063513":[],"063631":[],"063657":[],"063752":11,"063851":[],"063857":5,"063872":[],"063874":[],"06388888888888888":[],"063977":5,"064052":[],"064108":[],"064110":[],"064184":[],"064274":[],"064384":[],"064388":5,"06444":[],"064459":5,"064461":5,"064469":[],"06453579006728315":[],"06453579006728322":6,"064538":11,"064604":11,"064618":5,"064623":5,"064648":[],"064658":[],"064681":[],"064838":[],"064880":5,"06491736":6,"064918":[],"064931":11,"064964":[],"06497046":[],"065020":[],"065106":[],"065249":11,"065314":11,"065348":[],"06547790180152352":6,"06547790180152353":6,"06547790180152357":[],"06547790180152363":[],"065514":5,"065557":[],"065575":[],"065641":11,"065680":5,"065730":11,"065826":[],"065892":[],"065974":[],"06602663":[],"066051":5,"066110":[],"066194":[],"066223":5,"066309":[],"066348":5,"06637":[],"066449":[],"066558":[],"066609":[],"066654":5,"066670":11,"0666807":2,"066729":11,"066753":[],"066789":[],"066837":11,"066954":[],"067079":[],"067162":5,"067213":[],"067236":[],"067240":[],"06724062":5,"067282":11,"067392":11,"067402":11,"067432":11,"067506":5,"067544":[],"067597":[],"067599":[],"067612":[],"067620":[],"067622":[],"067675":[],"067714":[],"067723":[],"067767":5,"067769":[],"067787":5,"067856":5,"067908":5,"067956":11,"068059":11,"068093":11,"068094":[],"068103":[],"068120":[],"068210":5,"068318":[],"068345":5,"068363":[],"068376":[],"068417":5,"06844519414009438":[],"06844519414009442":6,"06844519414009444":6,"068461":11,"068500":5,"068505":5,"068538":11,"068573":5,"06858699":[],"068608":[],"068642":[],"068659":[],"068735":[],"068806":[],"068809":[],"068831":[],"068852":5,"068937":[],"068965":[],"068991":[],"068992":[],"069044":5,"069085":11,"069091":[],"069181":[],"069275":11,"069285":5,"069408":[],"069409":[],"069441":[],"069455":[],"069578":5,"069584":[],"069654":5,"069672":[],"069685":11,"069754":[],"069796":[],"069847":[],"069877":11,"069884":11,"069888":[],"069912":[],"06it":6,"07":6,"070028":[],"070043":[],"070071":[],"070074":[],"070150":[],"07016":[],"070163":11,"07017":[],"070343":11,"070379":[],"07039":[],"070419":11,"070429":11,"070491":[],"070492":11,"070576":[],"070612":[],"07062318":6,"070630":[],"070635":[],"070775":5,"070889":11,"070911":[],"070950":11,"070959":5,"070972":11,"07099747918547346":[],"071022":11,"071086":[],"071112":[],"071136":[],"07115":[],"07129539":[],"0712953943627344":[],"0713":0,"071387":[],"07145103":11,"071467":[],"071480":5,"0714956":16,"071515":5,"071529":[],"071547":5,"07160048164232467":6,"07160048164248561":[],"071614":[],"071632":[],"071698":[],"071705":[],"071741":5,"071767":[],"071906":5,"071921":[],"071935":[],"072008":5,"07201957":[],"072216":11,"072242":[],"072348":[],"072352":5,"072442":11,"072492":[],"072521":5,"072530":[],"072597":5,"072611":5,"072617":[],"072620":[],"072750":[],"07285":3,"0728785":[],"07291729":18,"072918":5,"072928":[],"073016":[],"073062":11,"073136":11,"073225":[],"073230":11,"073238":5,"073280":11,"073303":5,"073320":5,"073362":[],"073368":[],"073380":5,"073423":[],"073436":11,"073449":[],"07345504":[],"073531":[],"073548":5,"073575":11,"073583":11,"073598":11,"073629":11,"073647":5,"073695":[],"073699":[],"073719":[],"073761":11,"073810":11,"073816":[],"073827":11,"073907":[],"073949":[],"074034":[],"074067":11,"074111":11,"07413172":[],"074149":11,"07421084":5,"074237":[],"074336":[],"074375":[],"074488":[],"074530":11,"07456491":5,"074573":11,"074666":[],"074693":[],"074881":5,"07490892":6,"074945":[],"075195":[],"075241":[],"075573":[],"075594":[],"075760":[],"075820":[],"075959":[],"076121":5,"076130":11,"076204":[],"076216":11,"076338":[],"0764924":6,"07656896":[],"076589":[],"076604":11,"076628":[],"07678":[],"076780":11,"076804":11,"076821":5,"076895":11,"076905":11,"076938":11,"076955":[],"077003":[],"077013":11,"077015":11,"077022":[],"077083":11,"077131":5,"077211":11,"077291":5,"077349":11,"07735703":16,"077375":5,"077402":[],"077425":[],"077452":11,"077467":[],"077620":5,"07777777777777778":1,"077793":[],"077948":5,"077978":5,"078040":[],"078042":5,"0782":6,"07820":[],"078253":[],"078254":11,"078269":11,"078299":11,"078314":11,"078436":11,"078548":[],"07864":[],"078667":[],"078697":5,"07871":[],"078725":5,"07878641":16,"078911":[],"078992":[],"07903849":16,"079157":[],"079281":[],"079347":[],"079383":[],"079389":[],"079405":[],"079406":[],"07944154":16,"079483":5,"079558":5,"079609":5,"07968918676726029":[],"0796891867672603":6,"079729":[],"079839":[],"079847":[],"079893":[],"07989327":[],"07999999999998":[],"07e":17,"08":[13,18],"080106":[],"080137":[],"080256":[],"080297":[],"080312":[],"080319":[],"080334":[],"080347":[],"080370":[],"080406":[],"080410":[],"08041015":[],"08043851":5,"080517":[],"080582":11,"080593":11,"080647":11,"080706":11,"080738":11,"080801":[],"080847":[],"08085812":[],"080916":[],"080984":11,"081046":11,"081072":11,"081140":[],"081144":11,"081233":[],"081253":[],"08131003":6,"081388":11,"081431":[],"081483":[],"081533":[],"081540":[],"08156108":6,"081773":[],"082174":[],"082183":[],"082267":5,"082295":11,"0823185":[],"082451":[],"082503":11,"08251519":6,"082536":11,"082874":5,"082896":11,"082900":[],"08299273e":6,"083015":[],"083053":[],"08318298e":1,"083220":[],"083227":[],"083276":11,"08328216846752691":11,"08333333333333333":1,"083361":5,"08336233266":4,"083404":[],"083441":[],"083506":[],"083527":[],"083579":5,"083600":[],"083692":[],"083694":5,"08376632":6,"083766322923899":6,"0837663229239016":[],"0837663229239025":[],"0837663229239043":6,"083799":[],"083829":[],"083977":[],"084000":[],"084101":[],"084184":[],"084224":[],"084226":[],"08426840630693411":[],"08426840630693412":6,"08426840630693413":6,"08428156":16,"084282":[],"084364":[],"084400":[],"084408":[],"084414":[],"084444":[],"084484":11,"084536":[],"084549":[],"08455":[],"084570":[],"084604":[],"084629":[],"08464758160254343":[],"084670":[],"084683":[],"084702":[],"08474":[],"084777":[],"084846":5,"084862":11,"084904":[],"084909":[],"084965":[],"085018":[],"085044":[],"085163":11,"085167":[],"085184":[],"085185":[],"085361":[],"085416":[],"08551306":6,"085764":[],"08576932":6,"085879":11,"08593216":6,"086074":11,"086076":[],"08611111111111111":1,"086112":11,"08612280083325631":5,"086262":5,"086303":[],"08630331":[],"086567":[],"086679":5,"08673755293381497":[],"086807":[],"086872":[],"086890":11,"08690":[],"086956":11,"087501":[],"08758":[],"08759":[],"087834":[],"08816688":[],"088176":[],"0881981":5,"088212":[],"088460":5,"088526":11,"088611":[],"088631":[],"08871404":5,"088809":[],"088816":[],"088825":[],"088853":[],"08888888888888889":1,"088926":[],"08902":[],"089059":[],"08917679":[],"089177":[],"089212":[],"089329":[],"089425":[],"089501":11,"089614":[],"0896981":6,"08996":[],"09":1,"090028":[],"090229":[],"090356":5,"09085624":16,"090929":[],"091051":11,"091060":[],"09117221":[],"091224":[],"091236":[],"091340":[],"091349":[],"091363":[],"091414":[],"091416":[],"091426":[],"09149881":[],"091630":[],"09166666666666666":1,"091696":11,"0917":9,"09170751":[],"09172408":6,"091891":[],"092066":16,"09216046":[],"0923":[],"09251":[],"09297039":[],"093247":[],"0934597075922044":[],"0938":[],"094082198961999e":6,"0940821989624095e":[],"094082198966615e":6,"0940821989673748e":[],"09440475":18,"094404754965417":18,"09444444444444444":1,"094472507965532":11,"094619":5,"095510":[],"095702":[],"095871":[],"09609807":5,"096173":[],"096472":11,"096623":[],"09672929714683368":[],"097360":[],"09744":[],"09744272":6,"09780":[],"09791":[],"09849763":11,"098498":11,"09856879":16,"09861229":16,"098802859381565":16,"099":[],"09903804":8,"0991919894927399":6,"099191989493334":[],"09951287404314545":1,"0n":0,"0s":[3,4],"0x11da42d90":13,"0x11e031e50":13,"0x7fad10f9a280":[],"0x7fad20f69be0":[],"0x7fd098df3280":[],"0x7fd0a9063be0":[],"1":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17,18,19,20],"10":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,16,18],"100":[0,1,2,3,4,5,6,7,8,9,10,11,13,14,16,18,19],"1000":[0,1,2,4,5,8,11,13,14,15,18],"10000":[2,5,6,10,11,18],"100000":8,"10001":10,"1001":18,"1002":18,"1003":18,"10030":[],"10044225464078282":[],"1005":18,"10077114273548984":6,"1009":18,"1011":18,"1013":18,"1013904243":18,"10141413e":6,"1015":18,"102":3,"1022233262115424":[],"10222333":[],"1023":18,"10230":[],"1023111":16,"1024":3,"1026":18,"1027":18,"1028":[],"103":1,"1030":18,"10302062":16,"10340":[],"1037":18,"10378326e":1,"1038":18,"10391807":6,"10398646080125035":[],"10398646080125036":6,"10398646080125037":6,"1040":18,"10405456":11,"10430":[],"104411":[],"10455924":[],"1047":18,"10505137":16,"10520":[],"10555555555555556":1,"1056":[],"10589577":5,"106":[],"106095":11,"10620135":16,"108":6,"109":[],"10913":6,"10931453":6,"10960":[],"1096767776832326":18,"10967678":18,"10th":9,"10x":0,"11":[0,2,3,4,5,6,7,8,9,10,11,12,13,16,18,20],"110":[],"1100":18,"1101":18,"11022302e":5,"11046771":16,"111":[1,7,12],"11100":[],"1122558214":[],"112383":11,"1124":[],"1125":3,"11297834":[],"1136":3,"11362930e":[],"11388888888888889":1,"1139":3,"11390":[],"114":3,"11402309":16,"114437":[],"11462415":5,"11482289e":6,"11499517":[],"11507992e":1,"11547777218875695":6,"11547777218875696":6,"11547777218940905":[],"11547777218940906":[],"115822":6,"11590":[],"11598862":18,"11598862273198":18,"11604844":[],"116048442683864":[],"11660":[],"11666666666666667":1,"11674401539815678":18,"117":8,"11744554e":6,"11780":[],"11790868":[],"117986":[],"118":2,"1182":[],"1183":[],"118318":[],"1184":4,"11840":[],"1185":[],"1186":[],"11890":[],"119":2,"1199":[],"119936":2,"119999999999976":[],"11it":6,"12":[0,1,2,3,4,5,6,8,9,11,12,13,16,18,20],"120":[2,3],"1203":[],"1203284":8,"1206":8,"12069773":16,"121":[2,8,9,10],"12182967":6,"12196674":[],"122":[2,8,9,10],"12222222222222222":1,"122439":[],"1224392":[],"12288563":[],"122886":[],"123":[],"12318726e":6,"12333649":6,"12345260617257443":9,"123459876":[],"123711":6,"12380":[],"124":0,"12400":[],"125":[],"1250":[],"125000":[],"12552073e":6,"126":[],"1261":[],"12618549":5,"1265":[],"127":4,"1270":[],"127043":[],"1271":6,"1277":6,"127773":[],"12777777777777777":1,"12788968":[],"12790":[],"128":[3,4,13],"128664":6,"12898627064868978":[],"12937662":[],"12945452":[],"1297":[],"1298":9,"12adb44b1c20":7,"12m":3,"13":[0,2,4,5,6,9,11,12,13,16,18],"130":[],"13003291":6,"13055555555555556":1,"131":[],"13117061":[],"1314":[],"132":[],"13220608e":6,"13229545716505003":16,"132360":[],"1323603":[],"1326":[],"13280":[],"133":7,"13333333333333333":[],"135":[],"13519106":[],"13535942":6,"136":[],"1360":[],"13609760e":18,"1361":[],"1362":[],"1363":[],"1364":[],"13646574":5,"13661243e":6,"13679863":6,"1371":6,"13740":[],"137400784702911":[],"137652":11,"1378":[],"1382":[3,4],"1383":[3,4],"1384":[3,4],"1385":[3,4],"1386":[3,4],"13865173":5,"13876586436927824":[],"138775":11,"1388888888888889":1,"13890":[],"1392559581788775e":[],"1392559584983597e":[],"1392559585048734e":6,"13925595925919e":6,"14":[0,2,4,5,6,8,9,10,11,12,13,16,18,20],"140":[],"14021063":6,"1404":[],"14042769":[],"140428":[],"141":2,"14100":[],"1416398":6,"14174745":6,"1418":[],"142":2,"14250":[],"142857":[],"143":[2,7],"1435666":[],"14360598":[],"1437":1,"144":2,"14400":[],"1440501043841336":1,"14440":[],"1446729567":4,"14484695":16,"145":2,"146":[],"147":[],"14710":[],"14722222222222223":1,"147400":11,"14741468":[],"147420":11,"14783702":[],"1479":[],"148":[3,4],"14812206":6,"14818":[],"1484256":[],"148564":6,"14859":6,"148768":[],"149":[3,4],"149213":6,"14932651":[],"14988578":[],"149886":[],"14g":6,"14it":6,"15":[0,2,4,6,7,8,9,12,13,16,18],"150":[3,4,8],"15005476":5,"15098090e":6,"151":[3,4],"15130074e":6,"151986":[],"152":[3,4],"15200":[],"15258907":[],"1527777777777778":1,"153036":[],"153106":[],"1533795":[],"153760":[],"15384615384616":[],"154":[],"15454301":[],"154720":[],"15483121":[],"154911":[],"155":[],"155491":[],"155687":[],"155883":[],"156":[],"1562":[],"15629539":[],"15680777":16,"156956":5,"157":[],"15717291":16,"1575":[],"158":[],"1583767":16,"15843769515580663":18,"1586300629904382":[],"1587":[],"15891336":16,"159":[],"1590":[],"15990":[],"15g":6,"15it":[],"16":[1,2,3,4,5,6,8,9,10,13,18],"160":[],"1603":3,"1604":[],"1605":[],"160539":[],"1606":[],"1607":[],"16111111111111112":1,"1612":[],"16211139":5,"16220":[],"162246":5,"16231451":4,"1625":[],"1628":[],"163":[],"1630775253":[],"16342407":5,"16343471":6,"16384":3,"16500":[],"166":[],"16660817":[],"166667":[],"167":[],"16740002":16,"167787":5,"168":[],"16805821e":6,"16807":[],"16827044":[],"16832385":[],"16b8e3cda33a":1,"17":[1,2,4,5,6,8,13,18],"17084902":[],"1709":[],"17174962e":1,"17222222222222222":1,"1726":[],"17300":[],"1731":[],"17339342":[],"17446471":6,"1752":[],"175300":[],"17641709":6,"176880142835407":[],"17777777777777778":1,"17801022":5,"17861098":6,"17917768":5,"17930649":16,"17949575":5,"17953942":11,"1797":[1,3],"18":[2,4,6,7,8,9,10,13,18],"180":[],"18029127":5,"1807":4,"1809":[],"181":[],"1810":4,"1812":[],"18156717":16,"1821":[],"18276924":[],"18327677":[],"18333333333333332":1,"18393678":[],"184":[],"184519":[],"184895":[],"185":[],"1851":[3,4],"1852":[3,4],"18526":[],"185278747229417":[],"1853":[3,4],"1854":[3,4],"1855":[3,4],"186":[],"1860":[],"1861":[],"18611111111111112":1,"18613217e":6,"18660":[],"18673098":11,"18682538":[],"1887":6,"18912963":16,"189496":[],"189622":[],"18it":[],"19":[2,4,6,13,18],"19003":6,"191262820314401":[],"19166666666666668":1,"19207979":5,"19213479":[],"19220":[],"193":[],"19354258":[],"19379506":[],"19394283":[],"194":[],"1940":0,"19404282648955e":6,"194042826653172e":[],"194042826815498e":[],"1940428268204826e":6,"1943":12,"1944":[],"19444444444444445":[],"19466812":[],"1950915150":[],"1954":[],"1956":[],"19569961":6,"1961":[],"1962":[],"1963":[],"1964":[],"1965":[],"1970":16,"1973":9,"197370":11,"19740":[],"1979":6,"19800":[],"19853775e":18,"1989":[],"199":[],"19937":[],"19994371":6,"1_1":12,"1_2":12,"1_3":12,"1cm":[0,8,10,18],"1d":[1,2,3],"1e":[1,2,3,4,14],"1e10":14,"1e4":6,"1f":1,"1k":16,"1n":0,"1s":3,"1x":0,"2":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,20],"20":[0,1,2,4,6,7,8,13,18],"200":[0,2,3,4,8,9,10],"2000":0,"200000":[],"20015436":6,"2004":13,"2006":20,"2010":1,"2011":1,"2014":4,"2015":1,"2016":0,"20174121":16,"2018":[0,6],"2018906331":[],"2019":[],"2021":[6,14],"2022":17,"2027":[],"20277777777777778":1,"203":6,"20320502":[],"20375361":[],"203753611274545":[],"20500":[],"20509391":[],"206":[],"2060":[],"20661216":[],"2069":[],"207545":11,"20756638":[],"20833333333333334":1,"20867052175006306":6,"20867052175109335":[],"20980":[],"21":[0,1,2,4,5,6,7,9,12,13,16,18],"210340":11,"21058097":5,"21130":[],"2116753732":4,"21169159e":6,"21265216":[],"213":6,"213103":11,"213743":11,"21472683":16,"2147483647":[],"21519063":16,"21596432":6,"216290":11,"216683":11,"21786964":16,"2188":[],"21919813":[],"21944444444444444":[],"2195":3,"21985165":13,"21997099":16,"22":[0,1,2,4,5,6,12,13,16],"22044605e":5,"220506557673408":18,"22094791":[],"221":8,"221180":[],"2216":[],"2218":[],"221805":2,"221921":5,"222400":[],"2225":3,"225":4,"2259440937":[],"226124657522696":[],"22612466":[],"226856":5,"22685646":5,"22690428":5,"2284246870217459":6,"22842468702288576":[],"22842468702288582":[],"22847924":5,"22929905e":18,"2299":3,"22it":6,"23":[1,2,4,6,7,12,13,16],"23002365e":6,"23014274e":18,"231":[],"23103285":[],"2315033":[],"23167717":5,"2321528":[],"232153":[],"232435":[],"23297056":[],"23333333333333334":1,"233528":[],"234":6,"23522201":[],"2357089093":[],"2360682191515046":[],"2361111111111111":[],"2364":[],"237038":[],"23703839":[],"2379":6,"2397":[],"24":[0,1,2,4,6,13,16],"24140":[],"2416":[],"24175744e":6,"2419":[],"24276315":16,"2430":[],"24390":[],"24444444444444444":1,"244858":[],"24485843":[],"24512498":16,"246":2,"2470":[],"24770094":6,"24829908":5,"24906604e":6,"24924624":[],"2495":[],"25":[2,3,4,5,6,7,8,9,11,13],"250":[2,4,7,9],"2500":[],"25000":0,"250000":[],"250154":[],"2517560119":[],"251879":[],"252436":[],"25259666":16,"2526":3,"252866":[],"25286618":[],"253775":[],"255":3,"255001":[],"256":[2,4],"25617654e":6,"25617657e":[],"25617658e":6,"256962":[],"257":[],"2572":[],"2572495066":[],"2572e3a4b38d":1,"2575":[],"25792767":16,"25845e8df859":6,"259153":11,"2597":[],"25976336":[],"26":[2,4,6,13],"26079358":[],"26153846153846":[],"26186844":16,"2619":[],"26290036":[],"26294938":[],"2629493813057833":[],"26301436":5,"26306244":[],"264":4,"26409315307910025":6,"2640931530791003":[],"2640931530791005":[],"26409315307910053":6,"265":[],"2650":[],"265109911":4,"26531223e":18,"2654":[],"266":[],"26610075":[],"26666667":13,"26710969":5,"26780278":5,"268":[],"268227":[],"26822717":[],"269":[],"27":[0,1,2,4,6,13],"270":[],"2703":3,"27092897":6,"2750":[],"275341":[],"27562809e":18,"27621662e":18,"276263":11,"27692307692308":[],"27700":[],"2772":3,"2775623201":[],"27760":[],"278036":[],"27803645":[],"27924636":5,"27n_":18,"28":[1,3,4,6],"28001319":[],"28047021":16,"280573":5,"280647":11,"28067036":16,"28097861":[],"280979":[],"2812":[],"282727":11,"283":[],"2830637392":4,"28336218e":6,"2836":[],"28390":[],"28475098":8,"28590743":[],"2861":18,"28634473":11,"286345":11,"2871":[],"2873":9,"2882":18,"2886":18,"2886847885377843":[],"28868479":[],"28875373":16,"2890":0,"2892":18,"28967287":16,"29":[4,6,7],"29149329":[],"2915":18,"29167186":5,"29229741":13,"2923076923077":[],"29512284":11,"295123":11,"2954":[3,4],"2955":[3,4],"2956":[3,4],"2957":[3,4],"2958":[3,4],"29588901":13,"29592539":[],"296247":[],"297":[],"2971492148":[],"2972":[],"29822833":6,"298273":[],"298375":[],"299267190588216":11,"299748":[],"2_":12,"2_1":12,"2_2":12,"2_3":12,"2_i":12,"2_m":[6,18],"2_t":13,"2_x":18,"2b":18,"2cm":8,"2d":[1,3,11,12,15],"2e":6,"2f":[0,7,9,10,11,12],"2ff97f4bf03b":[],"2g":2,"2g_i":2,"2k":3,"2m":6,"2n":[0,2,3],"2nd":9,"2p":18,"2pt":4,"2s":4,"2x":[0,3,8,13],"2x_ix_jy_iy_j":8,"2x_j":8,"2y_i":10,"2y_j":8,"3":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,19],"30":[0,1,4,6,7,10,13],"30000":0,"30010":[],"30119421":8,"3017":[],"3018":[],"3019":[],"301927":[],"3020":[],"3021":[],"30258509":16,"302m":4,"303":6,"3037":[],"3038":[],"30384239":16,"3039":[],"303m":4,"3040":[],"3041":[],"30466214e":6,"304m":4,"30535506":[],"30552077":16,"30559547":[],"305m":4,"3063":[],"306m":4,"3072":3,"30761405e":18,"30787294":6,"307m":4,"308m":4,"309":0,"30940":[],"30b53504a633":0,"31":[4,6,12,16,18],"310":0,"311":0,"31120247":5,"311m":4,"312":0,"3120271598582915":18,"3123314713548606":6,"31276579e":6,"312m":4,"313":0,"31318084":5,"314":[],"31457796":5,"315":6,"3155":[0,5,6],"315977":5,"31597731":5,"316":[],"31605061":16,"31614188e":18,"317":[],"31718909":11,"317367":11,"317m":4,"31866499":13,"31896852":8,"319m":4,"32":[3,4,6,12,13,16,18],"3200":1,"32039227e":18,"32047562":[],"3208":2,"320m":4,"32149601703519115":6,"3214960170351912":6,"3215":[],"32179365":[],"32309075":[],"32320052":16,"324":2,"32458459":[],"324m":4,"3250":[1,6],"32512":[],"326238":[],"326m":4,"32721178":11,"327212":11,"32750531e":18,"32816737":[],"32903042":[],"3297":[],"32992274":[],"329923":[],"33":[3,4,12,14,16],"3303":[],"33066907e":5,"3310":[],"33166055e":5,"331939":[],"331m":4,"332331":[],"333":7,"3331":[],"33327369":[],"333274":[],"33333333":13,"3337":[],"33611111111111114":[],"33711888":[],"3384":[],"33900713":[],"33m":4,"34":[4,7,16],"3403":[],"34040204e":18,"340782":11,"34114547":5,"341m":4,"342680":[],"34305928":[],"3436":0,"3437":0,"3456":[],"34568872":16,"34569596":5,"3457":[],"3458":[],"34585355":16,"3459":[],"3460":[],"346810":[],"3469819128513336":[],"34740615":[],"3498":[],"34it":6,"35":[0,2,4,6,7],"3514":[],"35140":[],"35147135":16,"351636":11,"35182854":5,"35203688":16,"3522":[],"3525":[],"3528556":[],"352856":[],"3529":[],"3530606977":[],"3538":[],"35396404e":18,"35401056e":18,"3543":[],"3544313922":[],"3546":[],"35470445e":5,"3548":[],"355":[],"3551":[],"35533773":6,"35533774":[],"3556":[],"35562617e":18,"3558":[],"3560":[],"356399":[],"3567":[],"3572":[],"35724288e":18,"3575":[],"357508":[],"3576":[],"3577":[],"35771842":6,"3581341341":4,"3585":[],"3587":[],"35892474":16,"359":5,"3593":[],"3594821":13,"3595":[],"3598":[],"359999999999985":[],"36":[0,2,4,5,6,7,18],"360":1,"3604":[],"3605":[],"3606":[],"360688":[],"3609":[],"36102113":[],"36117602":[],"3613":[],"3615":[],"361556":[],"3617":[],"3621311":5,"3624":[],"3627":[],"3628":[],"363295916323784e":6,"363295916414895e":[],"3632959170548605e":[],"363295924430451e":6,"363834":11,"36383443":11,"363936":5,"36393643":5,"3643":[],"364418e97433":1,"3645":[],"3646":[],"3647":[],"3655":[],"3655222":5,"3659":[],"3668":[],"36689784":[],"366898":[],"3669":[],"367":2,"3672":[],"3673":[],"3674":[],"3679":[],"3684":[],"3687":[],"3688":[],"368m":4,"369139":11,"36it":[],"37":[2,4,6,7],"3704":[],"370782966":4,"3711":[],"3713":[],"3718":[],"3721":[],"3722":[],"3725":[],"3729":[],"37307168":16,"3739":[],"37396662":6,"37415316":16,"374291":[],"37429133":[],"3748":[],"3749":[],"3753":[],"3759":[],"3760":[],"3765":[],"376559":[],"37655936":[],"37692363":[],"37703055":[],"3772":[],"3773":[],"37732":[],"3776":[],"3777801602":[],"3779":[],"37835429e":[],"3784":[],"378664":5,"37866422":5,"37900111":6,"3791":[],"3794":[],"379647":11,"37964744":11,"37992857":[],"38":[2,4,7,18],"380":[],"3802":[],"3803":[],"3804":[],"3805":[],"380739":[],"38073947":[],"3811":[],"38135733e":6,"3815":4,"381627865854956":[],"38162787":[],"3817475779":[],"3818":[],"3819":[],"3820":[],"38246359":[],"3827":[],"382951":11,"38295101":11,"3830":4,"3833":[],"38336316":16,"3834":4,"3837":4,"3838":4,"3839":4,"3842":[],"3850":[],"3851":4,"38533184":6,"3854":[],"3858":4,"386":[],"3861":4,"3862":4,"38629436":16,"3864":4,"3867":[],"3869":4,"387":[],"3871":4,"3872":4,"387482":[],"38748219":[],"3876":[],"388":[],"3881":4,"3882":[],"3885":[],"38868469":16,"3888":4,"3889":4,"389":[],"38901478":[],"3891":4,"38916861e":6,"38962192e":6,"3898":[],"39":[0,2,4,13,19],"390":[],"3906":4,"39095416":[],"3914":4,"3915":4,"3916":4,"391602":[],"3917":4,"3922":4,"3925515884752442":[],"3928":4,"3931":[],"39311435":16,"3943":4,"3944":4,"39456996":16,"3950":4,"3955":4,"39560937":16,"39579407":5,"3958":[],"3960":4,"3962":4,"3970":4,"39706038":5,"39724390e":18,"3975":4,"397700":11,"39789527":16,"3979":4,"39794864e":18,"3980313467":[],"3983":4,"3994":4,"3996":4,"399836":[],"3d":[2,3,4,6,13],"3f":[1,3,9],"3n":16,"3x":[2,8],"3x_i":2,"3y":8,"4":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,18],"40":[1,4,6,19],"400":4,"4000":20,"4005":4,"4011":4,"40116777":[],"401168":[],"4012":4,"4017":4,"401842":11,"40214433":16,"4022":[],"40236901e":18,"4027":4,"4030":4,"40340043":[],"4034668048":[],"4038":4,"4039":4,"404":[],"4045":4,"4048":4,"4055":4,"405890":11,"4059":4,"40599799":[],"4068":4,"4069":4,"4075":4,"4077":[],"408":2,"4082":[4,6],"4084":4,"4087":[],"4087793":5,"4088":4,"4089":4,"409":2,"40927184e":6,"40a38ad763f1":6,"41":[2,4,16],"410":2,"4100":4,"4107":[],"410815":5,"41081513":5,"411":2,"4115":4,"4117":4,"412":2,"4128":4,"4131":4,"41357064":[],"4143":4,"41433969":5,"4144":4,"4146":4,"41511965e":1,"4155":2,"4162706317":[],"4167":4,"4176":4,"4177":4,"418506":11,"4186":4,"41876267":[],"418763":[],"41882036e":6,"41882037e":6,"4192423635":[],"41958102e":18,"4198":4,"41990268":[],"41it":6,"42":[0,1,2,4,8,9,10,16],"420":[],"42037468e":18,"42078103":[],"421":2,"4212":4,"422":2,"4224":4,"423":2,"42340403e":18,"42394972":16,"424":2,"42441033":5,"42449643":[],"42450":[],"425":2,"4255":[],"4258989918":[],"426":[6,7],"42615374e":18,"42631342":[],"427017":11,"4275":4,"43":[0,1,2,4,7,16],"43054282":5,"43135183":16,"43294696e":18,"43330971e":6,"434932":11,"43493232":11,"435163":[],"43552433":16,"43579948e":6,"436462435":4,"43761347":[],"43766686":11,"4379":4,"438060758":[],"438136":[],"43876695":5,"438767":5,"439230":6,"44":[0,1,2,4,16],"44089210e":5,"4410":[],"4411":[],"442600":11,"443217":[],"444":[],"44688507e":18,"44970586e":1,"45":[2,4,19],"450":[],"450257":11,"4504":[],"45290829":16,"45393214e":18,"4543859":[],"4557763":11,"455947":[],"456":[],"456418966187335":[],"457":[2,4],"457770268480242":[],"458027":[],"458078":11,"45960079":5,"45985488":5,"459855":5,"46":[2,4,19],"4601":[],"461":[],"461175":16,"462":7,"46383925e":6,"464424":[],"4644244":[],"46508305":16,"46567887":16,"466":[],"46602982":[],"46696223":[],"469":[],"46932688":[],"4694":[],"46984697e":6,"469868":[],"46986815":[],"47":[4,19],"4703":4,"47042744":5,"470714":[],"47075725":6,"47116868e":6,"47125748":5,"47132891":5,"47245463":5,"472455":5,"47387858":[],"47400238":[],"47432993":[],"4744":[],"47478057":[],"47485224":[],"475311":[],"47531107":[],"47610036":6,"47815203":11,"47920156":[],"47942814":[],"479465113":4,"48":4,"48089797":[],"48133064":[],"481979":6,"48212873":16,"48257387":19,"48316523e":18,"483257001":[],"4837":[],"48420165":[],"48476997":11,"48574149":16,"486873":[],"48687342":[],"489":[],"48994188":5,"49":[4,5,6,11,13],"490":[],"491":[],"49152":3,"492":[],"493":[],"49385454e":18,"4940954":0,"4959161509356135e":6,"495916150936645e":6,"495916150936654e":[],"495916150938325e":[],"49614357":18,"49636583":[],"497":[3,4],"498":[3,4],"499":[3,4],"4990":18,"4992":18,"4997":18,"49992743e":18,"4c4c7f":[9,10],"4d":3,"4f":6,"4y":8,"4y_i":10,"5":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,18],"50":[1,2,3,4,6,7,8,10,13],"500":[1,3,4,6,9,10,13],"500000":[],"50000455":5,"50000553":5,"50000718":5,"50000855":5,"50000969":5,"50001063":5,"50001142":5,"50001207":5,"50001261":5,"50001306":5,"50001343":5,"50001374":5,"500014":5,"50001414":5,"50001422":5,"50001439":5,"50001454":5,"50001466":5,"50001476":5,"50001485":5,"50001492":5,"50001498":5,"50001502":5,"50001506":5,"5000151":5,"50001512":5,"50001515":5,"50001517":5,"50001518":5,"50001519":5,"50001521":5,"50001522":5,"50001523":5,"50001524":5,"50001525":5,"501":[3,4],"50105159":[],"5018":18,"50227564e":6,"5031474174499113":18,"50314742":18,"50321091":5,"504167":[],"50416731":[],"506":0,"50680321e":18,"50727059":16,"50769230769231":[],"507d50":[9,10],"50846111e":6,"50846112e":6,"50it":6,"50j":13,"50x10":1,"51":[4,10],"510":1,"51004249":16,"51126895e":18,"511888":5,"512132":[],"51214899":6,"51265232":16,"51289697":11,"512897":11,"5138":[],"51389553":16,"514219":[],"51561271":16,"517350858882083":[],"5177783846":4,"518030":11,"51803019":11,"519842":[],"52":[3,4,13],"5222222222222223":1,"522758":[],"52307692307693":[],"5260627":[],"526744":11,"52723079":[],"52773051":[],"52799362":11,"528115":11,"52811546":11,"52874252":5,"529":[],"52911941":[],"52945798e":[],"53":[3,4,9],"5303329":11,"5305555555555556":1,"5312":[],"531280":[],"53189647":[],"53312754":16,"53423784":16,"53603432":[],"53611562":[],"53697476":[],"53703498":6,"5378811":11,"53794784":11,"537948":11,"53846153846155":[],"539261":11,"54":[3,4,6,18],"540":[],"54016188":11,"540162":11,"54039921":5,"54041041e":5,"541605":[],"54163136":13,"544439":[],"546166676":[],"54780216":[],"54it":[],"55":[1,3,4],"5501":[3,4,14],"550321":[],"5539":[],"55505907":16,"5555555555555556":1,"55578041":[],"5566":[],"557795":11,"55854694":11,"5594":6,"56":[1,3,4],"56033697":5,"561":[],"5611":[],"5615":[],"56198284":5,"5625":[],"56302854":16,"5639":[],"564":[],"564374":11,"565":[],"56536":0,"566":[],"56636616e":6,"567":[],"568":[],"569":1,"56912044e":6,"56939714":5,"56992937":[],"57":[0,4,8,19],"570":[],"5700":[],"571":5,"571105947979336e":6,"571105947979394e":6,"571105947979395e":[],"571105947979439e":[],"57154252":[],"57174058":[],"57201944e":6,"57266138":[],"57361898":[],"574465":11,"57673618":16,"57842073e":18,"57it":[],"58":[4,10,19],"583595":[],"58395707":[],"58428804":[],"584804":[],"5888888888888889":1,"589":[],"58986647":[],"59":[2,4],"590":[],"591":[],"591317992":4,"591594":[],"59159438":[],"592":[],"593":[],"593040":5,"59304008":5,"5944444444444444":1,"59591979":[],"595920":[],"59592669":[],"59766":[],"597660":[],"59833875":13,"598392":[],"59839245":[],"59955801":13,"5cm":18,"5dd54edf2138":6,"5f":8,"5x":8,"5y":8,"6":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,16,17,18],"60":[1,2,3,4,6],"60000":4,"6019067271":4,"60236938":16,"60293962":5,"603494":5,"60349429":5,"60420593":5,"60538875":16,"60619654":6,"6063219":[],"606439":[],"60673226":11,"606760":5,"60685864":6,"60791699":[],"6079169911277265":[],"60943791":16,"61":[2,4,7],"61033524":[],"6111111111111112":1,"612939":[],"613579":[],"61399851":11,"613999":11,"61463451":16,"614808":11,"6149274949460215":5,"61576236e":18,"618":[],"61808351":[],"618982":[],"6199381169260247":[],"62":[2,3,4],"62168613":[],"62364974":[],"62373464":11,"625":7,"626635268":[],"62767384":[],"62894215":5,"629961":[],"63":[0,1,2,3,4,6,7],"6300745149331701":[],"630224":[],"63025821e":6,"63207808":18,"63249532e":6,"63270833":[],"63395187":[],"63498144":5,"63675140":[],"6371293350711955":[],"63860687":16,"63901111":[],"63it":[],"64":[1,3,4,7,13,16],"64012627":5,"64113381e":18,"64141716e":18,"64293754":[],"64425009":[],"645":[],"64615384615385":[],"646283":11,"647":6,"64742912e":6,"647473":11,"649339":[],"64933923":[],"649382":11,"64x50":1,"65":[1,2,3,4,7,8,9],"65136857":[],"6530742540053943":[],"6562":[],"65626043":[],"65628853":16,"65885453":5,"659306":[],"66":[2,3,4],"66054752":[],"66087937":[],"66204648":6,"66226149":6,"66247212":[],"662854":5,"66285434":5,"6628996975186953":[],"66292841":[],"66310422":[],"6638":[],"66410989":[],"66560":[],"66619972":11,"666200":11,"667":[],"668172":[],"668186":[],"66818635":[],"66934291":5,"66it":6,"67":[2,4],"67047975e":6,"671089":[],"672721":[],"67314874e":5,"67588315":[],"67591616":[],"67697934":11,"67838309":[],"67882608":[],"68":[2,4],"6808538439837775":5,"68176047e":18,"68192193":5,"68246089":16,"68279358":16,"6834195":[],"68534263e":6,"68542204":5,"68545647e":[],"6869":[],"6887363571":4,"68929213e":6,"68944595":[],"689519":11,"69":[2,4,7,18],"690":[],"690569639355314":[],"69061276":11,"690617":[],"69069n_":18,"692":1,"69295955":[],"69484813e":5,"69493539":16,"69504801":6,"69634577e":6,"69695259":5,"69985355":[],"6999536":11,"69it":[],"6e75736fdab1":6,"6f7a6bd7d79f":6,"6m":[3,4],"6n_":18,"7":[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20],"70":[1,2,4,6,7],"70127680":6,"701370":5,"70179437":[],"70205195":16,"70354373":[],"703716d317a7":8,"70434005":[],"7050":[],"70598996":[],"70653767":4,"70710678":5,"70769586":[],"70831425":[],"70832814":5,"70980493":16,"71":[1,2,4],"71131626":16,"7119":[],"712018":11,"7134":[],"713487":5,"71348713":5,"71350226":[],"7151":[],"71721168":[],"718165":5,"718697":[],"71869727":[],"72":[2,4],"72174172":11,"722047011333792":[],"72271878e":6,"72347283":[],"7236674":5,"72373129":[],"724":3,"72522848":[],"72859758":5,"7293182":[],"72981762":8,"73":[4,6],"731000":[],"73174557":[],"73287103e":18,"733096":[],"73406033e":18,"73484667":[],"735738558766299":[],"73573856":[],"73752910":[],"73it":6,"74":[4,6,13],"740":[],"74081822":8,"74368436":16,"743u":[],"7448615806559786":[],"7469898175164704":[],"74840212":5,"749765":[],"75":[4,5,6,8,11],"7501749450963715":[],"750445":[],"750u":[],"75106135":16,"75118364":[],"751699":11,"75170092":5,"753846153846155":[],"75517445":[],"756352":[],"75703965":5,"757040":5,"75838233":[],"75it":[],"76":[2,4,19],"76060096":[],"76066069":16,"763u":[],"7643536":13,"765":7,"76529528":[],"76674796":16,"76731400e":18,"76802186":[],"76923076923077":[],"76936315":5,"7694444444444445":1,"77":[2,4,13,19],"77034458":[],"770345":[],"77152076":5,"7718":9,"773329728649545":[],"77332973":[],"77333117e":18,"774300":[],"775":[],"77627886":13,"77632220e":18,"77636e":13,"77662945":[],"7767978193240488":11,"77714169":8,"77754132e":18,"7782028952":4,"77865169":[],"78":[2,4],"78011544":[],"78156479e":5,"78184120e":6,"7846153846154":[],"78941903":5,"78988962e":18,"79":[2,4],"79009329":16,"79093776":[],"79111643":5,"791123":[],"79145214e":18,"793167":[],"79394867":[],"7939646":[],"794282":11,"79449156":[],"79602861":[],"79754246":[],"797e":6,"79856831e":18,"7c394b1e8b71":9,"7d7d58":[9,10],"7f2b3a6174c2":13,"7m":4,"8":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17,18],"80":[0,1,2,4,5,6,8],"800":[4,7],"80315282":[],"803153":[],"80354994":6,"80469739":5,"8055555555555556":1,"80561191":[],"80609615e":6,"80609616e":6,"8064":[],"80734875":[],"807349":[],"80738685":16,"80747253":16,"80842254":11,"808423":11,"80847477e":6,"81":[1,2,4],"81048318e":6,"8108619":[],"81160425":5,"81187794":16,"81333804":6,"81333805":[],"81388724e":18,"814":[7,11],"815563":[],"81633628":11,"816454":[],"81671821":[],"816847":[],"8175":[],"82":[2,4],"8219235992494145":[],"8219236":[],"82198978":5,"82650876":[],"826509":[],"8265786":5,"82747653":[],"827477":[],"82773778":[],"829648415811072":18,"82964842":18,"83":4,"8305555555555556":1,"83512277":5,"836874":[],"83687444":[],"83698677":16,"83999999999999":[],"84":4,"84062065":[],"84228957e":[],"84232163":16,"842436":[],"84292394":[],"842u":[],"84355903e":1,"84443254e":1,"84569271":13,"84780262":6,"84854738":[],"84923989e":6,"84924834":11,"84994524":5,"85":[1,4],"850164":5,"8503720991789538":[],"85091337":[],"85263220":6,"8527777777777777":[],"85278920e":5,"853241":[],"85324115":[],"853u":[],"85601992":5,"85758696":16,"858":[],"8583333333333333":1,"85953586":6,"85959007":[],"86":2,"8608479":[],"860848":[],"861":[],"86117291":5,"86134827":5,"86145244":11,"8638888888888889":1,"86478158":[],"86546962":[],"86623151":13,"86630":[],"8666666666666667":1,"86810":[],"869":0,"86905621":[],"86925797":[],"869258":[],"87":2,"870":0,"8702784034":4,"871":0,"872":0,"8722222222222222":1,"873":0,"87327414":[],"87381451":5,"875":1,"8759":13,"876":6,"87625493":[],"87647541":[],"8768":[],"878297":[],"87836018":[],"87940752":16,"87it":6,"88":[0,2,13],"88017651":11,"880177":11,"88031314":[],"88046261":5,"8805555555555555":1,"88118231":[],"88168312e":6,"881788":[],"883":[],"88336879":5,"884":[],"88477619":[],"885":[],"88512489":[],"88529063e":6,"8855417382991412":[],"88554174":[],"886":[],"88679947":[],"887":[],"887366":5,"88736621":5,"8879":6,"88871662":16,"8888888888888888":1,"8894":6,"89":2,"8916666666666667":[],"89274639":16,"89288636":11,"893489":[],"89348922":[],"89410423":5,"8944444444444445":1,"89550839":16,"89565264":[],"8962476":[],"896248":[],"89873772":16,"89876748":[],"8991514":16,"89944994":[],"899450":[],"8f":6,"8g":6,"8n":16,"8x8":1,"9":[0,1,2,3,4,5,6,7,8,9,11,12,13,14,16,18],"90":[1,2,6],"900449":[],"90054363":[],"90075537":5,"9011":6,"90220243":5,"90266948":5,"90268858":[],"9027777777777778":1,"903824":[],"90382431":[],"9040":9,"90475506e":6,"90540529":11,"9055555555555556":1,"90559087":5,"905591":5,"906747":5,"9083333333333333":[],"90884627":16,"90895045":16,"90940378":16,"90999452e":18,"91":19,"910":[],"9111111111111111":1,"91128596":5,"912u":[],"913":[3,4],"91379157":[],"913791573406831":[],"91383439":16,"91396388":[],"914":[3,4],"91416375":[],"91479093":[],"91492986e":6,"915":[3,4],"91549644":[],"916":[3,4],"9166666666666666":[],"917":[3,4],"91760278":5,"918":[],"91812702":5,"918992":[],"919":[],"92":[6,19],"92272314":[],"922u":[],"92343595":[],"924018":[],"92477093":[],"924e":6,"925":1,"92507116e":1,"9252772":11,"92578916":5,"92603747":16,"92626212":16,"926583":5,"92658312":5,"92754397":[],"927544":[],"9277777777777778":1,"92819235":[],"92857143":7,"93":[],"9305555555555556":1,"930583":11,"931":0,"93155188":5,"93158979":5,"93248252":[],"932483":[],"932u":[],"933":5,"93414191":[],"93492130e":6,"93579127":16,"935u":[],"9361111111111111":[],"937":18,"937082":[],"93799826":5,"938":18,"9387":[],"939":[0,18],"94":[7,18],"9400":[],"941866404575299":[],"94226022e":6,"94284104":5,"94320205":5,"9444444444444444":1,"945":[3,4],"94548496":[],"94591015":16,"946":[3,4],"94639099":11,"94659383":[],"946957":5,"947":[3,4],"9472222222222222":1,"94735055":[],"947903":[],"94790323":[],"948":[3,4],"9482527":5,"948641":5,"949":[3,4],"95":[1,7,11],"95008046":6,"95079764":6,"95231424":5,"9527777777777777":1,"95284275":5,"953065564":[],"95351665":5,"954":18,"9549351910143222":[],"954u":[],"9555555555555556":1,"95569422":[],"955820c21e8b":4,"956563":11,"95684892":5,"95703":13,"95714723":[],"957147232685324":[],"958228616652075":5,"95it":[],"96":[6,7,11],"960":18,"9601304850018328e":6,"960130485007504e":6,"960130485007934e":[],"9601304850213484e":[],"96024953":5,"96032148":16,"96084663":5,"961":18,"962":18,"9637117593816477":6,"96390357":5,"9640435":5,"964268":5,"96426825":5,"96489434":[],"9649652536":4,"96527903":16,"96551427e":18,"965548":[],"96606158":16,"96653373":[],"96686324e":18,"96688672":5,"9674916":5,"967809":11,"96863851":[],"96987657":[],"96992454":[],"97":7,"97005689":5,"97065296":[],"97108e":13,"9722222222222222":1,"97230501":[],"97243128":5,"97300836":5,"97497404e":6,"975":1,"97507735":5,"97547354":18,"97547354476579":18,"975510299261579":9,"9760832":[],"97705827":5,"977418":[],"97758848":5,"9777777777777777":1,"977880":[],"97788031":[],"9780387310732":20,"9780387848570":20,"9781492032632":20,"978553":5,"97898392":6,"97926491":5,"98":[0,1,7],"980":[],"98017611":13,"98036405":[],"9805555555555555":1,"98091621":5,"981321":[],"98139097":5,"98249059":5,"982491":5,"98266587":16,"98275501":5,"983310":[],"98346748":[],"98399675":[],"98413059":5,"98454786":5,"985":18,"98566191":5,"986":18,"9861111111111112":1,"986699":5,"98680716":5,"98716878":5,"98756882":13,"98794823":16,"9879924":[],"98808176":5,"98822371":6,"9888888888888889":1,"989":18,"9890348":5,"9893149172528393":[],"9893447":5,"9898254753574576":[],"98982548":[],"9898ff":[9,10],"99":[6,7,11,13],"990":[],"99009525":5,"9902552771282336":[],"99049330":6,"99088801":5,"991":18,"99115119":5,"99157584":5,"99176998":5,"992":18,"99242921":5,"99265097":5,"99274513":0,"993":18,"99316252":5,"99353454":[],"993535":[],"99371056":5,"99389612":5,"993972":[],"99397245":[],"9943201":5,"99435648":[],"9947756":5,"99492986":5,"99519225":13,"99528218":5,"99539415":5,"9955282554647219":[],"99566069":5,"99578809":5,"996":5,"99608161":5,"9963961":5,"99650061":5,"9967458":5,"99700706":5,"99709215":5,"99724883":[],"99729756":5,"99751458":5,"99758326":5,"99775587":5,"99775949":[],"99793613":5,"99799099":5,"99813653":5,"99828624":5,"99829953":[],"9983295":5,"99845267":5,"998577":5,"99861053":5,"99871521":5,"99881845":5,"99884384":5,"99893323":5,"999":[9,18],"99901896":5,"99903755":5,"99911427":5,"99918546":5,"99919837":5,"99926459":5,"9993237":5,"99933188":5,"99938942":5,"9994385":5,"99944272":5,"99949306":5,"99953381":5,"99953475":5,"99957911":5,"99961294":5,"99965056":5,"99967865":5,"99970988":5,"9997332":5,"99975913":5,"99977416":[],"99977849":5,"99980002":5,"9998161":5,"99984732":5,"99987324":5,"99989476":5,"99991263":5,"99992746":5,"99993978":5,"99995":5,"9999555851685968":6,"999955585168597":6,"9999840939906267":[],"9999858320366368":[],"9x":6,"9y":6,"\u00f8yvind":[6,19],"abstract":1,"boolean":4,"break":[0,4,6,11,14],"byte":16,"case":[0,1,2,3,4,5,6,7,11,12,13,14,15,16,17],"catch":0,"char":[],"class":[0,1,3,4,6,7,8,9,11,12,13,18],"const":[],"default":[0,1,2,4,6,7,13,16],"do":[0,2,3,4,5,6,8,9,10,11,12,13,14,16],"ekstr\u00f8m":4,"eng\u00f8i":19,"export":9,"f\u00f8470":19,"final":[0,1,2,3,4,5,6,7,8,9,10,11,13,14,17,18,19],"float":[0,3,4,5,9,11,13,14,16],"function":[2,3,4,5,9,14,15,16],"import":[0,1,2,3,4,6,7,8,9,10,11,12,13,14,18],"int":[0,1,2,3,4,5,6,11,13,14,16,18],"long":[0,1,3,4,12,13],"m\u00f8svatn":6,"new":[0,1,2,3,5,6,7,8,9,10,11,13,14,16],"null":[],"public":[0,15],"return":[0,1,2,3,4,5,6,7,8,9,11,13,14,16,18],"s\u00f8rli":[],"s\u00f8rlie":19,"sch\u00f8yen":[6,19],"short":[4,5],"steinsv\u00e5g":[],"super":[3,5],"switch":0,"throw":[3,6,18],"true":[0,1,2,3,4,5,6,7,8,9,10,12,13,14,16,18],"try":[0,1,2,3,4,5,6,7,8,9,10,11,13,14,15,16,18],"var":[5,6,10,11,18],"while":[0,1,3,4,5,6,7,8,9,11,12,13,18],A:[2,3,5,6,7,10,11,12,13,15,16,17,18,19,20],AND:2,And:[0,3,4,5,6,9,15,18],As:[0,1,2,3,4,5,6,8,10,12,13,16,18],At:[0,4,6,13],BE:0,Be:[2,15],Being:13,But:[0,1,2,3,5,6,9,10,18],By:[0,3,5,6,12,13,16],For:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20],IF:6,IN:20,If:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,15,16,18],In:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,20],Is:11,Ising:[5,12],It:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18],Its:[1,2,4,11],NO:[7,11],No:[3,4,6,7,8,9],Not:[0,1,5,6,17],OR:18,Of:18,On:[0,3,17,18,20],One:[0,1,3,4,5,6,7,8,11,12,13,18],Or:[0,1,6],Such:[0,6,12,18],That:[0,5,7,10,11,12,14,18],The:[4,10,13,14,16,17,18,19,20],Then:[0,1,6,8,9,10,11,12,13,14,16],There:[0,3,4,5,6,8,9,11,12,14,16,17,18,19],These:[0,3,4,5,8,9,10,11,12,13,14,16,18],To:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,16,18],With:[0,5,6,8,9,10,11,12,14,16,18],_0:[5,8,10,11,13],_1:[2,5,6,8,10,11,12,13,14,16],_2:[2,5,8,11,12,13,16],_3:16,_4:16,_9:13,_:[0,1,2,4,5,6,7,8,9,10,11,12,13,16],_________________________________________________________________:4,__call__:[3,4],__class__:10,__doc__:6,__future__:[8,9],__getitem__:[],__init__:[1,3,4,14],__main__:2,__mosek:[],__name__:[2,10],__traceback__:[3,4],_asarrai:[],_auto10:[6,12],_auto12:6,_auto1:[2,3,4,5,6,7,12,13,16,18],_auto2:[2,3,4,5,6,12,13,16,18],_auto3:[3,4,5,6,12,13,16],_auto4:[4,6,12,13,16],_auto5:[4,6,12,13,16],_auto6:[4,6,12,16],_auto7:[4,6,12,16],_auto8:[6,12],_auto9:[6,12],_ax:[],_base:8,_build:[0,15,17,20],_build_call_output:[3,4],_c:1,_call:[3,4],_call_flat:[3,4],_check_1d:[],_check_optimize_result:[7,11],_compon:11,_coordinate_desc:6,_copy_docstring_and_deprec:[],_decor:0,_depth:9,_fraction:9,_get_lin:[],_getitem_multilevel:[],_handl:[3,4],_i:[0,1,2,5,6,8,11,12,13],_inference_funct:[3,4],_interpolatefunctionerror:[3,4],_is_primit:[],_j:[0,1,2,3,5,6,8,13],_jit_compil:[3,4],_k:13,_l:12,_lambda:6,_leaf:9,_logist:[7,11],_m:10,_make_vjp:[2,13],_maybe_define_funct:[3,4],_multilayer_perceptron:1,_n:[2,5,8,11,13],_node:[2,9,13],_notokstatusexcept:[3,4],_np:[],_num_output:[3,4],_p:[5,8],_plot_arg:[],_process_traceback_fram:[3,4],_r:[3,4],_ratio:11,_sampl:9,_select_forward_and_backward_funct:[3,4],_split:[6,9],_src:[3,4,14],_stateful_fn:[3,4],_stateless_fn:[3,4],_t:13,_test:6,_trace:[2,13],_valu:[2,13],_varianc:11,_weight:9,a0:3,a0faa0:[9,10],a1:0,a2:0,a3:0,a4:0,a_0:0,a_1a:0,a_2a:0,a_3:0,a_3a:0,a_4:0,a_4a:0,a_:[0,1,16],a_h:1,a_i:[0,1,2,12],a_j:[1,12],a_k:[0,1,12],a_ndim:2,aaron:20,ab:[0,2,5,13,14],ab_channel:15,abandon:1,abbrevi:17,abid:18,abil:[0,10],abl:[0,1,4,5,6,7,10,12,13],abort:[],about:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,15,16,20],abov:[0,1,3,4,5,6,7,8,9,10,11,12,13,14,16,18],abovement:6,abscissa:13,absolut:[0,2,5,6,13],acceler:13,accept:[0,3,6,9],access:[0,3,4,11,18],accid:[4,6],accmod:[],accompani:0,accomplish:[8,9,13],accord:[0,1,2,5,6,9,12,13,14,18],accordingli:11,account:[0,3,5,13,18],accumul:[12,18],accur:[0,3,4,6,10,13],accuraci:[0,1,3,4,5,6,7,9,10,11,12],accuracy_scor:[0,1,10],accuracy_score_numpi:1,achiev:[0,1,5,6,8,12,16],aco:18,acquaint:15,acquir:[1,15],acr:0,across:[1,3,6,9,15],act:[1,3,16],action:18,activ:[0,2,3,4,9,17],actual:[0,1,4,5,6,8,11,16,18],ad:[1,3,4,5,8,13,16],ada_clf:10,adaboostclassifi:10,adadelta:13,adagrad:13,adam:[1,3,4],adapt:[4,6,13,20],add:[0,1,2,3,4,5,6,8,10,11,12,18],add_lin:[],add_outgrad:2,add_subplot:[1,7,12,14],addendum:5,addit:[0,2,3,5,6,7,8,9,10,12,13,15,16,18,19,20],addition:[12,13],address:[1,9,11,13,20],adjac:[3,12],adjoint:5,adjust:[0,5,12,13],admir:0,advanc:[4,6,12,20],advantag:[1,3,5,6,10,13,16],affect:3,affin:[0,3,8,11],afford:3,aforement:14,african:0,after:[0,1,2,4,5,6,9,11,12,13,15,16,18],afterward:0,ag:[0,7,17],ag_0:2,again:[0,1,4,5,6,7,8,10,11,12,13,18],against:[1,4,7,10],agegroup:7,agegroupmean:7,aggreg:[9,10],agorithm:10,agre:[5,6,18],ahead:9,ai:[0,20],aid:11,aim:[0,1,4,6,7,11,14,15,16],ainv:5,airplan:3,aka:5,al:[0,2,4,17,20],alarm:5,algebra:[0,3,5,13,15,17],algo:[],algorithm:[0,1,2,4,5,6,7,8,13,14,15,16,17,18,20],align:[0,2,5,6,7,8,13,18],all:[0,1,2,3,4,5,6,7,9,10,11,12,13,14,15,16,17,18,19,20],allevi:[1,13],alloc:[3,16],allow:[0,1,2,3,5,6,8,10,13,15,16],almost:[0,1,6,8,11,13,18],alon:[2,9],along:[2,3,4,5,6,9,10,11,15,16],alpha:[0,1,2,3,4,6,7,8,9,10,13,14,18],alpha_0:3,alpha_1:3,alpha_2:3,alpha_:10,alpha_i:[3,13],alpha_k:13,alpha_m:10,alpha_n:3,alpha_opt:13,alreadi:[2,3,4,5,6,10,12,15,16,18],also:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20],alter:1,altern:[0,1,4,5,6,7,8,9,11,13,16],although:[0,1,5,6,8,10,13],alwai:[0,3,5,6,12,13,18],am:4,ame2016:0,american:0,among:[0,3,5,9,10,12,16],amongst:5,amount:[0,1,3,4,6,8,10,14,15],an:[1,2,3,5,6,7,8,9,11,12,13,14,15,16,18,19,20],an_:18,anaconda3:[],anaconda:[0,1,15],analog:13,analys:6,analysi:[1,3,4,7,14,16,17,20],analyt:[2,3,5,6,7,12,13,15],analyz:[0,1,3,4,5,6,18],andrew:1,angl:[0,3,9],anharmon:3,ani:[0,1,2,3,4,5,6,7,8,9,10,12,14,18],anim:[4,12],ann:12,annot:[0,1,3,7,8],anoth:[0,1,3,4,5,6,7,8,10,11,12,13,16,18],anp:2,ans_vspac:2,ansatz:0,answer:[0,1,3,5,6,16],antialias:[2,6],anticip:4,anymor:[1,8],anyon:[4,8],anyth:[1,18],anytim:19,apach:1,apart:[11,13],api:[1,15],appar:2,appear:[0,1,3,13,16,18],append:[1,3,4,8,9,13],appendcon:[],appendvar:[],appli:[0,1,2,3,4,6,7,8,9,10,11,12,13,18,20],applic:[0,1,3,4,5,6,7,9,12,13,16,17,18,20],apply_gradi:4,approach:[1,2,4,5,6,9,10,11,12,13,15,18,20],appropri:[2,6,9,12,13,15,18],approx:[0,2,3,6,10,11,13,18],approxim:[0,1,2,3,4,5,6,7,10,11,13,18],apt:[0,15],aq:18,ar:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20],arang:[1,3,4,6,7,9,10,12],arbitrari:[1,4,6,8,12,13,18],arbitrarili:[0,1,11],arc:6,architectur:[3,4,12,20],area:[0,3,6,20],arg:[0,2,3,4,13],argc:[],argmax:[1,11],argmin:[4,10,14],argnum:[2,13],argnum_0:2,argnum_1:2,argsort:11,argu:[1,13],argument:[0,2,3,5,6,11,12,13],argv:[],argval:2,aris:[0,6,12,13,18],arithmet:[0,13,16],arm:[3,4,6,14],arma:[],armadillo:16,around:[0,1,4,5,6,11,18],arr:2,arrai:[0,1,2,3,4,5,6,7,8,9,11,12,13,14,15,18],arrang:3,arraybox:13,arriv:[0,6,9,11,16,18],arrow:12,arrowprop:8,art3d:13,art:[0,1,15],articl:[0,3,4,6,10],artifici:[0,2,7,12,20],artificialneuron:12,arug:13,arxiv:[3,4],as_fram:[],asarrai:[0,2,6,9],asc:[],ascii:[],ashrafi:19,ask:[5,6,11,12],aspect:[0,6,15],assembl:[0,3],assert:4,assess:[0,6],assici:4,assign:[0,7,8,9,12,13,14,17,20],associ:[0,6,9,12,14,18],assum:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,18],assumpt:[0,3,5,6,9,11,18],ast:[0,5,6],astyp:[4,9,10],asymmetri:0,asymptot:[4,6],async_wait:[3,4],atoi:[],atom:0,attempt:[0,4,6,7,8,10],attend:17,attent:[0,16],attr:[3,4],attract:[0,10],attribut:[0,9],attributeerror:[],audi:0,audio:[3,4],aurelien:[0,17,20],austfjel:6,author:[0,1,10,18],authour:0,auto:[6,9,10,18],autocor:18,autocorrelation_tim:18,autocorrelform:18,autocovari:18,autoencod:[4,15],autoencond:15,autograd:15,autom:[0,15],automac:16,automat:[0,1,2,3,4,11,15,16,17],automobil:3,autonom:[4,20],avail:[0,1,4,6,10,11,15,16,17,20],averag:[0,1,3,6,9,10,13,14,18,19],avg:[],avoid:[0,4,5,6,9,11,13,16],avx2:[],avx:[],awai:[2,3,6],awar:[2,10],award:19,ax:[0,1,2,3,4,6,7,8,9,10,11,12,13,14,16],axes3d:[2,6,13],axes_grid1:6,axessubplot:[],axhlin:8,axi:[0,1,2,3,4,6,7,8,9,10,11,12,13,14,16,18],axiom:5,axlabel:0,axvlin:[4,8],axvspan:4,b1:8,b2:8,b3:8,b:[0,1,2,3,4,5,6,8,9,10,12,13,14,18,19],b_0:0,b_1:[0,2,12,13],b_2:[0,13],b_5:13,b_:[0,1,16],b_group:9,b_i:[0,1,2,12],b_ia_:0,b_ia_i:0,b_index:9,b_is_vec:2,b_j:[1,12],b_k:[0,1,12,13],b_m:12,b_meta:2,b_score:9,b_valu:9,bachelor:17,back:[0,3,4,5,6,8,9,10,16,17,18],backbon:16,backend:[1,4],background:[17,20],backpropag:1,backtrack:9,backup:16,backward:[1,2,4,12,16],backward_pass:2,bad:6,badli:18,bag:[9,15,17],bag_clf:10,baggingboot:10,baggingclassifi:10,baggingtre:10,balanc:6,band:16,bandwidth:16,bar:[0,6,11],barber:20,bare:[4,10],base:[0,1,3,4,5,7,8,9,10,14,15,18,19,20],basi:[5,7,8,10,11,12,13,16],basic:[6,8,12,13,14,15,17,18],batch:[3,4,11,12,13],batch_shap:4,batch_siz:[1,3,4],batchnorm:4,bay:7,bayesian:[5,15,20],bc298b802fe2:6,becaus:[0,1,2,3,4,5,6,8,9,12,13,14],becom:[0,1,2,5,6,7,9,12,13,18],been:[0,1,2,3,4,5,6,11,12,13,15,16],befor:[0,1,2,3,4,5,6,7,8,12,13,14,16,18],beforehand:[0,18],begin:[0,1,2,3,4,5,6,7,8,9,11,12,13,14,16,18],behav:[1,6,13],behavior:[0,1,13],behaviour:12,behind:[0,1,6,8,13],behnoosh:19,being:[0,1,2,3,4,5,7,8,10,11,12,13,18],believ:[9,16],belong:[5,7,8,9,13,14],below:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,16,18],benchmark:10,bendik:[],benefici:[1,13],benefit:[0,1,4,11,13,15],bengio:[1,17,20],benign:[1,7],bennosh:19,besid:[4,5],bessel:5,best:[0,1,2,3,4,5,6,7,8,9,10,12,13,19],beta:[0,1,3,5,6,7,10,11,13],beta_0:[0,1,3,5,6,7,13],beta_0x_:0,beta_1:[0,1,3,5,6,7,10,13],beta_1x_0:0,beta_1x_1:[0,7],beta_1x_2:0,beta_1x_:0,beta_1x_i:[7,13],beta_2:[0,3,13],beta_2x_0:0,beta_2x_1:0,beta_2x_2:[0,7],beta_2x_:0,beta_3:3,beta_:[0,3,6,7,13],beta_i:[0,3,5],beta_j:[0,5,6,13],beta_k:13,beta_linreg:13,beta_m:10,beta_mg_m:10,beta_n:3,beta_p:7,beta_px_p:7,betavalu:5,better:[0,1,2,3,4,6,9,10,11,12,13],between:[0,1,2,3,4,5,6,7,8,9,11,12,13,14,18],beyond:[0,1,5,6,8,13],bf:[13,14,16,18],bgd:13,bia:[0,1,2,3,5,8,9,10,12,13,17],bias:[1,2,3,5,6,9,12],big:[0,1,2,5,6,14],bigger:[1,6],bigr:12,bike:9,bilek:19,billion:[3,12,15],bin:[0,7,18],binari:[0,3,5,7,9,10,12,17],binarycrossentropi:4,bind:0,binomi:[15,18],binsboot:6,bioinformat:0,biolog:[1,12,20],bios1100:15,bird:[0,3],bishop:[17,20],bit:[1,4,16,18],bitwis:18,bivari:2,bk:[0,13],bla:16,black:[8,9,14],blob:17,block:[6,10,15,16,18],blockingavg:[],blockingstd:[],blockingvar:[],blocksiz:[],blocksizemax:[],blocksizemin:[],blogpost:4,blue:[0,3],bmatrix:[0,1,3,5,7,8,11,13,16],bmi:1,bodi:[0,1,4,12],bold:1,boldfac:[0,5],boldsymbol:[0,1,2,3,5,6,7,8,10,11,13,14],boltzmann:[12,15],book:[17,20],boost:[1,9,15,17],boostrap:10,bootavg:[],bootstd:[],bootstrap:[1,13,15,17],bootvar:[],bootvec:[],boston_dataset:0,bot:8,both:[0,1,4,5,6,8,9,10,13,14,15,16,18,19],bottl:7,bound:[0,8,12],boundari:[2,4,8,11,12],boundkei:[],box:[2,4,9],boxed_arg:2,boyd:[8,13],bracket:[4,18],brain:[1,7,12],branch:9,breast:[5,7,11],breviti:13,brew:[0,15],brg:8,briefli:0,bring:[0,5,6,10],broad:[0,3,4],brought:15,brownle:4,brute:[3,5,11],bs:[8,9,10],buffer_s:4,bui:4,build:[0,4,5,6,10,13,16,18],built:[0,1,3,4,6],bunch:11,busi:0,bx:[],bzl:[],c1:[8,11],c2:[8,11],c95af3df0cdd:3,c:[0,1,2,4,5,6,7,8,9,10,11,12,13,14,15,16,18,19,20],c_0:18,c_1:12,c_2:12,c_3:12,c_4:12,c_:[0,8,9,10,13,18],c_i:[12,13],c_k:18,ca:1,cabc613b8702:13,cach:10,cal:[0,8,10,12,13],calcul:[0,1,2,4,5,6,8,9,10,11,12,13,14,16,18],california:[],call:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,20],callabl:[3,4],callback:[3,4],calor:0,cambridg:[13,20],can:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,20],cancel:[0,13],cancellation_manag:[3,4],cancer:[5,10],cancerpd:7,candid:[8,9,10],cannot:[0,1,4,5,6,7,8,9,17,18],canopi:[0,15],cap:5,capabl:[0,1,8,13,15],capac:2,capita:0,captur:[4,11,12],captured_input:[3,4],car:[3,4],card:[0,7],cardin:1,care:11,carefulli:13,carlo:[0,6,15,18,20],carri:[2,6,7],cart:10,carvalho:19,casella:20,cast:1,cat:[3,4],categor:[0,1,3,9,11],categori:[0,1,3,7,10,12,14,17],categorical_crossentropi:[1,3],caus:[0,5,6,18],causal:0,causat:0,cax:1,cb:6,cbar:1,cbook:[],cc:[0,1,5,13],ccc:[5,12],cd_fast:6,cdf:18,cdot:[0,2,6,12,13,14,16,18],celebr:13,cell:4,center:[0,1,6,7,8,9,11,14,18],centr:20,central:[0,3,5,6,8,16],centroid:[14,18],centroid_differ:14,centuri:3,certain:[0,3,6,7,9,18],cg:13,cha:0,chain:[0,1,13,15,18],chanc:[1,5,13,18],chang:[0,1,2,3,4,5,6,8,9,11,12,13,14,16,18],channel:3,chapter3:0,chapter:[0,6,10,11,16,17,20],charact:[0,3,5],character:[8,9,10,12,18],characterist:[0,1,3,10,13],charg:0,charl:0,chase:4,chd:7,chddata:7,cheap:5,cheaper:[1,13],check:[0,1,3,4,5,6,11,13,16],checkmark:3,checkpoint:4,checkpoint_dir:4,checkpoint_prefix:4,chemic:[],chen:10,chiaramont:2,choic:[0,1,2,3,4,6,9,12,13,14,16],choleski:[5,16],choos:[2,3,6,9,10,11,13,14],chosen:[0,1,2,6,8,9,10,13,18],chosen_datapoint:1,christian:20,christoph:[17,20],cifar10:3,cifar:3,cin:[],circ:[1,12],circl:[0,8,12],circuit:3,circumfer:9,circumv:[1,5,13],ckpt:4,clariti:18,class_nam:[3,9],class_val:9,class_valu:9,class_weight:[3,4],classic:[7,9,13],classif:[0,3,5,6,7,8,11,12,15,17,20],classifi:[0,1,4,7,9,10,11],classificaton:1,classifii:10,clean:1,clear:[1,5,10,12,13],clearli:[0,3,5,6,7,8,18],clever:[1,10],clf3:0,clf:[0,6,8,9,10],clf_lasso:6,clf_ridg:6,clip:[3,18],close:[0,1,2,4,6,8,9,11,12,13,14,18,20],closer:[3,5,13],closest:[8,11,13,14],closur:15,cloud:15,cluster:[0,1,4,6,11,15,17],cluster_label:14,cm:[1,2,3,6,8,13],cmap:[0,1,2,3,4,6,8,9,10],cmap_arg:6,cmath:[],cmb:17,cmd:9,cmu:[],cn_:18,cnn:[12,17],cnn_kera:3,cntk:15,co:[0,2,3,6,9,13],code:[3,4,6,7,8,13,15,16,17,18,20],coef0:8,coef:0,coef_:[0,5,6,8,9,13],coeff:5,coeffici:[0,3,5,6,7,8,9,13,16],coerc:[0,6],coin:[10,18],coin_toss:10,col:[0,11],colab:15,cold:9,colinear:0,collaps:8,collect:[0,2,6,10,11,15,18,20],collinear:5,color:[0,3,4,6,8,9,10,18],color_channel:3,color_cod:6,colorbar:[1,6],colsample_bytre:10,colsaobject:10,colspec:0,column:[0,1,2,5,6,7,8,9,11,12,16],columntransform:9,com:[3,4,6,14,15,17,20],combin:[1,2,5,6,7,10,18],come:[0,1,3,4,5,12,13,14,17],command:[0,1],comment:[0,4,5,6],commerci:[0,15],commod:0,common:[0,1,3,5,6,7,9,11,13,14,18],commonli:[0,1,4,6,7,9,13,14],commun:[0,12],commut:3,commutatitav:3,compact:[0,1,3,5,6,7,9,11,12,13,14],compair:0,compar:[0,3,4,5,6,11,13,16],comparison:[2,4,13],compat:7,compet:0,competit:10,compil:[0,1,3,4,15,16],complet:[0,2,3,4,9,12],completenn:12,complex:[1,5,8,9,11,12,13],complic:[0,1,9,13],compon:[0,1,3,4,5,6,7,9,14,15,17],components_:11,compos:[9,12,14,15],compphys:[0,6,15,17,20],compress:0,compris:6,compromis:5,compulsori:15,comput:[0,1,2,3,4,5,6,7,8,10,11,12,13,15,16,17,18,20],computation:[0,3,6,9,13,18],con:[],concaten:[2,4,6,14],concav:[1,13],concentr:[0,10],concept:[0,2,15],conceptu:[12,13],concern:[0,1,4,7],conclud:[0,5,13],conclus:1,cond:2,conda:[0,1,15],condit:[0,2,4,5,6,8,9,11,13,18],conduct:15,condwav:2,coneqp:[],confid:[0,5,6,7,8],configur:3,confirm:[5,12],confus:[5,6,10,16],confusion_matrix:9,congruenti:18,conjug:[4,8],conjugaci:13,conjunct:3,connect:[0,1,3,4,9,11,12,13,16],consequ:[5,6,8,10,12,13],conserv:[5,14],consid:[0,1,2,3,5,6,7,8,9,10,12,13,16,18],consider:[0,1,5,13],consist:[0,1,2,3,4,6,12,13,18],constant:[0,2,4,5,6,8,12,13,18],constitu:0,constitut:[2,6],constrain:[1,3,5,7,11],constraint:[5,6,8,13],construct:[0,1,2,3,5,6,7,8,9,10,11,16,18,20],contact:0,contain:[0,2,3,4,5,6,7,8,9,11,12,13,16,18,20],contemporari:20,content:[1,15,16],context:[3,4,6,10,13],contigu:16,continu:[0,1,2,3,4,5,6,7,8,9,10,12,13,16,18],contour:[9,10,13],contourf:[8,9,10],contrast:[1,4,9,10,12],contribut:[0,3,5,13,18],contributor:0,control:[0,1,3,9,13,15],conv2d:[3,4],conv2dtranspos:4,conv:[3,4],conveni:[0,5,6,12,13,16],convent:12,converg:[1,2,4,5,6,7,8,11,13,14],convergencewarn:[1,6,7,8,11],convert:[0,1,4,5,9,11,13,16],converttomatrix:4,convex:[4,5,7],convinc:13,convolut:[1,4,15,17],cool:[4,9],coolwarm:6,coordin:[5,12,14],coorel:0,copi:[0,1,14],core:[2,3,4,10,13],corel:0,coronari:7,corr:[0,5,7,11],correalt:[11,15],correct:[0,1,2,3,4,5,13,16,18],correctli:[1,2,6,10],correl:[0,1,3,5,6,7,10,12,13,15,18],correlation_matrix:[0,5,7,11],correspond:[0,3,5,6,8,9,11,12,15,16,18],cortex:12,cosin:[3,6],cost:[0,2,3,5,6,7,8,9,12,13],cost_deep_grad:2,cost_funct:2,cost_function_deep:2,cost_function_deep_grad:2,cost_function_grad:2,cost_grad:2,cost_sum:2,costol:13,could:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,16,18],coulomb:0,count:[0,9,17,18,19],countor:13,coupl:[4,5,6],cours:[0,1,3,5,11,17],courvil:[17,20],cout:[],cov:[5,6,11,16,18],cov_xi:[5,11],cov_xx:[5,11],cov_yi:[5,11],covari:[0,7,15,16],covariance_matrix:[5,11,14],cover:[0,5,15,17,20],covert:0,covxi:18,covxx:18,covxz:18,covyi:18,covyz:18,covzz:18,cpu:1,cpu_feature_guard:[],craft:3,creat:[1,2,3,4,5,6,9,10,11,12,13,15],create_biases_and_weight:1,create_convolutional_neural_network_kera:3,create_neural_network_kera:1,create_x:[5,11],credit:[0,7],crim:0,crime:0,criteria:[0,4,9,10,14,18],criterion:[9,10,13],critic:6,cross:[0,1,3,7,9,10,13,15,17,18],cross_entropi:4,cross_val_scor:6,cross_valid:[7,10],crossvalid:6,crucial:[1,18],cs231:3,cs:17,csr_matrix:16,cstdlib:[],csv:[0,4,6,7,9],ctnk:1,ctx:[3,4],cubic:0,cumbersom:5,cumsum:[10,11],cumul:[10,18],cumulative_heads_ratio:10,cup:5,current:[1,2,3,4,6,13,14],curs:0,curv:[6,7,10,12],curvatur:13,custom:[6,14],custom_cmap2:[9,10],custom_cmap:[9,10],cutpoint:9,cv:[6,7,10],cvxbook:13,cvxopt:[5,8],cyber:20,cycl:[1,12],d1:[],d2:[],d2_g_t:2,d3:[],d670a873ab0c:[],d985fb40c43d:6,d:[1,2,3,4,5,6,7,8,9,10,11,13,14,16,18,19],d_f:13,d_g_t:2,d_net_out:2,da:3,dagger:[5,16],dai:[1,9,15],dalen:[],damp:3,darget:9,darkr:18,dat:0,dat_id:[0,6,7,9],data1:14,data2:14,data3:14,data4:14,data:[2,4,5,8,10,12,13,14,16,20],data_handl:[3,4],data_id:[0,6,7,9],data_indic:1,data_modul:[],data_path:[0,6,7,9],data_url:[],databas:1,datafil:[0,6,7,9],datafram:[0,4,5,7,9,11],datapoint:[1,5,6,7,11,13],dataset:[0,4,6,7,8,9,10,11,13,14],datatyp:4,date:0,daughter:10,david:20,dbh:1,dbo:1,dcomposit:16,ddot:2,dead:1,deadlin:17,deal:[0,1,3,5,6,8,11,13,14,16,18],dealt:0,debt:7,debug:[0,5,6],decad:[0,3],decai:[0,13,18],decemb:17,decent:10,decid:[0,2,3,5,6,9],decim:0,decis:[0,1,8,11,15,17,20],decision_funct:8,decision_tre:9,decisiontreeclassifi:[9,10],decisiontreeregressor:[0,9,10],declar:[0,4,16],decompos:[5,6,16],decomposit:[0,6,12,17],decompost:5,deconvolut:3,decorrel:[10,13],decreas:[1,2,4,5,6,10,11,13],deduc:0,deep:[3,7,12,13,15,17,20],deep_neural_network:2,deep_param:2,deep_tree_clf1:9,deep_tree_clf2:9,deep_tree_clf:[9,10],deepen:[5,15],deeper:[0,3,4],deeplearningbook:20,deer:3,def:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,18],def_covari:18,def_funct:[3,4],default_tim:4,defect:5,defici:5,defin:[0,2,3,4,5,6,7,8,9,10,11,12,13,14,16,18],definit:[1,2,5,6,8,10,11,12,13,16,18],defint:18,defun:[3,4],defvjp:2,degre:[3,5,6,8,9,10,11,18],del:1,delet:6,delimit:4,deliv:17,delta:[0,2,3,6,8,12,13,14],delta_0:3,delta_1:3,delta_2:3,delta_3:3,delta_4:3,delta_5:3,delta_:[1,16],delta_h:[0,1],delta_j:[3,12],delta_k:12,delta_l:[1,3],delta_n:[0,3],delug:15,delv:0,demand:13,demonstr:[0,3,5,6,7,11,12,15],den:4,denomin:[1,5],denot:[1,2,6,7,13,18],dens:[1,3,4],dense_1:4,densiti:[0,2,6,18],depart:19,depend:[0,1,2,4,5,6,7,8,11,12,13,15,16,18],depict:18,deploy:[0,15],deprec:[2,3,6,13],depth:[0,3,9,10,16],deriv:[0,1,2,6,7,8,10,11,13,15],derivati:13,descend:[5,9,11],descent:[0,1,3,7,8,12,17],descr:[],describ:[0,2,4,5,6,8,10,11,12,13,16],descript:[0,8,9],design:[0,1,3,4,5,6,7,10,11,12,13],designmatrix:0,desir:[0,2,4,5,13,14],despit:[1,12],destroi:16,det:[5,16],detail:[0,6,11,13,14,16],detect:[3,8,12],determin:[0,2,3,4,5,6,8,9,10,11,12,13,16,18],determinist:[7,13,18],dev:1,develop:[0,3,5,8,10,11,12,15,16,17],deviat:[0,1,2,4,5,6,18],device_nam:[3,4],devis:12,df:[4,8,11,13],di:0,diag:[5,8],diagnost:[1,10],diagon:[0,5,7,13,16,18],diagonaliz:5,diagram:10,diagsvd:6,dice:[6,18],dict:[6,8],dict_kei:[],dictionari:0,did:[0,1,5,6,7,10,11,14],die:1,diff1:2,diff2:2,diff:2,diff_ag:2,diffeent:8,differ:[0,1,2,3,4,5,6,9,10,11,12,13,14,15,16,18,20],differenti:[0,3,15,16,17],differential_oper:[2,13],difficult:[0,1,6,10,13,18],difficulti:[0,1,13],diffonedim:2,digit:[0,1,3,4,6,17,19],dilemma:13,dilut:1,dim:[4,11,14,16],dimens:[0,1,2,3,4,5,8,11,14,16],dimension:[0,4,5,6,9,11,13,14,15,16],dimensionless:[0,3],diment:16,dimnsion:4,diod:3,direct:[0,1,2,4,11,12,13,14],directli:[1,4,5,6,18],directori:[],disabl:[3,4],disadvantag:0,disappear:[3,6],disc_loss:4,disc_tap:4,discard:[6,11],disciplin:[0,3,12],disclaim:18,discourag:13,discov:0,discover:5,discret:[1,3,5,7,13],discrimin:[4,7,10,11],discriminator_loss:4,discriminator_loss_list:4,discriminator_model:4,discriminator_optim:4,discuss:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20],diseas:7,disguis:6,disord:[1,7],displai:[0,1,3,4,5,6,7,8,9,10,11,12,14,18],displaystyl:[0,5],displot:[],disregard:0,dissimilar:[11,14],dist:14,distanc:[0,8,9,11,14,18],distance_list:9,distinct:[3,7,8,9,10,14],distinctli:8,distinguish:[0,4,7,8,18],distplot:0,distribut:[0,1,4,6,7,10,11,13,14,15,16],distrubut:[0,15],div:[],dive:[0,8,16],diverg:[1,13],divid:[0,1,3,5,6,8,9,11,12,18],divis:[6,8,9,13,16,18],dna:7,dnn1:4,dnn2_gru2:4,dnn:[0,1,2,4,12],dnn_kera:1,dnn_model:1,dnn_numpi:1,dnn_scikit:[0,1],doc:[0,6,15,17,20],document:[4,7,11,13],doe:[0,1,2,3,4,5,6,8,10,11,12,13,16,18],doesn:[3,9,12],dog:[1,3,4],domain:[5,8,13],domin:0,don:[0,1,3,5,6,8,11,13,15],done:[0,2,3,4,5,6,9,10,11,13,16],dot:[0,2,3,5,6,7,8,9,10,11,12,13,16,18],doubl:[3,4,16],doubli:1,down:[0,3,6,9,11,12,13],download:[0,1,3,5,6,16,20],downsampl:3,dozen:1,dq:6,drag:13,dramat:11,drastic:4,draw:[4,6,10,13],drawback:[0,1,3,13],drawn:[1,4,6,7,11,18],drive:[3,4],driven:3,drop:[0,1,5,6,11,13,18],dropna:[0,6],dropout:4,ds:[],dt:[2,3,13,18],dtype:[0,1,2,3,4,14,16],dualiti:6,dub:0,due:[1,2,5,6,8,10,12,13],dummi:0,dure:[0,1,3,4,8,9,11,15],dwell:0,dwh:1,dwo:1,dx:[2,3,8,18],dx_1:18,dx_1p:6,dx_2p:6,dx_mp:6,dx_n:18,dxp:6,dy:[1,8,18],dynam:4,dysth:19,dz:8,e:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,18,19],e_:[0,2],each:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19],eager:[3,4],eapprox:0,earli:[1,3,4,13],earlier:[0,5,7,8,9,11,12,13],earthexplor:6,eas:[6,9,14],easi:[0,5,6,7,8,9,10,11,12,13,15,16],easier:[5,6,8,9,13,18],easiest:13,easili:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,16],eastern:19,ebind:0,eblock:9,economi:5,ecosystem:15,ect:17,edg:3,edgecolor:6,edu:13,educ:0,eface79dac2c:10,eff:18,effect:[1,4,10,13,18],effic:1,effici:[0,3,10,13,15,16,18],efron:6,egrad:13,eig:[5,11,13,16,18],eigen:18,eigenpair:[5,11],eigenvalu:[0,5,8,11,13,16],eigenvector:[5,11,13],eight:16,eigval:[16,18],eigvalu:[11,13],eigvec:[16,18],eigvector:[11,13],eispack:16,either:[1,5,6,7,8,9,10,11,13,18],ekstrom:[],elabor:18,elarn:3,electr:[0,3,12],electur:20,eleg:11,element:[1,2,3,4,5,6,7,8,11,12,13,15,16,17,20],elementari:[10,13,16],elementwis:[3,13],elementwise_grad:[2,13],elif:[2,3,4,14],elim:16,elimin:[3,8],els:[1,2,3,4,7,9,12,13,16],elu:1,elus:0,email:[17,19],embed:[0,11],embodi:6,emit:18,emner:[17,20],emphas:[0,10,15],emphasi:[0,15,20],empir:[1,11,18],emploi:[0,1,5,6,11,13,18],employ:0,empti:[6,10],emul:12,en:[15,20],enabl:11,enbodi:6,encod:[0,3,5,9,11,14],encompass:[0,18],encount:[0,1,5,6,7,13,18],end:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,18],end_box:[2,13],end_nod:[2,13],end_valu:[2,13],endl:[],endpoint:[3,6],energi:[0,4,6],enet_coordinate_desc:6,enforc:12,eng:20,engin:[0,1,3,4,15],english:20,enorm:3,enough:[0,6,13],ensembl:[1,9,17],ensur:[0,1,2,3,5,6,11,13,18],ensure_initi:[3,4],enter:[5,6],enthought:[0,15],entir:[1,3,7,9,15,18],entiti:[9,12,16],entri:[0,5,8,11,12,16],entropi:[1,3,7,10,13],enumer:[0,1,2,3,4,6,8],env:[0,1,2,3,4,6,7,8,11,13,14,18],environ:[2,15,20],eo:[0,6],eol:0,eosfit:0,epoch:[0,1,3,4,12,13],epsilon:[0,5,6,7,13],epsilon_0:0,epsilon_1:0,epsilon_2:0,epsilon_:0,epsilon_i:0,eq:[3,13,14,16,18],eqnarrai:[3,5,6],equal:[0,1,2,3,4,5,6,8,9,11,12,13,14,16,18],equat:[1,3,4,5,6,7,8,9,10,11,13,14,16,17,18],equilibrium:[2,12],equiv:[3,13,16,18],equival:[0,1,5,8,11,13,15,16],erf:18,err:[0,10],err_:6,err_sqr:2,errat:13,errno:[],erron:2,error:[1,2,4,5,6,7,9,11,12,13,15,16,18],error_estimate_corr_tim:18,error_handl:[3,4],error_hidden:1,error_output:1,escap:13,especi:[1,3,9,12,13],essenti:[0,5,6,9,10,12,14,17,18],establish:[0,6,10,11],estim:[0,1,5,6,7,10,11,13,15,18],estimated_mse_fold:6,estimated_mse_kfold:6,estimated_mse_sklearn:6,et:[0,2,4,17,20],eta0:[8,13],eta:[0,1,3,8,12,13],eta_:13,eta_t:13,eta_v:[0,1,3],etc:[0,1,3,5,7,8,9,11,12,13,14,15,16,18],ethic:15,etsim:6,euclidean:[0,14],evalu:[0,2,3,4,5,6,9,13,18],evalut:13,even:[0,1,3,4,5,6,8,9,10,11,12,13,14,15,16,18],evenli:4,event:[3,4,5,7,10,14,18],eventu:[0,5,6,11,12,13,19],everi:[0,1,2,3,4,5,6,9,10,11,12,13,14,15,18],everyth:[4,12],everywher:[4,13],evolv:0,exact:[0,2,5,11,12,13,16,18],exactli:[0,3,4,6,12,15],examin:6,exampl:[5,11,12,13,15,16,17,18,20],exce:[1,12,13],excel:[0,1,4,5,10,20],except:[3,4,6,8,9,16],excess:0,excit:0,exclud:[1,6,12],exclus:[0,1,3,6,18],execut:[2,3,4,5,13],executing_eagerli:[3,4],exemplifi:13,exercis:[5,15,17],exhaust:6,exhibit:[0,5,6,8],exist:[0,1,2,3,5,6,7,8,9,13,16,20],exit:[5,16],exp:[0,1,2,5,6,7,8,10,11,12,13,18],exp_term:1,expand:[5,7,11,13],expans:[0,3,5,8,10,12,13],expect:[0,1,5,6,7,11,12,13,15],expectation_value_of_h_wrt_p:18,expens:[6,10,13],experi:[0,1,6,8,13,15],experiment:[0,3,4,6,9,14,18],experimental_get_tracing_count:[3,4],expert:[1,9],explain:[0,6,9,10,11,13],explained_variance_ratio_:11,explanatori:0,explicit:[0,3,6,13,16],explicitli:[0,4],explod:1,exploit:[0,3,12,13],explor:[1,4,6,8,13,15],expon:1,exponenti:[0,1,5,6,10,13,18],export_graphviz:9,export_text:9,exporttext:9,expos:15,express:[0,2,3,5,6,7,10,12,13,16,18],exptmean:18,exptvari:18,extend:[0,2,7,11,13,15],extens:[0,12,15],extent:[0,1,6,20],extern:[3,6,9],extra:[1,3,5],extract:[0,3,5,6,7,8,11,13,16],extrapol:0,extrem:[0,1,4,5,6,7,8,9,13,16],extremum:13,extrins:11,ey:[0,5,6,13,14,16],f11:0,f12:0,f13:0,f1:13,f1_grad:13,f1d:13,f2:13,f2_grad_x1:13,f2_grad_x1_analyt:13,f2_grad_x2:13,f2_grad_x2_analyt:13,f3:13,f3_grad:13,f3_grad_analyt:13,f4:13,f4_grad:13,f4_grad_analyt:13,f5:13,f5_grad:13,f6:13,f6_for:13,f6_for_grad:13,f6_grad_analyt:13,f6_while:13,f6_while_grad:13,f6d7a289d493:[],f7:13,f7_grad:13,f7_grad_analyt:13,f8:13,f8_grad:13,f9:[0,13],f9_altern:13,f9_alternative_grad:13,f9_grad:13,f:[0,1,2,3,4,5,6,7,8,10,12,13,14,16,18,19],f_0:[3,10],f_1:[10,13],f_2:[12,13],f_3:12,f_:10,f_d:18,f_grad:13,f_grad_analyt:13,f_i:[0,6,12],f_m:[3,10],f_n:3,f_raw:2,f_vec:2,f_wrap:2,face:13,facecolor:[6,8,18],facil:[0,15],facilit:12,fact:[0,1,3,5,9,11,12,13],factor:[0,1,3,5,6,9,10,11,13,16,18],factori:13,fade:6,fafab0:[9,10],fail:[0,6,7,8,11,13,19],failur:7,fairli:[1,2,18],fake:4,fake_loss:4,fake_output:4,fall:[8,9,17],fals:[0,1,2,3,4,5,6,7,9,10,13,14,16],famili:[0,7,8,18],familiar:[0,3,5,6,8,15,16,18],famou:[6,12],far:[0,3,4,5,6,8,11,12,13,14],fashion:[0,9,10],fast:[1,3,6,10,12,13,15,18],faster:[1,11,13],fastest:[13,16],favor:7,favorit:18,fc:3,fdf8a5d7c717:2,fdfcc778e1f8:4,fe5b9d300cc0:6,featur:[0,1,3,5,6,7,8,10,11,12,13,15,18],feature_nam:[0,1,7,9],feautur:9,fed:1,feed:[0,2,3,11,15,17],feed_forward:1,feed_forward_out:1,feed_forward_train:1,feedback:4,feeddorward:4,feedforward:[1,4,12],feel:[0,5,6,11,13,15,19],feet:0,fetch:6,fetch_california_h:[],fetch_openml:[],few:[1,3,4,5,9,18],fewer:[0,9,11],ffnn:[1,12],field:[0,3,6,12,15],fifth:[0,6],fig:[0,1,2,3,4,6,7,12,13,14],fig_id:[0,6,7,9],figaxi:18,figsiz:[0,1,2,3,4,6,7,8,9,10],figur:[0,1,2,3,4,5,6,7,8,9,10,12,13,14,15],figure_id:[0,6,7,9],figurefil:[0,6,7,9],file:[0,1,2,4,5,6,7,9],file_prefix:4,filenam:[],filenotfounderror:[],fileout:[],filepath_or_buff:0,fill:[5,9],filter:[3,4],filtered_flat_arg:[3,4],filtered_tb:[3,4],financ:0,find:[0,1,2,3,5,6,7,8,9,10,11,12,13,14,15,18],find_top_boxed_arg:2,fine:[0,14],finish:2,finit:[3,5,6,12,13,18],first:[0,1,2,3,5,6,7,8,9,10,11,13,14,16,17,18,20],firsteigvector:11,fit:[1,3,4,5,6,7,8,9,11,12,13,18],fit_beta:6,fit_intercept:[0,5,6],fit_mod:9,fit_transform:[0,6,8,9,11],fiti:0,five:[0,9],fix:[0,3,4,6,10,11,12,13],fixedformatt:6,fixedloc:6,fkkt:[],flag:4,flat:[12,13],flatten:[1,3,4,5,16],flexibl:[1,6,8,10,12],float32:[4,9],float64:[4,16],flop:[5,16],flow:[1,4,12],fluctuat:5,fly:11,flyvbjerg:[],fm:0,fma:[],fmax:3,fmesh:13,fn:[3,4],focu:[0,3,4,5,6,15,20],focus:[1,6,7,16],fold:[6,9],folder:[0,4,6],follow:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20],font:[0,7,18],fontdict:18,fontsiz:[1,6,8,9,10,18],fontweight:1,footprint:3,foral:8,forc:[0,5,6,10,11],forcast:4,forecast:[4,12],forelesningsvideo:17,forest:[0,1,9,15,17],forget:11,form:[0,3,4,5,6,7,8,9,11,12,13,15,16,18],formal:[3,4,14,18],format:[0,1,2,3,4,6,7,8,9,10,11,15,18,20],format_data:4,formatstrformatt:[6,13],formul:[4,6,11,14],formula:[3,13,18],forth:[4,12],fortran2003:15,fortran90:18,fortran:[0,15,16],fortun:[0,11],forward:[0,3,6,15,16,17],forward_backward:[3,4],found:[1,2,4,5,6,12,13],foundat:15,four:[4,5,6,8,12,16,17],fourier:0,fourierdef1:3,fourierdef2:3,fourierseriessign:3,fourth:12,fr:[],frac:[0,1,2,3,5,6,7,8,9,10,11,12,13,14,16,18],fractal:[],fraction:9,frame:7,framework:[1,8,10,18],frank:[5,11],frankefunct:[5,6,11],free:[0,6,11,13,15,16,18,19,20],freecodecamp:15,freedom:5,freeli:0,frequenc:[3,6,7,18],frequent:[0,8,9,13],frequentist:15,fresh:10,frida:19,fridai:17,friedman:[6,17,20],friendli:4,frog:3,from:[0,1,2,3,4,6,7,8,9,11,13,14,15,16,17,18,19,20],from_cod:9,from_logit:[3,4],from_tensor_slic:4,fromnumer:2,front:[0,4,5],fstream:[],fulfil:[2,5,12],full:[0,1,3,5,7,9,10,13,18],full_matric:5,fulli:[3,6,12,17,18],fun:[2,13,15],fun_nam:[],func:[0,2],functionali:11,fundament:[0,6,15],funtion:2,further:[2,9],furthermor:[0,3,5,6,7,11,12,13,15],futur:[0,4,8,9],futurewarn:[],fx:[],fy:[17,19],g0:2,g42mrgv128v34gnnhxwk9nrc0000gp:[],g:[0,1,2,3,4,6,8,9,10,11,13,18],g_0:2,g_1:[2,10],g_2:[2,10],g_:[2,9,10],g_analyt:2,g_dnn_ag:2,g_euler:2,g_i:2,g_m:[3,10],g_n:3,g_re:2,g_t:2,g_t_d2t:2,g_t_d2x:2,g_t_dt:2,g_t_hessian:2,g_t_hessian_func:2,g_t_jacobian:2,g_t_jacobian_func:2,g_trial:2,g_trial_deep:2,g_vec:2,gain:[1,5,9,10,13],galleri:0,game:4,gamma1:8,gamma2:8,gamma:[0,2,8,9,10,11,13],gamma_0:10,gamma_1:10,gamma_1x:10,gamma_:0,gamma_i:[0,8,18],gamma_j:13,gamma_k:13,gamma_m:10,gamma_x:0,gap:[6,8],gate:[4,12],gather:[0,1,12],gaug:12,gaussbacksub:16,gaussian:[4,5,6,8,14,18],gaussian_point:14,gaussian_rbf:8,gave:13,gbc:17,gca:[2,6,8,13],gd:1,gd_clf:10,gdclassiffiercgain:10,gdclassiffierconfus:10,gdclassiffierroc:10,gdm:13,gdregress:10,ge:[1,5,7,18],gemv:[],gen:[],gen_loss:4,gen_tap:4,gender:0,genener:4,gener:[0,1,2,3,5,6,8,10,11,12,13,14,16,18,20],generallay:12,generate_and_save_imag:4,generate_imag:4,generate_latent_point:4,generate_simple_clustering_dataset:14,generated_imag:4,generator_loss:4,generator_loss_list:4,generator_model:4,generator_optim:4,genexpr:[],genom:15,geodes:11,geometr:[0,13],geometri:5,georg:20,geotif:6,geq:[2,5,8,9,13],geron:[0,17,20],get:[0,1,2,3,4,5,6,7,9,10,11,13,15,16,18],get_dummi:9,get_loc:[],get_next_color:[],get_paramet:2,get_split:9,get_yaxi:8,get_yticklabel:6,getsolutionslic:[],getval:[],gg:[],gibb:15,gif:4,gini:10,gini_index:9,git:[0,15],github:[0,3,4,6,14,15,17,20],gitlab:[0,15],give:[0,1,2,3,5,6,7,8,9,10,12,13,14,15,17,18,20],given:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17,18],global:[6,7,13],glorot:1,gmail:[],go:[0,1,3,5,6,8,9,11,12,13],goal:[0,7,9],goe:[0,1,2,5,6,13,14,16],golden:13,gone:5,gong:1,good:[1,3,4,5,6,9,10,11,13,15,17,18,20],goodfellow:[4,17,20],googl:[1,3,4,14,15],got:[1,6],gov:6,gp:20,gpu:[1,15],grad:[2,13],grad_analyt:13,grade:17,gradient:[0,3,4,7,8,9,12,15,17],gradient_desc:3,gradientboostingclassifi:10,gradientboostingregressor:10,gradients_of_discrimin:4,gradients_of_gener:4,gradienttap:4,gradual:[1,14],grai:[4,6],graph:[1,9,11,12,13],graph_from_dot_data:9,graph_funct:[3,4],graphic:[0,1,9],grasp:0,gray_r:[1,3],grayscal:3,great:[5,13],greater:[1,7,18],greatli:13,greedi:9,green:[0,3,9,18],grei:4,grid:[1,3,6,7,8,12,18],grossli:13,ground:0,group:[0,6,7,9,14,15,17],groupbi:0,grow:[1,3,9,10],growth:0,gru:4,guarante:[0,3,4,13,18],guess:[1,4,10,13,14],guestrin:10,guid:1,guilherm:19,h1:2,h21:17,h:[0,1,5,6,8,13,18,20],h_1:[2,13],h_2:[2,13],h_:[0,13],h_m:10,ha:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,18],habit:0,had:[0,1,6,7,13],hadamard:[1,12],half:[1,8,9],halv:10,hand:[0,1,2,3,5,11,12,13,15,16,17,18,20],handi:3,handl:[0,1,2,5,9,11,15],handle_unknown:9,handsid:12,handwrit:12,handwritten:[1,5],happen:[1,2,3,4,5,6,10,13,18],hard:[1,7,8,10,13],hardcopi:15,harder:[0,1],harmon:3,hasn:1,hassl:[0,15],hast:15,hasti:[0,6,17,20],hat:[0,1,5,6,7,9,10,11,12,13,16],have:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18],haven:1,he:7,head:[0,4,10,18],header:0,heads_proba:10,health:0,hear:[0,13],heart:[0,7],heatmap:[0,1,3,7],heavili:0,heavisid:1,height:[1,3,6],held:13,help:[0,1,4,12,13],helper:[4,14],henc:[0,5,6,8,9,10,12,13],her:7,here:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20],hereaft:[0,8,12],hermitian:16,hessenberg:16,hessian:[0,2,5,13],heterogen:[9,10],hi:7,hidden:[1,3,4,12],hidden_bia:1,hidden_bias_gradi:1,hidden_layer_s:[0,1],hidden_neuron:4,hidden_weight:1,hidden_weights_gradi:1,hierarch:5,high:[0,1,2,3,4,5,6,9,10,11,13,14,15,16],higher:[0,1,3,5,6,8,13],highest:[1,2],highli:[0,3,4,10,15,16,20],highwai:0,hing:8,hint:13,hip:15,hire:0,hist:[4,6,7,18],histogram:[0,6,7,18],histor:[7,11],histori:[3,4,12],histplot:[],hit:[],hitherto:5,hjorth:19,hobbi:18,hoc:5,hoff:20,hold:[1,3,6,13,14],holder:0,home:0,homework:[6,13],homogen:[1,3,9,10,13],honchar:2,hopefulli:[0,11,18],horizont:11,hors:[3,7],hot:[1,9],hour:[1,15,17,18,19],house_pric:[],how:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,20],howev:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18],hs:[],hspace:[0,4,8,10,18],hstack:1,htf:17,html:[0,7,11,15,17,20],http:[0,3,4,6,7,11,13,14,15,16,17,20],huang:0,huber:0,huge:[1,3,4,15],human:[0,1,3,6,9,12],humid:9,hundr:1,hungri:1,hybrid:17,hydrogen:0,hyperbol:[1,4,12],hyperparam:8,hyperparamet:[3,4,5,6,9,13],hyperplan:11,i0:0,i1:[0,6,8,12],i2:[0,8,12],i3:[0,12],i5:0,i:[0,2,3,4,5,6,7,8,9,10,11,12,13,14,16,18,19],i_1:[5,6],i_2:[5,6],i_:13,ian:20,ic:1,id:[7,13],ida:19,idea:[0,1,2,3,4,6,9,10,12,13,16],ideal:[0,2,6,8,13,18],idem:6,ident:[5,6,12,13,16],identical:5,identifi:[0,1,7,9,11,12,13,14],idum:[],ieor:18,ifi:20,ifs:15,ignor:[0,1,3,9],ii:[16,18],iii:16,ij:[0,1,3,6,8,12,14,16,18],ik:[0,16],illustr:[5,7,10,12,13,14,15],im:6,imag:[1,3,4,6,9,11,12,14,20],image_at_epoch_:4,image_batch:4,image_height:3,image_path:[0,6,7,9],image_width:3,imageio:6,images_from_seed_imag:4,imagin:1,immedi:[0,3,4,6,15],implement:[0,2,3,4,5,6,8,9,10,11,12,13,14,18],impli:[3,5,6,7,13,16],implicit:3,implicitli:[11,18],importantli:3,impos:[0,6,11,12],imposs:[0,5],impress:[0,12],improv:[0,4,5,9,10,11,13],impur:9,imread:6,imshow:[1,3,4,6],in3050:20,in4080:20,in4300:20,in5400:[3,20],in_out_neuron:4,inaccur:13,inacio:19,inact:12,inadequ:0,inch:6,includ:[0,1,2,3,4,5,6,7,11,12,15,18,19,20],include_bia:[6,9],incom:12,incorrect:1,incoveni:8,increas:[0,1,3,4,5,6,7,8,9,11,12,13,18],increasingli:18,ind:6,inde:[0,2,4,5,6],indefinit:4,indent:[],indentationerror:[],independ:[0,5,6,7,8,12,13,18],index:[0,1,3,4,10,14,15,16,18,20],index_col:0,index_of:[],indic:[0,1,3,4,5,6,9,10,11,13],indispens:6,individu:[1,6,7,10,12,18],indu:0,indx1:2,indx2:2,indx3:2,indx:16,ineffici:[3,13],inequ:8,inequaltii:13,inertia:13,inf1000:15,inf1100:15,inf1100l:15,inf1110:15,inf3000:20,inf4490:20,inf5860:20,infeas:9,infer:[0,1,4,6,20],infer_nrow:0,inferenc:1,infil:[0,6,7,9],infin:[5,6,7,11],infinit:3,infinitesim:18,influenc:[6,10],influenti:1,inform:[0,1,3,4,6,9,11,12,13,14,16,20],infti:[3,6,13,18],ingeni:13,ingrad:2,ingredi:[0,9],inher:6,inherit:16,initi:[0,1,2,6,10,13,14,16,18],initial_epoch:[3,4],initialis:[],initialize_root:[],inject:14,inlin:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,18],inner:[0,13],innov:20,inp:4,inplac:13,input:[0,1,3,4,5,6,7,8,9,10,12,13,14,18],input_dim:1,input_shap:[3,4],inputs:1,inputs_shuffl:[0,1],insert:[3,5,6,8,10,18],insid:[0,4,7],insight:[0,1,5,15,20],insist:[6,13],inspir:[0,1,12,20],instabl:2,instal:[0,1,5,6,9],instanc:[0,1,2,4,6,9,11,13],instanti:10,instead:[0,1,2,3,4,5,6,8,9,11,13,14,16,18],institut:1,instruct:[0,1],int32:10,int64:[],int_0:18,int_:[3,6,18],int_a:18,intak:0,integ:[1,2,13,14,16,18],integer_vector:1,integr:[3,6,18],intellig:[0,14,20],intend:10,intens:1,intention:14,interact:[0,6,9,12,15],intercept:[0,6,8,11,13],intercept_:[0,6,8,9,13],interchang:[5,12,16],interconnect:1,interest:[0,1,2,3,4,5,6,7,8,9,12,15,17,18],interfac:[0,1,16],interior:[0,9],intermedi:16,intern:[1,10,12],interpol:[1,3,4,6,12],interpr:5,interpret:[0,1,6,9,10,12,13,16,18],interv:[0,3,5,6,7,13,18],intial:13,intract:[0,4],intrins:[3,11,16,18],intro:[15,20],introduc:[0,1,5,6,8,10,12,13,16,18],introduct:[1,2,4,13,17,20],introductori:[0,4,16,20],intuit:[0,5,6,8,12,13],inv:[0,5,13],invalid:1,invalu:[0,13,15],invari:1,invd:5,inver:8,invers:[0,3,6,13],invers_period:[],inverse_transform:8,invert:[0,5,7,10],invok:[0,8],involv:[0,2,6,7,11,12],io:[0,15,17,20],iomanip:[],iostream:[],ip:[0,8,18],ipca:11,ipykernel_42331:[],ipykernel_42376:[],ipykernel_42449:[],ipykernel_42456:[],ipykernel_42530:[],ipykernel_42541:[],ipykernel_42553:[],ipykernel_42573:[],ipykernel_42580:[],ipykernel_42586:[],ipykernel_47411:[],ipykernel_47448:[],ipykernel_47647:[],ipykernel_47724:[],ipykernel_47735:[],ipynb:15,ipython:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,15],iq:6,iri:[8,9],irreduc:6,irrelev:5,irrespect:0,is_integ:[],isbox:[2,13],iscomplexobj:[],isinst:[2,13],isn:5,isnul:0,isomap:11,issu:[1,3,4,9,14,16],it_arrai:13,item:[0,13],items:16,iter:[1,2,3,4,6,7,8,11,13,14,18],itr:[],its:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,20],itself:[5,6,12,18],ix:[],j1:16,j:[0,1,2,3,4,5,6,8,9,11,12,13,14,16,18,20],j_:6,j_lasso_sk:6,j_ridge_sk:6,j_sk:6,jackknavg:[],jackknif:[6,15],jackknstd:[],jackknvar:[],jackknvec:[],jacobian:[2,13],jacobian_shap:2,jargon:[],jason:4,jax:[3,4,14,15],jensen:19,jerom:20,ji:[12,16],jj:[0,5,6],jk:[0,1,6,12,16],jl:0,jm:16,joao:19,joaogca:19,job:[2,8,10],join:[0,4,6,7,9],joint:[4,5],journal:[],judg:13,judgement:6,julia:[15,16],jump:18,junk:4,jupyt:[0,15,17,20],just:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,18],justif:0,justifi:[3,10],jy:[],jydg2xzka5:17,k0:7,k1:7,k:[0,1,3,5,6,7,8,9,10,11,12,13,14,15,16,18],kaggl:6,kappa_d:18,karim:[],karlsen:[],karush:8,keep:[0,1,4,5,6,11,13,14,16],keepdim:[1,6,10,16],kei:[0,1,3,6,12,20],kept:[4,6,14],kera:[0,4,15],kernel:[0,1,3,15],kernel_regular:[1,3],kernel_s:4,kernelpca:11,kev:0,kevin:20,keyboardinterrupt:[2,3,4],keyerror:[],keyword:[6,13,16],kfold:6,kg:1,ki:16,kick:[1,13],kiener:2,kilomet:6,kind:[0,2,3,4,8,12,13,14],kj:[6,12,16],kjm:15,kkt:8,kktsolver:[],kl0m3:17,kl:18,km:12,kmean:14,kmeanspoint:14,kn_k:14,know:[0,1,2,5,6,8,13,15],knowledg:[0,15],known:[1,3,4,5,6,7,8,9,12,16,18,20],kondev:0,kp:18,kpca:11,kroneck:14,kuhn:8,kwarg:[0,2,3,4,13],kwd:[0,3,4],kwown:0,l0:7,l1:[0,1,3,7],l1_l2:[1,3],l1regl:5,l1regls_mosek2:[],l1regls_mosek:[],l2:[1,3],l:[0,1,2,3,5,6,7,8,10,11,12,13,16,18],l_1:7,l_2:[7,13],l_:16,l_j:12,la:13,la_i:12,la_k:12,lab:[15,17],label:[0,1,2,3,4,5,6,7,8,9,10,12,13,14,15,16,18],label_prob:13,labelencod:[7,10],labels:[6,8,9],labels_shuffl:[0,1],laboratori:17,lack:0,lagari:2,lagrang:[8,11],lambda:[0,1,2,3,5,6,7,8,10,12,13,18],lambda_0:11,lambda_1:[5,8,11],lambda_2:[8,11],lambda_:11,lambda_i:[8,11],lambda_iy_i:8,lambda_jy_iy_j:8,lambda_k:8,lambda_n:[5,8],lamda:1,lamdbda:5,land:[0,8],landmark:8,landscap:13,langl:[0,6,11,18],languag:[0,1,4,8,15,16,20],lapack:16,laplac:5,laptop:15,larg:[0,1,2,4,5,6,8,9,10,11,13,15,16,18,20],larger:[0,3,5,6,8,10,11,13,18],largest:[4,8,11],lasso:[0,7,15,17],lasso_sk:6,last:[0,1,2,3,4,5,6,7,8,9,10,12,13,16,17,18],latent:4,latent_dim:4,latent_point:4,latent_space_value_rang:4,later:[0,1,4,6,7,8,12,13,14,15],latest:[4,15],latest_checkpoint:4,latter:[0,3,6,7,8,11,13,16,17,18],lattic:12,law:0,layer:[0,4,13],lbfg:[7,9,10,11],lcc:[5,6],lda:11,ldot:[0,6,11],le:[5,7,10,13,18],lead:[0,1,3,5,6,7,8,9,10,11,12,13,16,18],leaf:9,leaki:1,leakyrelu:4,lear:13,learn:[3,4,5,6,7,8,9,10,12,16,17,20],learnabl:3,learner:10,learning_r:[3,8,10],learning_rate_init:[0,1],learning_schedul:13,least:[0,2,7,8,10,11,15,16,17,18],leat:13,leav:[0,1,3,5,6,9,11],lectur:[0,1,5,10,11,12,13,15,16,17,20],lecturenot:[0,15,17,20],lecturenovember11:[],lecturenovember12:[],lecturenovember19:[],lecturenovember25:[],lecturenovember26:[],lecturenovember4:[],lecturenovember5:[],lectureoctober14:17,lectureoctober15:17,lectureoctober1:[],lectureoctober21:[],lectureoctober22:[],lectureoctober28:[],lectureoctober29:[],lectureoctober7:[],lectureoctober8:[],lectureseptember10:[],lectureseptember16firstpart:[],lectureseptember16secondpart:[],lectureseptember17:[],lectureseptember23:[],lectureseptember24:[],lectureseptember2:[],lectureseptember30:[],lectureseptember3:[],lectureseptember9:[],lecturethursdayaugust26:[],lecturethursdayaugust27:[],left:[0,1,2,3,5,6,7,8,9,10,11,12,13,14,16,18],leftarrow:[8,12],legend:[0,2,3,4,5,6,7,8,9,10,13],len:[0,1,2,3,4,5,6,8,9,10,11,12,16],len_index:0,length:[0,1,2,3,4,8,9,13,15],length_of_sequ:4,leq:[0,5,7,8,13,14,18],less:[0,1,3,4,5,6,8,9,13,15,18],lessen:1,let:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,18],letter:[0,16,18],level:[0,1,5,6,9,15,16,17],li:[8,11],lib:[0,1,2,3,4,6,7,8,11,13,14],liblinear:[8,10],librari:[0,1,2,3,4,5,6,9,10,11,16,18,20],licens:[0,1,15],lie:[0,6,11,18],life:[0,1,8,12],lifetim:13,like:[0,1,2,3,4,5,6,7,9,10,11,12,13,15,16,18],likelihood:[0,1,5,9,13],lim_:18,limit:[0,5,6,7,8,11,12,16],lin_clf:8,lin_model:0,lin_reg:9,linalg:[0,2,5,6,8,11,13,16,18],line1:8,line2:8,line2d:13,line3:8,line:[0,1,3,6,8,11,13],linear:[1,3,5,6,7,9,10,11,12,15,17,18],linear_model:[0,5,6,7,8,9,10,11,13],linear_regress:6,linearli:5,linearloc:[6,13],linearregress:[0,6,7,9],linearsvc:8,liner:[1,3],linerar:10,linewidth:[0,2,4,6,8,9,10],link:[0,4,9,12,15],linlag:5,linpack:16,linreg:0,linspac:[0,2,3,4,6,8,9,10,13,16,18],linu:4,linuek:[],linux:[0,1,15],liquid:0,list:[0,1,2,3,4,9,15],listcomp:2,listedcolormap:[9,10],literatur:[1,7,14,20],littl:[1,3,9,12],live:8,ll:[0,18],lle:0,lloyd:[4,14],lmb:[0,2,5,6],lmbd:[0,1,3],lmbd_val:[0,1,3],lmbda:13,ln:[1,13],lo:[],load:[0,1,4,6,7,9,10],load_boston:0,load_breast_canc:[1,7,9,10,11],load_data:[3,4],load_digit:[1,3],load_iri:[8,9],loc:[0,3,6,7,8,9,10],local:[0,1,3,7,12,13],locat:[2,3,8],lock:[3,4],log10:[0,5,6],log:[0,1,2,4,5,6,7,9,10,11,13,16],log_:0,log_clf:10,logarithm:[0,5,7,16],logic:[0,1,9],logist:[0,1,2,8,9,10,11,12,15,17],logistic_predict:13,logisticregress:[7,9,10,11],logit:7,logreg:[7,9,10,11],logspac:[0,1,3,5,6],longer:[2,3,8,10,14,16,18],loocv:6,look:[0,1,2,3,4,5,6,7,8,9,10,11,13,16,18],loop:[1,4,6,10,12,14,15,16],lose:1,loss:[0,1,3,4,5,6,7,8,10,11,13,16],loss_fil:4,lossfil:4,lost:4,lot:[0,1,4,6],low:[0,6,9,10,11],lower:[0,1,3,6,9,10,16],lowercas:16,lowest:[9,13,18],lr:[1,3,4,10],lstat:0,lstm:4,lstm_2layer:4,lstsq:0,lt:6,lu:[0,5],lubksb:16,luckili:2,ludcmp:16,lux:16,lvert:1,lw:0,m:[0,1,2,3,5,6,8,9,10,11,12,13,16,17,18,19,20],m_1:14,m_:[9,12],m_h:0,m_k:14,m_l:12,m_n:0,m_p:0,m_t:13,ma:11,mac:[3,4,14],machin:[1,3,4,5,6,7,9,10,11,12,14,16,17,20],machinelearn:[0,6,15,17,20],machinelearningmurphi:17,mackai:20,made:[0,1,3,4,5,6,7,9,11,12],mae:0,magic:4,magnitud:[1,6,7,13],mai:[0,1,2,3,5,6,7,8,9,11,12,13,15,16,18],mail:17,main:[0,1,3,4,5,6,7,9,16,20],mainli:[0,5,6,7,9],maintain:6,major:[1,6,9,10,13,16],make:[1,2,3,4,5,6,7,8,11,12,13,15,16,18,20],make_axes_locat:6,make_moon:[8,9,10],make_pipelin:[0,6,10],make_vjp:[2,13],makedir:[0,6,7,9],makeplot:0,malcondit:16,malign:[1,7,9],mammographi:5,manag:[0,2,3,15],mani:[0,1,3,4,5,6,7,8,9,11,13,14,15,16,18,20],manifold:11,manner:3,manual:6,map:[0,1,2,6,7,8,11,12,14,18],margin:[0,5,8],mari:19,marit:0,marker:[0,7,16],markov:15,marsaglia:18,mask:[],mass:[0,1,5,13],massag:0,masses2016:0,masses2016ol:0,masses2016tre:0,masseval2016:0,master:[6,17],mat1100:15,mat1110:15,mat1120:15,mat3155:[],mat4155:[],mat:15,match:[0,1,4,5,13,14],materi:[4,5,7,13,16],math:[3,7,12,13,16,18,20],mathbb:[0,4,5,6,7,8,11,12,13,14,16,18],mathbf:[0,5,6,7,8,13,16],mathcal:[1,5,6,7,13],matheemat:3,mathemat:[0,6,11,12,13,15,16,17,18,20],mathrm:[0,1,3,4,5,6,7,8,9,10,11,12,13,14,18],matmul:[1,2,5],matmul_adjoint_1:2,matmul_vjp_0:2,matmul_vjp_1:2,matnat:[17,19,20],matplotlib:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18],matplotlibdeprecationwarn:[6,13],matric:[0,1,3,4,6,7,8,11,13,15],matrix:[0,2,3,4,6,7,8,10,13,18],matshow:1,matter:[2,3,13],max:[0,1,2,3,4,9,10,12,13],max_depth:[0,9,10],max_diff1:2,max_diff2:2,max_diff:2,max_it:[0,1,7,8,11,13],max_iter:14,max_leaf_nod:10,max_queue_s:[3,4],max_sampl:10,maxdegre:[0,6,10],maxdepth:10,maxim:[1,4,5,7,8,11],maximum:[0,1,2,3,5,7,8,9,10,13,14],maxpolydegre:[5,6],maxpooling2d:3,mbox:[5,6],mc:[],mcculloch:12,mcint:[],mcintsqr2:[],md:11,mdoel:4,mean:[1,2,3,4,5,6,7,9,10,11,12,13,14,15,16,18],mean_absolute_error:0,mean_divisor:14,mean_i:18,mean_matrix:14,mean_squared_error:[0,4,6,7,10],mean_squared_log_error:0,mean_vector:14,mean_x:18,meaning:[0,4,7],meansquarederror:0,meant:[2,3,7,10,13],meantempvec:[],meanvec:[],measur:[0,1,2,5,6,9,11,12,14,18],mechan:[0,4,18],median:0,medicin:12,medium:[4,8,13],medv:0,meet:[0,19],mehta:0,memori:[3,4,11,12,13,16],mention:[0,12,13,18],mere:0,mersienn:[],meshgrid:[2,5,6,8,9,10,11],messag:[5,13],messi:2,met:[0,3,8],metadata:2,meteorolog:9,meter:6,method:[0,1,2,3,4,5,7,8,11,12,14,15,16,17,18,20],metion:6,metric:[0,1,3,6,7,9,10,14],metropoli:15,mev:[0,18],mgd:13,mglearn:15,mgrid:13,mhjensen:[1,2,3,4,6,7,8,11,14],mi:10,microsoft:20,mid:1,midel:4,midpoint:9,might:[0,1,2,4,6,9,13],mild:9,miller:[],millimet:6,million:0,mimic:12,min:[0,2,5,8,9],min_:[0,2,5,14],min_samples_leaf:9,mind:[0,6,13],mindboard:4,mine:15,mini:[1,11,12,13],minibatch:[1,11,13],minibathc:13,miniforge3:[0,1,2,3,4,6,7,8,11,13,14],minim:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14],minima:[0,1,7,13],minimum:[0,1,2,6,8,9,11,13],minmaxscal:0,minor:[6,13,18],minst:1,minu:7,mirror:9,misc:6,misclassif:[8,9,10],misclassifi:[8,10],miser:0,mismatch:1,miss:[0,10],mistak:4,mit:20,mix:[1,2],mixtur:13,mk:[9,16],mkdir:[0,6,7,9],ml:[0,1,10,13,16],mlab:18,mle:[5,7],mline:[],mlir:[],mlir_graph_optimization_pass:[],mlp:1,mlpclassifi:1,mlpregressor:0,mm:16,mn:[12,18,20],mnist:[1,11],mod:18,mode:17,model:[2,3,5,7,8,9,10,11,13,14,15,18,20],model_select:[0,1,3,5,6,7,9,10,11],moder:10,modern:[0,6,7,15],modif:[2,12,13],modifi:[0,1,3,5,7,8,10,12,13],modul:[0,2,3,4,6,7,8,9,10,11,13,16],modular:18,modulenotfounderror:[7,8,9],modulo:18,moe:[5,11],moment:[5,6,13,18],monitor:13,monoton:[5,12,18],mont:[0,6,15,18,20],montecarlocycl:[],moor:[5,6],more:[0,1,2,4,5,7,8,9,10,11,12,13,14,15,17,18],moreov:[0,3],morten:19,mortenimac:[],mosek:[],most:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,17,18],mostli:[1,11],motion:[0,13],motiv:[1,4],move:[0,4,5,6,7,9,12,13,14,18],mp4:17,mpl:[0,7],mpl_toolkit:[2,6,13],mplot3d:[2,6,13],mplregressor:1,mse:[0,4,5,6,9,10],mse_simpletre:10,mselassopredict:5,mselassotrain:5,mseownridgepredict:6,msepredict:5,mseridgepredict:[0,5,6],msetrain:5,msg:[],msle:0,mt19937_64:[],mt:[7,12],mu0:18,mu1:18,mu2:18,mu:[0,6,11,13,18],mu_:[6,18],mu_i:6,mu_n:11,mu_x:18,much:[0,1,2,3,4,5,6,8,9,10,11,12,13,16,18],mul:[],multi:[0,1,3,7,15],multiclass:[1,7],multidimension:[11,12],multilay:1,multinomi:7,multipl:[2,4,5,6,7,12,13,18],multipli:[3,5,6,11,13,16,18],multiplum:8,multivari:[0,2,10,11,15,18],multivariate_norm:[11,14],murphi:[11,17,20],must:[0,1,2,5,6,8,10,12,13,14,18],mutat:7,mutual:[1,3,6,13],mx_:18,myenv:[0,1,2,3,4,6,7,8,11,13,14],myriad:[0,15],mz1:18,mz2:18,n1:16,n2:16,n:[0,1,2,3,4,5,6,7,8,10,11,12,13,14,16,18],n_0:[12,18],n_:[1,2,3,8,12,18],n_b:[],n_boostrap:[6,10],n_bootstrap:6,n_categori:[1,3],n_cluster:14,n_compon:11,n_epoch:13,n_estim:10,n_examples_to_gener:4,n_featur:1,n_filter:3,n_hidden:2,n_hidden_neuron:[0,1],n_i:18,n_input:[0,1,3],n_instanc:9,n_iter_i:[7,11],n_job:10,n_k:14,n_l:[12,18],n_layer:1,n_m:9,n_neuron:1,n_neurons_connect:3,n_neurons_layer1:1,n_neurons_layer2:1,n_point:14,n_sampl:[6,8,9,10,14],n_split:6,n_step:4,n_t:2,n_x:2,nabla:[1,13],nabla_:[2,13],nabla_w:13,nag:13,naimi:0,naiv:7,naive_kmean:14,nall:0,name:[0,1,3,4,5,6,7,8,9,10,12,13,14,15,16,18,19],nameerror:[6,10],namespac:[],narrow:13,nary_f:[2,13],nary_op_arg:[2,13],nary_op_kwarg:[2,13],nary_oper:[2,13],nation:[1,5],nativ:15,natur:[0,1,4,8,9,12,13,18,20],navier:12,nb:18,nb_:16,nboot:[],nd:14,ndarrai:[2,6],ndim:2,ne:[9,10,16,18],ne_xcl2ctm0:17,nearest:[1,3,6,11],nearli:13,neccesari:6,necess:2,necessari:[0,1,3,4,8,14],necessarili:[0,4,11,18],necesserali:5,neck:7,need:[0,1,2,3,4,5,6,8,9,10,11,12,13,14,16,18],neg:[0,1,3,5,6,7,10,13,16,18],neg_mean_squared_error:6,neglect:18,neglig:18,neighbor:[3,6,11],neither:[4,13],neq:[13,14,18],nervou:12,nest:[2,9,12],nesterov:13,net:[2,4,12],netlib:16,network:[0,9,13,15,17,20],neural:[0,7,13,15,17,20],neural_network:[0,1,2],neuralnetwork:1,neuron:[1,2,3,4,12],neutral:0,neutron:0,never:[1,3,4,6,9,18],new_box:[2,13],new_root:[2,13],new_trac:[2,13],new_tracing_count:[3,4],newaxi:[0,3,6,9],newli:0,newton:[1,7,8,13,18],next:[0,1,2,3,4,5,6,8,9,13,14],next_guess:13,next_input:4,ng:1,ngini:[],ni:14,nian:[],nice:[0,1,5,11],nichola:[],nicholaskarlsen1102:[],niter:13,nitric:0,nlambda:[0,5,6],nlevel:[],nm:18,nm_n:0,nmse:6,nn:[2,5,6,12,16],nn_model:1,nnmin:2,node:[1,2,3,9,10,12],node_constructor:2,nois:[0,4,5,6,8,9,10,13],noise_dimens:4,noisi:[1,6],non:[0,1,3,4,5,6,7,9,10,11,12,13,14,16,18],none:[0,1,2,3,4,5,9,10,13,18],nonlinear:[3,6,8,9,11,12],nonneg:[6,9,13],nonparametr:6,nonsens:18,nonsingular:16,nonumb:[3,7,8,13,16],nor:[1,4,13],norm:[0,1,5,6,8,11,13],normal:[3,4,5,6,7,8,9,10,11,12,13,15,16,18],normali:16,normalize_kwarg:[],norwai:6,notat:[0,2,5,6,13,14,18],note:[0,1,2,3,4,5,6,7,8,11,12,13,14,15,16,17,18,20],notebook:[0,1,3,9,15],noth:[1,2,5,8,12,14,18],notic:[4,5,12,13,16,18],notimplementederror:[],notion:3,notrace_primit:[],novel:[3,6,10],novemb:1,now:[0,2,4,5,6,7,8,10,11,12,13,14,15,16,18],nowadai:[0,1,3,9,15],nox:0,np:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,16,18],npr:2,nsampl:6,nspin:[],nt:2,nthi:0,ntrained_model:6,nu:18,nuclear:5,nuclei:[0,18],nucleon:0,nucleu:0,num:4,num_coordin:2,num_hidden_neuron:2,num_it:2,num_neuron:2,num_neurons_hidden:2,num_output:[3,4],num_point:2,num_tre:10,num_valu:2,number:[1,3,4,5,6,7,8,9,10,11,12,13,14,16,17,19],numberid:7,numberparamet:3,numer:[0,5,6,9,10,11,12,13,15,16,20],numpi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,18],numpy_vjp:2,numpy_wrapp:2,nunmpi:5,nvalu:[],nx:2,nx_test:6,nx_train:6,nx_train_mean:6,ny:18,ny_pr:6,ny_train:6,ny_train_mean:6,o:[0,6,7,8,9,11,16,20],obei:[6,11,13],object:[0,1,2,4,6,8,10,13,16],objsens:[],obliqu:5,observ:[0,1,3,5,6,7,8,9,10,11,12,13,14,18],obtain:[0,1,5,6,7,8,9,10,12,13,14,16,18],obviou:[5,6,11,18],obviouli:0,obvious:[0,4,5,6,16],oc:5,occupi:0,occur:[0,6,8,9,16,18],od:0,odd:[0,3,7],odenum:2,odesi:2,oen:0,off:[1,3,4,5,9,13,18],offer:[6,11,15,16,17],offic:19,offici:17,ofil:[],ofstream:[],often:[0,1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18],ofter:16,ol:0,old:[1,5,10,13],ols_sk:6,ols_svd:6,olsbeta:[0,5],omega:[2,3,6],omega_0:3,omit:[0,5],on_train_batch_begin:[3,4],onc:[1,6,9,11,13],one:[0,1,3,4,5,6,7,8,9,10,11,13,14,15,16,18],oneapi:[],onednn:[],onehot:1,onehot_vector:1,onehotencod:9,ones:[0,2,5,6,8,9,10,11,13,16,17],ones_lik:4,onl:3,onli:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,18],onlin:[11,17],onto:[5,11],op_nam:[3,4],open:[0,1,4,6,7,9,15,17],oper:[0,1,3,5,6,10,11,12,13,15,18],operation:18,oplu:18,opmiz:13,opportun:0,oppos:[6,13],opposit:[1,5,8],opt:[1,5],optim:[0,2,3,4,5,6,7,9,10,11,14,17],optimis:[1,3],optimizer_v2:3,option:[0,1,3,5,6,7,8,11,16],optionalxlacontext:[3,4],optmiz:[1,8,13],orang:0,order:[0,1,2,3,5,6,7,8,9,10,11,12,13,16,18],ordinari:[0,2,3,7,11,13,15,17],oreilli:20,org:[0,3,4,7,11,15,16,20],organ:[6,7,10,16],orient:[1,5,18],origin:[0,3,5,6,8,11,12,13,16],orthogn:5,orthogon:[0,5,6,8,11,13,16],orthonorm:5,os:[0,1,4,5,6,7,8,9],oscar:1,oscil:[3,13],oslo:[0,15,17,19],osx:[0,15],other:[0,1,2,3,5,6,7,8,10,13,14,15,17,18,20],otherwis:[0,1,4,7,13,16],ouput:[5,7,12],our:[1,2,3,6,7,8,9,10,12,14,15,16,17,18],ourmodel:0,ourselv:[0,5,6,8,11,13],out:[0,1,2,4,5,6,7,8,9,10,11,12,13,15,16,18],out_fil:9,outcom:[0,7,9,10,12,18],outdoor:9,outer:[6,12],outfil:4,outfilenam:[],outgrad:2,outlier:[0,8],outlin:[6,10,11],outlook:9,outperform:10,output:[0,1,3,4,5,6,7,8,9,10,12,13,16,18],output_bia:1,output_bias_gradi:1,output_shap:4,output_weight:1,output_weights_gradi:1,outputlayer1:12,outputlayer2:12,outsid:4,over1:13,over:[0,1,3,4,5,6,9,10,12,13,16],overal:[1,10],overcast:9,overcom:[12,13],overdetermin:0,overfit:[0,1,3,6,9,10,13],overflow:[1,5],overhead:12,overlap:[3,7,8,9],overlin:[0,5,6,9,10,11,14,16],overst:0,overtrain:4,overview:[3,20],own:[4,5,6,8,12,13,15,16],owner:0,ownmsepredict:0,ownmsetrain:0,ownridgebeta:[0,6],ownypredictridg:0,ownytilderidg:0,oxid:0,oyvinssc:19,p0:2,p1:2,p:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,16,18],p_:[2,4,8,9],p_hidden:2,p_i:[5,18],p_j:18,p_n:18,p_output:2,p_x:18,pack:0,packag:[0,1,2,3,4,5,6,7,8,11,13,14,15,18],pad:[3,4],page:[0,15],pai:[0,1,9,13],pair:[0,2,3,9,15,18],panda:[0,4,5,6,7,9,11,15],paper:1,paradigm:0,parallel:[10,15,16],param:[2,4],paramat:2,paramet:[0,1,2,3,4,5,6,7,8,9,10,12,13,18],parameter:[0,6,10],parametr:[0,6],paramt:[3,5],parent:2,parent_argnum:[],park:[],parser:0,part:[0,1,3,5,6,10,16,17,18,20],partial:[0,1,5,6,7,8,10,11,12,13,18],particip:[15,17],particl:[0,4,13,18],particular:[0,1,2,3,5,6,9,10,11,12,13,18,20],particularli:[5,6,8,11,13,18],partit:[1,4,9],partli:6,pass:[2,3,12,14],past:[10,18],patch:[6,18],path:[0,4,6,7,9,15],patient:7,patter:4,pattern:[0,3,4,12,17,20],pauli:0,pc:[11,15],pca:[0,7,15,17],pcolor:6,pcolormesh:6,pd:[0,4,5,6,7,9,11],pde:2,pdf:[0,3,4,5,6,9,17,20],pedagog:0,penal:6,penalti:[6,13],penros:[5,6],pentagon:13,peopl:[0,1,9,13,15],per:[0,1,6,17],percentag:[0,10,11],perceptron:[0,1,7],perfect:[0,1],perfectli:[4,6],perform:[0,2,3,4,5,6,8,10,11,12,13,14,15,16,18],performac:4,perhap:[0,5,13],perimet:1,period:[1,4,18],permut:11,persist:13,person:[5,6,7,17,19],perspect:20,pertin:12,petal:[8,9],peter:20,petersen:[],phantom:18,phase:[6,12],phenomena:18,phi:8,phi_k:8,philip:[],philosophi:13,phone:19,photo:4,phrase:0,physic:[0,1,4,7,12,13,18,19,20],pi:[2,3,5,6,7,9,12,13,18],pick:[1,9,10,11,13,14],pickl:1,pictur:0,pie:15,piec:[11,14],pillow:[0,15],pinv:[5,6,13],pip3:[0,1],pip:[0,1,15],pipelin:[0,6,8,10],pit:4,pitfal:6,pitt:12,pixel:[1,3,4],pixel_height:[1,3],pixel_width:[1,3],place:[0,4,6,8,13,16],plai:[0,3,4,5,6,8,11,15],plain:[8,10,12,13,14],plan:[6,9,19,20],plane:[8,9],plateau:5,platform:15,plausibl:12,pleas:[3,4,6,7,11,13,14],plenti:1,plethora:[3,12],plot:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18],plot_confusion_matrix:[7,10],plot_count:6,plot_cumulative_gain:[7,10],plot_data:1,plot_dataset:8,plot_decision_boundari:[9,10],plot_import:10,plot_max:4,plot_min:4,plot_model:4,plot_numb:4,plot_predict:8,plot_regression_predict:9,plot_result:4,plot_roc:[7,10],plot_surfac:[2,6,13],plot_train:9,plot_tre:[9,10],plt:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,18],plu:[0,3,5,7],pm:8,pmatrix:2,pn:3,png:[0,4,6,7,9],point:[0,1,2,3,5,6,7,8,9,10,11,13,14,16,18,19],point_1:4,point_2:4,poisson:[15,18],poli:[6,8],poly100_kernel_svm_clf:8,poly3:0,poly3_plot:0,poly3dcollect:13,poly_featur:[8,9],poly_features10:9,poly_fit10:9,poly_fit:9,poly_kernel_svm_clf:8,polydegre:[0,5,6,10],polygon:13,polym:12,polynomi:[0,5,6,7,8,9,10,11],polynomial_featur:6,polynomial_svm_clf:8,polynomialfeatur:[0,6,8,9],polytrop:[0,6],pool:3,pool_siz:3,poor:[1,13],poorli:0,pop:2,popul:[0,5],popular:[0,1,3,6,7,8,9,11,12,15,16,18],popularli:0,portabl:10,portion:[11,13],pose:[0,4,5,6,11,18],posit:[0,1,2,3,5,7,8,10,11,13,14,16,18],possibl:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,15,16,18,19],posterior:5,postpon:0,postul:5,potenti:[0,3,5,6,12,13],potr:[],potrf:[],pott:12,power:[0,1,5,6,8,9,12,13],pp:[5,6],practic:[0,5,6,7,8,17,18],practition:[0,1,3],preced:[1,11,12,18],preceed:4,preceq:8,precis:[0,2,5,11,13,16,18],pred:[6,13],predicit:0,predict:[0,1,5,6,7,8,9,10,15,20],predict_prob:1,predict_proba:[7,10],predictor:[0,5,6,7,9,10,11],prefer:[0,1,6,8,9,11,15],prepar:[0,6,16],preprocess:[0,4,6,7,8,9,10,11],prerequisit:0,presenc:13,present:[0,5,6,9,12,13,16,17,18],preserv:[3,11,16],press:[13,20],pretrain:[1,4],pretti:[0,4,8,9,15],prev_centroid:14,prevent:[13,18],previou:[0,1,2,3,4,5,6,8,10,11,12,13,16,18],previous:[2,3,9,10,18],price:[0,4,9,13],primal:8,primari:[0,7],prime:18,primit:2,princip:[0,5,7,15,17],principl:[0,6,7,8,14],print:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,16,18],print_funct:[8,9],printout:0,prior:[0,5,6],privat:0,prob:[1,18],probabilist:[0,20],probabl:[0,1,3,4,6,7,10,13,15,17],problem:[0,3,4,5,6,7,8,9,10,11,12,14,15,16,17,18],proce:[0,5,6,8,9,10,11,13,16],procedur:[2,4,5,6,8,10,11,13],proceed:16,process:[0,2,4,6,9,10,12,13,15,16,18,20],prod:20,prod_:[1,5,7],produc:[0,3,4,5,6,9,10,11,12,13,15,16,18],product:[0,1,3,5,6,7,8,12,13,15,16],profess:0,program:[0,1,4,5,6,8,12,14,15,16,17,18],programm:16,progress:[1,4,14],prohibit:6,project1:6,project:[0,1,2,3,5,11,13,15,17,19],project_root_dir:[0,6,7,9],promin:12,promis:8,prone:9,pronounc:[13,15],proof:[0,11,12,13],propag:[2,3,13,17],proper:[0,2,6],properli:[1,6,8,10,13],properti:[0,1,3,12,13,16],proport:[0,1,5,9,11,13,18],propos:[1,4,6,10],propto:[5,13],protect:[3,4],proton:0,prove:[3,13],provid:[0,1,3,4,5,6,8,9,10,12,13,15,16,18,20],proxi:[1,13],prune:9,pseudo:[16,18],pseudoinv:5,pseudoinvers:[5,6],pseudorandom:[6,18],psycholog:0,pt:13,ptratio:[],punish:[0,1],pure:[3,9,18],purest:9,puriti:9,purpos:[0,3,10,12,14],put:1,putarow:[],putboundslic:[],putclist:[],putobjsens:[],putqobj:[],py:[0,1,2,3,4,5,6,7,8,11,13,14],pydata:15,pydot:9,pylab:[0,7],pylint:[3,4],pypi:15,pyplot:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,18],pythagora:5,python2:0,python3:[0,1,2,3,4,6,7,8,11,13,14,15],python:[1,2,3,4,5,6,8,11,12,13,14,17,18],pytorch:[0,15],pywrap_tf:[3,4],q:[5,6,8,11,18],qp:8,qquad:[2,11,13,16],qr:[5,6,16],quad:[1,13,16],quadrat:[0,8,9,13],qualit:[4,9,18],qualiti:[0,9,15],quantifi:1,quantil:10,quantit:[0,6,9],quantiti:[0,2,5,6,7,9,10,11,12,14,16,18],quantum:[4,12],quartil:0,quench:5,queri:9,question:[0,5,6,9,11,12,13],qugan:4,quick:[4,18],quick_execut:[3,4],quickli:[1,3,9,11,13],quit:[1,5,6,9,10,12],quot:4,r2:[0,5,6],r2_score:0,r2score:0,r:[0,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18],r_1:9,r_2:9,r_j:9,r_m:9,rad:0,radial:[0,8,12],radioact:18,radiu:[0,1],rag:2,rain:9,rais:[0,2,13],ramp:1,ran0:18,ran1:18,ran2:18,ran3:18,rand:[0,4,5,6,9,10,13,16],rand_max:[],randint:[6,9,13],randn:[0,1,2,5,6,9,11,13],random:[0,1,2,3,4,5,6,8,9,13,14,15,16,17],random_devic:[],random_forest_model:10,random_index:13,random_indic:[1,3],random_st:[0,7,8,9,10,11],randomforestclassifi:10,randomli:[1,6,9,13,14],randomnumbergener:[],rang:[0,1,2,3,4,5,6,7,9,10,11,12,13,14,16,18],rangl:[0,6,11,18],rangle_x:18,rank:5,rankdir:4,raphson:[1,8,13],rapidli:0,rare:[1,13],rate:[0,1,2,3,4,8,9,10,12,13],rather:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,16,18],ratio:[4,7,9,10,11],rational:0,ravel:[5,6,7,8,9,10,11,13,16],raw:3,raw_df:[],rbf:[8,11,12],rbf_kernel_svm_clf:8,rbf_pca:11,rc:[0,18],rcond:0,rcparam:[0,1,3,7,8,9,10,18],rd:[],re:[2,4,13],reach:[1,4,5,6,7,9,10,11,12,13,14],read:[0,2,3,4,5,6,7,8,11,12,16,17,18,20],read_csv:[0,6,7,9],read_fwf:0,reader:[0,6,16,18],readi:[0,1,5,6,8,10,11,12,16],readili:1,readthedoc:15,real:[0,1,2,4,7,10,11,12,13,16],real_loss:4,real_output:4,realist:8,realiti:18,realiz:[1,12],realli:[0,1],rearrang:13,reason:[0,1,3,4,10,13,20],reassign:1,rebuild:[],recal:[5,6,9,10,11,12,16,18],recalcul:[],recast:3,receiv:[1,3,10,12,18],recent:[0,2,3,4,6,7,8,9,10,13],recept:[3,12],receptive_field:3,recip:[0,6,7,16],reciproc:5,recogn:[0,4,5,10],recognit:[0,1,3,12,17,20],recommend:[0,2,3,4,5,6,8,13,15,16,17,20],reconsid:9,reconstruct:11,record:[10,17],recreat:[],rectangl:[9,13],rectangular:5,rectifi:[1,3,12],recur:[0,15],recurr:[0,1,15,17],recurs:[9,15,16],recycl:[],red:[0,3,4,6,8,9],redefin:[0,10],reduc:[1,3,5,6,9,10,11,13],reduct:[0,10,11,15,18],refer:[0,1,2,3,5,6,7,11,12,13,14,16,20],referenc:2,refin:12,refit:6,reflect:[0,1,4,5,18],refresh:[15,17],reg:[10,11],regard:[1,9,13],regardless:12,region:[3,4,6,9,12],regist:[6,18],reglasso:5,regr_1:[0,9],regr_2:[0,9],regr_3:[0,9],regress:[1,8,11,12,15,16,17],regressor:[0,7,10],regridg:[0,5,6],regular:[0,3,4,5,6,7,9,13],regularis:6,reilli:[0,20],reinforc:[0,8,15],reiter:1,rel:[0,4,6,7,9,12,13,18],relat:[0,1,3,4,5,11,13,14,16,18],relationship:[0,4,9],relativeerror:0,releas:[1,3,4,6,13,15],relev:[0,1,5,7,11,15,17,18],reli:[0,6,8],reliabl:[7,18],relu:[3,4],remain:[1,2,4,6,12,16,18],remaind:18,reman:2,remark:1,rememb:[0,8,13,16],remind:[0,5,11,13,16,17,18],remov:[0,4,5,6],render:0,reorder:[5,7],reorgan:0,repeat:[0,1,3,4,5,6,9,10,11,13,14,16,18],repeated:0,repeatedli:[6,10,13],repet:3,repetit:[6,17],rephras:13,replac:[0,1,3,4,5,6,10,12,13,14,15],replica:6,repositori:[0,4],repres:[0,1,2,3,4,5,6,7,8,9,10,12,13,18],represent:[0,1,3,6,18],representd:3,reproduc:[0,5,6,9,12,15,18],repuls:0,request:[0,13],requir:[0,1,3,4,5,6,8,9,11,12,13,16],res1:2,res2:2,res3:2,res_analyt:2,res_analytical1:2,res_analytical2:2,res_analytical3:2,resaml:6,resampl:[0,7,10,15,17],rescal:[0,11,12],rescu:5,reseach:6,research:[0,4,15,20],resembl:[6,18],reserv:[1,5,6,18],reset:[],reshap:[0,1,2,3,4,6,8,9,10,16],residenti:0,residu:[0,5,13],resiz:5,respect:[0,1,2,3,5,6,7,8,10,11,12,13,14,18],respond:12,respons:[0,7,9,12],rest:[0,5],restat:[0,12],restor:4,restored_discrimin:4,restored_gener:4,restrict:[0,3,9,12],result:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18],result_typ:[],retail:0,retain:[5,6],return_data:14,return_kwarg:[],return_sequ:4,return_x_i:9,reus:[1,3,6],reveal:[0,12],revers:[1,16],review:[15,16,17],revisit:14,reward:[0,4],rewrit:[0,3,5,6,7,8,10,11,12,13,16,18],rewritten:[2,6,8,10,18],rewrot:13,rf:10,rgb:3,rgoj5yh7evk:15,rh:6,rho:[0,10],rho_1:10,rho_2:10,rho_m:10,rich:0,ride:9,rideclass:9,ridedata:9,ridg:[7,11,13,15,17],ridge_sk:6,ridgebeta:5,right:[0,1,2,3,5,6,7,8,9,10,12,13,14,16,18],right_sid:2,rightarrow:[0,1,5,6,8,11,12,13,18],rigor:0,ring:6,rise:0,risk:[0,13],rival:4,river:0,rm:[0,18],rmse:0,rmsporp:13,rmsprop:[1,3,4,13],rnd_clf:10,rng:18,rnn1:4,rnn2:4,rnn:[4,12,17],rnn_2layer:4,rnn_input:4,rnn_output:4,rnn_train:4,rntrick1:18,rntrick2:18,rntrick3:18,rntrick4:18,ro:[0,13],robert:20,robust:0,robustscal:0,roc:10,role:[0,2,5,6,8,15],roll:6,room:[0,19],root:[0,5,9,13,18],rotat:[1,8,9,10],rotation_matrix:9,roughli:[1,3],round:[0,7,9,13],routin:[13,16],row:[0,1,2,5,6,7,9,11,16],rr:5,rrr:5,rthe:5,rug:13,rule:[0,1,5,6,13],run:[0,1,2,3,4,5,6,8,9,11,13,15],runtim:[1,6,14],runtimewarn:[1,6],rust:[0,15,16],rustad:19,rvert:1,rvert_2:1,s:[0,1,2,3,4,5,6,7,9,11,12,13,15,16,17,18,19],s_1:6,s_:[3,6],s_i:[6,7],s_j:6,s_k:6,saddl:13,safe:[],sai:[0,1,2,3,4,5,6,7,8,9,10,11,12,16,18],said:[6,9,13],sake:[0,5,7,11],sale:0,same:[0,1,2,3,4,5,6,8,9,11,12,13,14,16,18],samm:10,sampl:[0,1,2,3,4,5,6,7,8,9,10,13,14,15,16,18],sample_vari:14,sample_weight:[3,4],sampleexptvari:18,sastri:11,satisfactori:0,satisfi:[1,2,3,6,8,13,16,18],satur:[1,6],save:[0,4,6,7,9],save_fig:[0,6,7,9,10],savefig:[0,4,6,7,9,18],savetxt:4,saw:5,scalabl:10,scalar:[2,5,6,10,13],scale:[0,1,3,5,6,7,8,9,10,11,12,13,15,16,19],scale_mean:4,scale_std:4,scalei:[],scaler:[0,7,8,9,10,11],scalex:[],scan:[5,7],scari:5,scatter:[0,1,6,7,8,9,14],scenario:[6,13],schedul:13,scheme:[1,13],schrage:18,scienc:[0,1,10,12,13,15,17,18,20],scientif:[0,15],scientist:0,scikit:[3,5,6,7,8,9,10,13,15,16,17,20],scikit_learn:0,scikitplot:[7,10],scipi:[0,3,5,6,13,15,16],scl:6,score:[0,1,3,6,7,9,10,11,19],scores_kfold:6,scratch:1,sdg:13,seaborn:[0,1,3,6,7],seamless:[0,15],search:[0,1,3,5,9,13],sec:6,second:[0,2,3,4,5,6,7,8,9,11,12,13,14,15,16,18],secondeigvector:11,secondli:12,section:[4,11,16,17,18],sector:0,see:[0,1,2,3,4,5,6,7,8,10,11,12,13,14,15,16,17,18],seed:[0,1,2,3,4,5,6,8,9,11,13,14,18],seed_imag:4,seek:[1,2,8],seem:[1,3,4],seemingli:0,seen:[0,1,3,5,10,12,18],segment:13,seismic:6,seldomli:0,select:[1,5,6,8,9,10,11,17,18,20],self:[1,3,4,5,20],sell:4,semest:[7,17],semi:[8,13],semilogx:6,send:[5,12,13,19],senior:17,sens:[0,4,6,8],sensibl:3,sensit:[0,5,6,9,13],sent:2,sentenc:[4,12],sep:[],separ:[0,1,2,4,6,8,9,12,14,15,18],sequenc:[2,3,4,7,9,10,12,13,15,16,18],sequenti:[1,3,4,10,12,18],seri:[0,1,2,3,4,5,6,10,11,12,13,16,17],serif:[0,7,18],serv:[0,1,2,3,5,7,13,20],session:[1,17],set:[1,4,5,6,7,8,10,11,13,14,15,16,18],set_major_formatt:6,set_major_loc:6,set_stream:[],set_tick:[1,8],set_ticklabel:1,set_titl:[0,1,2,3,7,12,14],set_xlabel:[0,1,2,3,7,12],set_xlim:[7,12],set_xticklabel:1,set_ylabel:[0,1,2,3,7],set_ylim:[7,12],set_ytick:7,set_yticklabel:[1,6],set_zlim:6,seth:4,setiosflag:[],setminu:6,setosa:[8,9],setosa_or_versicolor:8,setp:6,setprecis:[],setse:[],setup:[1,4,6,8,15],setw:[],sever:[0,3,5,6,7,8,9,11,12,13,15,16,17,18],sgd:[1,3],sgd_clf:8,sgdclassifi:8,sgdreg:13,sgdregressor:13,sgn:5,sh:[],shallow:13,shape:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,16],share:[1,3],she:7,shift:[1,6,12,18],ship:3,shortcom:13,shorten:4,shorter:18,shortli:16,should:[0,2,3,5,6,8,9,11,12,13,16,18],should_sync:[3,4],show:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,18],show_shap:4,shown:[0,4,5,7,8,11,12,13,16],showpoint:[],shrink:[3,5,6,8,11],shrinkag:[5,6],shrunk:11,shuffl:[0,1,3,4,6,13],side:[0,2,5,8,12,13,16],sigh:15,sigma0:18,sigma1:18,sigma2:18,sigma:[0,1,5,6,7,10,11,12,13,16,18],sigma_0:5,sigma_1:5,sigma_2:5,sigma_:[5,16],sigma_fn:[7,12],sigma_i:[0,5],sigma_j:5,sigma_m:[6,18],sigma_n:[11,18],sigma_t:13,sigma_x:18,sigmoid:[1,2,4,7,8,10,12,13],sigmundson:[6,19],sign:[1,2,7,8,10,18],signal:[1,3,10,12],signatur:[3,4],signifi:4,signific:1,significantli:[1,13,18],sigurd:19,sim:[4,5,6,13,18],similar:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,15,16],similarli:[0,1,3,5,8,10,18],simpl:[1,2,3,5,6,7,8,10,11,12,14,15,16,18],simple_rnn:4,simplepredict:10,simpler:[0,1,5,6,13,15],simplernn:4,simplest:[0,1,3,4,9,10,12,14],simpletre:10,simpli:[0,1,2,4,5,6,8,9,10,11,12,15,16,18],simplic:[2,5,6,7,8,9,10,11,12,14],simplicti:5,simplifi:[0,6,9,15],simplist:[3,6,18],simul:6,simultan:6,sin:[0,1,2,3,4,9,12,13,16],sinc:[0,1,2,3,5,6,7,8,9,10,11,13,16,18,20],sine:[3,12],singl:[0,1,2,3,5,6,7,8,9,12,13,16,18],singular:[0,6,13,16,17],sinusoid:3,site:[0,1,2,3,4,6,7,8,11,13,14,17],situat:[0,4,5,7,13,18],six:[3,18],size:[0,1,2,3,4,5,6,8,9,10,11,13,16,18],sketch:10,ski:9,skill:0,skip:[3,4,11],skiprow:[],skl:[0,6],sklearn:[0,1,3,5,6,7,8,9,10,11,13,14],skplt:[7,10],sl:6,slack:8,slice:[2,16],slide:[0,3,18],slight:[6,13],slightli:[1,2,3,5,6,7,10,18],slope:[8,11,12],slow:[0,2,8,13],slower:[5,16],slowest:16,slowli:12,slp:1,small:[0,1,2,3,5,6,8,9,10,11,12,13,15,16,18],smaller:[0,1,2,5,6,8,9,11,13,18],smallest:[0,4,14],smallest_row_index:14,smooth:[0,3,6,13],sn:[0,1,3,6,7],sne:11,so:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18],soar:6,social:0,soft:[1,7,10,12],soften:8,softmax:[3,7],softwar:[0,8,15,16,17],sol:8,sole:[0,6],solid:[0,7],solitem:[],soltyp:[],solut:[0,1,2,3,5,6,8,10,11,13,16,18],solutionsummari:[],soluton:2,solv:[0,1,3,5,6,8,10,11,12,13,16,17],solve_expdec:2,solve_ode_deep_neural_network:2,solve_ode_neural_network:2,solve_pde_deep_neural_network:2,solveod:2,solveode_popul:2,solver:[2,7,8,9,10,11,16],some:[0,1,2,3,4,5,6,7,8,9,10,11,12,14,17,18],some_model:6,somehow:4,someth:[0,1,3,4,7,9,11,18],sometim:[0,1,11,12,13,14],soon:16,sophist:0,sopt:13,sort:[5,6,9,11,18],sound:[3,5],sourc:[0,1,3,6,15,16,18],space:[0,1,4,5,8,9,11,12,13,14,18],span:[0,3,5,9,11,16],spare:1,spars:[3,6,16],sparse_mtx:16,sparsecategoricalcrossentropi:3,sparsiti:10,spatial:[1,2,3,12],spdiag:[],speak:18,special:[6,7,10,12,13,16,18],specif:[0,1,2,3,4,5,6,7,8,9,11,12,15,16,18],specifi:[0,3,5,6,7,9,11,13,14,18],specifici:[0,10],spectacular:3,spectral:1,speech:[0,1,3,4,12],speed:[1,2,4,13],spend:18,sphere:0,spin:6,spite:0,spline:8,split:[1,3,4,5,6,8,9,10,11,14,18],splite:0,splitter:[1,10],spmatrix:[],spontan:18,spot:3,spread:[0,11,18],springer:20,spuriou:13,sqquar:5,sqrsignal:3,sqrt:[0,3,4,5,6,8,10,11,13,18],squar:[1,2,3,4,7,8,9,11,13,14,15,16,17,18],squarederror:10,squaredeuclidean:14,squash:12,squeez:2,srand:[],srtm:6,srtm_data_norway_1:6,sse4:[],stabil:5,stabl:[0,4,5,6,7,9,11,15],stack:[2,3,4],stacklevel:0,stage:[5,13],stai:[0,2,4,5,11],stand:[0,5,9,12],standard:[0,1,4,5,6,7,8,10,12,16,18],standard_basi:2,standardscal:[0,6,7,8,9,10,11],stanford:13,start:[0,1,2,3,4,5,6,8,9,10,11,12,13,14,16,17,18],start_box:[2,13],start_nod:[2,13],start_tim:14,startpoint:[],stat:6,state:[1,2,4,5,6,7,8,10,11,12,13,15,18],statement:[0,7,16],statist:[0,1,3,4,7,9,10,11,12,13,14,16,17,20],statu:[0,7,11],stavang:6,std:[0,4,6],stdev:[],stdout:[],steep:13,step:[0,1,2,3,4,6,7,9,10,11,12,13,14,16],step_fn:[7,12],step_length:13,steps_list:9,steps_per_epoch:[3,4],stereo:3,stian:19,still:[0,2,3,5,6,11,13,18],stimuli:12,stk2100:20,stk3155:17,stk4021:20,stk4051:20,stk4155:17,stk5000:20,stk:20,stochast:[0,1,5,6,8,11,12,17],stock:4,stoke:12,stone:[0,7],stop:[1,4,7,9,11,13,14],storag:5,store:[0,1,2,3,6,11,13,18],storehaug:19,str:[1,3,4],straight:[0,6,8,13],straightforward:[0,2,3,5,6,8,9,10,13,16],strategi:[0,1,9],stratifi:6,streamtyp:[],strength:[0,5,14],stretch:11,strict:[8,13],strictli:[8,13],stride:[4,16],strike:6,string:1,stroke:7,strong:[3,6,9,10,12,16,18],strongli:[0,8,15,16],stronli:0,structur:[0,1,2,3,6,9,10,12,15],stuck:[1,13],student:[0,17,19,20],studi:[0,3,4,5,6,7,8,11,12,13,15,20],studier:[17,20],style:[0,7,9,16],sub:[9,12],subarg:[2,13],subdivid:[0,16],subfield:0,subject:[6,8,18],subplot:[0,1,3,4,6,7,8,9,10,13,14],subplots_adjust:[8,18],subprogram:16,subract:0,subroutin:0,subscript:1,subsequ:[1,4,5,6,12,16,18],subset:[1,6,9,12,13,15],subspac:[0,8,11],substanti:[9,10],substep:11,substitut:[3,6,12,16],subsubset:9,subtask:6,subtl:1,subtract:[0,4,5,6,11,13,16,18],subtre:9,subval:[2,13],succeed:[0,4],success:[3,7,9,13,18],successfulli:[4,9],sucess:[],sudo:[0,15],suffer:[0,1,2,5,10],suffici:[1,6,8,11,13],suggest:[1,13,20],suit:[8,12],suitabl:[0,18],sum:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,18],sum_:[0,1,2,3,5,6,7,8,9,10,11,12,13,14,16,18],sum_i:[0,2,5,6,8,13],sum_j:6,sum_ja_:0,sum_k:[6,8,12,16],sum_m:3,sum_n:3,sum_nx_:3,summar:[5,6,9],summari:[1,3,4,10,17],summat:[0,3],sunni:9,superfici:3,superscript:[1,12],supervis:[0,5,6,7,9,12,15],supplement:7,support:[0,1,9,10,11,13,15,17],suppos:[0,5,6,7,8,10,11,12,13,16],suppress:[5,13],sure:[0,1,4,6],surf:6,surfac:[0,6],surpass:6,surpris:0,surround:[3,15],survei:[0,5,6],suyrzm0:17,svc:[8,9,10],svd:[0,6,11,17],svdinv:5,svm:[8,9,10,11],svm_clf:[8,10],swap:2,swapax:2,swath:5,sy:13,symbol:[1,5,11,13,15,18],symmeteri:1,symmetr:[0,5,8,11,12,13,16],symmetri:6,sympi:[0,15],synonim:18,syntax:[1,13],syntaxerror:1,syrk:[],system:[0,1,3,4,6,7,9,10,12,13,15,16,20],systemat:[4,6],t0:[3,6,13],t1:[2,13],t2:2,t3:2,t:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,19],t_0:[2,9,13],t_1:13,t_:2,t_b:10,t_i:[1,2,12],t_j:[5,12],t_k:9,tabl:[9,18,19],tabul:0,tackl:4,tag:[2,3,4,5,6,7,12,13,14,16,18],taht:0,tail:18,tailor:[2,8,11],taiwan:0,take:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,15,16,18],taken:[0,1,3,6,10,13,16],tan:3,tangent:[1,4,12,13],tanh:[1,4,7,8,12,13],tape:[3,4],target:[0,1,3,4,5,6,7,8,9,10,11,12,13],target_nam:9,task:[0,1,3,6,9,11,12,14],tau:[3,5,18],tax:0,taylor:[2,13],taylornr:13,tc:8,team:1,teaser:0,technic:[0,5,6,13],techniqu:[0,1,8,10,13,15,17,18,20],technolog:[0,1],tek5040:20,tell:[0,4,6,10,11,13,18],temp1:1,temp2:1,temp:1,temperatur:[0,9],temporarili:1,ten:3,tend:[3,5,6,8,9,10,12,13,14],tendenc:0,tension:6,tensor:[3,4],tensorflow:[0,2,4,8,14,15,16,17,20],term1:[5,6,11],term2:[5,6,11],term3:[5,6,11],term4:[5,6,11],term:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,18],termin:[0,4,5,9,10,13],terrain1:6,terrain:6,test:[3,4,5,6,7,8,9,10,13,14,16,18],test_acc:3,test_accuraci:[1,3],test_error:6,test_imag:[3,4],test_ind:6,test_input:4,test_label:[3,4],test_loss:3,test_pr:1,test_predict:1,test_rnn:4,test_scor:[7,10],test_siz:[0,1,3,5,6,10],test_split:9,testerror:[0,6],testi:4,testpredict:4,testx:4,text:[0,1,2,4,5,8,9,11,13,16,17,18,20],textbook:17,textual:9,textur:1,tf:[1,3,4,13,14],tfe_py_execut:[3,4],th:[0,1,2,5,6,7,9,12,13,14,16,18],than:[0,1,2,3,4,5,6,7,9,10,11,12,13,15,18],thank:[4,6],theano:[1,15],thei:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18],them:[0,1,3,4,6,8,9,10,11,12,13,16],theme:0,themselv:[0,18],thenc:6,theorem:[2,6,7],theoret:[0,4,10],theori:[0,1,3,8,9,12,13,15,17,20],thereaft:[0,5,6,11,12,16],therebi:[0,5,7,11],therefor:[0,1,2,3,4,6,7,8,11,13,18],therein:11,thereof:[0,6,13],theta:[1,4,13,18],theta_:[1,13],theta_i:1,theta_k:[],theta_linreg:13,theta_t:13,thi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20],thing:[0,1,2,4,5,7,9,18],think:[0,1,3,4,6,9,12,13,14,18],third:[0,3,6,13],thirti:7,those:[0,3,5,6,8,9,10,11,16,17],though:[1,2,3,4,13,16,18],thought:[6,14,18],thousand:[0,1],thread:[3,4],three:[0,1,3,5,6,8,9,12,16,17,18,19],threshold:[1,3,9,10,11,12,13],through:[0,1,2,3,4,5,6,8,11,12,13,14,15,16,18],throughout:[0,4,5,14,15,16,18],thu:[0,1,2,5,6,7,8,10,11,12,13,19],thumb:[0,6],thursdai:17,tibshirani:[6,17,20],tick_param:6,ticker:[6,13,18],tif:6,tight_layout:[1,7],tightli:11,tild:[0,5,6,11,18],till:[0,4,7,8,9,10,12,16],time:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18],timefunct:[],timeit:4,timer:4,tini:1,tip:3,titl:[0,1,2,3,4,6,7,8,9,10,13,18],tmp:13,tmp_log:[3,4],tn:[2,3],to_categor:[1,3,4],to_categorical_numpi:1,to_numer:[0,6],to_str:[],todai:3,togeth:[0,3,6,8,11,15],toi:[13,14],told:13,toler:[2,6,14],tolist:4,tomographi:12,too:[0,2,4,5,6,9,11,13,18,20],took:8,tool:[0,1,3,6,13,15],toolbox:8,top:[0,3,5,6,9,10,15],top_node_typ:2,top_trac:2,topic:[0,5,6,7,8,15,17,20],topolog:[1,3,12],toposort:2,torkjellsdatt:19,toss:[10,18],total:[0,1,2,3,4,6,7,8,10,11,12,13,14,16,18,19],total_loss:4,totalclustervari:14,totalscatt:14,totalvari:[],toward:[1,2,7,12,13],town:0,tp:4,tpng:9,tpu:15,tqdm:6,tr:[],trace:[2,13],trace_stack:[2,13],traceback:[0,2,3,4,6,7,8,9,10,13],traceback_util:[3,4],tracer:[2,13],track:[3,13,14,16],tract:0,tractabl:0,trade:[5,9],tradeoff:[0,5,17],tradit:[0,1,4,6],train:[2,3,5,6,8,9,10,11,12,13],train_accuraci:[0,1,3],train_dataset:4,train_end:[0,1],train_error:6,train_funct:[3,4],train_imag:[3,4],train_ind:6,train_label:[3,4],train_pr:1,train_siz:[0,1,3],train_step:4,train_test_split:[0,1,3,5,6,7,9,10,11],train_test_split_numpi:[0,1],trainabl:4,trainable_vari:4,trained_model:6,trainerror:0,traini:4,training_checkpoint:4,training_dataset:4,training_gradi:13,training_gradient_fun:13,training_loss:13,trainingerror:6,trainpredict:4,trainscor:4,trainx:4,trait:0,trajectori:4,tran:[],transfer:9,transform:[0,5,6,7,8,9,10,11,12,13,15,16],transit:[6,12],translat:[1,4,6,10],transpos:[1,5,11,16],travers:[0,5],treat:[0,1,3,6,12,13,18],tree:[0,1,6,15,17],tree_clf:[9,10],tree_clf_:9,tree_clf_sr:9,tree_reg1:9,tree_reg2:9,tree_reg:9,trend:18,trevor:20,tri:[2,3,4,9,13],triain:0,trial:[0,2,4,6,13,18],triangl:13,triangular:16,trick:[3,4,8,11,13,18],trickier:18,tridiagon:16,trillion:15,trivial:[0,1,5,11,18],troubl:[0,8,12],truck:3,true_beta:6,true_divid:1,true_fun:6,tucker:8,tumor:[7,9],tumour:7,tunabl:1,tune:[4,9,13,16],tup:[],tupl:[2,13],turn:[0,1,5,6,7,8,9,10,11,12,13,16,18],tutori:[1,4],tv:2,tveito:2,tweak:[1,4,10,18],twice:13,twist:11,twister:[],two:[0,1,2,4,5,6,7,9,10,11,12,13,16,17,18,20],tx:13,tx_1:13,txt:4,ty:13,type:[0,1,3,6,8,10,13,16,18],typeerror:[2,13],typic:[0,1,2,3,4,5,7,9,10,12,13,18],u:[0,2,5,6,10,11,12,16],u_:16,u_i:12,u_m:10,ua:0,ubuntu:[0,15],uci:0,uio:[17,19,20],un:14,unari:16,unary_f:[2,13],unary_oper:[2,13],unary_to_nari:2,unbalanc:[6,9],unbias:[0,5,6],uncent:6,uncertainti:[0,5],uncertitud:18,unchang:[1,3],uncorrel:[10,18],undefin:5,under:[0,1,5,6,10,13,15],underdetermin:0,underfit:[1,6],underflowproblem:5,undergo:5,undergradu:17,underli:[0,1,9,13,18],underset:[4,14],understand:[0,1,3,5,6,10,13,14,15],understood:[8,13],undesir:8,undetermin:[5,8],undo:4,unexpect:6,unexpected:18,unfair:6,unfortun:[1,8,9,10],unicode_liter:[8,9],uniform:[0,1,5,6,11,13,18],uniform_real_distribut:[],uniformli:[13,18],unifrompdf:18,unimport:13,union:[5,6],uniqu:[0,2,6,13,14,16],unique_cluster_label:14,unit:[0,1,3,4,5,10,12,18],unitari:[5,6,16],unitarili:16,uniti:18,univari:18,univers:[0,1,2,13,15,17,19],unix:1,unknow:[0,16],unknown:[0,1,3,4,5,6,8,10,16],unknowwn:12,unlabel:1,unless:[0,3,6,11,13],unlik:[1,3,8,13],unnecessarili:9,unord:3,unravel:1,unrol:[3,11],unseen:[0,7,9],unstabl:1,unsupervis:[0,1,4,12,15,17],unsymmetr:16,until:[1,2,4,9,12,13,14],untouch:0,unusu:12,up:[1,3,4,5,6,8,10,11,13,14,15,16,17,18],updat:[1,2,10,12,13,14],upload:[15,20],upon:[0,1,6,11,16],upper:[0,8,9,16],uppercas:16,upsampl:4,upscal:4,us:[4,5,6,8,9,10,11,12,14,16,17,18,20],usag:[0,8,15],usd10000:0,usd:0,use_bia:4,use_multiprocess:[3,4],usecol:0,useless:1,user:[0,1,2,3,4,6,7,8,11,14,15,16],userwarn:[3,4,6,14],usetex:18,usg:6,usr:18,usual:[0,3,4,7,12,13,14],ut:5,util:[0,1,3,4,6,7,10,14],ux:16,v0:18,v1:18,v2:18,v:[2,4,5,6,11,13,15],v_0:11,va:1,val:13,val_accuraci:3,val_loss:4,vale:2,valid:[0,1,4,7,9,10,13,15,17,18],validation_batch_s:[3,4],validation_data:[3,4],validation_freq:[3,4],validation_split:[3,4],validation_step:[3,4],valu:[0,1,2,3,4,6,7,8,9,10,12,13,14,15,16,17],valuat:9,valueerror:[0,2],valy:4,van:0,vandenbergh:[8,13],vandermond:0,vanilla:[0,6,11,14],vanish:[1,4,13,18],var_x:18,varabl:8,varepsilon:[5,6],varepsilon_:[5,6],varepsilon_i:[5,6],vari:[0,1,3,5,6,10],variabl:[0,1,2,3,4,5,6,7,8,10,11,12,13,14,16],varianc:[0,1,5,7,9,10,11,13,14,15,16,17,18],variance_i:[5,11],variance_x:[5,11],variant:[0,1,6,8,12,13],variat:[3,4,11],varieti:[0,3,12,15],variou:[1,3,5,6,7,8,9,11,12,13,15,16,18],vartempvec:[],varvec:[],varydimens:4,vastli:3,vaue:1,vault:0,vdot:[2,13],vec:6,vector:[0,1,2,3,4,5,6,7,9,10,11,13,14,15,17],vector_mean:14,ventur:[0,8,15],verbos:[1,3,4],veri:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,18,20],verifi:[3,11,16],versatil:8,versicolor:[8,9],version:[0,3,4,10,13,14,15,16,18],versu:1,vert:[0,1,5,6,7,8,9,11,13],vert_1:[5,6],vert_2:[5,6,11],via:[0,5,6,7,8,9,10,11,12,15,16,17,18],vidal:11,video:[0,1,12,15,17],view:[1,3,5,6,12,13,17,18,20],violat:8,virginica:9,viridi:[0,1,2,3],virtual:1,viscos:13,viscou:13,visibledeprecationwarn:2,vision:[0,3],visual:[0,3,11,12,15],visualis:1,viz:[6,8,18],vjp:[2,13],vjp_0:[],vjp_0_fun:[],vjp_1:[],vjp_1_fun:[],vjp_argnum:[],vjpfun:2,vjpmaker:[],vjpnode:[2,13],vmax:[1,6],vmc:[],vmin:[1,6],voic:3,volum:[0,3],vote:10,voting_clf:10,votingclassifi:10,votingsimpl:10,vrtx:17,vs:[0,4,6],vspace:[2,13],vstack:[5,11,16,18],vt:5,w1:8,w2:[8,11],w3:8,w:[0,1,2,3,4,5,6,7,8,10,11,12,13,14,16,18],w_1:[8,16],w_1x_1:8,w_1x_:8,w_2:[8,16],w_2x_2:8,w_2x_:8,w_3:16,w_4:16,w_:[1,12],w_hidden:2,w_i:[1,2,10],w_ix_i:12,w_j:16,w_m:16,w_output:2,w_px_:8,w_px_p:8,wa:[0,1,3,4,5,6,7,10,11,12,13,14,16],wai:[0,1,2,3,4,5,6,7,8,10,11,12,13,14,16,18],walk:9,walker:18,wang:0,want:[0,1,2,3,4,5,6,8,9,10,11,12,13,14,15,18],warn:[1,3,4,8,14],warrant:6,wast:3,watch:[3,4,15],wave:3,wavelet:8,we:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20],weak:[9,10,14],weather:[1,12],web:[15,17],webpag:17,websit:[6,16,17],wedg:[8,18],wednesdai:17,wee:11,week:[0,5,6,7],weekli:[15,20],weight:[0,1,2,3,6,7,9,10,12,13,18],weigth:2,welcom:[8,15],well:[0,1,2,3,4,5,6,7,8,9,10,12,13,15,16,17,18,20],went:8,were:[0,1,3,4,5,6,7,8,10,11,12,14,18],wessel:0,westbi:19,westby:19,what:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18],whatev:3,when:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,18],whenev:[13,18],where:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,19],wherea:[6,18],wherein:[1,12],whether:[0,3,5,7,9,18],which:[0,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19],whichev:[1,3],white:9,who:[0,17],whole:[1,3,4,5,9,11,13],whose:[0,6,10,18],whow:[5,11],why:[0,1,3,6,13],wide:[0,1,3,6,7,12,15,16],widehat:6,width:[0,3,8,9],wieringen:0,win:10,wind:9,wing:19,winther:2,wiothout:6,wiscons:7,wisconsin:10,wisdom:6,wise:[0,1,5,12,13],wish:[0,2,5,7,8,11,13,14,16],with_std:0,wither:6,within:[0,2,3,4,7,9,12,13,14,18,20],withinclust:14,without:[0,1,5,6,8,9,11,12,13],won:0,wonder:8,word:[0,1,3,4,5,6,14,18],work:[0,1,4,6,7,8,9,13,15,17,18],worker:[3,4],workshop:17,world:[0,8],worldwid:0,wors:[0,1,3,4,6],worst:[],worth:9,would:[0,1,3,5,6,7,8,9,10,11,12,13,16,18],wrap:[2,6,16,17],wrap_util:[2,13],wrapper:0,write:[0,1,2,3,5,6,7,8,12,13,16],written:[0,2,3,5,11,12,13,15,16,18],wrong:[1,8],wrongli:10,wrote:[5,11],wrt:[2,10,13],wth:10,www:[15,16,17,20],wx_1:8,x0:8,x1:[4,8,9,10,13],x1_exampl:8,x1d:8,x2:[8,9,10,13],x2d:[8,11],x2d_train:11,x2dsl:11,x3:8,x:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,18],x_0:[0,5,11,16],x_1:[0,2,5,6,7,8,9,10,11,13,16,18],x_2:[0,2,5,6,7,8,9,10,11,13,16,18],x_3:[8,16,18],x_4:16,x_:[0,2,3,5,6,8,10,11,13,14,16,18],x_center:11,x_data:1,x_data_ful:1,x_hidden:2,x_i:[0,1,2,5,6,7,8,9,10,11,12,13,14,16,18],x_input:2,x_ix_:0,x_iy_i:8,x_j:[0,2,8,9,12,18],x_jy_j:8,x_k:[12,14,16,18],x_l:18,x_m:[6,12,16,18],x_n:[0,2,3,6,8,11,12,13,16,18],x_new:[9,10],x_offset:6,x_output:2,x_p:[3,7,9],x_poli:9,x_poly10:9,x_pred:4,x_prev:2,x_reduc:11,x_scale:8,x_test:[0,1,3,5,6,7,9,10,11],x_test_own:6,x_test_scal:[0,6,7,9,10,11],x_tot:4,x_train:[0,1,3,4,5,6,7,9,10,11],x_train_mean:6,x_train_own:6,x_train_scal:[0,6,7,9,10,11],x_val:1,xarrai:15,xavier:1,xbnew:13,xcode:[0,15],xdclassiffierconfus:10,xdclassiffierroc:10,xg_clf:10,xgb:10,xgbclassifi:10,xgboost:9,xgboot:10,xgbregressor:10,xgparam:10,xgtree:10,xi:[8,13],xi_1:8,xi_:8,xi_i:8,xk:8,xla:15,xlabel:[0,1,2,3,4,5,6,7,8,9,10,13,18],xlim:[6,10],xm:9,xmesh:13,xnew:[0,13],xp:18,xpanda:0,xpd:[5,11],xplot:0,xs:9,xscale:0,xsr:9,xt_x:13,xtest:6,xtick:[3,6,8,9],xtrain:6,xu:0,xx:[0,16],xy:[0,6,8,16],xytext:8,xz:16,y1:4,y2:4,y3:4,y:[0,1,3,4,5,6,7,8,9,10,11,12,13,14,16,18],y_0:[0,5,11,16],y_1:[0,5,8,9,11,13,16],y_1y_1:8,y_1y_1k:8,y_1y_2:8,y_1y_2k:8,y_1y_n:8,y_1y_nk:8,y_2:[0,5,8,9,11,16],y_2y_1:8,y_2y_1k:8,y_2y_2:8,y_2y_2k:8,y_3:[0,9,16],y_4:16,y_:[0,1,5,6,10,11,16],y_data:[0,1,5,6],y_data_ful:1,y_decis:8,y_fit:0,y_i:[0,1,5,6,7,8,9,10,11,12,13,16],y_if_:10,y_ix_:0,y_ix_i:[7,8,13],y_iy_jk:8,y_j:[6,8,12],y_k:12,y_m:16,y_model:[0,4,5,6],y_n:[8,13],y_ny_1:8,y_ny_1k:8,y_ny_2:8,y_ny_2k:8,y_ny_n:8,y_ny_nk:8,y_offset:6,y_plot:9,y_pred1:9,y_pred2:9,y_pred:[0,1,4,6,7,8,9,10],y_pred_rf:10,y_pred_tre:10,y_proba:[7,10],y_scaler:6,y_test:[0,1,3,4,5,6,7,9,10,11],y_test_onehot:1,y_test_predict:0,y_tot:4,y_train:[0,1,3,4,5,6,7,9,10,11],y_train_mean:6,y_train_onehot:1,y_train_predict:0,y_train_scal:6,y_val:1,ye:[3,6,7],year:[0,15],yet:[0,1,6,8,11,13],yhd5w:17,yi:13,yield:[0,2,5,6,8,10,12,13,14,16,18],yk:8,ylabel:[0,1,2,3,4,5,6,7,8,9,10,13,18],ylim:[3,6],ym:9,ymesh:13,yn:0,yo:[8,9,10],yoshua:[1,20],you:[0,1,2,3,4,5,6,8,9,10,11,13,15,16,18,20],young:0,your:[1,2,4,5,6,8,11,13,15,16],yourself:[11,13],youtu:17,youtub:15,ypred:6,ypredict2:13,ypredict:[0,13],ypredictlasso:5,ypredictol:[0,5],ypredictown:6,ypredictownridg:6,ypredictridg:[0,5,6],ypredictskl:6,ys:9,ytest:6,ytick:[3,6,8,9],ytild:[0,6],ytildelasso:5,ytildenp:0,ytildeol:[0,5],ytildeownridg:6,ytilderidg:[5,6],ytrain:6,yx:16,yy:16,yz:16,z:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18],z_0:16,z_1:16,z_2:16,z_:[1,2,12,16],z_c:1,z_h:1,z_hidden:2,z_i:[1,12],z_j:[1,12],z_k:12,z_m:1,z_mod:9,z_o:1,z_output:2,zaman:18,zaxi:6,zero:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,18],zeros_lik:4,zfill:4,zip:[2,4,6,13],zl:[],zm_h:0,zn:0,zone:0,zx:16,zy:16,zz:16},titles:["3. Linear Regression","14. Building a Feed Forward Neural Network","15. Solving Differential Equations with Deep Learning","16. Convolutional Neural Networks","17. Recurrent neural networks: Overarching view","4. Ridge and Lasso Regression","5. Resampling Methods","6. Logistic Regression","8. Support Vector Machines, overarching aims","9. Decision trees, overarching aims","10. Ensemble Methods: From a Single Tree to Many Trees and Extreme Boosting, Meet the Jungle of Methods","11. Basic ideas of the Principal Component Analysis (PCA)","13. Neural networks","7. Optimization, the central part of any Machine Learning algortithm","12. Clustering and Unsupervised Learning","Applied Data Analysis and Machine Learning","2. Linear Algebra, Handling of Arrays and more Python Features","Teaching schedule with links to material","1. Elements of Probability Theory and Statistical Data Analysis","Teachers and Grading","Textbooks"],titleterms:{"1":0,"10":17,"11":17,"12":17,"13":[],"14":17,"15":[],"16":17,"17":17,"18":17,"19":17,"2":[0,17],"20":[],"2021":[],"2022":19,"21":17,"22":17,"23":17,"24":17,"25":17,"26":17,"27":[],"28":17,"29":17,"3":[0,17],"30":17,"31":17,"34":17,"35":17,"36":17,"37":17,"38":17,"39":17,"4":[0,17],"40":17,"41":17,"4155":[],"42":17,"43":17,"44":17,"45":17,"46":17,"47":17,"5":[0,17],"6":[],"7":17,"8":[],"9":17,"case":[8,10,18],"do":1,"final":12,"function":[0,1,6,7,8,10,11,12,13,18],"import":[5,16],"new":4,A:[0,1,4,8,9],And:13,Ising:6,The:[0,1,2,3,5,6,7,8,9,11,12,15],With:4,activ:[1,12],actual:[],ad:[0,6],adaboost:10,adam:13,adapt:10,adjust:1,adversari:4,again:[3,9],aim:[8,9],algebra:16,algorithm:[9,10,11,12],algortithm:13,all:8,an:[0,4,10],analys:5,analysi:[0,5,6,11,15,18],analyt:0,ani:13,anoth:9,appli:15,approach:[0,8,14],approxim:12,architectur:1,arrai:16,assist:19,august:17,autocorrel:18,autograd:[2,13],automat:13,back:[1,11,12],background:15,bag:10,base:13,basic:[0,5,7,9,10,11,16],batch:1,bay:5,befor:11,better:8,bia:6,binari:1,binomi:[],bird:10,block:[],boost:10,bootstrap:[6,10],boston:0,breast:1,bring:12,build:[1,3,9],calcul:[],cancer:[1,7,9,11],cart:9,central:[13,15,18],chain:12,chang:10,chi:0,choos:1,cifar01:3,classic:11,classif:[1,9,10],classifi:8,clip:1,cluster:14,cnn:3,code:[0,1,2,5,9,11,12,14],collect:[1,3],compar:[2,10],complex:[0,6],complic:6,compon:11,comput:9,con:9,concept:18,conjug:13,continu:[],convex:[8,13],convolut:[3,12],correl:11,cost:[1,10],cours:[15,20],covari:[5,11,18],cross:6,cumul:[],data:[0,1,3,6,7,9,11,15,18],dataset:[1,3],decai:2,decis:[9,10],decomposit:[5,11,16],deep:[1,2],defin:1,definit:[],degre:0,demonstr:[],dens:0,deriv:[5,12],descent:[2,10,13],detail:3,develop:1,deviat:[],diagon:11,dice:[],differ:8,differenti:[2,13],diffus:2,dimension:[2,3,8],disadvantag:9,discret:18,disguis:[],distribut:[5,18],domain:18,down:1,dropout:1,element:[0,18],elimin:16,ensembl:10,entropi:9,environ:0,equat:[0,2,12],error:[0,10],euler:2,evalu:1,event:[],exampl:[0,1,2,3,4,6,7,8,9,10],exercis:[0,6],expect:18,experi:18,explor:0,exponenti:2,extrapol:4,extrem:10,ey:10,fall:19,famili:1,famou:16,featur:[9,16],feed:[1,12],fine:1,first:[4,12],fit:[0,10],forc:3,forest:10,forward:[1,2,12],fourier:3,frank:6,freedom:0,frequentist:0,from:[5,10,12],full:2,further:[3,5],fy:[],gan:4,gaussian:16,gd:13,gener:[4,9],geometr:11,gini:9,good:0,grade:19,gradient:[1,2,10,13],growth:2,ha:15,handl:16,hidden:2,hous:0,how:[],hyperparamet:1,hyperplan:8,i:1,id3:9,idea:11,implement:1,implic:5,improv:1,includ:13,increment:11,index:9,inform:19,input:2,instal:15,instructor:19,interpret:[5,11],introduc:11,introduct:[0,6,15,16],invers:[5,16],iter:10,its:[],jackknif:[],jungl:10,kera:[1,3],kernel:[8,11],lagrangian:8,lasso:[5,6],later:5,layer:[1,2,3,12],learn:[0,1,2,11,13,14,15],least:[5,6],level:10,librari:15,likelihood:7,limit:[1,13,18],linear:[0,8,13,16],link:[5,11,17,20],logist:[7,13],lu:16,machin:[0,8,13,15],main:18,make:[0,9,10],mani:[10,12],materi:17,math:5,mathemat:[3,5,8],matric:[5,16],matrix:[1,5,11,12,16],matter:0,mean:0,meet:[5,10,18],mercer:8,mersenn:[],method:[6,9,10,13],mlp:12,mnist:[3,4],model:[0,1,4,6,12],moment:[],momentum:13,moon:[8,9],more:[3,6,16],multilay:12,multipl:[1,3],multipli:8,name:[],network:[1,2,3,4,7,12],neural:[1,2,3,4,12],non:8,normal:[0,1],norwai:[],notat:12,novemb:17,now:[1,9],nuclear:0,nueral:7,number:[0,2,18],numer:[2,18],numpi:16,object:3,observ:[],obtain:11,octob:17,od:2,off:6,ol:[5,6,13],one:[2,12],oper:16,optim:[1,8,13,15],ordinari:[5,6],organ:0,oslo:20,other:[4,9,11,12,16],our:[0,4,5,11,13],outcom:15,output:2,overarch:[0,4,8,9],overview:10,own:[0,10,11],packag:16,part:[13,15],partial:2,pass:1,pca:11,pdf:18,perceptron:12,perform:[1,9],period:3,perspect:1,point:4,poisson:2,polynomi:3,popul:2,practic:13,pre:[1,3],predict:4,prerequisit:[3,15],princip:11,principl:3,pro:9,probabl:[5,18],problem:[1,2,13],procedur:9,process:[1,3],program:[2,13],project:6,prop:13,propag:[1,12],properti:[5,18],pseudo:[],python:[0,9,15,16],quick:8,ran0:[],random:[10,11,18],read:9,real:6,recip:[],recurr:[4,12],reduc:0,reduct:3,reformul:2,regress:[0,5,6,7,9,10,13],regular:1,relev:20,relu:1,remark:3,remind:[6,8],requir:[2,15],resampl:6,rescal:6,resourc:2,revisit:13,ridg:[0,5,6],rm:13,rng:[],rule:12,s:[8,10],sampl:11,schedul:17,schemat:9,scheme:2,scikit:[0,1,11],select:[],semest:19,septemb:17,set:[0,2,3,9,12],sgd:13,should:1,simpl:[0,4,9,13],singl:10,singular:[5,11],situat:[],soft:8,softmax:1,solv:2,solver:13,some:[13,16],specifi:2,split:0,squar:[0,5,6,10],standard:13,state:0,statist:[5,6,15,18],steepest:[10,13],stk3155:[],stochast:[13,18],superposit:3,supervis:1,support:8,svd:5,systemat:3,teach:[17,19],teacher:19,techniqu:[6,11],technolog:15,tensorflow:[1,3],test:[0,1],textbook:20,theorem:[5,8,11,12,18],theori:18,three:[],tip:13,togeth:12,top:1,toss:[],toward:11,trade:6,tradeoff:6,train:[0,1,4],transform:3,tree:[9,10],tune:1,two:[3,8,15],type:[2,4,12],uncorrel:[],uniform:[],univers:[12,20],unsupervis:14,up:[0,2,9,12],us:[0,1,2,3,7,13,15],valid:6,valu:[5,11,18],variabl:18,varianc:6,variou:0,vector:[8,12,16],view:[0,4,10],visual:[1,9],vs:3,wai:9,wave:2,week:17,weekli:17,what:0,which:1,why:[],wisconsin:7,write:[4,11],xgboost:10,your:[0,10]}})
\ No newline at end of file
diff --git a/doc/LectureNotes/_build/jupyter_execute/chapter2.ipynb b/doc/LectureNotes/_build/jupyter_execute/chapter2.ipynb
index d6bad4e44..b42aac22d 100644
--- a/doc/LectureNotes/_build/jupyter_execute/chapter2.ipynb
+++ b/doc/LectureNotes/_build/jupyter_execute/chapter2.ipynb
@@ -2,23 +2,45 @@
"cells": [
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "7146aabe",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ ""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "383d5dba",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "# Ridge and Lasso Regression"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "08812109",
+ "metadata": {
+ "editable": true
+ },
"source": [
- "# Ridge and Lasso Regression\n",
- "\n",
- "\n",
- "\n",
"## Mathematical Interpretation of Ordinary Least Squares\n",
"\n",
"What is presented here is a mathematical analysis of various regression algorithms (ordinary least squares, Ridge and Lasso Regression). The analysis is based on an important algorithm in linear algebra, the so-called Singular Value Decomposition (SVD). \n",
"\n",
- "\n",
"We have shown that in ordinary least squares (OLS) the optimal parameters $\\beta$ are given by"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "04ce00fc",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\hat{\\boldsymbol{\\beta}}_{\\mathrm{OLS}} = \\left(\\boldsymbol{X}^T\\boldsymbol{X}\\right)^{-1}\\boldsymbol{X}^T\\boldsymbol{y}.\n",
@@ -27,7 +49,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "88d4cd43",
+ "metadata": {
+ "editable": true
+ },
"source": [
"The **hat** over $\\boldsymbol{\\beta}$ means we have the optimal parameters after minimization of the cost function.\n",
"\n",
@@ -36,7 +61,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "b95f6106",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\tilde{\\boldsymbol{y}}=\\boldsymbol{X}\\hat{\\boldsymbol{\\beta}} = \\boldsymbol{X}\\left(\\boldsymbol{X}^T\\boldsymbol{X}\\right)^{-1}\\boldsymbol{X}^T\\boldsymbol{y}.\n",
@@ -45,14 +73,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "2ee3b8e9",
+ "metadata": {
+ "editable": true
+ },
"source": [
"We now define a matrix"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "72f7dde8",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{A}=\\boldsymbol{X}\\left(\\boldsymbol{X}^T\\boldsymbol{X}\\right)^{-1}\\boldsymbol{X}^T.\n",
@@ -61,14 +95,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "4b092bc7",
+ "metadata": {
+ "editable": true
+ },
"source": [
"We can rewrite"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "44b3e758",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\tilde{\\boldsymbol{y}}=\\boldsymbol{X}\\hat{\\boldsymbol{\\beta}} = \\boldsymbol{A}\\boldsymbol{y}.\n",
@@ -77,20 +117,23 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "6cec4c92",
+ "metadata": {
+ "editable": true
+ },
"source": [
"The matrix $\\boldsymbol{A}$ has the important property that $\\boldsymbol{A}^2=\\boldsymbol{A}$. This is the definition of a [projection matrix](https://en.wikipedia.org/wiki/Projection_matrix).\n",
"We can then interpret our optimal model $\\tilde{\\boldsymbol{y}}$ as being represented by an orthogonal projection of $\\boldsymbol{y}$ onto a space defined by the column vectors of $\\boldsymbol{X}$. In our case here the matrix $\\boldsymbol{A}$ is a square matrix. If it is a general rectangular matrix we have an oblique projection matrix.\n",
"\n",
- "\n",
- "\n",
- "\n",
"We have defined the residual error as"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "ef64424c",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{\\epsilon}=\\boldsymbol{y}-\\tilde{\\boldsymbol{y}}=\\left[\\boldsymbol{I}-\\boldsymbol{X}\\left(\\boldsymbol{X}^T\\boldsymbol{X}\\right)^{-1}\\boldsymbol{X}^T\\right]\\boldsymbol{y}.\n",
@@ -99,17 +142,22 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "cad57da0",
+ "metadata": {
+ "editable": true
+ },
"source": [
"The residual errors are then the projections of $\\boldsymbol{y}$ onto the orthogonal component of the space defined by the column vectors of $\\boldsymbol{X}$.\n",
"\n",
- "\n",
"If the matrix $\\boldsymbol{X}$ is an orthogonal (or unitary in case of complex values) matrix, we have"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "94355d54",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X}^T\\boldsymbol{X}=\\boldsymbol{X}\\boldsymbol{X}^T = \\boldsymbol{I}.\n",
@@ -118,14 +166,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "4c1ccdf5",
+ "metadata": {
+ "editable": true
+ },
"source": [
"In this case the matrix $\\boldsymbol{A}$ becomes"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "0d943ee1",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{A}=\\boldsymbol{X}\\left(\\boldsymbol{X}^T\\boldsymbol{X}\\right)^{-1}\\boldsymbol{X}^T)=\\boldsymbol{I},\n",
@@ -134,14 +188,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "3f951392",
+ "metadata": {
+ "editable": true
+ },
"source": [
"and we have the obvious case"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "ce1a6d6f",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{\\epsilon}=\\boldsymbol{y}-\\tilde{\\boldsymbol{y}}=0.\n",
@@ -150,16 +210,23 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "2861bd8e",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "This serves also as a useful test of our codes."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "1dfaffdb",
+ "metadata": {
+ "editable": true
+ },
"source": [
- "This serves also as a useful test of our codes. \n",
- "\n",
- "\n",
- "\n",
- "\n",
"## The singular value decomposition\n",
"\n",
- "\n",
"The examples we have looked at so far are cases where we normally can\n",
"invert the matrix $\\boldsymbol{X}^T\\boldsymbol{X}$. Using a polynomial expansion where we fit of various functions leads to\n",
"row vectors of the design matrix which are essentially orthogonal due\n",
@@ -167,7 +234,6 @@
"design matrix is then often done via a so-called LU, QR or Cholesky\n",
"decomposition.\n",
"\n",
- "\n",
"As we will also see in the first project, \n",
"this may\n",
"however not the be case in general and a standard matrix inversion\n",
@@ -191,9 +257,6 @@
"in the principal component analysis where high-dimensional data can be\n",
"reduced to the statistically relevant features.\n",
"\n",
- "\n",
- "\n",
- "\n",
"One of the typical problems we encounter with linear regression, in particular \n",
"when the matrix $\\boldsymbol{X}$ (our so-called design matrix) is high-dimensional, \n",
"are problems with near singular or singular matrices. The column vectors of $\\boldsymbol{X}$ \n",
@@ -204,7 +267,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "3e091b51",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\begin{align*}\n",
@@ -224,7 +290,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "2fcbdb36",
+ "metadata": {
+ "editable": true
+ },
"source": [
"The columns of $\\boldsymbol{X}$ are linearly dependent. We see this easily since the \n",
"the first column is the row-wise sum of the other two columns. The rank (more correct,\n",
@@ -238,7 +307,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "1f35594a",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\begin{align*}\n",
@@ -254,19 +326,23 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "093183cd",
+ "metadata": {
+ "editable": true
+ },
"source": [
"We see easily that $\\mbox{det}(\\boldsymbol{X}) = x_{11} x_{22} - x_{12} x_{21} = 1 \\times (-1) - 1 \\times (-1) = 0$. Hence, $\\mathbf{X}$ is singular and its inverse is undefined.\n",
"This is equivalent to saying that the matrix $\\boldsymbol{X}$ has at least an eigenvalue which is zero.\n",
"\n",
- "\n",
- "\n",
"If our design matrix $\\boldsymbol{X}$ which enters the linear regression problem"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "7a22cf10",
+ "metadata": {
+ "editable": true
+ },
"source": [
"\n",
"\n",
@@ -281,7 +357,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "a66feb94",
+ "metadata": {
+ "editable": true
+ },
"source": [
"has linearly dependent column vectors, we will not be able to compute the inverse\n",
"of $\\boldsymbol{X}^T\\boldsymbol{X}$ and we cannot find the parameters (estimators) $\\beta_i$. \n",
@@ -294,7 +373,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "b5b5978a",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X}^{T} \\boldsymbol{X} \\rightarrow \\boldsymbol{X}^{T} \\boldsymbol{X}+\\lambda \\boldsymbol{I},\n",
@@ -303,16 +385,23 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "bed64679",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "where $\\boldsymbol{I}$ is the identity matrix. When we discuss **Ridge** regression this is actually what we end up evaluating. The parameter $\\lambda$ is called a hyperparameter. More about this later."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "860c9b6d",
+ "metadata": {
+ "editable": true
+ },
"source": [
- "where $\\boldsymbol{I}$ is the identity matrix. When we discuss **Ridge** regression this is actually what we end up evaluating. The parameter $\\lambda$ is called a hyperparameter. More about this later. \n",
- "\n",
- "\n",
- "\n",
- "\n",
"## Basic math of the SVD\n",
"\n",
- "\n",
"From standard linear algebra we know that a square matrix $\\boldsymbol{X}$ can be diagonalized if and only it is \n",
"a so-called [normal matrix](https://en.wikipedia.org/wiki/Normal_matrix), that is if $\\boldsymbol{X}\\in {\\mathbb{R}}^{n\\times n}$\n",
"we have $\\boldsymbol{X}\\boldsymbol{X}^T=\\boldsymbol{X}^T\\boldsymbol{X}$ or if $\\boldsymbol{X}\\in {\\mathbb{C}}^{n\\times n}$ we have $\\boldsymbol{X}\\boldsymbol{X}^{\\dagger}=\\boldsymbol{X}^{\\dagger}\\boldsymbol{X}$.\n",
@@ -321,7 +410,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "724355a3",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"(\\lambda_1,\\boldsymbol{u}_1),\\dots, (\\lambda_n,\\boldsymbol{u}_n),\n",
@@ -330,14 +422,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "80fea225",
+ "metadata": {
+ "editable": true
+ },
"source": [
"and the eigenvalues are given by the diagonal matrix"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "4a7bc845",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{\\Sigma}=\\mathrm{Diag}(\\lambda_1, \\dots,\\lambda_n).\n",
@@ -346,14 +444,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "789f1977",
+ "metadata": {
+ "editable": true
+ },
"source": [
"The matrix $\\boldsymbol{X}$ can be written in terms of an orthogonal/unitary transformation $\\boldsymbol{U}$"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "56e422f4",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X} = \\boldsymbol{U}\\boldsymbol{\\Sigma}\\boldsymbol{V}^T,\n",
@@ -362,7 +466,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "f015c981",
+ "metadata": {
+ "editable": true
+ },
"source": [
"with $\\boldsymbol{U}\\boldsymbol{U}^T=\\boldsymbol{I}$ or $\\boldsymbol{U}\\boldsymbol{U}^{\\dagger}=\\boldsymbol{I}$.\n",
"\n",
@@ -371,7 +478,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "dfd219d0",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X} = \\begin{bmatrix} \n",
@@ -383,15 +493,14 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "9992b4d2",
+ "metadata": {
+ "editable": true
+ },
"source": [
"is not diagonalizable, it is a so-called [defective matrix](https://en.wikipedia.org/wiki/Defective_matrix). It is easy to see that the condition\n",
"$\\boldsymbol{X}\\boldsymbol{X}^T=\\boldsymbol{X}^T\\boldsymbol{X}$ is not fulfilled. \n",
"\n",
- "\n",
- "\n",
- "\n",
- "\n",
"However, and this is the strength of the SVD algorithm, any general\n",
"matrix $\\boldsymbol{X}$ can be decomposed in terms of a diagonal matrix and\n",
"two orthogonal/unitary matrices. The [Singular Value Decompostion\n",
@@ -405,7 +514,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "e41ce3a1",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X} = \\boldsymbol{U}\\boldsymbol{\\Sigma}\\boldsymbol{V}^T\n",
@@ -414,14 +526,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "916148d2",
+ "metadata": {
+ "editable": true
+ },
"source": [
"As an example, the above defective matrix can be decomposed as"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "8488b628",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X} = \\frac{1}{\\sqrt{2}}\\begin{bmatrix} 1& 1 \\\\ 1& -1\\\\ \\end{bmatrix} \\begin{bmatrix} 2& 0 \\\\ 0& 0\\\\ \\end{bmatrix} \\frac{1}{\\sqrt{2}}\\begin{bmatrix} 1& -1 \\\\ 1& 1\\\\ \\end{bmatrix}=\\boldsymbol{U}\\boldsymbol{\\Sigma}\\boldsymbol{V}^T,\n",
@@ -430,7 +548,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "eb7bb105",
+ "metadata": {
+ "editable": true
+ },
"source": [
"with eigenvalues $\\sigma_1=2$ and $\\sigma_2=0$. \n",
"The SVD exits always! \n",
@@ -453,7 +574,6 @@
"\n",
"The columns of $\\boldsymbol{U}$ are called the left singular vectors while the columns of $\\boldsymbol{V}$ are the right singular vectors.\n",
"\n",
- "\n",
"If we assume that $n > p$, then our matrix $\\boldsymbol{U}$ has dimension $n\n",
"\\times n$. The last $n-p$ columns of $\\boldsymbol{U}$ become however\n",
"irrelevant in our calculations since they are multiplied with the\n",
@@ -469,14 +589,23 @@
"If $n > p$, we keep only the first $p$ columns of $\\boldsymbol{U}$ and $\\boldsymbol{\\Sigma}$ has dimension $p\\times p$. \n",
"If $p > n$, then only the first $n$ columns of $\\boldsymbol{V}$ are computed and $\\boldsymbol{\\Sigma}$ has dimension $n\\times n$.\n",
"The $n=p$ case is obvious, we retain the full SVD. \n",
- "In general the economy-size SVD leads to less FLOPS and still conserving the desired accuracy.\n",
- "\n",
+ "In general the economy-size SVD leads to less FLOPS and still conserving the desired accuracy."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "86e39aa0",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
"## Codes for the SVD"
]
},
{
"cell_type": "code",
"execution_count": 1,
+ "id": "9c3ae0cf",
"metadata": {
"collapsed": false,
"editable": true
@@ -538,7 +667,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "b5e02d16",
+ "metadata": {
+ "editable": true
+ },
"source": [
"The matrix $\\boldsymbol{X}$ has columns that are linearly dependent. The first\n",
"column is the row-wise sum of the other two columns. The rank of a\n",
@@ -549,8 +681,6 @@
"inversion algorithm for matrix inversion with $\\boldsymbol{X}^T\\boldsymbol{X}$ results\n",
"in the program terminating due to a singular matrix.\n",
"\n",
- "\n",
- "\n",
"The $U$, $S$, and $V$ matrices returned from the **svd()** function\n",
"cannot be multiplied directly.\n",
"\n",
@@ -562,9 +692,16 @@
"\n",
"If you wish to include the zero singular values, you will need to\n",
"resize the matrices and set up a diagonal matrix as done in the above\n",
- "example\n",
- "\n",
- "\n",
+ "example"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "ceac1ca3",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
"## Code for SVD and Inversion of Matrices\n",
"\n",
"How do we use the SVD to invert a matrix $\\boldsymbol{X}^T\\boldsymbol{X}$ which is singular or near singular?\n",
@@ -574,6 +711,7 @@
{
"cell_type": "code",
"execution_count": 2,
+ "id": "15a9c8e8",
"metadata": {
"collapsed": false,
"editable": true
@@ -585,7 +723,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "4a6e5469",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Let us first look at a matrix which does not causes problems and write our own function where we just use the SVD."
]
@@ -593,6 +734,7 @@
{
"cell_type": "code",
"execution_count": 3,
+ "id": "ef3b6935",
"metadata": {
"collapsed": false,
"editable": true
@@ -653,7 +795,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "155ca008",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Although our matrix to invert $\\boldsymbol{X}^T\\boldsymbol{X}$ is a square matrix, our matrix may be singular. \n",
"\n",
@@ -668,7 +813,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "da493b94",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{A}_{\\mathrm{PI}}= \\boldsymbol{V}\\boldsymbol{D}_{\\mathrm{PI}}\\boldsymbol{U}^T,\n",
@@ -677,14 +825,18 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "8bf214ea",
+ "metadata": {
+ "editable": true
+ },
"source": [
- "where $\\boldsymbol{D}_{\\mathrm{PI}}$ can be calculated by creating a diagonal matrix from $\\boldsymbol{Sigma}$ where we only keep the singular values (the non-zero values). The following code computes the pseudoinvers of the matrix based on the SVD."
+ "where $\\boldsymbol{D}_{\\mathrm{PI}}$ can be calculated by creating a diagonal matrix from $\\boldsymbol{\\Sigma}$ where we only keep the singular values (the non-zero values). The following code computes the pseudoinvers of the matrix based on the SVD."
]
},
{
"cell_type": "code",
"execution_count": 4,
+ "id": "e437b5d9",
"metadata": {
"collapsed": false,
"editable": true
@@ -733,14 +885,21 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "e711d30f",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "As you can see from these examples, our own decomposition based on the SVD agrees the pseudoinverse algorithm provided by **Numpy**."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "a0ba9d2f",
+ "metadata": {
+ "editable": true
+ },
"source": [
- "As you can see from these examples, our own decomposition based on the SVD agrees the pseudoinverse algorithm provided by **Numpy**.\n",
- "\n",
- "\n",
- "\n",
- "\n",
- "\n",
"## Mathematics of the SVD and implications\n",
"\n",
"Let us take a closer look at the mathematics of the SVD and the various implications for machine learning studies.\n",
@@ -750,7 +909,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "90951d11",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X}=\\begin{bmatrix}\n",
@@ -766,14 +928,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "91ff188a",
+ "metadata": {
+ "editable": true
+ },
"source": [
"We can SVD decompose our matrix as"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "61b2e6d7",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X}=\\boldsymbol{U}\\boldsymbol{\\Sigma}\\boldsymbol{V}^T,\n",
@@ -782,7 +950,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "3a5bf286",
+ "metadata": {
+ "editable": true
+ },
"source": [
"where $\\boldsymbol{U}$ is an orthogonal matrix of dimension $n\\times n$, meaning that $\\boldsymbol{U}\\boldsymbol{U}^T=\\boldsymbol{U}^T\\boldsymbol{U}=\\boldsymbol{I}_n$. Here $\\boldsymbol{I}_n$ is the unit matrix of dimension $n \\times n$.\n",
"\n",
@@ -793,7 +964,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "1bd0e480",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\sigma_0 > \\sigma_1 > \\sigma_2 > \\dots > \\sigma_{p-1} > 0.\n",
@@ -802,17 +976,22 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "6133bbea",
+ "metadata": {
+ "editable": true
+ },
"source": [
"All values beyond $p-1$ are all zero.\n",
"\n",
- "\n",
"As an example, consider the following $3\\times 2$ example for the matrix $\\boldsymbol{\\Sigma}$"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "c2f4ec9c",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{\\Sigma}=\n",
@@ -826,14 +1005,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "d8e91a1a",
+ "metadata": {
+ "editable": true
+ },
"source": [
"The singular values are $\\sigma_0=2$ and $\\sigma_1=1$. It is common to rewrite the matrix $\\boldsymbol{\\Sigma}$ as"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "66510064",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{\\Sigma}=\n",
@@ -846,14 +1031,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "0de239cf",
+ "metadata": {
+ "editable": true
+ },
"source": [
"where"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "ae4894a1",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{\\tilde{\\Sigma}}=\n",
@@ -866,14 +1057,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "928421c0",
+ "metadata": {
+ "editable": true
+ },
"source": [
"contains only the singular values. Note also (and we will use this below) that"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "f707ba94",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{\\Sigma}^T\\boldsymbol{\\Sigma}=\n",
@@ -886,14 +1083,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "c2169a96",
+ "metadata": {
+ "editable": true
+ },
"source": [
"which is a $2\\times 2 $ matrix while"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "0fd7213a",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{\\Sigma}\\boldsymbol{\\Sigma}^T=\n",
@@ -907,20 +1110,24 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "014bf918",
+ "metadata": {
+ "editable": true
+ },
"source": [
"is a $3\\times 3 $ matrix. The last row and column of this last matrix\n",
"contain only zeros. This will have important consequences for our SVD\n",
"decomposition of the design matrix.\n",
"\n",
- "\n",
- "\n",
"The matrix that may cause problems for us is $\\boldsymbol{X}^T\\boldsymbol{X}$. Using the SVD we can rewrite this matrix as"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "5b371d72",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X}^T\\boldsymbol{X}=\\boldsymbol{V}\\boldsymbol{\\Sigma}^T\\boldsymbol{U}^T\\boldsymbol{U}\\boldsymbol{\\Sigma}\\boldsymbol{V}^T,\n",
@@ -929,14 +1136,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "5fdd06fb",
+ "metadata": {
+ "editable": true
+ },
"source": [
"and using the orthogonality of the matrix $\\boldsymbol{U}$ we have"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "416109ee",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X}^T\\boldsymbol{X}=\\boldsymbol{V}\\boldsymbol{\\Sigma}^T\\boldsymbol{\\Sigma}\\boldsymbol{V}^T.\n",
@@ -945,32 +1158,22 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "38a7766d",
+ "metadata": {
+ "editable": true
+ },
"source": [
"We define $\\boldsymbol{\\Sigma}^T\\boldsymbol{\\Sigma}=\\tilde{\\boldsymbol{\\Sigma}}^2$ which is a diagonal matrix containing only the singular values squared. It has dimensionality $p \\times p$.\n",
"\n",
- "This means, using the orthogonality of $\\boldsymbol{V}$, that we get"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "$$\n",
- "\\boldsymbol{X}^T\\boldsymbol{X}=\\tilde{\\boldsymbol{\\Sigma}}^2.\n",
- "$$"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
"We can now insert the result for the matrix $\\boldsymbol{X}^T\\boldsymbol{X}$ into our equation for ordinary least squares where"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "18839f7b",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\tilde{y}_{\\mathrm{OLS}}=\\boldsymbol{X}\\left(\\boldsymbol{X}^T\\boldsymbol{X}\\right)^{-1}\\boldsymbol{X}^T\\boldsymbol{y},\n",
@@ -979,30 +1182,42 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "b743da67",
+ "metadata": {
+ "editable": true
+ },
"source": [
"and using our SVD decomposition of $\\boldsymbol{X}$ we have"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "b91982c5",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
- "\\tilde{y}_{\\mathrm{OLS}}=\\boldsymbol{U}\\boldsymbol{\\Sigma}\\boldsymbol{V}^T\\tilde{\\boldsymbol{\\Sigma}}^{-2}\\boldsymbol{V}\\boldsymbol{\\Sigma}^T\\boldsymbol{U}^T\\boldsymbol{y},\n",
+ "\\tilde{y}_{\\mathrm{OLS}}=\\boldsymbol{U}\\boldsymbol{\\Sigma}\\boldsymbol{V}^T\\left(\\boldsymbol{V}\\tilde{\\boldsymbol{\\Sigma}}^{2}(\\boldsymbol{V}^T\\right)^{-1}\\boldsymbol{V}\\boldsymbol{\\Sigma}^T\\boldsymbol{U}^T\\boldsymbol{y},\n",
"$$"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "310034bb",
+ "metadata": {
+ "editable": true
+ },
"source": [
- "which gives us, using the orthogonality of the matrices $\\boldsymbol{U}$ and $\\boldsymbol{V}$,"
+ "which gives us, using the orthogonality of the matrices $\\boldsymbol{U}$ and $\\boldsymbol{V}$,,"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "efadf88e",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\tilde{y}_{\\mathrm{OLS}}=\\boldsymbol{U}\\boldsymbol{U}^T\\boldsymbol{y}=\\sum_{i=0}^{p-1}\\boldsymbol{u}_i\\boldsymbol{u}^T_j\\boldsymbol{y},\n",
@@ -1011,14 +1226,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "293eece5",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Note here that when we perform the multiplication of the various matrices, the orthogonal vectors of the matrix $\\boldsymbol{U}$"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "66ead26c",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{U}=[\\boldsymbol{u}_0,\\boldsymbol{u}_1,\\dots,\\boldsymbol{u}_{n-1}],\n",
@@ -1027,13 +1248,23 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "67b71310",
+ "metadata": {
+ "editable": true
+ },
"source": [
"that belong to $i>p-1$, result in only zeros when we perform the multiplications. This means that the sum above has non-zero elements only up to $i=p-1$. This corresponds also to the number of singular values (these are all non-zero).\n",
"\n",
- "It means that the ordinary least square model (with the optimal parameters) $\\boldsymbol{\\tilde{y}}$, corresponds to an orthogonal transformation of the output (or target) vector $\\boldsymbol{y}$ by the vectors of the matrix $\\boldsymbol{U}$.\n",
- "\n",
- "\n",
+ "It means that the ordinary least square model (with the optimal parameters) $\\boldsymbol{\\tilde{y}}$, corresponds to an orthogonal transformation of the output (or target) vector $\\boldsymbol{y}$ by the vectors of the matrix $\\boldsymbol{U}$."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "fa804884",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
"## Further properties (important for our analyses later)\n",
"\n",
"Let us study again $\\boldsymbol{X}^T\\boldsymbol{X}$ in terms of our SVD,"
@@ -1041,7 +1272,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "ac661f44",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X}^T\\boldsymbol{X}=\\boldsymbol{V}\\boldsymbol{\\Sigma}^T\\boldsymbol{U}^T\\boldsymbol{U}\\boldsymbol{\\Sigma}\\boldsymbol{V}^T=\\boldsymbol{V}\\boldsymbol{\\Sigma}^T\\boldsymbol{\\Sigma}\\boldsymbol{V}^T.\n",
@@ -1050,14 +1284,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "1d195b3c",
+ "metadata": {
+ "editable": true
+ },
"source": [
"If we now multiply from the right with $\\boldsymbol{V}$ (using the orthogonality of $\\boldsymbol{V}$) we get"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "38865678",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\left(\\boldsymbol{X}^T\\boldsymbol{X}\\right)\\boldsymbol{V}=\\boldsymbol{V}\\boldsymbol{\\Sigma}^T\\boldsymbol{\\Sigma}.\n",
@@ -1066,7 +1306,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "07a7126d",
+ "metadata": {
+ "editable": true
+ },
"source": [
"This means the vectors $\\boldsymbol{v}_i$ of the orthogonal matrix $\\boldsymbol{V}$ are the eigenvectors of the matrix $\\boldsymbol{X}^T\\boldsymbol{X}$\n",
"with eigenvalues given by the singular values squared, that is"
@@ -1074,7 +1317,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "1375bb2d",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\left(\\boldsymbol{X}^T\\boldsymbol{X}\\right)\\boldsymbol{v}_i=\\boldsymbol{v}_i\\sigma_i^2.\n",
@@ -1083,14 +1329,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "6b32590d",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Similarly, if we use the SVD decomposition for the matrix $\\boldsymbol{X}\\boldsymbol{X}^T$, we have"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "0bfefb07",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X}\\boldsymbol{X}^T=\\boldsymbol{U}\\boldsymbol{\\Sigma}\\boldsymbol{V}^T\\boldsymbol{V}\\boldsymbol{\\Sigma}^T\\boldsymbol{U}^T=\\boldsymbol{U}\\boldsymbol{\\Sigma}\\boldsymbol{\\Sigma}^T\\boldsymbol{U}^T.\n",
@@ -1099,14 +1351,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "c9a62b75",
+ "metadata": {
+ "editable": true
+ },
"source": [
"If we now multiply from the right with $\\boldsymbol{U}$ (using the orthogonality of $\\boldsymbol{U}$) we get"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "c591bfc0",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\left(\\boldsymbol{X}\\boldsymbol{X}^T\\right)\\boldsymbol{U}=\\boldsymbol{U}\\boldsymbol{\\Sigma}\\boldsymbol{\\Sigma}^T.\n",
@@ -1115,7 +1373,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "d7fa31d3",
+ "metadata": {
+ "editable": true
+ },
"source": [
"This means the vectors $\\boldsymbol{u}_i$ of the orthogonal matrix $\\boldsymbol{U}$ are the eigenvectors of the matrix $\\boldsymbol{X}\\boldsymbol{X}^T$\n",
"with eigenvalues given by the singular values squared, that is"
@@ -1123,7 +1384,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "d132cee3",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\left(\\boldsymbol{X}\\boldsymbol{X}^T\\right)\\boldsymbol{u}_i=\\boldsymbol{u}_i\\sigma_i^2.\n",
@@ -1132,7 +1396,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "7aa7f89c",
+ "metadata": {
+ "editable": true
+ },
"source": [
"**Important note**: we have defined our design matrix $\\boldsymbol{X}$ to be an\n",
"$n\\times p$ matrix. In most supervised learning cases we have that $n\n",
@@ -1142,12 +1409,18 @@
"always refer to the number of features in our data set, while the\n",
"number of rows represents the number of data inputs. Note that in\n",
"other texts you may find the opposite notation. This has consequences\n",
- "for the definition of for example the covariance matrix and its relation to the SVD.\n",
- "\n",
- "\n",
+ "for the definition of for example the covariance matrix and its relation to the SVD."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "8e546bb5",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
"## Meet the Covariance Matrix\n",
"\n",
- "\n",
"Before we move on to a discussion of Ridge and Lasso regression, we want to show an important example of the above.\n",
"\n",
"We have already noted that the matrix $\\boldsymbol{X}^T\\boldsymbol{X}$ in ordinary\n",
@@ -1157,7 +1430,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "96d8b53c",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\frac{\\partial^2 C(\\boldsymbol{\\beta})}{\\partial \\boldsymbol{\\beta}^T\\partial \\boldsymbol{\\beta}} =\\frac{2}{n}\\boldsymbol{X}^T\\boldsymbol{X}.\n",
@@ -1166,7 +1442,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "c7e05a9b",
+ "metadata": {
+ "editable": true
+ },
"source": [
"This quantity defines was what is called the Hessian matrix (the second derivative of a function we want to optimize).\n",
"\n",
@@ -1175,7 +1454,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "55fd14e4",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{H}=\\boldsymbol{X}^T\\boldsymbol{X}.\n",
@@ -1184,15 +1466,16 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "09320523",
+ "metadata": {
+ "editable": true
+ },
"source": [
"The Hessian matrix for ordinary least squares is also proportional to\n",
"the covariance matrix. This means also that we can use the SVD to find\n",
"the eigenvalues of the covariance matrix and the Hessian matrix in\n",
"terms of the singular values. Let us develop these arguments, as they will play an important role in our machine learning studies.\n",
"\n",
- "\n",
- "\n",
"Before we discuss the link between for example Ridge regression and the singular value decomposition, we need to remind ourselves about\n",
"the definition of the covariance and the correlation function. These are quantities that play a central role in machine learning methods.\n",
"\n",
@@ -1202,7 +1485,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "23b5cf2d",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{C}[\\boldsymbol{x},\\boldsymbol{y}] = \\begin{bmatrix} \\mathrm{cov}[\\boldsymbol{x},\\boldsymbol{x}] & \\mathrm{cov}[\\boldsymbol{x},\\boldsymbol{y}] \\\\\n",
@@ -1213,14 +1499,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "136c43bc",
+ "metadata": {
+ "editable": true
+ },
"source": [
"where for example"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "b52fc8e3",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\mathrm{cov}[\\boldsymbol{x},\\boldsymbol{y}] =\\frac{1}{n} \\sum_{i=0}^{n-1}(x_i- \\overline{x})(y_i- \\overline{y}).\n",
@@ -1229,14 +1521,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "fe153c88",
+ "metadata": {
+ "editable": true
+ },
"source": [
"With this definition and recalling that the variance is defined as"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "ea57dd81",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\mathrm{var}[\\boldsymbol{x}]=\\frac{1}{n} \\sum_{i=0}^{n-1}(x_i- \\overline{x})^2,\n",
@@ -1245,14 +1543,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "f8154bc8",
+ "metadata": {
+ "editable": true
+ },
"source": [
"we can rewrite the covariance matrix as"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "081adf91",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{C}[\\boldsymbol{x},\\boldsymbol{y}] = \\begin{bmatrix} \\mathrm{var}[\\boldsymbol{x}] & \\mathrm{cov}[\\boldsymbol{x},\\boldsymbol{y}] \\\\\n",
@@ -1263,7 +1567,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "d61424f0",
+ "metadata": {
+ "editable": true
+ },
"source": [
"**Note:** we have used $1/n$ in the above definitions of the *sample* variance and covariance. We assume then that we can calculate the exact mean value. \n",
"What you will find in essentially all statistics texts are equations\n",
@@ -1274,7 +1581,6 @@
"**Scikit-Learn** or **nunmpy's** function calculate the covariance, this\n",
"quantity will be computed with a factor $1/(n-1)$.\n",
"\n",
- "\n",
"The covariance takes values between zero and infinity and may thus\n",
"lead to problems with loss of numerical precision for particularly\n",
"large values. It is common to scale the covariance matrix by\n",
@@ -1284,7 +1590,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "1f517794",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\mathrm{corr}[\\boldsymbol{x},\\boldsymbol{y}]=\\frac{\\mathrm{cov}[\\boldsymbol{x},\\boldsymbol{y}]}{\\sqrt{\\mathrm{var}[\\boldsymbol{x}] \\mathrm{var}[\\boldsymbol{y}]}}.\n",
@@ -1293,7 +1602,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "27c43f34",
+ "metadata": {
+ "editable": true
+ },
"source": [
"The correlation function is then given by values $\\mathrm{corr}[\\boldsymbol{x},\\boldsymbol{y}]\n",
"\\in [-1,1]$. This avoids eventual problems with too large values. We\n",
@@ -1303,7 +1615,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "35ac64e2",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{K}[\\boldsymbol{x},\\boldsymbol{y}] = \\begin{bmatrix} 1 & \\mathrm{corr}[\\boldsymbol{x},\\boldsymbol{y}] \\\\\n",
@@ -1314,19 +1629,23 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "7ec11e59",
+ "metadata": {
+ "editable": true
+ },
"source": [
"In the above example this is the function we constructed using **pandas**.\n",
"\n",
- "\n",
- "\n",
"In our derivation of the various regression algorithms like **Ordinary Least Squares** or **Ridge regression**\n",
"we defined the design/feature matrix $\\boldsymbol{X}$ as"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "8d1a1a24",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X}=\\begin{bmatrix}\n",
@@ -1342,7 +1661,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "b12f1560",
+ "metadata": {
+ "editable": true
+ },
"source": [
"with $\\boldsymbol{X}\\in {\\mathbb{R}}^{n\\times p}$, with the predictors/features $p$ refering to the column numbers and the\n",
"entries $n$ being the row elements.\n",
@@ -1351,7 +1673,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "7975e5ec",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X}=\\begin{bmatrix} \\boldsymbol{x}_0 & \\boldsymbol{x}_1 & \\boldsymbol{x}_2 & \\dots & \\dots & \\boldsymbol{x}_{p-1}\\end{bmatrix},\n",
@@ -1360,14 +1685,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "4628dae3",
+ "metadata": {
+ "editable": true
+ },
"source": [
"with a given vector"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "6acd55ed",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{x}_i^T = \\begin{bmatrix}x_{0,i} & x_{1,i} & x_{2,i}& \\dots & \\dots x_{n-1,i}\\end{bmatrix}.\n",
@@ -1376,7 +1707,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "15268d5e",
+ "metadata": {
+ "editable": true
+ },
"source": [
"With these definitions, we can now rewrite our $2\\times 2$\n",
"correlation/covariance matrix in terms of a moe general design/feature\n",
@@ -1386,7 +1720,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "f7cc7e46",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{C}[\\boldsymbol{x}] = \\begin{bmatrix}\n",
@@ -1402,14 +1739,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "91f506bb",
+ "metadata": {
+ "editable": true
+ },
"source": [
"and the correlation matrix"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "3f65d15d",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{K}[\\boldsymbol{x}] = \\begin{bmatrix}\n",
@@ -1425,7 +1768,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "4dda44f3",
+ "metadata": {
+ "editable": true
+ },
"source": [
"The Numpy function **np.cov** calculates the covariance elements using\n",
"the factor $1/(n-1)$ instead of $1/n$ since it assumes we do not have\n",
@@ -1438,7 +1784,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "3a6e7b9b",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{W} = \\begin{bmatrix} x_0 & x_1 & x_2 & \\dots & x_{n-2} & x_{n-1} \\\\\n",
@@ -1449,7 +1798,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "d907b263",
+ "metadata": {
+ "editable": true
+ },
"source": [
"which in turn is converted into into the $2\\times 2$ covariance matrix\n",
"$\\boldsymbol{C}$ via the Numpy function **np.cov()**. We note that we can also calculate\n",
@@ -1461,6 +1813,7 @@
{
"cell_type": "code",
"execution_count": 5,
+ "id": "8dbb102f",
"metadata": {
"collapsed": false,
"editable": true
@@ -1470,10 +1823,10 @@
"name": "stdout",
"output_type": "stream",
"text": [
- "-0.13876586436927824\n",
- "3.722047011333792\n",
- "[[ 1.233528 3.58428804]\n",
- " [ 3.58428804 11.47942814]]\n"
+ "-0.01591355407242949\n",
+ "3.6808538439837775\n",
+ "[[ 0.96390357 2.99157584]\n",
+ " [ 2.99157584 10.31120247]]\n"
]
}
],
@@ -1492,7 +1845,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "25852e86",
+ "metadata": {
+ "editable": true
+ },
"source": [
"The previous example can be converted into the correlation matrix by\n",
"simply scaling the matrix elements with the variances. We should also\n",
@@ -1504,6 +1860,7 @@
{
"cell_type": "code",
"execution_count": 6,
+ "id": "cb3ee7b6",
"metadata": {
"collapsed": false,
"editable": true
@@ -1513,10 +1870,10 @@
"name": "stdout",
"output_type": "stream",
"text": [
- "0.08464758160254343\n",
- "1.8503720991789538\n",
- "[[1. 0.65626043]\n",
- " [0.65626043 1. ]]\n"
+ "0.08612280083325631\n",
+ "1.6149274949460215\n",
+ "[[1. 0.66934291]\n",
+ " [0.66934291 1. ]]\n"
]
}
],
@@ -1546,7 +1903,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "6f2860ea",
+ "metadata": {
+ "editable": true
+ },
"source": [
"We see that the matrix elements along the diagonal are one as they\n",
"should be and that the matrix is symmetric. Furthermore, diagonalizing\n",
@@ -1554,14 +1914,13 @@
"\n",
"The above procedure with **numpy** can be made more compact if we use **pandas**.\n",
"\n",
- "\n",
- "\n",
"We whow here how we can set up the correlation matrix using **pandas**, as done in this simple code"
]
},
{
"cell_type": "code",
"execution_count": 7,
+ "id": "48781620",
"metadata": {
"collapsed": false,
"editable": true
@@ -1571,30 +1930,30 @@
"name": "stdout",
"output_type": "stream",
"text": [
- "[[-1.41876267 -4.93248252]\n",
- " [ 1.83687444 5.28097861]\n",
- " [ 0.37429133 0.59766 ]\n",
- " [ 0.59159438 1.71869727]\n",
- " [-0.80315282 -0.89348922]\n",
- " [-0.38748219 -2.12288563]\n",
- " [-2.08917679 -5.64933923]\n",
- " [ 0.27803645 0.89944994]\n",
- " [ 1.23703839 3.2321528 ]\n",
- " [ 0.38073947 1.86925797]]\n",
+ "[[-1.04649105 -2.92658312]\n",
+ " [ 0.45985488 1.43876695]\n",
+ " [-0.41081513 -1.96426825]\n",
+ " [ 1.75703965 4.88736621]\n",
+ " [ 1.02698605 3.59304008]\n",
+ " [-0.71348713 -1.98249059]\n",
+ " [-0.22685646 0.37866422]\n",
+ " [-0.90559087 -1.31597731]\n",
+ " [-0.60349429 -3.47245463]\n",
+ " [ 0.66285434 1.36393643]]\n",
" 0 1\n",
- "0 -1.418763 -4.932483\n",
- "1 1.836874 5.280979\n",
- "2 0.374291 0.597660\n",
- "3 0.591594 1.718697\n",
- "4 -0.803153 -0.893489\n",
- "5 -0.387482 -2.122886\n",
- "6 -2.089177 -5.649339\n",
- "7 0.278036 0.899450\n",
- "8 1.237038 3.232153\n",
- "9 0.380739 1.869258\n",
+ "0 -1.046491 -2.926583\n",
+ "1 0.459855 1.438767\n",
+ "2 -0.410815 -1.964268\n",
+ "3 1.757040 4.887366\n",
+ "4 1.026986 3.593040\n",
+ "5 -0.713487 -1.982491\n",
+ "6 -0.226856 0.378664\n",
+ "7 -0.905591 -1.315977\n",
+ "8 -0.603494 -3.472455\n",
+ "9 0.662854 1.363936\n",
" 0 1\n",
- "0 1.000000 0.977418\n",
- "1 0.977418 1.000000\n"
+ "0 1.000000 0.948641\n",
+ "1 0.948641 1.000000\n"
]
}
],
@@ -1617,7 +1976,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "4ccdedad",
+ "metadata": {
+ "editable": true
+ },
"source": [
"We expand this model to the Franke function discussed earlier."
]
@@ -1625,6 +1987,7 @@
{
"cell_type": "code",
"execution_count": 8,
+ "id": "e4090257",
"metadata": {
"collapsed": false,
"editable": true
@@ -1636,37 +1999,37 @@
"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.081253 0.083015 0.080297 0.079157 0.078040 0.071112 0.069847 \n",
- "2 0.0 0.083015 0.086807 0.084909 0.084904 0.084702 0.076955 0.076338 \n",
- "3 0.0 0.080297 0.084909 0.084414 0.084862 0.085018 0.077793 0.077402 \n",
- "4 0.0 0.079157 0.084904 0.084862 0.086076 0.086872 0.079281 0.079383 \n",
- "5 0.0 0.078040 0.084702 0.085018 0.086872 0.088212 0.080319 0.080847 \n",
- "6 0.0 0.071112 0.076955 0.077793 0.079281 0.080319 0.073719 0.074034 \n",
- "7 0.0 0.069847 0.076338 0.077402 0.079383 0.080847 0.074034 0.074693 \n",
- "8 0.0 0.068735 0.075760 0.077003 0.079405 0.081233 0.074237 0.075195 \n",
- "9 0.0 0.067769 0.075241 0.076628 0.079389 0.081533 0.074375 0.075594 \n",
- "10 0.0 0.062136 0.068318 0.069888 0.071921 0.073449 0.067622 0.068376 \n",
- "11 0.0 0.061149 0.067723 0.069408 0.071767 0.073583 0.067612 0.068608 \n",
- "12 0.0 0.060309 0.067213 0.068991 0.071632 0.073699 0.067599 0.068806 \n",
- "13 0.0 0.059601 0.066789 0.068642 0.071529 0.073816 0.067597 0.068992 \n",
- "14 0.0 0.059013 0.066449 0.068363 0.071467 0.073949 0.067620 0.069181 \n",
+ "1 0.0 0.084846 0.071547 0.086679 0.078725 0.071480 0.079609 0.073320 \n",
+ "2 0.0 0.071547 0.061716 0.073647 0.067908 0.062640 0.068417 0.063857 \n",
+ "3 0.0 0.086679 0.073647 0.094619 0.086262 0.078697 0.090356 0.083579 \n",
+ "4 0.0 0.078725 0.067908 0.086262 0.079483 0.073303 0.082874 0.077375 \n",
+ "5 0.0 0.071480 0.062640 0.078697 0.073303 0.068345 0.076121 0.071741 \n",
+ "6 0.0 0.079609 0.068417 0.090356 0.082874 0.076121 0.088460 0.082267 \n",
+ "7 0.0 0.073320 0.063857 0.083579 0.077375 0.071741 0.082267 0.077131 \n",
+ "8 0.0 0.067787 0.059824 0.077620 0.072521 0.067856 0.076821 0.072597 \n",
+ "9 0.0 0.062888 0.056235 0.072352 0.068210 0.064388 0.072008 0.068573 \n",
+ "10 0.0 0.071906 0.062551 0.083694 0.077291 0.071515 0.083361 0.077978 \n",
+ "11 0.0 0.066654 0.058715 0.077948 0.072611 0.067767 0.078042 0.073548 \n",
+ "12 0.0 0.062061 0.055344 0.072918 0.068500 0.064461 0.073380 0.069654 \n",
+ "13 0.0 0.058033 0.052372 0.068505 0.064880 0.061538 0.069285 0.066223 \n",
+ "14 0.0 0.054491 0.049747 0.064623 0.061685 0.058948 0.065680 0.063192 \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.068735 0.067769 0.062136 0.061149 0.060309 0.059601 0.059013 \n",
- "2 0.075760 0.075241 0.068318 0.067723 0.067213 0.066789 0.066449 \n",
- "3 0.077003 0.076628 0.069888 0.069408 0.068991 0.068642 0.068363 \n",
- "4 0.079405 0.079389 0.071921 0.071767 0.071632 0.071529 0.071467 \n",
- "5 0.081233 0.081533 0.073449 0.073583 0.073699 0.073816 0.073949 \n",
- "6 0.074237 0.074375 0.067622 0.067612 0.067599 0.067597 0.067620 \n",
- "7 0.075195 0.075594 0.068376 0.068608 0.068806 0.068992 0.069181 \n",
- "8 0.075959 0.076589 0.068965 0.069409 0.069796 0.070150 0.070491 \n",
- "9 0.076589 0.077425 0.069441 0.070074 0.070630 0.071136 0.071614 \n",
- "10 0.068965 0.069441 0.063052 0.063364 0.063631 0.063874 0.064110 \n",
- "11 0.069409 0.070074 0.063364 0.063851 0.064274 0.064658 0.065020 \n",
- "12 0.069796 0.070630 0.063631 0.064274 0.064838 0.065348 0.065826 \n",
- "13 0.070150 0.071136 0.063874 0.064658 0.065348 0.065974 0.066558 \n",
- "14 0.070491 0.071614 0.064110 0.065020 0.065826 0.066558 0.067240 \n"
+ "1 0.067787 0.062888 0.071906 0.066654 0.062061 0.058033 0.054491 \n",
+ "2 0.059824 0.056235 0.062551 0.058715 0.055344 0.052372 0.049747 \n",
+ "3 0.077620 0.072352 0.083694 0.077948 0.072918 0.068505 0.064623 \n",
+ "4 0.072521 0.068210 0.077291 0.072611 0.068500 0.064880 0.061685 \n",
+ "5 0.067856 0.064388 0.071515 0.067767 0.064461 0.061538 0.058948 \n",
+ "6 0.076821 0.072008 0.083361 0.078042 0.073380 0.069285 0.065680 \n",
+ "7 0.072597 0.068573 0.077978 0.073548 0.069654 0.066223 0.063192 \n",
+ "8 0.068852 0.065514 0.073238 0.069578 0.066348 0.063493 0.060963 \n",
+ "9 0.065514 0.062773 0.069044 0.066051 0.063401 0.061048 0.058955 \n",
+ "10 0.073238 0.069044 0.079558 0.074881 0.070775 0.067162 0.063977 \n",
+ "11 0.069578 0.066051 0.074881 0.070959 0.067506 0.064459 0.061765 \n",
+ "12 0.066348 0.063401 0.070775 0.067506 0.064618 0.062062 0.059795 \n",
+ "13 0.063493 0.061048 0.067162 0.064459 0.062062 0.059933 0.058038 \n",
+ "14 0.060963 0.058955 0.063977 0.061765 0.059795 0.058038 0.056468 \n"
]
}
],
@@ -1718,7 +2081,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "6547bf2f",
+ "metadata": {
+ "editable": true
+ },
"source": [
"We note here that the covariance is zero for the first rows and\n",
"columns since all matrix elements in the design matrix were set to one\n",
@@ -1729,14 +2095,15 @@
"drop these elements and construct a correlation\n",
"matrix without these elements. \n",
"\n",
- "\n",
- "\n",
"We can rewrite the covariance matrix in a more compact form in terms of the design/feature matrix $\\boldsymbol{X}$ as"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "4e26eab7",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{C}[\\boldsymbol{x}] = \\frac{1}{n}\\boldsymbol{X}^T\\boldsymbol{X}= \\mathbb{E}[\\boldsymbol{X}^T\\boldsymbol{X}].\n",
@@ -1745,14 +2112,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "7f6a0df9",
+ "metadata": {
+ "editable": true
+ },
"source": [
"To see this let us simply look at a design matrix $\\boldsymbol{X}\\in {\\mathbb{R}}^{2\\times 2}$"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "5ff73ba2",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X}=\\begin{bmatrix}\n",
@@ -1766,14 +2139,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "ae6e2e42",
+ "metadata": {
+ "editable": true
+ },
"source": [
"If we then compute the expectation value (note the $1/n$ factor instead of $1/(n-1)$)"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "87a8dccc",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\mathbb{E}[\\boldsymbol{X}^T\\boldsymbol{X}] = \\frac{1}{n}\\boldsymbol{X}^T\\boldsymbol{X}=\\frac{1}{n}\\begin{bmatrix}\n",
@@ -1785,14 +2164,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "1db8e000",
+ "metadata": {
+ "editable": true
+ },
"source": [
"which is just"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "59e0c46d",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{C}[\\boldsymbol{x}_0,\\boldsymbol{x}_1] = \\boldsymbol{C}[\\boldsymbol{x}]=\\begin{bmatrix} \\mathrm{var}[\\boldsymbol{x}_0] & \\mathrm{cov}[\\boldsymbol{x}_0,\\boldsymbol{x}_1] \\\\\n",
@@ -1803,14 +2188,25 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "ce39f8d0",
+ "metadata": {
+ "editable": true
+ },
"source": [
- "where we wrote $$\\boldsymbol{C}[\\boldsymbol{x}_0,\\boldsymbol{x}_1] = \\boldsymbol{C}[\\boldsymbol{x}]$$ to indicate that this is the covariance of the vectors $\\boldsymbol{x}$ of the design/feature matrix $\\boldsymbol{X}$.\n",
- "\n",
- "It is easy to generalize this to a matrix $\\boldsymbol{X}\\in {\\mathbb{R}}^{n\\times p}$.\n",
- "\n",
- "\n",
+ "where we wrote $\\boldsymbol{C}[\\boldsymbol{x}_0,\\boldsymbol{x}_1]=\\boldsymbol{C}[\\boldsymbol{x}]$ to indicate\n",
+ "that this is the covariance of the vectors $\\boldsymbol{x}$ of the\n",
+ "design/feature matrix $\\boldsymbol{X}$.\n",
"\n",
+ "It is easy to generalize this to a matrix $\\boldsymbol{X}\\in {\\mathbb{R}}^{n\\times p}$."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "526f22b3",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
"## Linking with the SVD\n",
"\n",
"We saw earlier that"
@@ -1818,7 +2214,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "5d16d7c8",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X}^T\\boldsymbol{X}=\\boldsymbol{V}\\boldsymbol{\\Sigma}^T\\boldsymbol{U}^T\\boldsymbol{U}\\boldsymbol{\\Sigma}\\boldsymbol{V}^T=\\boldsymbol{V}\\boldsymbol{\\Sigma}^T\\boldsymbol{\\Sigma}\\boldsymbol{V}^T.\n",
@@ -1827,14 +2226,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "11a74368",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Since the matrices here have dimension $p\\times p$, with $p$ corresponding to the singular values, we defined earlier the matrix"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "0ca3614f",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{\\Sigma}^T\\boldsymbol{\\Sigma} = \\begin{bmatrix} \\tilde{\\boldsymbol{\\Sigma}} & \\boldsymbol{0}\\\\ \\end{bmatrix}\\begin{bmatrix} \\tilde{\\boldsymbol{\\Sigma}} \\\\ \\boldsymbol{0}\\\\ \\end{bmatrix},\n",
@@ -1843,14 +2248,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "b98abb6c",
+ "metadata": {
+ "editable": true
+ },
"source": [
"where the tilde-matrix $\\tilde{\\boldsymbol{\\Sigma}}$ is a matrix of dimension $p\\times p$ containing only the singular values $\\sigma_i$, that is"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "813567cc",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\tilde{\\boldsymbol{\\Sigma}}=\\begin{bmatrix} \\sigma_0 & 0 & 0 & \\dots & 0 & 0 \\\\\n",
@@ -1864,14 +2275,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "ed905c7b",
+ "metadata": {
+ "editable": true
+ },
"source": [
"meaning we can write"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "0136bdac",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X}^T\\boldsymbol{X}=\\boldsymbol{V}\\tilde{\\boldsymbol{\\Sigma}}^2\\boldsymbol{V}^T.\n",
@@ -1880,14 +2297,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "d43e6609",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Multiplying from the right with $\\boldsymbol{V}$ (using the orthogonality of $\\boldsymbol{V}$) we get"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "15d2bb49",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\left(\\boldsymbol{X}^T\\boldsymbol{X}\\right)\\boldsymbol{V}=\\boldsymbol{V}\\tilde{\\boldsymbol{\\Sigma}}^2.\n",
@@ -1896,7 +2319,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "374104f4",
+ "metadata": {
+ "editable": true
+ },
"source": [
"This means the vectors $\\boldsymbol{v}_i$ of the orthogonal matrix $\\boldsymbol{V}$\n",
"are the eigenvectors of the matrix $\\boldsymbol{X}^T\\boldsymbol{X}$ with eigenvalues\n",
@@ -1905,7 +2331,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "86f4db59",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\left(\\boldsymbol{X}^T\\boldsymbol{X}\\right)\\boldsymbol{v}_i=\\boldsymbol{v}_i\\sigma_i^2.\n",
@@ -1914,7 +2343,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "9d007f11",
+ "metadata": {
+ "editable": true
+ },
"source": [
"In other words, each non-zero singular value of $\\boldsymbol{X}$ is a positive\n",
"square root of an eigenvalue of $\\boldsymbol{X}^T\\boldsymbol{X}$. It means also that\n",
@@ -1924,7 +2356,6 @@
"$\\boldsymbol{v}_i$ are hierarchically ordered by how much correlation they\n",
"encode from the columns of $\\boldsymbol{X}$. \n",
"\n",
- "\n",
"Note that these are also the eigenvectors and eigenvalues of the\n",
"Hessian matrix.\n",
"\n",
@@ -1934,7 +2365,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "03c93eed",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{C}[\\boldsymbol{X}]=\\frac{1}{n}\\boldsymbol{X}^T\\boldsymbol{X},\n",
@@ -1943,7 +2377,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "3ee37fac",
+ "metadata": {
+ "editable": true
+ },
"source": [
"meaning that every squared non-singular value of $\\boldsymbol{X}$ divided by $n$ (\n",
"the number of samples) are the eigenvalues of the covariance\n",
@@ -1952,13 +2389,15 @@
"self-adjoint, the singular values of $\\boldsymbol{X}$ are equal to the\n",
"absolute value of the eigenvalues of $\\boldsymbol{X}$.\n",
"\n",
- "\n",
"For $\\boldsymbol{X}\\boldsymbol{X}^T$ we found"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "13290881",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X}\\boldsymbol{X}^T=\\boldsymbol{U}\\boldsymbol{\\Sigma}\\boldsymbol{V}^T\\boldsymbol{V}\\boldsymbol{\\Sigma}^T\\boldsymbol{U}^T=\\boldsymbol{U}\\boldsymbol{\\Sigma}^T\\boldsymbol{\\Sigma}\\boldsymbol{U}^T.\n",
@@ -1967,14 +2406,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "3896b3e6",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Since the matrices here have dimension $n\\times n$, we have"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "ca47bd66",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{\\Sigma}\\boldsymbol{\\Sigma}^T = \\begin{bmatrix} \\tilde{\\boldsymbol{\\Sigma}} \\\\ \\boldsymbol{0}\\\\ \\end{bmatrix}\\begin{bmatrix} \\tilde{\\boldsymbol{\\Sigma}} \\boldsymbol{0}\\\\ \\end{bmatrix}=\\begin{bmatrix} \\tilde{\\boldsymbol{\\Sigma}} & \\boldsymbol{0} \\\\ \\boldsymbol{0} & \\boldsymbol{0}\\\\ \\end{bmatrix},\n",
@@ -1983,14 +2428,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "1513e1d0",
+ "metadata": {
+ "editable": true
+ },
"source": [
"leading to"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "4b9bf25a",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X}\\boldsymbol{X}^T=\\boldsymbol{U}\\begin{bmatrix} \\tilde{\\boldsymbol{\\Sigma}} & \\boldsymbol{0} \\\\ \\boldsymbol{0} & \\boldsymbol{0}\\\\ \\end{bmatrix}\\boldsymbol{U}^T.\n",
@@ -1999,14 +2450,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "2eeb03c8",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Multiplying with $\\boldsymbol{U}$ from the right gives us the eigenvalue problem"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "da278d8e",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"(\\boldsymbol{X}\\boldsymbol{X}^T)\\boldsymbol{U}=\\boldsymbol{U}\\begin{bmatrix} \\tilde{\\boldsymbol{\\Sigma}} & \\boldsymbol{0} \\\\ \\boldsymbol{0} & \\boldsymbol{0}\\\\ \\end{bmatrix}.\n",
@@ -2015,7 +2472,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "2b341903",
+ "metadata": {
+ "editable": true
+ },
"source": [
"It means that the eigenvalues of $\\boldsymbol{X}\\boldsymbol{X}^T$ are again given by\n",
"the non-zero singular values plus now a series of zeros. The column\n",
@@ -2024,11 +2484,16 @@
"\n",
"Since we will mainly be interested in the correlations among the features\n",
"of our data (the columns of $\\boldsymbol{X}$, the quantity of interest for us are the non-zero singular\n",
- "values and the column vectors of $\\boldsymbol{V}$.\n",
- "\n",
- "\n",
- "\n",
- "\n",
+ "values and the column vectors of $\\boldsymbol{V}$."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "e66723d1",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
"## Ridge and Lasso Regression\n",
"\n",
"Let us remind ourselves about the expression for the standard Mean Squared Error (MSE) which we used to define our cost function and the equations for the ordinary least squares (OLS) method, that is \n",
@@ -2037,7 +2502,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "85cff01a",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"{\\displaystyle \\min_{\\boldsymbol{\\beta}\\in {\\mathbb{R}}^{p}}}\\frac{1}{n}\\left\\{\\left(\\boldsymbol{y}-\\boldsymbol{X}\\boldsymbol{\\beta}\\right)^T\\left(\\boldsymbol{y}-\\boldsymbol{X}\\boldsymbol{\\beta}\\right)\\right\\}.\n",
@@ -2046,14 +2514,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "c3bdf4f5",
+ "metadata": {
+ "editable": true
+ },
"source": [
"or we can state it as"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "1306ed38",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"{\\displaystyle \\min_{\\boldsymbol{\\beta}\\in\n",
@@ -2063,14 +2537,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "00474af5",
+ "metadata": {
+ "editable": true
+ },
"source": [
"where we have used the definition of a norm-2 vector, that is"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "346ae1ad",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\vert\\vert \\boldsymbol{x}\\vert\\vert_2 = \\sqrt{\\sum_i x_i^2}.\n",
@@ -2079,7 +2559,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "36f83c2a",
+ "metadata": {
+ "editable": true
+ },
"source": [
"By minimizing the above equation with respect to the parameters\n",
"$\\boldsymbol{\\beta}$ we could then obtain an analytical expression for the\n",
@@ -2089,7 +2572,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "eb246827",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"{\\displaystyle \\min_{\\boldsymbol{\\beta}\\in\n",
@@ -2099,7 +2585,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "d38c34b0",
+ "metadata": {
+ "editable": true
+ },
"source": [
"which leads to the Ridge regression minimization problem where we\n",
"require that $\\vert\\vert \\boldsymbol{\\beta}\\vert\\vert_2^2\\le t$, where $t$ is\n",
@@ -2108,7 +2597,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "e3f2141f",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"C(\\boldsymbol{X},\\boldsymbol{\\beta})=\\frac{1}{n}\\vert\\vert \\boldsymbol{y}-\\boldsymbol{X}\\boldsymbol{\\beta}\\vert\\vert_2^2+\\lambda\\vert\\vert \\boldsymbol{\\beta}\\vert\\vert_1,\n",
@@ -2117,14 +2609,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "74f56599",
+ "metadata": {
+ "editable": true
+ },
"source": [
"we have a new optimization equation"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "ea246d4b",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"{\\displaystyle \\min_{\\boldsymbol{\\beta}\\in\n",
@@ -2134,7 +2632,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "c6b1faa8",
+ "metadata": {
+ "editable": true
+ },
"source": [
"which leads to Lasso regression. Lasso stands for least absolute shrinkage and selection operator. \n",
"\n",
@@ -2143,7 +2644,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "7b2fc09f",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\vert\\vert \\boldsymbol{x}\\vert\\vert_1 = \\sum_i \\vert x_i\\vert.\n",
@@ -2152,14 +2656,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "a9f2c69a",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Using the matrix-vector expression for Ridge regression and dropping the parameter $1/n$ in front of the standard means squared error equation, we have"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "2fb35c59",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"C(\\boldsymbol{X},\\boldsymbol{\\beta})=\\left\\{(\\boldsymbol{y}-\\boldsymbol{X}\\boldsymbol{\\beta})^T(\\boldsymbol{y}-\\boldsymbol{X}\\boldsymbol{\\beta})\\right\\}+\\lambda\\boldsymbol{\\beta}^T\\boldsymbol{\\beta},\n",
@@ -2168,7 +2678,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "2e7636c6",
+ "metadata": {
+ "editable": true
+ },
"source": [
"and \n",
"taking the derivatives with respect to $\\boldsymbol{\\beta}$ we obtain then\n",
@@ -2179,7 +2692,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "51bd5332",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\hat{\\boldsymbol{\\beta}}_{\\mathrm{Ridge}} = \\left(\\boldsymbol{X}^T\\boldsymbol{X}+\\lambda\\boldsymbol{I}\\right)^{-1}\\boldsymbol{X}^T\\boldsymbol{y},\n",
@@ -2188,14 +2704,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "bbd07896",
+ "metadata": {
+ "editable": true
+ },
"source": [
"with $\\boldsymbol{I}$ being a $p\\times p$ identity matrix with the constraint that"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "39cd7db8",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\sum_{i=0}^{p-1} \\beta_i^2 \\leq t,\n",
@@ -2204,7 +2726,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "245333af",
+ "metadata": {
+ "editable": true
+ },
"source": [
"with $t$ a finite positive number. \n",
"\n",
@@ -2213,7 +2738,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "5ea29678",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\hat{\\boldsymbol{\\beta}}_{\\mathrm{OLS}} = \\left(\\boldsymbol{X}^T\\boldsymbol{X}\\right)^{-1}\\boldsymbol{X}^T\\boldsymbol{y},\n",
@@ -2222,26 +2750,29 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "ad883534",
+ "metadata": {
+ "editable": true
+ },
"source": [
"which can lead to singular matrices. However, with the SVD, we can always compute the inverse of the matrix $\\boldsymbol{X}^T\\boldsymbol{X}$.\n",
"\n",
- "\n",
"We see that Ridge regression is nothing but the standard OLS with a\n",
"modified diagonal term added to $\\boldsymbol{X}^T\\boldsymbol{X}$. The consequences, in\n",
"particular for our discussion of the bias-variance tradeoff are rather\n",
"interesting. We will see that for specific values of $\\lambda$, we may\n",
"even reduce the variance of the optimal parameters $\\boldsymbol{\\beta}$. These topics and other related ones, will be discussed after the more linear algebra oriented analysis here.\n",
"\n",
- "\n",
- "\n",
"Using our insights about the SVD of the design matrix $\\boldsymbol{X}$ \n",
"We have already analyzed the OLS solutions in terms of the eigenvectors (the columns) of the right singular value matrix $\\boldsymbol{U}$ as"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "54e5791f",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\tilde{\\boldsymbol{y}}_{\\mathrm{OLS}}=\\boldsymbol{X}\\boldsymbol{\\beta} =\\boldsymbol{U}\\boldsymbol{U}^T\\boldsymbol{y}.\n",
@@ -2250,14 +2781,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "c406bcb3",
+ "metadata": {
+ "editable": true
+ },
"source": [
"For Ridge regression this becomes"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "1a6f9659",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\tilde{\\boldsymbol{y}}_{\\mathrm{Ridge}}=\\boldsymbol{X}\\boldsymbol{\\beta}_{\\mathrm{Ridge}} = \\boldsymbol{U\\Sigma V^T}\\left(\\boldsymbol{V}\\boldsymbol{\\Sigma}^2\\boldsymbol{V}^T+\\lambda\\boldsymbol{I} \\right)^{-1}(\\boldsymbol{U\\Sigma V^T})^T\\boldsymbol{y}=\\sum_{j=0}^{p-1}\\boldsymbol{u}_j\\boldsymbol{u}_j^T\\frac{\\sigma_j^2}{\\sigma_j^2+\\lambda}\\boldsymbol{y},\n",
@@ -2266,18 +2803,22 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "e2edbb3a",
+ "metadata": {
+ "editable": true
+ },
"source": [
"with the vectors $\\boldsymbol{u}_j$ being the columns of $\\boldsymbol{U}$ from the SVD of the matrix $\\boldsymbol{X}$. \n",
"\n",
- "\n",
- "\n",
"Since $\\lambda \\geq 0$, it means that compared to OLS, we have"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "402353ad",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\frac{\\sigma_j^2}{\\sigma_j^2+\\lambda} \\leq 1.\n",
@@ -2286,7 +2827,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "423b6396",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Ridge regression finds the coordinates of $\\boldsymbol{y}$ with respect to the\n",
"orthonormal basis $\\boldsymbol{U}$, it then shrinks the coordinates by\n",
@@ -2296,14 +2840,15 @@
"\n",
"For small eigenvalues $\\sigma_i$ it means that their contributions become less important, a fact which can be used to reduce the number of degrees of freedom. More about this when we have covered the material on a statistical interpretation of various linear regression methods.\n",
"\n",
- "\n",
- "\n",
"For the sake of simplicity, let us assume that the design matrix is orthonormal, that is"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "f1d49878",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X}^T\\boldsymbol{X}=(\\boldsymbol{X}^T\\boldsymbol{X})^{-1} =\\boldsymbol{I}.\n",
@@ -2312,14 +2857,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "29e021c6",
+ "metadata": {
+ "editable": true
+ },
"source": [
"In this case the standard OLS results in"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "7ea41670",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{\\beta}^{\\mathrm{OLS}} = \\boldsymbol{X}^T\\boldsymbol{y}=\\sum_{i=0}^{p-1}\\boldsymbol{u}_j\\boldsymbol{u}_j^T\\boldsymbol{y},\n",
@@ -2328,14 +2879,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "b5c24d1b",
+ "metadata": {
+ "editable": true
+ },
"source": [
"and"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "5cde9430",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{\\beta}^{\\mathrm{Ridge}} = \\left(\\boldsymbol{I}+\\lambda\\boldsymbol{I}\\right)^{-1}\\boldsymbol{X}^T\\boldsymbol{y}=\\left(1+\\lambda\\right)^{-1}\\boldsymbol{\\beta}^{\\mathrm{OLS}},\n",
@@ -2344,7 +2901,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "f8725e06",
+ "metadata": {
+ "editable": true
+ },
"source": [
"that is the Ridge estimator scales the OLS estimator by the inverse of a factor $1+\\lambda$, and\n",
"the Ridge estimator converges to zero when the hyperparameter goes to\n",
@@ -2352,14 +2912,15 @@
"\n",
"We will come back to more interpreations after we have gone through some of the statistical analysis part. \n",
"\n",
- "\n",
- "\n",
"Using the matrix-vector expression for Lasso regression and dropping the parameter $1/n$ in front of the standard mean squared error equation, we have the following **cost** function"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "77595d78",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"C(\\boldsymbol{X},\\boldsymbol{\\beta})=\\left\\{(\\boldsymbol{y}-\\boldsymbol{X}\\boldsymbol{\\beta})^T(\\boldsymbol{y}-\\boldsymbol{X}\\boldsymbol{\\beta})\\right\\}+\\lambda\\vert\\vert\\boldsymbol{\\beta}\\vert\\vert_1,\n",
@@ -2368,14 +2929,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "30d6a0a4",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Taking the derivative with respect to $\\boldsymbol{\\beta}$ and recalling that the derivative of the absolute value is (we drop the boldfaced vector symbol for simplicty)"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "e6aaeb07",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\frac{d \\vert \\beta\\vert}{d \\boldsymbol{\\beta}}=\\mathrm{sgn}(\\boldsymbol{\\beta})=\\left\\{\\begin{array}{cc} 1 & \\beta > 0 \\\\ 0 & \\beta =0\\\\-1 & \\beta < 0, \\end{array}\\right.\n",
@@ -2384,14 +2951,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "61f8860b",
+ "metadata": {
+ "editable": true
+ },
"source": [
"we have that the derivative of the cost function is"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "848fab1b",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\frac{\\partial C(\\boldsymbol{X},\\boldsymbol{\\beta})}{\\partial \\boldsymbol{\\beta}}=-2\\boldsymbol{X}^T(\\boldsymbol{y}-\\boldsymbol{X}\\boldsymbol{\\beta})+\\lambda sgn(\\boldsymbol{\\beta})=0,\n",
@@ -2400,14 +2973,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "6b3f9c65",
+ "metadata": {
+ "editable": true
+ },
"source": [
"and reordering we have"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "a4535489",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X}^T\\boldsymbol{X}\\boldsymbol{\\beta}+\\lambda sgn(\\boldsymbol{\\beta})=2\\boldsymbol{X}^T\\boldsymbol{y}.\n",
@@ -2416,14 +2995,13 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "08d1dcfc",
+ "metadata": {
+ "editable": true
+ },
"source": [
"This equation does not lead to a nice analytical equation as in Ridge regression or ordinary least squares. This equation can however be solved by using standard convex optimization algorithms using for example the Python package [CVXOPT](https://cvxopt.org/). We will discuss this later. \n",
"\n",
- "\n",
- "\n",
- "\n",
- "\n",
"Let us assume that our design matrix is given by unit (identity) matrix, that is a square diagonal matrix with ones only along the\n",
"diagonal. In this case we have an equal number of rows and columns $n=p$.\n",
"\n",
@@ -2432,7 +3010,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "bfad6360",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"C(\\boldsymbol{\\beta})=\\sum_{i=0}^{p-1}(y_i-\\beta_i)^2,\n",
@@ -2441,14 +3022,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "ececd781",
+ "metadata": {
+ "editable": true
+ },
"source": [
"and minimizing we have that"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "834ae242",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\hat{\\beta}_i^{\\mathrm{OLS}} = y_i.\n",
@@ -2457,14 +3044,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "ef16a3d3",
+ "metadata": {
+ "editable": true
+ },
"source": [
"For Ridge regression our cost function is"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "a40a2bf7",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"C(\\boldsymbol{\\beta})=\\sum_{i=0}^{p-1}(y_i-\\beta_i)^2+\\lambda\\sum_{i=0}^{p-1}\\beta_i^2,\n",
@@ -2473,14 +3066,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "6c6b14af",
+ "metadata": {
+ "editable": true
+ },
"source": [
"and minimizing we have that"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "d9fb8933",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\hat{\\beta}_i^{\\mathrm{Ridge}} = \\frac{y_i}{1+\\lambda}.\n",
@@ -2489,14 +3088,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "272cb2f8",
+ "metadata": {
+ "editable": true
+ },
"source": [
"For Lasso regression our cost function is"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "fadce691",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"C(\\boldsymbol{\\beta})=\\sum_{i=0}^{p-1}(y_i-\\beta_i)^2+\\lambda\\sum_{i=0}^{p-1}\\vert\\beta_i\\vert=\\sum_{i=0}^{p-1}(y_i-\\beta_i)^2+\\lambda\\sum_{i=0}^{p-1}\\sqrt{\\beta_i^2},\n",
@@ -2505,14 +3110,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "c7cd5640",
+ "metadata": {
+ "editable": true
+ },
"source": [
"and minimizing we have that"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "463185a0",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"-2\\sum_{i=0}^{p-1}(y_i-\\beta_i)+\\lambda \\sum_{i=0}^{p-1}\\frac{(\\beta_i)}{\\vert\\beta_i\\vert}=0,\n",
@@ -2521,14 +3132,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "7b2748c6",
+ "metadata": {
+ "editable": true
+ },
"source": [
"which leads to"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "14027ed3",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\hat{\\boldsymbol{\\beta}}_i^{\\mathrm{Lasso}} = \\left\\{\\begin{array}{ccc}y_i-\\frac{\\lambda}{2} &\\mathrm{if} & y_i> \\frac{\\lambda}{2}\\\\\n",
@@ -2539,18 +3156,23 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "6ee85f1d",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Plotting these results ([figure in handwritten notes for week 36](https://github.com/CompPhysics/MachineLearning/blob/master/doc/HandWrittenNotes/2021/NotesSeptember9.pdf)) shows clearly that Lasso regression suppresses (sets to zero) values of $\\beta_i$ for specific values of $\\lambda$. Ridge regression reduces on the other hand the values of $\\beta_i$ as function of $\\lambda$.\n",
"\n",
- "\n",
"As another examples, \n",
"let us assume we have a data set with outputs/targets given by the vector"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "b5208771",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{y}=\\begin{bmatrix}4 \\\\ 2 \\\\3\\end{bmatrix},\n",
@@ -2559,14 +3181,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "c1b21b70",
+ "metadata": {
+ "editable": true
+ },
"source": [
"and our inputs as a $3\\times 2$ design matrix"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "c7f60db1",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X}=\\begin{bmatrix}2 & 0\\\\ 0 & 1 \\\\ 0 & 0\\end{bmatrix},\n",
@@ -2575,17 +3203,22 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "908ab8d8",
+ "metadata": {
+ "editable": true
+ },
"source": [
"meaning that we have two features and two unknown parameters $\\beta_0$ and $\\beta_1$ to be determined either by ordinary least squares, Ridge or Lasso regression.\n",
"\n",
- "\n",
"For ordinary least squares (OLS) we know that the optimal solution is"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "aebb6349",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\hat{\\boldsymbol{\\beta}}^{\\mathrm{OLS}}=\\left( \\boldsymbol{X}^T\\boldsymbol{X}\\right)^{-1}\\boldsymbol{X}^T\\boldsymbol{y}.\n",
@@ -2594,14 +3227,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "c5e7c53f",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Inserting the above values we obtain that"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "2197be2d",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\hat{\\boldsymbol{\\beta}}^{\\mathrm{OLS}}=\\begin{bmatrix}2 \\\\ 2\\end{bmatrix},\n",
@@ -2610,17 +3249,22 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "3d6f2196",
+ "metadata": {
+ "editable": true
+ },
"source": [
"The code which implements this simpler case is presented after the discussion of Ridge and Lasso.\n",
"\n",
- "\n",
"For Ridge regression we have"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "5f340903",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\hat{\\boldsymbol{\\beta}}^{\\mathrm{Ridge}}=\\left( \\boldsymbol{X}^T\\boldsymbol{X}+\\lambda\\boldsymbol{I}\\right)^{-1}\\boldsymbol{X}^T\\boldsymbol{y}.\n",
@@ -2629,14 +3273,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "11b0427e",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Inserting the above values we obtain that"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "963a0089",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\hat{\\boldsymbol{\\beta}}^{\\mathrm{Ridge}}=\\begin{bmatrix}\\frac{8}{4+\\lambda} \\\\ \\frac{2}{1+\\lambda}\\end{bmatrix},\n",
@@ -2645,21 +3295,25 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "7db2daaa",
+ "metadata": {
+ "editable": true
+ },
"source": [
"There is normally a constraint on the value of $\\vert\\vert \\boldsymbol{\\beta}\\vert\\vert_2$ via the parameter $\\lambda$.\n",
"Let us for simplicity assume that $\\beta_0^2+\\beta_1^2=1$ as constraint. This will allow us to find an expression for the optimal values of $\\beta$ and $\\lambda$.\n",
"\n",
"To see this, let us write the cost function for Ridge regression. \n",
"\n",
- "\n",
- "\n",
"We define the MSE without the $1/n$ factor and have then, using that"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "688d8588",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X}\\boldsymbol{\\beta}=\\begin{bmatrix} 2\\beta_0 \\\\ \\beta_1 \\\\0 \\end{bmatrix},\n",
@@ -2668,7 +3322,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "711738d9",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"C(\\boldsymbol{\\beta})=(4-2\\beta_0)^2+(2-\\beta_1)^2+\\lambda(\\beta_0^2+\\beta_1^2),\n",
@@ -2677,14 +3334,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "6c949f8e",
+ "metadata": {
+ "editable": true
+ },
"source": [
"and taking the derivative with respect to $\\beta_0$ we get"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "0bbc3b07",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\beta_0=\\frac{8}{4+\\lambda},\n",
@@ -2693,14 +3356,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "1cbf8a76",
+ "metadata": {
+ "editable": true
+ },
"source": [
"and for $\\beta_1$ we obtain"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "8f10e5bd",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\beta_1=\\frac{2}{1+\\lambda},\n",
@@ -2709,14 +3378,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "b547328c",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Using the constraint for $\\beta_0^2+\\beta_1^2=1$ we can constrain $\\lambda$ by solving"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "707c1a57",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\left(\\frac{8}{4+\\lambda}\\right)^2+\\left(\\frac{2}{1+\\lambda}\\right)^2=1,\n",
@@ -2725,18 +3400,23 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "b90e6997",
+ "metadata": {
+ "editable": true
+ },
"source": [
"which gives $\\lambda=4.571$ and $\\beta_0=0.933$ and $\\beta_1=0.359$.\n",
"\n",
- "\n",
"For Lasso we need now, keeping a constraint on $\\vert\\beta_0\\vert+\\vert\\beta_1\\vert=1$, to take the derivative of the absolute values of $\\beta_0$\n",
"and $\\beta_1$. This gives us the following derivatives of the cost function"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "e4f6ca20",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"C(\\boldsymbol{\\beta})=(4-2\\beta_0)^2+(2-\\beta_1)^2+\\lambda(\\vert\\beta_0\\vert+\\vert\\beta_1\\vert),\n",
@@ -2745,7 +3425,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "b3d7018c",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\frac{\\partial C(\\boldsymbol{\\beta})}{\\partial \\beta_0}=-4(4-2\\beta_0)+\\lambda\\mathrm{sgn}(\\beta_0)=0,\n",
@@ -2754,14 +3437,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "9e6f1823",
+ "metadata": {
+ "editable": true
+ },
"source": [
"and"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "ea3b2bf0",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\frac{\\partial C(\\boldsymbol{\\beta})}{\\partial \\beta_1}=-2(2-\\beta_1)+\\lambda\\mathrm{sgn}(\\beta_1)=0.\n",
@@ -2770,7 +3459,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "484b5cd4",
+ "metadata": {
+ "editable": true
+ },
"source": [
"We have now four cases to solve besides the trivial cases $\\beta_0$ and/or $\\beta_1$ are zero, namely\n",
"1. $\\beta_0 > 0$ and $\\beta_1 > 0$,\n",
@@ -2786,7 +3478,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "4861f625",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"-4(4-2\\beta_0)+\\lambda=0,\n",
@@ -2795,14 +3490,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "9928eadb",
+ "metadata": {
+ "editable": true
+ },
"source": [
"and"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "c94a1223",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"-2(2-\\beta_1)+\\lambda=0.\n",
@@ -2811,14 +3512,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "9bcaff12",
+ "metadata": {
+ "editable": true
+ },
"source": [
"which yields"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "1b7020d6",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\beta_0=\\frac{16+\\lambda}{8},\n",
@@ -2827,14 +3534,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "51fce0e9",
+ "metadata": {
+ "editable": true
+ },
"source": [
"and"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "c1fe81b2",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\beta_1=\\frac{4+\\lambda}{2}.\n",
@@ -2843,11 +3556,13 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "414a2e5b",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Using the constraint on $\\beta_0$ and $\\beta_1$ we can then find the optimal value of $\\lambda$ for the different cases. We leave this as an exercise to you.\n",
"\n",
- "\n",
"Here we set up the OLS, Ridge and Lasso functionality in order to study the above example. Note that here we have opted for a set of values of $\\lambda$, meaning that we need to perform a search in order to find the optimal values.\n",
"\n",
"First we study and compare the OLS and Ridge results. The next code compares all three methods.\n",
@@ -2857,6 +3572,7 @@
{
"cell_type": "code",
"execution_count": 9,
+ "id": "57451fca",
"metadata": {
"collapsed": false,
"editable": true
@@ -2880,7 +3596,7 @@
},
"metadata": {
"filenames": {
- "image/png": "/Users/mhjensen/Teaching/MachineLearning/doc/LectureNotes/_build/jupyter_execute/chapter2_245_1.png"
+ "image/png": "/Users/mhjensen/Teaching/MachineLearning/doc/LectureNotes/_build/jupyter_execute/chapter2_254_1.png"
},
"needs_background": "light"
},
@@ -2943,7 +3659,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "6d10b060",
+ "metadata": {
+ "editable": true
+ },
"source": [
"We see here that we reach a plateau for the Ridge results. Writing out the coefficients $\\boldsymbol{\\beta}$, we that they are getting smaller and smaller and our error stabilizes since the predicted values of $\\tilde{\\boldsymbol{y}}$ approach zero.\n",
"\n",
@@ -2957,6 +3676,7 @@
{
"cell_type": "code",
"execution_count": 10,
+ "id": "100f7dbb",
"metadata": {
"collapsed": false,
"editable": true
@@ -3180,7 +3900,7 @@
},
"metadata": {
"filenames": {
- "image/png": "/Users/mhjensen/Teaching/MachineLearning/doc/LectureNotes/_build/jupyter_execute/chapter2_247_1.png"
+ "image/png": "/Users/mhjensen/Teaching/MachineLearning/doc/LectureNotes/_build/jupyter_execute/chapter2_256_1.png"
},
"needs_background": "light"
},
@@ -3248,7 +3968,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "3d50bfd5",
+ "metadata": {
+ "editable": true
+ },
"source": [
"We bring then back our exponential function example and study all\n",
"three regression methods. Depending on the level of noise, we note\n",
@@ -3264,6 +3987,7 @@
{
"cell_type": "code",
"execution_count": 11,
+ "id": "409f405d",
"metadata": {
"collapsed": false,
"editable": true
@@ -3289,7 +4013,7 @@
},
"metadata": {
"filenames": {
- "image/png": "/Users/mhjensen/Teaching/MachineLearning/doc/LectureNotes/_build/jupyter_execute/chapter2_249_1.png"
+ "image/png": "/Users/mhjensen/Teaching/MachineLearning/doc/LectureNotes/_build/jupyter_execute/chapter2_258_1.png"
},
"needs_background": "light"
},
@@ -3379,327 +4103,26 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "50e9be28",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Both these example send a clear message. The addition of a\n",
"shrinkage/regularization term implies that we need to perform a search\n",
"for the optimal values of $\\lambda$. We will see this throughout these\n",
"series of lectures.\n",
"\n",
- "\n",
- "As a small addendum, we note that you can also solve this problem using the convex optimization package [CVXOPT](https://cvxopt.org/examples/mlbook/l1regls.html). This requires, in addition to having installed **CVXOPT**, you need to download the file *l1regl.py*.\n",
- "The following code example solves the simpler problem we discussed above, where we have added the latter python file."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 12,
- "metadata": {
- "collapsed": false,
- "editable": true
- },
- "outputs": [
- {
- "ename": "ModuleNotFoundError",
- "evalue": "No module named 'cvxopt'",
- "output_type": "error",
- "traceback": [
- "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
- "\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)",
- "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0;32mfrom\u001b[0m \u001b[0mcvxopt\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mmatrix\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mspdiag\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmul\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdiv\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msqrt\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnormal\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msetseed\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0mcvxopt\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mblas\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlapack\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msolvers\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msparse\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mspmatrix\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mmath\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
- "\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'cvxopt'"
- ]
- }
- ],
- "source": [
- "from cvxopt import matrix, spdiag, mul, div, sqrt, normal, setseed\n",
- "from cvxopt import blas, lapack, solvers, sparse, spmatrix\n",
- "import math\n",
- "\n",
- "try:\n",
- " import mosek\n",
- " import sys\n",
- " __MOSEK = True\n",
- "except: __MOSEK = False\n",
- "\n",
- "if __MOSEK:\n",
- "\n",
- " def l1regls_mosek(A, b):\n",
- " \"\"\"\n",
- "\n",
- " Returns the solution of l1-norm regularized least-squares problem\n",
- "\n",
- " minimize || A*x - b ||_2^2 + e'*u\n",
- "\n",
- " subject to -u <= x <= u\n",
- "\n",
- " \"\"\"\n",
- "\n",
- " m, n = A.size\n",
- "\n",
- " env = mosek.Env()\n",
- " task = env.Task(0,0)\n",
- " task.set_Stream(mosek.streamtype.log, lambda x: sys.stdout.write(x))\n",
- "\n",
- " task.appendvars( 2*n) # number of variables\n",
- " task.appendcons( 2*n) # number of constraints\n",
- "\n",
- " # input quadratic objective\n",
- " Q = matrix(0.0, (n,n)) \n",
- " blas.syrk(A, Q, alpha = 2.0, trans='T')\n",
- "\n",
- " I = []\n",
- " for i in range(n):\n",
- " I.extend(range(i,n))\n",
- "\n",
- " J = []\n",
- " for i in range(n):\n",
- " J.extend((n-i)*[i])\n",
- "\n",
- " task.putqobj(I, J, list(Q[matrix(I) + matrix(J)*n]))\n",
- " task.putclist(range(2*n), list(-2*A.T*b) + n*[1.0]) # setup linear objective\n",
- "\n",
- " # input constraint matrix row by row\n",
- " for i in range(n):\n",
- " task.putarow( i, [i, n+i], [1.0, -1.0])\n",
- " task.putarow( n+i, [i, n+i], [1.0, 1.0])\n",
- "\n",
- " # setup bounds on constraints\n",
- " task.putboundslice(mosek.accmode.con,\n",
- " 0, n, n*[mosek.boundkey.up], n*[0.0], n*[0.0])\n",
- " task.putboundslice(mosek.accmode.con,\n",
- " n, 2*n, n*[mosek.boundkey.lo], n*[0.0], n*[0.0])\n",
- "\n",
- " # setup variable bounds\n",
- " task.putboundslice(mosek.accmode.var,\n",
- " 0, 2*n, 2*n*[mosek.boundkey.fr], 2*n*[0.0], 2*n*[0.0])\n",
- "\n",
- " # optimize the task\n",
- " task.putobjsense(mosek.objsense.minimize)\n",
- " task.optimize()\n",
- " task.solutionsummary(mosek.streamtype.log)\n",
- " x = n*[0.0]\n",
- " task.getsolutionslice(mosek.soltype.itr, mosek.solitem.xx, 0, n, x)\n",
- "\n",
- " return matrix(x)\n",
- "\n",
- " def l1regls_mosek2(A, b):\n",
- " \"\"\"\n",
- "\n",
- " Returns the solution of l1-norm regularized least-squares problem\n",
- "\n",
- " minimize w'*w + e'*u\n",
- "\n",
- " subject to -u <= x <= u\n",
- "\n",
- " A*x - w = b\n",
- "\n",
- " \"\"\"\n",
- "\n",
- " m, n = A.size\n",
- "\n",
- " env = mosek.Env()\n",
- " task = env.Task(0,0)\n",
- " task.set_Stream(mosek.streamtype.log, lambda x: sys.stdout.write(x))\n",
- "\n",
- " task.appendvars(2*n + m) # number of variables\n",
- " task.appendcons(2*n + m) # number of constraints\n",
- "\n",
- " # input quadratic objective\n",
- " task.putqobj(range(2*n,2*n+m), range(2*n,2*n+m), m*[2.0])\n",
- "\n",
- " task.putclist(range(2*n+m), n*[0.0] + n*[1.0] + m*[0.0]) # setup linear objective\n",
- "\n",
- " # input constraint matrix row by row\n",
- " for i in range(n):\n",
- " task.putarow( i, [i, n+i], [1.0, -1.0])\n",
- " task.putarow( n+i, [i, n+i], [1.0, 1.0])\n",
- "\n",
- " for i in range(m):\n",
- " task.putarow( 2*n+i, range(n) + [2*n+i], list(A[i,:]) + [-1.0])\n",
- "\n",
- " # setup bounds on constraints\n",
- " task.putboundslice(mosek.accmode.con,\n",
- " 0, n, n*[mosek.boundkey.up], n*[0.0], n*[0.0])\n",
- " task.putboundslice(mosek.accmode.con,\n",
- " n, 2*n, n*[mosek.boundkey.lo], n*[0.0], n*[0.0])\n",
- " task.putboundslice(mosek.accmode.con,\n",
- " 2*n, 2*n+m, m*[mosek.boundkey.fx], list(b), list(b))\n",
- "\n",
- " # setup variable bounds\n",
- " task.putboundslice(mosek.accmode.var, 0, 2*n+m, (2*n+m)*[mosek.boundkey.fr], \n",
- " (2*n+m)*[0.0], (2*n+m)*[0.0])\n",
- "\n",
- " # optimize the task\n",
- " task.putobjsense(mosek.objsense.minimize)\n",
- " task.optimize()\n",
- " task.solutionsummary(mosek.streamtype.log)\n",
- " x = n*[0.0]\n",
- " task.getsolutionslice(mosek.soltype.itr, mosek.solitem.xx, 0, n, x)\n",
- "\n",
- " return matrix(x)\n",
- "\n",
- "def l1regls(A, b):\n",
- " \"\"\"\n",
- " \n",
- " Returns the solution of l1-norm regularized least-squares problem\n",
- " \n",
- " minimize || A*x - b ||_2^2 + || x ||_1.\n",
- "\n",
- " \"\"\"\n",
- "\n",
- " m, n = A.size\n",
- " q = matrix(1.0, (2*n,1))\n",
- " q[:n] = -2.0 * A.T * b\n",
- "\n",
- " def P(u, v, alpha = 1.0, beta = 0.0 ):\n",
- " \"\"\"\n",
- " v := alpha * 2.0 * [ A'*A, 0; 0, 0 ] * u + beta * v \n",
- " \"\"\"\n",
- " v *= beta\n",
- " v[:n] += alpha * 2.0 * A.T * (A * u[:n])\n",
- "\n",
- "\n",
- " def G(u, v, alpha=1.0, beta=0.0, trans='N'):\n",
- " \"\"\"\n",
- " v := alpha*[I, -I; -I, -I] * u + beta * v (trans = 'N' or 'T')\n",
- " \"\"\"\n",
- "\n",
- " v *= beta\n",
- " v[:n] += alpha*(u[:n] - u[n:])\n",
- " v[n:] += alpha*(-u[:n] - u[n:])\n",
- "\n",
- " h = matrix(0.0, (2*n,1))\n",
- "\n",
- "\n",
- " # Customized solver for the KKT system \n",
- " #\n",
- " # [ 2.0*A'*A 0 I -I ] [x[:n] ] [bx[:n] ]\n",
- " # [ 0 0 -I -I ] [x[n:] ] = [bx[n:] ].\n",
- " # [ I -I -D1^-1 0 ] [zl[:n]] [bzl[:n]]\n",
- " # [ -I -I 0 -D2^-1 ] [zl[n:]] [bzl[n:]]\n",
- " #\n",
- " # where D1 = W['di'][:n]**2, D2 = W['di'][:n]**2.\n",
- " # \n",
- " # We first eliminate zl and x[n:]:\n",
- " #\n",
- " # ( 2*A'*A + 4*D1*D2*(D1+D2)^-1 ) * x[:n] = \n",
- " # bx[:n] - (D2-D1)*(D1+D2)^-1 * bx[n:] + \n",
- " # D1 * ( I + (D2-D1)*(D1+D2)^-1 ) * bzl[:n] - \n",
- " # D2 * ( I - (D2-D1)*(D1+D2)^-1 ) * bzl[n:] \n",
- " #\n",
- " # x[n:] = (D1+D2)^-1 * ( bx[n:] - D1*bzl[:n] - D2*bzl[n:] ) \n",
- " # - (D2-D1)*(D1+D2)^-1 * x[:n] \n",
- " #\n",
- " # zl[:n] = D1 * ( x[:n] - x[n:] - bzl[:n] )\n",
- " # zl[n:] = D2 * (-x[:n] - x[n:] - bzl[n:] ).\n",
- " #\n",
- " # The first equation has the form\n",
- " #\n",
- " # (A'*A + D)*x[:n] = rhs\n",
- " #\n",
- " # and is equivalent to\n",
- " #\n",
- " # [ D A' ] [ x:n] ] = [ rhs ]\n",
- " # [ A -I ] [ v ] [ 0 ].\n",
- " #\n",
- " # It can be solved as \n",
- " #\n",
- " # ( A*D^-1*A' + I ) * v = A * D^-1 * rhs\n",
- " # x[:n] = D^-1 * ( rhs - A'*v ).\n",
- "\n",
- " S = matrix(0.0, (m,m))\n",
- " Asc = matrix(0.0, (m,n))\n",
- " v = matrix(0.0, (m,1))\n",
- "\n",
- " def Fkkt(W):\n",
- "\n",
- " # Factor \n",
- " #\n",
- " # S = A*D^-1*A' + I \n",
- " #\n",
- " # where D = 2*D1*D2*(D1+D2)^-1, D1 = d[:n]**-2, D2 = d[n:]**-2.\n",
- "\n",
- " d1, d2 = W['di'][:n]**2, W['di'][n:]**2\n",
- "\n",
- " # ds is square root of diagonal of D\n",
- " ds = math.sqrt(2.0) * div( mul( W['di'][:n], W['di'][n:]), \n",
- " sqrt(d1+d2) )\n",
- " d3 = div(d2 - d1, d1 + d2)\n",
- " \n",
- " # Asc = A*diag(d)^-1/2\n",
- " Asc = A * spdiag(ds**-1)\n",
- "\n",
- " # S = I + A * D^-1 * A'\n",
- " blas.syrk(Asc, S)\n",
- " S[::m+1] += 1.0 \n",
- " lapack.potrf(S)\n",
- "\n",
- " def g(x, y, z):\n",
- "\n",
- " x[:n] = 0.5 * ( x[:n] - mul(d3, x[n:]) + \n",
- " mul(d1, z[:n] + mul(d3, z[:n])) - mul(d2, z[n:] - \n",
- " mul(d3, z[n:])) )\n",
- " x[:n] = div( x[:n], ds) \n",
- "\n",
- " # Solve\n",
- " #\n",
- " # S * v = 0.5 * A * D^-1 * ( bx[:n] - \n",
- " # (D2-D1)*(D1+D2)^-1 * bx[n:] + \n",
- " # D1 * ( I + (D2-D1)*(D1+D2)^-1 ) * bzl[:n] - \n",
- " # D2 * ( I - (D2-D1)*(D1+D2)^-1 ) * bzl[n:] )\n",
- " \n",
- " blas.gemv(Asc, x, v)\n",
- " lapack.potrs(S, v)\n",
- " \n",
- " # x[:n] = D^-1 * ( rhs - A'*v ).\n",
- " blas.gemv(Asc, v, x, alpha=-1.0, beta=1.0, trans='T')\n",
- " x[:n] = div(x[:n], ds)\n",
- "\n",
- " # x[n:] = (D1+D2)^-1 * ( bx[n:] - D1*bzl[:n] - D2*bzl[n:] ) \n",
- " # - (D2-D1)*(D1+D2)^-1 * x[:n] \n",
- " x[n:] = div( x[n:] - mul(d1, z[:n]) - mul(d2, z[n:]), d1+d2 )\\\n",
- " - mul( d3, x[:n] )\n",
- " \n",
- " # zl[:n] = D1^1/2 * ( x[:n] - x[n:] - bzl[:n] )\n",
- " # zl[n:] = D2^1/2 * ( -x[:n] - x[n:] - bzl[n:] ).\n",
- " z[:n] = mul( W['di'][:n], x[:n] - x[n:] - z[:n] ) \n",
- " z[n:] = mul( W['di'][n:], -x[:n] - x[n:] - z[n:] ) \n",
- "\n",
- " return g\n",
- "\n",
- " return solvers.coneqp(P, q, G, h, kktsolver = Fkkt)['x'][:n]"
+ "As a small addendum, we note that you can also solve this problem using the convex optimization package [CVXOPT](https://cvxopt.org/examples/mlbook/l1regls.html). This requires, in addition to having installed **CVXOPT**, you need to download the file *l1regl.py*."
]
},
{
"cell_type": "markdown",
- "metadata": {},
- "source": [
- "Then we call the above functions and solve the problem, as done here"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
+ "id": "4c5c2565",
"metadata": {
- "collapsed": false,
"editable": true
},
- "outputs": [],
"source": [
- "from cvxopt import matrix, normal\n",
- "\n",
- "X = matrix( [ [ 2, 0, 1], [0, 1, 3]])\n",
- "y = matrix( [4, 2, 3])\n",
- "x = l1regls(X,y)"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "**More text will be added to this example.**\n",
- "\n",
"## Linking the regression analysis with a statistical interpretation\n",
"\n",
"We will now couple the discussions of ordinary least squares, Ridge\n",
@@ -3710,7 +4133,6 @@
"parameter can reduce considerably the variance of the parameters\n",
"$\\beta$.\n",
"\n",
- "\n",
"The\n",
"advantage of doing linear regression is that we actually end up with\n",
"analytical expressions for several statistical quantities. \n",
@@ -3718,7 +4140,6 @@
"derive quantities like the variance and other expectation values in a\n",
"rather straightforward way.\n",
"\n",
- "\n",
"It is assumed that $\\varepsilon_i\n",
"\\sim \\mathcal{N}(0, \\sigma^2)$ and the $\\varepsilon_{i}$ are\n",
"independent, i.e.:"
@@ -3726,7 +4147,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "f264b531",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\begin{align*} \n",
@@ -3739,7 +4163,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "800b179f",
+ "metadata": {
+ "editable": true
+ },
"source": [
"The randomness of $\\varepsilon_i$ implies that\n",
"$\\mathbf{y}_i$ is also a random variable. In particular,\n",
@@ -3752,8 +4179,6 @@
"notation above $\\mathbf{X}_{i,\\ast}$ means that we are looking at the\n",
"row number $i$ and perform a sum over all values $p$.\n",
"\n",
- "\n",
- "\n",
"The assumption we have made here can be summarized as (and this is going to be useful when we discuss the bias-variance trade off)\n",
"that there exists a function $f(\\boldsymbol{x})$ and a normal distributed error $\\boldsymbol{\\varepsilon}\\sim \\mathcal{N}(0, \\sigma^2)$\n",
"which describe our data"
@@ -3761,7 +4186,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "b4815186",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{y} = f(\\boldsymbol{x})+\\boldsymbol{\\varepsilon}\n",
@@ -3770,7 +4198,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "2a343970",
+ "metadata": {
+ "editable": true
+ },
"source": [
"We approximate this function with our model from the solution of the linear regression equations, that is our\n",
"function $f$ is approximated by $\\boldsymbol{\\tilde{y}}$ where we want to minimize $(\\boldsymbol{y}-\\boldsymbol{\\tilde{y}})^2$, our MSE, with"
@@ -3778,7 +4209,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "358077b0",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{\\tilde{y}} = \\boldsymbol{X}\\boldsymbol{\\beta}.\n",
@@ -3787,14 +4221,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "73f23e81",
+ "metadata": {
+ "editable": true
+ },
"source": [
"We can calculate the expectation value of $\\boldsymbol{y}$ for a given element $i$"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "bebdffa9",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\begin{align*} \n",
@@ -3807,7 +4247,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "8c38cb47",
+ "metadata": {
+ "editable": true
+ },
"source": [
"while\n",
"its variance is"
@@ -3815,7 +4258,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "193c47ee",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\begin{align*} \\mbox{Var}(y_i) & = \\mathbb{E} \\{ [y_i\n",
@@ -3835,18 +4281,23 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "92832b0a",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Hence, $y_i \\sim \\mathcal{N}( \\mathbf{X}_{i, \\ast} \\, \\boldsymbol{\\beta}, \\sigma^2)$, that is $\\boldsymbol{y}$ follows a normal distribution with \n",
"mean value $\\boldsymbol{X}\\boldsymbol{\\beta}$ and variance $\\sigma^2$ (not be confused with the singular values of the SVD). \n",
"\n",
- "\n",
"With the OLS expressions for the parameters $\\boldsymbol{\\beta}$ we can evaluate the expectation value"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "5f517886",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\mathbb{E}(\\boldsymbol{\\beta}) = \\mathbb{E}[ (\\mathbf{X}^{\\top} \\mathbf{X})^{-1}\\mathbf{X}^{T} \\mathbf{Y}]=(\\mathbf{X}^{T} \\mathbf{X})^{-1}\\mathbf{X}^{T} \\mathbb{E}[ \\mathbf{Y}]=(\\mathbf{X}^{T} \\mathbf{X})^{-1} \\mathbf{X}^{T}\\mathbf{X}\\boldsymbol{\\beta}=\\boldsymbol{\\beta}.\n",
@@ -3855,7 +4306,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "f9dea445",
+ "metadata": {
+ "editable": true
+ },
"source": [
"This means that the estimator of the regression parameters is unbiased.\n",
"\n",
@@ -3866,7 +4320,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "3aececb1",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\begin{eqnarray*}\n",
@@ -3894,7 +4351,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "f38f2849",
+ "metadata": {
+ "editable": true
+ },
"source": [
"where we have used that $\\mathbb{E} (\\mathbf{Y} \\mathbf{Y}^{T}) =\n",
"\\mathbf{X} \\, \\boldsymbol{\\beta} \\, \\boldsymbol{\\beta}^{T} \\, \\mathbf{X}^{T} +\n",
@@ -3904,7 +4364,6 @@
"$\\boldsymbol{\\sigma}^2 (\\boldsymbol{\\beta}_j ) = \\boldsymbol{\\sigma}^2 [(\\mathbf{X}^{T} \\mathbf{X})^{-1}]_{jj} $. This may be used to\n",
"construct a confidence interval for the estimates.\n",
"\n",
- "\n",
"In a similar way, we can obtain analytical expressions for say the\n",
"expectation values of the parameters $\\boldsymbol{\\beta}$ and their variance\n",
"when we employ Ridge regression, allowing us again to define a confidence interval. \n",
@@ -3914,7 +4373,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "47dbc181",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\mathbb{E} \\big[ \\boldsymbol{\\beta}^{\\mathrm{Ridge}} \\big]=(\\mathbf{X}^{T} \\mathbf{X} + \\lambda \\mathbf{I}_{pp})^{-1} (\\mathbf{X}^{\\top} \\mathbf{X})\\boldsymbol{\\beta}^{\\mathrm{OLS}}.\n",
@@ -3923,7 +4385,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "a409614d",
+ "metadata": {
+ "editable": true
+ },
"source": [
"We see clearly that \n",
"$\\mathbb{E} \\big[ \\boldsymbol{\\beta}^{\\mathrm{Ridge}} \\big] \\not= \\boldsymbol{\\beta}^{\\mathrm{OLS}}$ for any $\\lambda > 0$. We say then that the ridge estimator is biased.\n",
@@ -3933,7 +4398,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "32e59beb",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\mbox{Var}[\\boldsymbol{\\beta}^{\\mathrm{Ridge}}]=\\sigma^2[ \\mathbf{X}^{T} \\mathbf{X} + \\lambda \\mathbf{I} ]^{-1} \\mathbf{X}^{T} \\mathbf{X} \\{ [ \\mathbf{X}^{\\top} \\mathbf{X} + \\lambda \\mathbf{I} ]^{-1}\\}^{T},\n",
@@ -3942,7 +4410,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "e5d38011",
+ "metadata": {
+ "editable": true
+ },
"source": [
"and it is easy to see that if the parameter $\\lambda$ goes to infinity then the variance of Ridge parameters $\\boldsymbol{\\beta}$ goes to zero. \n",
"\n",
@@ -3951,7 +4422,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "999a6bc6",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\mbox{Var}[\\boldsymbol{\\beta}^{\\mathrm{OLS}}]-\\mbox{Var}(\\boldsymbol{\\beta}^{\\mathrm{Ridge}})=\\sigma^2 [ \\mathbf{X}^{T} \\mathbf{X} + \\lambda \\mathbf{I} ]^{-1}[ 2\\lambda\\mathbf{I} + \\lambda^2 (\\mathbf{X}^{T} \\mathbf{X})^{-1} ] \\{ [ \\mathbf{X}^{T} \\mathbf{X} + \\lambda \\mathbf{I} ]^{-1}\\}^{T}.\n",
@@ -3960,14 +4434,23 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "888f1db7",
+ "metadata": {
+ "editable": true
+ },
"source": [
"The difference is non-negative definite since each component of the\n",
"matrix product is non-negative definite. \n",
- "This means the variance we obtain with the standard OLS will always for $\\lambda > 0$ be larger than the variance of $\\boldsymbol{\\beta}$ obtained with the Ridge estimator. This has interesting consequences when we discuss the so-called bias-variance trade-off below. \n",
- "\n",
- "\n",
- "\n",
+ "This means the variance we obtain with the standard OLS will always for $\\lambda > 0$ be larger than the variance of $\\boldsymbol{\\beta}$ obtained with the Ridge estimator. This has interesting consequences when we discuss the so-called bias-variance trade-off below."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "76360bbe",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
"## Deriving OLS from a probability distribution\n",
"\n",
"Our basic assumption when we derived the OLS equations was to assume\n",
@@ -3986,7 +4469,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "6b1976cd",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"y_i\\sim \\mathcal{N}(\\boldsymbol{X}_{i,*}\\boldsymbol{\\beta}, \\sigma^2)=\\frac{1}{\\sqrt{2\\pi\\sigma^2}}\\exp{\\left[-\\frac{(y_i-\\boldsymbol{X}_{i,*}\\boldsymbol{\\beta})^2}{2\\sigma^2}\\right]}.\n",
@@ -3995,7 +4481,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "5ff419a1",
+ "metadata": {
+ "editable": true
+ },
"source": [
"We assume now that the various $y_i$ values are stochastically distributed according to the above Gaussian distribution. \n",
"We define this distribution as"
@@ -4003,7 +4492,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "82730c14",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"p(y_i, \\boldsymbol{X}\\vert\\boldsymbol{\\beta})=\\frac{1}{\\sqrt{2\\pi\\sigma^2}}\\exp{\\left[-\\frac{(y_i-\\boldsymbol{X}_{i,*}\\boldsymbol{\\beta})^2}{2\\sigma^2}\\right]},\n",
@@ -4012,7 +4504,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "4982965d",
+ "metadata": {
+ "editable": true
+ },
"source": [
"which reads as finding the likelihood of an event $y_i$ with the input variables $\\boldsymbol{X}$ given the parameters (to be determined) $\\boldsymbol{\\beta}$.\n",
"\n",
@@ -4021,7 +4516,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "ab4c31a7",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"p(\\boldsymbol{y},\\boldsymbol{X}\\vert\\boldsymbol{\\beta})=\\prod_{i=0}^{n-1}\\frac{1}{\\sqrt{2\\pi\\sigma^2}}\\exp{\\left[-\\frac{(y_i-\\boldsymbol{X}_{i,*}\\boldsymbol{\\beta})^2}{2\\sigma^2}\\right]}=\\prod_{i=0}^{n-1}p(y_i,\\boldsymbol{X}\\vert\\boldsymbol{\\beta}).\n",
@@ -4030,7 +4528,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "768cb1fc",
+ "metadata": {
+ "editable": true
+ },
"source": [
"We will write this in a more compact form reserving $\\boldsymbol{D}$ for the domain of events, including the ouputs (targets) and the inputs. That is\n",
"in case we have a simple one-dimensional input and output case"
@@ -4038,7 +4539,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "f9f0c7f3",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{D}=[(x_0,y_0), (x_1,y_1),\\dots, (x_{n-1},y_{n-1})].\n",
@@ -4047,7 +4551,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "c617cdd7",
+ "metadata": {
+ "editable": true
+ },
"source": [
"In the more general case the various inputs should be replaced by the possible features represented by the input data set $\\boldsymbol{X}$. \n",
"We can now rewrite the above probability as"
@@ -4055,7 +4562,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "760dd73f",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"p(\\boldsymbol{D}\\vert\\boldsymbol{\\beta})=\\prod_{i=0}^{n-1}\\frac{1}{\\sqrt{2\\pi\\sigma^2}}\\exp{\\left[-\\frac{(y_i-\\boldsymbol{X}_{i,*}\\boldsymbol{\\beta})^2}{2\\sigma^2}\\right]}.\n",
@@ -4064,27 +4574,27 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "0fd8cbb0",
+ "metadata": {
+ "editable": true
+ },
"source": [
"It is a conditional probability (see below) and reads as the\n",
"likelihood of a domain of events $\\boldsymbol{D}$ given a set of parameters\n",
"$\\boldsymbol{\\beta}$.\n",
"\n",
- "\n",
"In statistics, maximum likelihood estimation (MLE) is a method of\n",
"estimating the parameters of an assumed probability distribution,\n",
"given some observed data. This is achieved by maximizing a likelihood\n",
"function so that, under the assumed statistical model, the observed\n",
"data is the most probable. \n",
"\n",
- "\n",
"We will assume here that our events are given by the above Gaussian\n",
"distribution and we will determine the optimal parameters $\\beta$ by\n",
"maximizing the above PDF. However, computing the derivatives of a\n",
"product function is cumbersome and can easily lead to overflow and/or\n",
"underflowproblems, with potentials for loss of numerical precision.\n",
"\n",
- "\n",
"In practice, it is more convenient to maximize the logarithm of the\n",
"PDF because it is a monotonically increasing function of the argument.\n",
"Alternatively, and this will be our option, we will minimize the\n",
@@ -4094,15 +4604,15 @@
"Note also that maximization/minimization of the logarithm of the PDF\n",
"is equivalent to the maximization/minimization of the function itself.\n",
"\n",
- "\n",
- "\n",
- "\n",
"We could now define a new cost function to minimize, namely the negative logarithm of the above PDF"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "bbfab5d3",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"C(\\boldsymbol{\\beta}=-\\log{\\prod_{i=0}^{n-1}p(y_i,\\boldsymbol{X}\\vert\\boldsymbol{\\beta})}=-\\sum_{i=0}^{n-1}\\log{p(y_i,\\boldsymbol{X}\\vert\\boldsymbol{\\beta})},\n",
@@ -4111,14 +4621,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "f4ee97d7",
+ "metadata": {
+ "editable": true
+ },
"source": [
"which becomes"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "1e74d52d",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"C(\\boldsymbol{\\beta}=\\frac{n}{2}\\log{2\\pi\\sigma^2}+\\frac{\\vert\\vert (\\boldsymbol{y}-\\boldsymbol{X}\\boldsymbol{\\beta})\\vert\\vert_2^2}{2\\sigma^2}.\n",
@@ -4127,14 +4643,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "b983cb4c",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Taking the derivative of the *new* cost function with respect to the parameters $\\beta$ we recognize our familiar OLS equation, namely"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "c90a8ed0",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X}^T\\left(\\boldsymbol{y}-\\boldsymbol{X}\\boldsymbol{\\beta}\\right) =0,\n",
@@ -4143,14 +4665,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "f38fcc19",
+ "metadata": {
+ "editable": true
+ },
"source": [
"which leads to the well-known OLS equation for the optimal paramters $\\beta$"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "348010f6",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\hat{\\boldsymbol{\\beta}}^{\\mathrm{OLS}}=\\left(\\boldsymbol{X}^T\\boldsymbol{X}\\right)^{-1}\\boldsymbol{X}^T\\boldsymbol{y}!\n",
@@ -4159,11 +4687,13 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "cd33a62d",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Before we make a similar analysis for Ridge and Lasso regression, we need a short reminder on statistics. \n",
"\n",
- "\n",
"A central theorem in statistics is Bayes' theorem. This theorem plays a similar role as the good old Pythagoras' theorem in geometry.\n",
"Bayes' theorem is extremely simple to derive. But to do so we need some basic axioms from statistics.\n",
"\n",
@@ -4177,7 +4707,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "2bb675c1",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"p(X \\cup Y)= p(X)+p(Y)-p(X \\cap Y).\n",
@@ -4186,14 +4719,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "d1ff7ab5",
+ "metadata": {
+ "editable": true
+ },
"source": [
"The product rule (aka joint probability) is given by"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "80d51bf1",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"p(X \\cup Y)= p(X,Y)= p(X\\vert Y)p(Y)=p(Y\\vert X)p(X),\n",
@@ -4202,20 +4741,24 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "3eb856c7",
+ "metadata": {
+ "editable": true
+ },
"source": [
"where we read $p(X\\vert Y)$ as the likelihood of obtaining $X$ given $Y$.\n",
"\n",
"If we have independent events then $p(X,Y)=p(X)p(Y)$.\n",
"\n",
- "\n",
- "\n",
"The marginal probability is defined in terms of only one of the set of variables $X,Y$. For a discrete probability we have"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "84c98a40",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"p(X)=\\sum_{i=0}^{n-1}p(X,Y=y_i)=\\sum_{i=0}^{n-1}p(X\\vert Y=y_i)p(Y=y_i)=\\sum_{i=0}^{n-1}p(X\\vert y_i)p(y_i).\n",
@@ -4224,14 +4767,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "094f6489",
+ "metadata": {
+ "editable": true
+ },
"source": [
"The conditional probability, if $p(Y) > 0$, is"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "40b87dab",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"p(X\\vert Y)= \\frac{p(X,Y)}{p(Y)}=\\frac{p(X,Y)}{\\sum_{i=0}^{n-1}p(Y\\vert X=x_i)p(x_i)}.\n",
@@ -4240,14 +4789,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "02ee6009",
+ "metadata": {
+ "editable": true
+ },
"source": [
"If we combine the conditional probability with the marginal probability and the standard product rule, we have"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "c9b83f7e",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"p(X\\vert Y)= \\frac{p(X,Y)}{p(Y)},\n",
@@ -4256,14 +4811,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "28693db1",
+ "metadata": {
+ "editable": true
+ },
"source": [
"which we can rewrite as"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "cd0819c2",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"p(X\\vert Y)= \\frac{p(X,Y)}{\\sum_{i=0}^{n-1}p(Y\\vert X=x_i)p(x_i)}=\\frac{p(Y\\vert X)p(X)}{\\sum_{i=0}^{n-1}p(Y\\vert X=x_i)p(x_i)},\n",
@@ -4272,11 +4833,13 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "c73d36a3",
+ "metadata": {
+ "editable": true
+ },
"source": [
"which is Bayes' theorem. It allows us to evaluate the uncertainty in in $X$ after we have observed $Y$. We can easily interchange $X$ with $Y$. \n",
"\n",
- "\n",
"The quantity $p(Y\\vert X)$ on the right-hand side of the theorem is\n",
"evaluated for the observed data $Y$ and can be viewed as a function of\n",
"the parameter space represented by $X$. This function is not\n",
@@ -4289,7 +4852,6 @@
"\n",
"Let us try to illustrate Bayes' theorem through an example.\n",
"\n",
- "\n",
"Let us suppose that you are undergoing a series of mammography scans\n",
"in order to rule out possible breast cancer cases. We define the\n",
"sensitivity for a positive event by the variable $X$. It takes binary\n",
@@ -4307,7 +4869,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "779d9389",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"p(X=1\\vert Y=1) =0.8.\n",
@@ -4316,7 +4881,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "63db00a0",
+ "metadata": {
+ "editable": true
+ },
"source": [
"This obviously sounds scary since many would conclude that if the test\n",
"is positive, there is a likelihood of $80\\%$ for having cancer. It is\n",
@@ -4326,7 +4894,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "ab01099c",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"p(Y=1\\vert X=1),\n",
@@ -4335,12 +4906,13 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "ec0ebb28",
+ "metadata": {
+ "editable": true
+ },
"source": [
"instead of $p(X=1\\vert Y=1)$.\n",
"\n",
- "\n",
- "\n",
"If we look at various national surveys on breast cancer, the general\n",
"likelihood of developing breast cancer is a very small number. Let us\n",
"assume that the prior probability in the population as a whole is"
@@ -4348,7 +4920,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "4c432161",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"p(Y=1) =0.004.\n",
@@ -4357,7 +4932,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "03d0cdb8",
+ "metadata": {
+ "editable": true
+ },
"source": [
"We need also to account for the fact that the test may produce a false\n",
"positive result (false alarm). Let us here assume that we have"
@@ -4365,7 +4943,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "8d7a0ad2",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"p(X=1\\vert Y=0) =0.1.\n",
@@ -4374,7 +4955,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "fcdc27a1",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Using Bayes' theorem we can then find the posterior probability that\n",
"the person has breast cancer in case of a positive test, that is we\n",
@@ -4383,7 +4967,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "e773eb9e",
+ "metadata": {
+ "editable": true
+ },
"source": [
"\n",
"\n",
@@ -4398,7 +4985,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "3892720e",
+ "metadata": {
+ "editable": true
+ },
"source": [
"\n",
"\n",
@@ -4413,12 +5003,21 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "c68513be",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "That is, in case of a positive test, there is only a $3\\%$ chance of having breast cancer!"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "db1bcf38",
+ "metadata": {
+ "editable": true
+ },
"source": [
- "That is, in case of a positive test, there is only a $3\\%$ chance of having breast cancer!\n",
- "\n",
- "\n",
- "\n",
"## Bayes' Theorem and Ridge and Lasso Regression\n",
"\n",
"Hitherto we have discussed Ridge and Lasso regression in terms of a\n",
@@ -4428,7 +5027,6 @@
"\n",
"Before we proceed let us perform a Ridge, Lasso and OLS analysis of a polynomial fit. \n",
"\n",
- "\n",
"We will play around with a study of the values for the optimal\n",
"parameters $\\boldsymbol{\\beta}$ using OLS, Ridge and Lasso regression. For\n",
"OLS, you will notice as function of the noise and polynomial degree,\n",
@@ -4443,12 +5041,38 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 12,
+ "id": "aa27ede9",
"metadata": {
"collapsed": false,
"editable": true
},
- "outputs": [],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "[ 1.0169643 0.27924636 -1.4087793 1.03308408 0. ]\n",
+ "Test MSE OLS\n",
+ "0.958228616652075\n"
+ ]
+ },
+ {
+ "data": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEGCAYAAABo25JHAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAnVklEQVR4nO3deXgUVd728e+PCAMDiCwBFcS4IC4sIYIj+LL4iOKCqA/Oi8CAgIgLOCLKgOKAyigoOoqAKCLiNjDKMqIIio4I7yAOqxiGARXwkeWRRcMga0jO+8dpYoxJurN0Kt19f64rF91dlaq7C+hf16lT55hzDhERSVwVgg4gIiLBUiEQEUlwKgQiIglOhUBEJMGpEIiIJLgTgg5QVHXq1HEpKSlBxxARiSmrVq3a45xLzm9ZzBWClJQUVq5cGXQMEZGYYmbfFLRMTUMiIglOhUBEJMGpEIiIJLiYu0aQn8zMTLZt28bhw4eDjiJFVLlyZRo0aEDFihWDjiKSsOKiEGzbto3q1auTkpKCmQUdRyLknGPv3r1s27aNM844I+g4IgkrLpqGDh8+TO3atVUEYoyZUbt2bZ3JiQQsLgoBoCIQo/T3JhK8uCkEIiJx7ZFHYPXqqGxahaCUmBm9evXKeX7s2DGSk5Pp3LkzAN999x2dO3emefPmnH/++Vx99dUAbN26lSpVqpCamprz8+qrr/5i+x06dKBx48Y0b96cVq1asXbt2pxlV199NRkZGb/4nYceeognn3yyRO9r7969OblOPvlk6tevn/P86NGjEW1j8eLFLFu2rEQ5RBLavHkwahTMnRuVzcfFxeLyoGrVqqSnp3Po0CGqVKnCokWLqF+/fs7ykSNHcvnll3P33XcDsG7dupxlZ5111s8+2Avyxhtv0LJlS15++WWGDh3KokWLAHjvvfdK983kUrt27ZxsDz30ENWqVeO+++4r0jYWL15MtWrVaNOmTRQSisS5PXtgwABo3hz++Meo7EJnBKXoqquuYv78+QDMmDGD7t275yzbuXMnDRo0yHnerFmzYu+ndevWbN++Ped5SkoKe/bsAeDRRx+lcePGdOzYkY0bN+ass2LFCpo1a0br1q0ZOnQoTZo0ASArK4uhQ4fSqlUrmjVrxgsvvBBRhlWrVtG+fXsuvPBCOnXqxM6dOwF49tlnOf/882nWrBk33XQTW7du5fnnn+fpp58mNTWVpUuXFvt9iyQc5+COO+D77+HVV6FSpajsJu7OCAYPhgi+XBdJaio880z49W666SYeeeQROnfuzLp16+jXr1/OB9/AgQPp1q0bEydOpGPHjvTt25dTTz0VgK+//prU1NSc7UyYMIG2bdsWuJ+FCxdy/fXX/+L1VatWMXPmTNasWcOxY8dIS0vjwgsvBKBv375MmTKFNm3aMHz48Jzfeemll6hRowYrVqzgyJEjXHLJJVxxxRWFdufMzMzkrrvu4u233yY5OZm//vWvjBgxgmnTpjF27Fi2bNnCr371KzIyMjjppJO4/fbbi3UmIZLwZs6EWbNgzBgowZfHcOKuEASpWbNmbN26lRkzZuRcAziuU6dObN68mYULF7JgwQJatGhBeno6EHnTUM+ePTlw4ABZWVmszuei0dKlS7nhhhv49a9/DUCXLl0AyMjIYP/+/TlNMz169ODdd98F4IMPPmDdunXMmjULgH379vHll18WWgg2btxIeno6l19+OeDPKk455ZScY9CzZ0+uv/76fIuViERoxw4YOBAuvhiGDo3qruKuEETyzT2aunTpwn333cfixYvZu3fvz5bVqlWLHj160KNHDzp37sySJUtyvrFH4o033qB58+YMHz6cgQMHMmfOnF+sk193TOdcgdt0zjFhwgQ6deoUcQ7nHBdccAGffvrpL5bNnz+fJUuWMG/ePEaPHs369esj3q6IhDgH/fvD4cO+SSgpKaq70zWCUtavXz9GjhxJ06ZNf/b63//+dw4ePAjA/v37+frrr2nYsGGRt1+xYkX+9Kc/sXz5cjZs2PCzZe3atWPu3LkcOnSI/fv388477wBQs2ZNqlevzvLlywGYOXNmzu906tSJyZMnk5mZCcCmTZs4cOBAoRkaN27M7t27cwpBZmYm69evJzs7m2+//ZZLL72UJ554goyMDH788UeqV6/O/v37i/xeRRLW1KmwYAE88QQ0ahT13akQlLIGDRrk9AzKbdWqVbRs2TLngm3//v1p1aoV8NM1guM/zz77bKH7qFKlCvfee+8vuoampaXRrVs3UlNT6dq168+uM7z00ksMGDCA1q1b45yjRo0aAPTv35/zzz+ftLQ0mjRpwm233caxY8cK3X+lSpWYNWsWw4YNo3nz5qSmprJs2TKysrL43e9+R9OmTWnRogX33HMPJ510Etdeey1z587VxWKRSGzZAkOGwH/9F9x5Z5ns0gprNiiPWrZs6fJOTLNhwwbOO++8gBLFhh9//JFq1aoBMHbsWHbu3Mn48eMDTuXp708kJDvbF4DVqyE9HYrRalAQM1vlnGuZ37K4u0Yg+Zs/fz5jxozh2LFjnH766UyfPj3oSCKS17PPwiefwLRppVoEwlEhSBDdunWjW7duQccQkYL8+99w//1w7bXQp0+Z7jpq1wjMbJqZ7TKz9AKW1zCzd8zsczNbb2Z9o5VFRKRcO3YMeveGqlVhyhQo48EYo3mxeDpwZSHLBwL/cs41BzoAT5lZdG6bExEpz8aOhRUrYPJkOPnkMt991AqBc24J8H1hqwDVzXd8rxZat/DuKiIi8WbtWnj4YejeHX7720AiBNl9dCJwHrAD+AK42zmXnd+KZjbAzFaa2crdu3eXZUYRkeg5cgR69YLkZJg4MbAYQRaCTsBa4FQgFZhoZifmt6JzbopzrqVzrmVycnLZJSyCshiGOm+32bLw6KOP5uRKSkqK+F6H3B577LEoJhSJYaNG+W6iU6dCrVqBxQiy11BfYKzzNzJ8ZWZbgHOBfwaYqdjKYhjqIIwYMYIRI0YAUK1atWLlfOyxx3jggQdKOZlIjFu2DMaN80NJ5BmbrKwFeUbwP8BlAGZWD2gMbA4wT4mV1TDUx23dupW2bduSlpZGWlpazuQvO3fupF27dqSmptKkSROWLl1KVlYWffr0oUmTJjRt2pSnn34agLVr13LxxRfTrFkzbrjhBn744Yew+y1o6Or89jt8+HAOHTpEamoqPXv2LPF7FokLBw7AzTf7ewX+/Oeg00TvjMDMZuB7A9Uxs23AKKAigHPueWA0MN3MvgAMGOac21PiHQc4DnVZDUN9XN26dVm0aBGVK1fmyy+/pHv37qxcuZK//OUvdOrUiREjRpCVlcXBgwdZu3Yt27dvzxnx9PiMZr1792bChAm0b9+ekSNH8vDDD/NMmPda0NDVc+bM+cV+27Zty8SJE8vtGY9IIIYPh6++go8/hurVg04TvULgnOseZvkO4Ipo7T8I0R6GOq/MzEwGDRrE2rVrSUpKYtOmTQC0atWKfv36kZmZyfXXX09qaipnnnkmmzdv5q677uKaa67hiiuuYN++fWRkZNC+fXsAbr75Zn4bQa+Fgoauzm+/IpLHRx/5C8ODB0OHDkGnAeLxzuKAx6GO5jDUeT399NPUq1ePzz//nOzsbCpXrgz4UUiXLFnC/Pnz6dWrF0OHDqV37958/vnnvP/++0yaNIk333wzp3moqAobujq//YpIyL590LcvNG4M5agThUYfLWXRHoY6t3379nHKKadQoUIFXnvtNbKysgD45ptvqFu3Lrfeeiu33HILq1evZs+ePWRnZ9O1a1dGjx7N6tWrqVGjBjVr1sxpvnrttddyzg4KU9DQ1fntF/zQ2cfXFUlogwf7CWdefRWqVAk6TY74OyMIWGHDUA8aNIgTTjiB7OzsnGGot27d+otrBP369eP3v//9L7ZxzTXXULFiRcDPW/zYY4/RtWtX3nrrLS699FKqVq0K+Mnix40bR8WKFalWrRqvvvoq27dvp2/fvmRn+1s1xowZA8Arr7zC7bffzsGDBznzzDN5+eWXw77H/v37s3XrVtLS0nDOkZyczN/+9rd89wswYMAAmjVrRlpaGm+88UbRDqhIvJg3D6ZPhwcfhIsuCjrNz2gYagmc/v4k7u3ZA02awCmnwGefRW0S+sJoGGoRkaA4B3fcAd9/D4sWBVIEwlEhEBGJppkzYdYsGDMG8lw7LC/i5mJxrDVxiae/N4lrO3bAwIHQujUMHRp0mgLFRSGoXLkye/fu1YdKjHHOsXfv3pxuryJxxTk/fMThw/DKK5CUFHSiAsVF01CDBg3Ytm0bGpk09lSuXPlnQ2+IxI2pU2HBApgwARo1CjpNoeKiEFSsWJEzzjgj6BgiIt6WLTBkCFx2Gdx5Z9BpwoqLpiERkXIjO9vfPVyhgp+EvkL5/5iNizMCEZFyY/x4+OQTePllP7poDCj/pUpEJFZs2AD33w/XXuuHmY4RKgQiIqXh2DH/4V+tGkyZAmZBJ4qYmoZERErD2LGwYgW89RacfHLQaYpEZwQiIiW1Zg08/DB07w433hh0miJTIRARKYkjR6B3b0hO9hPOxCA1DYmIlMSoUZCeDvPnQ61aQacpFp0RiIgU17JlMG4c3Hor5JmeNpaoEIiIFMeBA76XUMOG8NRTQacpETUNiYgUx7Bh8NVXsHgxVK8edJoS0RmBiEhRffghTJrk5yCOYJ7v8k6FQESkKPbtg3794Nxz4bHHgk5TKtQ0JCJSFIMH+wlnli2DKlWCTlMqdEYgIhKpefNg+nQ/ntBFFwWdptSoEIiIRGLPHt9NNDUV/vjHoNOUKjUNiYiE4xzccQdkZPgLxZUqBZ2oVKkQiIiEM3MmzJrlB5Zr2jToNKVOTUMiIoXZsQMGDoTWreG++4JOExUqBCIiBXEObrnFDyz3yiuQlBR0oqhQ05CISEGmToWFC/2ooo0aBZ0manRGICKSny1bYMgQuOwyf6E4jqkQiIjklZ0NffpAhQowbZr/M46paUhEJK/x42HJEnj5ZT+6aJyLWpkzs2lmtsvM0gtZp4OZrTWz9Wb2SbSyiIhEbMMGf+dwly5+mOkEEM3znenAlQUtNLOTgOeALs65C4DfRjGLiEh4x475D/9q1eCFF8As6ERlImpNQ865JWaWUsgqPYA5zrn/Ca2/K1pZREQiMmYMrFgBb70FJ58cdJoyE+QVkHOAmma22MxWmVnvALOISKJbswYeeQS6d4cbbww6TZkK8mLxCcCFwGVAFeBTM1vunNuUd0UzGwAMAGiYABduRKSMHTkCvXtDcrK/ZyDBBHlGsA1Y6Jw74JzbAywBmue3onNuinOupXOuZXJycpmGFJEEMGoUpKfDSy9BrVpBpylzQRaCt4G2ZnaCmf0a+A2wIcA8IpKIli2DceP8ENNXXRV0mkBErWnIzGYAHYA6ZrYNGAVUBHDOPe+c22BmC4F1QDYw1TlXYFdTEZFSd+CA7yXUsCE89VTQaQITzV5D3SNYZxwwLloZREQKNWwYfP01fPwxVK8edJrAxPd90yIiBfnwQ5g0yc9B3L590GkCpUIgIoln3z7o1w/OPRcefTToNIHTWEMiknjuvttPOPPpp1ClStBpAqczAhFJLG+/7SeZeeABaNUq6DTlggqBiCSO3bthwABo0QIefDDoNOWGmoZEJDE45yeYycjwF4orVQo6UbmhQiAiiWHGDJg9G8aOhaZNg05TrqhpSETi344dMHAgtG4N990XdJpyR4VAROKbc3DLLXD0qL9InJQUdKJyR01DIhLfpk6FhQv9qKKNGgWdplzSGYGIxK8tW2DIEOjY0V8olnypEIhIfMrOhj59oEIFmDbN/yn5UtOQiMSn8eNhyRKYPh1OOy3oNOWaSqSIxJ8NG+D++6FLFz/zmBRKhUBE4suxY/7Dv1o1mDIFzIJOVO6paUhE4suYMbByJbz1FtSrF3SamKAzAhGJH2vWwCOPQI8ecOONQaeJGSoEIhIfjhzxTULJyTBhQtBpYoqahkQkPowcCenp8N57UKtW0Gliis4IRCT2LVsG48b5IaavuiroNDFHhUBEYtuBA75JKCUFnnwy6DQxSU1DIhLbhg2DzZvh44+hevWg08QknRGISOz68EOYNAkGD4b27YNOE7NUCEQkNu3bB337wrnnwqOPBp0mpqlpSERi0913w86d8OmnUKVK0Glims4IRCT2vP22n2TmgQegVaug08Q8FQIRiS27d/tuoi1awIMPBp0mLqhpSERih3N+gpmMDPjoI6hUKehEcaHQMwIz+12ux5fkWTYoWqFERPI1YwbMng2jR0OTJkGniRvhmoaG5Hqcd/COfqWcRUSkYNu3w8CB0KYN3Htv0GniSrhCYAU8zu+5iEh0OAf9+8PRo/4icVJS0IniSrhrBK6Ax/k9FxGJjhdfhIULYeJEOPvsoNPEnXCF4FwzW4f/9n9W6DGh52dGNZmICPjhI4YMgY4d/YViKXXhCsF5ZZJCRCQ/2dn+7uGkJJg2DSqox3s0FFoInHPf5H5uZrWBdsD/OOdWRTOYiAjjx8OSJTB9Opx2WtBp4la47qPvmlmT0ONTgHR8b6HXzGxwmN+dZma7zCw9zHqtzCzLzDSvnIj8ZMMGuP9+uO46P8y0RE2486wznHPHP8j7Aoucc9cCvyF899HpwJWFrWBmScDjwPvho4pIwsjM9B/+1avDCy+AqZNiNIUrBJm5Hl8GvAfgnNsPZBf2i865JcD3YbZ/FzAb2BVmPRFJJGPHwsqVMHky1KsXdJq4F+5i8bdmdhewDUgDFgKYWRWgYkl2bGb1gRuA/wIKHTXKzAYAAwAaNmxYkt2KSHm3ejU88gj06AE3qsW4LIQ7I7gFuADoA3RzzmWEXr8YeLmE+34GGOacywq3onNuinOupXOuZXJycgl3KyLl1pEjvkmobl1/z4CUiXC9hnYBt+fz+sfAxyXcd0tgpvm2vzrA1WZ2zDn3txJuV0Ri1ciRsH49vPce1KwZdJqEUWghMLN5hS13znUp7o6dc2fk2s904F0VAZEEtmwZjBvnh5i+6qqg0ySUcNcIWgPfAjOAzyjC+EJmNgPoANQxs23AKELXFZxzzxcnrIjEqQMHfJNQSgo8+WTQaRJOuEJwMnA50B3oAcwHZjjn1ofbsHOue6QhnHN9Il1XROLQsGF+KInFi32XUSlThV4sds5lOecWOuduxl8g/gpYHOpJJCJSch9+CJMmwT33QLt2QadJSGFnKDOzXwHX4M8KUoBngTnRjSUiCSEjw48ldN558Kc/BZ0mYYW7WPwK0ARYADyc6y5jEZGSGzwYdu6EOXOgSpWg0ySscGcEvYADwDnA7+2n27wNcM65E6OYTUTi2dtv+0lm/vhHaFXoPaUSZeHuI9CYryJS+nbv9t1EW7SABx8MOk3CC3uNQESkVDnnJ5jJyICPPoJKlYJOlPBUCESkbM2YAbNnw+OPQ5MmQacRwo81JCJSerZvh4EDoU0buPfeoNNIiAqBiJQN56B/fzh61F8kTkoKOpGEqGlIRMrGiy/CwoX+5rGzzw46jeSiMwIRib7Nm2HIEOjYEW7/xYDGEjAVAhGJruxs6NPHNwVNmwYV9LFT3qhpSESi65lnYOlSmD4dTjst6DSSD5VmEYmeDRvggQfguuv8MNNSLqkQiEh0ZGb6D//q1eGFF8Ains5EypiahkQkOsaOhZUrYdYsqFcv6DRSCJ0RiEjpW70aHnkEevaErl2DTiNhqBCISOk6fNg3CdWtCxMmBJ1GIqCmIREpXaNGwfr1sGAB1KwZdBqJgM4IRKT0/OMfMG6cH2L6yiuDTiMRUiEQkdJx4ADcfDOkpMCTTwadRopATUMiUjr+8Ac/lMTixb7LqMQMnRGISMktWgTPPQf33APt2gWdRopIhUBESiYjA/r1g/POg0cfDTqNFIOahkSkZAYPhp07Ye5cqFw56DRSDDojEJHie/ttP8nMiBHQsmXQaaSYVAhEpHh27/bdRFu08IVAYpaahkSk6JzzE8xkZMBHH0GlSkEnkhJQIRCRovvLX2DOHHjiCWjSJOg0UkJqGhKRotm+HQYNgksu8dNPSsxTIRCRyDkH/fvD0aN+xrGkpKATSSlQ05CIRO7FF2HhQpg0Cc4+O+g0Ukp0RiAikdm82TcFXX453HFH0GmkFKkQiEh4WVnQpw+ccAK89JKmnYwzahoSkfDGj4elS/3NY6edFnQaKWVROyMws2lmtsvM0gtY3tPM1oV+lplZ82hlEZES+Ne/4IEH4LrroFevoNNIFESzaWg6UNjMFFuA9s65ZsBoYEoUs4hIcWRm+jkGqleHKVPUJBSnotY05JxbYmYphSxfluvpcqBBtLKISDGNGQMrV8Ls2X4OYolL5eVi8S3AgoIWmtkAM1tpZit3795dhrFEEtjq1TB6NPTsCf/930GnkSgKvBCY2aX4QjCsoHWcc1Occy2dcy2Tk5PLLpxIojp8GHr39mcBEyYEnUaiLNBeQ2bWDJgKXOWc2xtkFhHJZdQoWL8eFiyAmjWDTiNRFlghMLOGwBygl3NuU1A5RCSXw4f93cPjxsFtt8GVhfX3kHgRtUJgZjOADkAdM9sGjAIqAjjnngdGArWB58z3RDjmnNPMFiJB+M9/YPJkePpp+O47aNvWFwNJCNHsNdQ9zPL+QP9o7V9EIrBrFzzzjJ94ft8+P3zE/fdDhw7qKppAdGexSCLauhWefNIPF3HkCHTtCsOHw4UXBp1MAqBCIJJI1q+Hxx/3E8tUqODvFP7DH6Bx46CTSYBUCEQSwfLlMHasn2z+17+Gu+6Ce++FBrqPU1QIROKXc7Bokb87ePFi3w101ChfBGrXDjqdlCMqBCLxJisL5s71ZwCrVsGpp8JTT8GAAVCtWtDppBxSIRCJF0ePwuuv+2sAmzZBo0b+noBeveBXvwo6nZRjKgQise7HH/0H/lNP+YnlW7SAN9/04wNpTmGJgAqBSKz6/ns/DtCzz/rH7dv77qBXXKF7AKRIVAhEYs327fDnP8MLL8CBA3Dttf4msNatg04mMUqFQCRWbNrkh3145RXIzobu3WHYMGjSJOhkEuNUCETKuzVrfBfQWbOgUiW49Va47z4444ygk0mcUCEQKY+cgyVLfAF4/3048UT/7X/wYKhXL+h0EmdUCETKk+xsmD/fF4BPP/UTw4wZA3fcATVqBJ1O4pQKgUh5cOwYzJzp7wFIT4eUFJg0Cfr2hSpVgk4ncU6FQCRIhw7Byy/7i8Bbt8IFF8Brr0G3blCxYtDpJEGoEIgEYd++nyaC2bULLr4Yxo+Hzp39qKAiZUiFQKQsfffdTxPB/Oc/0KmTvwegXTvdBCaBUSEQKQtbt/rmn2nT/EQwN97oJ4JJSws6mYgKgUhUpaf7C8AzZvgmn969/UQw55wTdDKRHCoEItHw6ae+2+c770DVqnD33XDPPZoIRsolFQKR0uIcfPCBLwCffAK1asFDD8GgQZoIRso1FQKRksrKgtmz/UQwa9ZA/fp+ULhbb9VEMBITVAhEiuvIEd/n/4kn4Msv/UQwU6fC736niWAkpqgQiBTVjz/ClCn+W//27b7nz1tvwQ03aCIYiUkqBCKR2rvXTwQzYYKfCKZDB98d9PLLdQ+AxDQVApFwtm3z00BOmQIHD0KXLv4msIsvDjqZSKlQIRApyKZN/h6A117zo4L26OHvAdBEMBJnVAhE8lq92ncBnT3bX/QdMMBPBJOSEnQykahQIRABfw/AJ5/4AvDBB34imOHD/Y1gmghG4pwKgSS27Gx/9++YMfDZZ/5Df+xYuP12TQQjCUOFQBJTZuZPE8GsX++bfZ57Dvr00UQwknBUCCSxHDrku3yOGwfffOMv/L7+up8I5gT9d5DEpH/5khgyMvw3/meegd27oU0bmDgRrr5aE8FIwlMhkPj2v//rP/wnT/YTwVx5pb8HoG1b3QQmEhK1r0JmNs3MdplZegHLzcyeNbOvzGydmWmGDik9W7bAnXf6tv8nnvAFYPVqWLBAs4GJ5BHNc+LpwJWFLL8KaBT6GQBMjmIWSRRffOEHfWvUCF56yU8Es3Ej/PWv0KJF0OlEyqWoNQ0555aYWUohq1wHvOqcc8ByMzvJzE5xzu2MViaJY8uW+S6g777rJ4IZPNhPBFO/ftDJRMq9IK8R1Ae+zfV8W+g1FQKJjHPw/vu+ACxZ4id/efhhPxFMrVpBpxOJGUEWgvwaaV2+K5oNwDcf0bBhw2hmkliQdyKYBg3g6af9RDBVqwadTiTmBNlvbhtwWq7nDYAd+a3onJvinGvpnGuZnJxcJuGkHDpyBF58Ec491/f7P3jQ3xPw9de+KUhFQKRYgiwE84Deod5DFwP7dH1A8rV/vx8G+swz/QBwNWrArFn+juC+faFSpaATisS0qDUNmdkMoANQx8y2AaOAigDOueeB94Crga+Ag0DfaGWRGLVnz08TwfzwA1x6KUyfDh07qvunSCmKZq+h7mGWO2BgtPYvMezbb/0ZwIsv+uaf667zN4H95jdBJxOJS7qzWMqPjRv9IHCvv+5HBe3ZE4YNg/PPDzqZSFxTIZDgrVrlu4DOmeMngrntNj8RzOmnB51MJCGoEOTmnP8mevwnKyt2n5enLIU9P3zYnwnUqOGbf+6+G+rWDfpfgkhCSZhC8Omwv3HuE32pQHbOTxJZP3teIf/bGOJO7nedRdLPjkDu5+74cyt8fZff71vu5yeQTaWco56d56j/s2I/ph69nf3PnAjP+Iz5XQsuzdeivf143We01on3/ZVWpv79YciQyLZVFAlTCGqnnc6/0nrhrALZloSzCjk/2RX8h9nPnh9fTgVc6Hl2zu/k+f0iPncV/Idrzj5z7S+SbWWTZ1t5nuesy8+fH/8pT1yo9vbK57X81iuN16K9/XjdZ7TWiff9lWamaM2amjCF4JxuLTinmwYdExHJq3x9PRQRkTKnQiAikuBUCEREEpwKgYhIglMhEBFJcCoEIiIJToVARCTBqRCIiCQ4c5He9lZOmNlu4Jti/nodYE8pxikt5TUXlN9sylU0ylU08ZjrdOdcvlM8xlwhKAkzW+mcaxl0jrzKay4ov9mUq2iUq2gSLZeahkREEpwKgYhIgku0QjAl6AAFKK+5oPxmU66iUa6iSahcCXWNQEREfinRzghERCQPFQIRkQQX14XAzEab2TozW2tmH5jZqQWsd6WZbTSzr8xseBnkGmdm/w5lm2tmJxWw3lYz+yKUf2U5ylXWx+u3ZrbezLLNrMCuc2V9vIqYrayPWS0zW2RmX4b+rFnAelE/ZuHeu3nPhpavM7O0aOQoRq4OZrYvdGzWmtnIMso1zcx2mVl6ActL/3g55+L2Bzgx1+PfA8/ns04S8DVwJlAJ+Bw4P8q5rgBOCD1+HHi8gPW2AnXK8HiFzRXQ8ToPaAwsBloWsl6ZHq9IswV0zJ4AhoceDw/q31gk7x24GlgAGHAx8FkZ/L1FkqsD8G5Z/nsK7bcdkAakF7C81I9XXJ8ROOf+k+tpVch3dvqLgK+cc5udc0eBmcB1Uc71gXPuWOjpcqBBNPcXqQhzBXG8NjjnNkZzH8UVYbYyP2ah7b8SevwKcH2U91eQSN77dcCrzlsOnGRmp5SDXIFwzi0Bvi9klVI/XnFdCADM7FEz+xboCeR3alcf+DbX822h18pKP3x1z48DPjCzVWY2oAwzQcG5gj5ehQnyeBUmiGNWzzm3EyD0Z90C1ov2MYvkvQdxfCLdZ2sz+9zMFpjZBVHOFKlSP14xP3m9mX0InJzPohHOubedcyOAEWZ2PzAIGJV3E/n8bon71IbLFVpnBHAMeKOAzVzinNthZnWBRWb279C3hSBzBXa8IlDqx6uUspX5MSvCZqJyzHKJ5L1H5fiEEck+V+PH5/nRzK4G/gY0inKuSJT68Yr5QuCc6xjhqn8B5vPLQrANOC3X8wbAjmjnMrObgc7AZS7U8JfPNnaE/txlZnPxp7Ml+k9aCrkCOV4RbqPUj1cpZSvzY2Zm35nZKc65naFmg10FbCMqxyyXSN57VI5PSXPlblp2zr1nZs+ZWR3nXNCD0ZX68YrrpiEzy129uwD/zme1FUAjMzvDzCoBNwHzopzrSmAY0MU5d7CAdaqaWfXjj/EXcvPtRVCWuQjgeEUiiONVBEEcs3nAzaHHNwO/OHMpo2MWyXufB/QO9Ya5GNh3vFkrisLmMrOTzcxCjy/Cf17ujXKuSJT+8SrrK+Jl+QPMxv/DXge8A9QPvX4q8F6u9a4GNuF7EYwog1xf4dv41oZ+ns+bC9+b4fPQz/rykiug43UD/lvQEeA74P3ycLwizRbQMasNfAR8GfqzVlDHLL/3DtwO3B56bMCk0PIvKKRnWBnnGhQ6Lp/jO0+0KaNcM4CdQGbo39Yt0T5eGmJCRCTBxXXTkIiIhKdCICKS4FQIREQSnAqBiEiCUyEQEUlwKgQS08zsxxL87qDQCI7OzOrker3A0R3NrIqZfWJmSWaWUtAIkcXIMt3MboxgvcVWyCinoXVm5rmHRqRQKgSSyP4BdAS+yfP6VfihBBoBA4DJuZb1A+Y457LKJGHxTAb+EHQIiR0qBBIXQt/ix5lZuvnx9buFXq8QGhpgvZm9a2bvHf/m7Zxb45zbms/mChvdsSf536WbYmZLzWx16KdN6PUOoTOIN81sk5mNNbOeZvbPUM6zcm2mY2gbm8ysc+j3q4S+4a8zs78CVXLtc7KZrQy9t4dzbWdpaFsxP4SMlA39Q5F48d9AKtAcqAOsMLMlwCVACtAUPwLnBmBamG3lO7qjme0FziygeOwCLnfOHQ41y8wAjjfhNMfPW/A9sBmY6py7yMzuBu4CBofWSwHaA2cBH5vZ2cAdwEHnXDMza4YfCO24Ec65780sCfjIzJo559Y557LN7KvQfleFea8iOiOQuPF/gBnOuSzn3HfAJ0Cr0OtvOeeynXP/C3wcwbYKGt2xDpBRwO9UBF40sy+At4Dzcy1b4Zzb6Zw7gh8W4IPQ61/gP/yPezOU80t8wTgXP0nJ6wDOuXX44VKO+79mthpYA1yQZ5+78MNJiISlMwKJF/l9eBf2emEKGt3xMFC5gN+5Bz/WUHP8F6zDuZYdyfU4O9fzbH7+fzDveC+ugNcxszOA+4BWzrkfzGx6nmyVgUMFZBX5GZ0RSLxYAnQL9eZJxn+T/ifw/4CuoWsF9fDTD4aT7+iOzrkfgCQzy68Y1AB2OueygV74qRCL6rehnGfhB4TbGHpfPQHMrAnQLLTuicABYF/ofV2VZ1vn4AdMEwlLhUDixVx8s8nnwN+BP4Sagmbjv+GnAy8AnwH7AMzs92a2Df+Nf52ZTQ1t6z1808xXwIvAnbn28wG+uSmv54CbzWw5/kP4QDHew0Z8k9YC/EiTh/E9gKqZ2Tp8T6B/AjjnPsc3Ca3HX/P4x/GNhArDIRf9oZwlTmj0UYl7ZlbN+VmmauM/SC8JFYnibKsFMMQ516tUQ5YiM7sH+I9z7qWgs0hs0DUCSQTvmtlJQCVgdHGLAPgup2b2sZklleN7CTKA14IOIbFDZwQiIglO1whERBKcCoGISIJTIRARSXAqBCIiCU6FQEQkwf1/FbtgXyPF8EUAAAAASUVORK5CYII=\n",
+ "text/plain": [
+ "
"
+ ],
+ "text/plain": [
+ " beta\n",
+ "0 0.718165\n",
+ "1 0.156956\n",
+ "2 0.040102\n",
+ "3 -0.001880\n",
+ "4 0.000000"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
"source": [
"import numpy as np\n",
"import pandas as pd\n",
@@ -4592,7 +5526,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "d32f4700",
+ "metadata": {
+ "editable": true
+ },
"source": [
"As an exercise, repeat these calculations with ordinary least squares\n",
"only with and without noise. Calculate thereafter the variance of the\n",
@@ -4600,11 +5537,16 @@
"noise. Here we recommend to use $\\sigma^2=1$ as variance for the\n",
"added noise (which follows a normal distribution with mean value zero).\n",
"Comment your results. If you have a large noise term, do the parameters $\\beta_j$ vary more as function\n",
- "model complexity? And what about their variance? \n",
- "\n",
- "\n",
- "\n",
- "\n",
+ "model complexity? And what about their variance?"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "5292b482",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
"## Linking Bayes' Theorem with Ridge and Lasso Regression\n",
"\n",
"We have seen that Ridge regression suppresses those features which\n",
@@ -4618,7 +5560,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "6b827637",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{D}=[(x_0,y_0), (x_1,y_1),\\dots, (x_{n-1},y_{n-1})],\n",
@@ -4627,14 +5572,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "6e73b7d4",
+ "metadata": {
+ "editable": true
+ },
"source": [
"is given by"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "ead2878e",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"p(\\boldsymbol{D}\\vert\\boldsymbol{\\beta})=\\prod_{i=0}^{n-1}\\frac{1}{\\sqrt{2\\pi\\sigma^2}}\\exp{\\left[-\\frac{(y_i-\\boldsymbol{X}_{i,*}\\boldsymbol{\\beta})^2}{2\\sigma^2}\\right]}.\n",
@@ -4643,14 +5594,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "1302f31e",
+ "metadata": {
+ "editable": true
+ },
"source": [
"In Bayes' theorem this function plays the role of the so-called likelihood. We could now ask the question what is the posterior probability of a parameter set $\\boldsymbol{\\beta}$ given a domain of events $\\boldsymbol{D}$? That is, how can we define the posterior probability"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "dd411d77",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"p(\\boldsymbol{\\beta}\\vert\\boldsymbol{D}).\n",
@@ -4659,14 +5616,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "01dcd800",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Bayes' theorem comes to our rescue here since (omitting the normalization constant)"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "0a3fa1e5",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"p(\\boldsymbol{\\beta}\\vert\\boldsymbol{D})\\propto p(\\boldsymbol{D}\\vert\\boldsymbol{\\beta})p(\\boldsymbol{\\beta}).\n",
@@ -4675,25 +5638,28 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "e5ce5ac4",
+ "metadata": {
+ "editable": true
+ },
"source": [
"We have a model for $p(\\boldsymbol{D}\\vert\\boldsymbol{\\beta})$ but need one for the **prior** $p(\\boldsymbol{\\beta}$! \n",
"\n",
- "\n",
- "\n",
"With the posterior probability defined by a likelihood which we have\n",
"already modeled and an unknown prior, we are now ready to make\n",
"additional models for the prior.\n",
"\n",
"We can, based on our discussions of the variance of $\\boldsymbol{\\beta}$ and\n",
"the mean value, assume that the prior for the values $\\boldsymbol{\\beta}$ is\n",
- "given by a Gaussian with mean value zero and variance $\\tau^2$, that\n",
- "is"
+ "given by a Gaussian with mean value zero and variance $\\tau^2$, that"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "9221bb65",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"p(\\boldsymbol{\\beta})=\\prod_{j=0}^{p-1}\\exp{\\left(-\\frac{\\beta_j^2}{2\\tau^2}\\right)}.\n",
@@ -4702,14 +5668,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "0e7f22c4",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Our posterior probability becomes then (omitting the normalization factor which is just a constant)"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "3565934d",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"p(\\boldsymbol{\\beta\\vert\\boldsymbol{D})}=\\prod_{i=0}^{n-1}\\frac{1}{\\sqrt{2\\pi\\sigma^2}}\\exp{\\left[-\\frac{(y_i-\\boldsymbol{X}_{i,*}\\boldsymbol{\\beta})^2}{2\\sigma^2}\\right]}\\prod_{j=0}^{p-1}\\exp{\\left(-\\frac{\\beta_j^2}{2\\tau^2}\\right)}.\n",
@@ -4718,7 +5690,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "5c4b9c3a",
+ "metadata": {
+ "editable": true
+ },
"source": [
"We can now optimize this quantity with respect to $\\boldsymbol{\\beta}$. As we\n",
"did for OLS, this is most conveniently done by taking the negative\n",
@@ -4728,7 +5703,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "f91f265b",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"C(\\boldsymbol{\\beta})=\\frac{\\vert\\vert (\\boldsymbol{y}-\\boldsymbol{X}\\boldsymbol{\\beta})\\vert\\vert_2^2}{2\\sigma^2}+\\frac{1}{2\\tau^2}\\vert\\vert\\boldsymbol{\\beta}\\vert\\vert_2^2,\n",
@@ -4737,14 +5715,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "a0427716",
+ "metadata": {
+ "editable": true
+ },
"source": [
"and replacing $1/2\\tau^2$ with $\\lambda$ we have"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "117eb03b",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"C(\\boldsymbol{\\beta})=\\frac{\\vert\\vert (\\boldsymbol{y}-\\boldsymbol{X}\\boldsymbol{\\beta})\\vert\\vert_2^2}{2\\sigma^2}+\\lambda\\vert\\vert\\boldsymbol{\\beta}\\vert\\vert_2^2,\n",
@@ -4753,17 +5737,22 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "9015a44a",
+ "metadata": {
+ "editable": true
+ },
"source": [
"which is our Ridge cost function! Nice, isn't it?\n",
"\n",
- "\n",
"To derive the Lasso cost function, we simply replace the Gaussian prior with an exponential distribution ([Laplace in this case](https://en.wikipedia.org/wiki/Laplace_distribution)) with zero mean value, that is"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "a184ac5a",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"p(\\boldsymbol{\\beta})=\\prod_{j=0}^{p-1}\\exp{\\left(-\\frac{\\vert\\beta_j\\vert}{\\tau}\\right)}.\n",
@@ -4772,14 +5761,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "ae799fbe",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Our posterior probability becomes then (omitting the normalization factor which is just a constant)"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "055d1b54",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"p(\\boldsymbol{\\beta}\\vert\\boldsymbol{D})=\\prod_{i=0}^{n-1}\\frac{1}{\\sqrt{2\\pi\\sigma^2}}\\exp{\\left[-\\frac{(y_i-\\boldsymbol{X}_{i,*}\\boldsymbol{\\beta})^2}{2\\sigma^2}\\right]}\\prod_{j=0}^{p-1}\\exp{\\left(-\\frac{\\vert\\beta_j\\vert}{\\tau}\\right)}.\n",
@@ -4788,7 +5783,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "104615f6",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Taking the negative\n",
"logarithm of the posterior probability and leaving out the\n",
@@ -4797,7 +5795,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "8d868c3b",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"C(\\boldsymbol{\\beta}=\\frac{\\vert\\vert (\\boldsymbol{y}-\\boldsymbol{X}\\boldsymbol{\\beta})\\vert\\vert_2^2}{2\\sigma^2}+\\frac{1}{\\tau}\\vert\\vert\\boldsymbol{\\beta}\\vert\\vert_1,\n",
@@ -4806,14 +5807,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "c88440ff",
+ "metadata": {
+ "editable": true
+ },
"source": [
"and replacing $1/\\tau$ with $\\lambda$ we have"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "07c1232a",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"C(\\boldsymbol{\\beta}=\\frac{\\vert\\vert (\\boldsymbol{y}-\\boldsymbol{X}\\boldsymbol{\\beta})\\vert\\vert_2^2}{2\\sigma^2}+\\lambda\\vert\\vert\\boldsymbol{\\beta}\\vert\\vert_1,\n",
@@ -4822,11 +5829,13 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "8416dffb",
+ "metadata": {
+ "editable": true
+ },
"source": [
"which is our Lasso cost function! \n",
"\n",
- "\n",
"Plotting these prior functions shows us that we can use the parameter\n",
"$\\lambda$ to shrink or increase the role of a given parameter\n",
"$\\beta_j$. The variance for the Laplace distribution is\n",
@@ -4852,5 +5861,5 @@
}
},
"nbformat": 4,
- "nbformat_minor": 4
+ "nbformat_minor": 5
}
\ No newline at end of file
diff --git a/doc/LectureNotes/_build/jupyter_execute/chapter2.py b/doc/LectureNotes/_build/jupyter_execute/chapter2.py
index 6c5959b71..1bfb3775a 100644
--- a/doc/LectureNotes/_build/jupyter_execute/chapter2.py
+++ b/doc/LectureNotes/_build/jupyter_execute/chapter2.py
@@ -1,15 +1,15 @@
#!/usr/bin/env python
# coding: utf-8
+#
+
# # Ridge and Lasso Regression
-#
-#
-#
+
# ## Mathematical Interpretation of Ordinary Least Squares
#
# What is presented here is a mathematical analysis of various regression algorithms (ordinary least squares, Ridge and Lasso Regression). The analysis is based on an important algorithm in linear algebra, the so-called Singular Value Decomposition (SVD).
#
-#
# We have shown that in ordinary least squares (OLS) the optimal parameters $\beta$ are given by
# $$
@@ -39,9 +39,6 @@
# The matrix $\boldsymbol{A}$ has the important property that $\boldsymbol{A}^2=\boldsymbol{A}$. This is the definition of a [projection matrix](https://en.wikipedia.org/wiki/Projection_matrix).
# We can then interpret our optimal model $\tilde{\boldsymbol{y}}$ as being represented by an orthogonal projection of $\boldsymbol{y}$ onto a space defined by the column vectors of $\boldsymbol{X}$. In our case here the matrix $\boldsymbol{A}$ is a square matrix. If it is a general rectangular matrix we have an oblique projection matrix.
#
-#
-#
-#
# We have defined the residual error as
# $$
@@ -50,7 +47,6 @@
# The residual errors are then the projections of $\boldsymbol{y}$ onto the orthogonal component of the space defined by the column vectors of $\boldsymbol{X}$.
#
-#
# If the matrix $\boldsymbol{X}$ is an orthogonal (or unitary in case of complex values) matrix, we have
# $$
@@ -69,14 +65,10 @@
# \boldsymbol{\epsilon}=\boldsymbol{y}-\tilde{\boldsymbol{y}}=0.
# $$
-# This serves also as a useful test of our codes.
-#
-#
-#
-#
+# This serves also as a useful test of our codes.
+
# ## The singular value decomposition
#
-#
# The examples we have looked at so far are cases where we normally can
# invert the matrix $\boldsymbol{X}^T\boldsymbol{X}$. Using a polynomial expansion where we fit of various functions leads to
# row vectors of the design matrix which are essentially orthogonal due
@@ -84,7 +76,6 @@
# design matrix is then often done via a so-called LU, QR or Cholesky
# decomposition.
#
-#
# As we will also see in the first project,
# this may
# however not the be case in general and a standard matrix inversion
@@ -108,9 +99,6 @@
# in the principal component analysis where high-dimensional data can be
# reduced to the statistically relevant features.
#
-#
-#
-#
# One of the typical problems we encounter with linear regression, in particular
# when the matrix $\boldsymbol{X}$ (our so-called design matrix) is high-dimensional,
# are problems with near singular or singular matrices. The column vectors of $\boldsymbol{X}$
@@ -156,8 +144,6 @@
# We see easily that $\mbox{det}(\boldsymbol{X}) = x_{11} x_{22} - x_{12} x_{21} = 1 \times (-1) - 1 \times (-1) = 0$. Hence, $\mathbf{X}$ is singular and its inverse is undefined.
# This is equivalent to saying that the matrix $\boldsymbol{X}$ has at least an eigenvalue which is zero.
#
-#
-#
# If our design matrix $\boldsymbol{X}$ which enters the linear regression problem
#
@@ -182,14 +168,10 @@
# \boldsymbol{X}^{T} \boldsymbol{X} \rightarrow \boldsymbol{X}^{T} \boldsymbol{X}+\lambda \boldsymbol{I},
# $$
-# where $\boldsymbol{I}$ is the identity matrix. When we discuss **Ridge** regression this is actually what we end up evaluating. The parameter $\lambda$ is called a hyperparameter. More about this later.
-#
-#
-#
-#
+# where $\boldsymbol{I}$ is the identity matrix. When we discuss **Ridge** regression this is actually what we end up evaluating. The parameter $\lambda$ is called a hyperparameter. More about this later.
+
# ## Basic math of the SVD
#
-#
# From standard linear algebra we know that a square matrix $\boldsymbol{X}$ can be diagonalized if and only it is
# a so-called [normal matrix](https://en.wikipedia.org/wiki/Normal_matrix), that is if $\boldsymbol{X}\in {\mathbb{R}}^{n\times n}$
# we have $\boldsymbol{X}\boldsymbol{X}^T=\boldsymbol{X}^T\boldsymbol{X}$ or if $\boldsymbol{X}\in {\mathbb{C}}^{n\times n}$ we have $\boldsymbol{X}\boldsymbol{X}^{\dagger}=\boldsymbol{X}^{\dagger}\boldsymbol{X}$.
@@ -225,10 +207,6 @@
# is not diagonalizable, it is a so-called [defective matrix](https://en.wikipedia.org/wiki/Defective_matrix). It is easy to see that the condition
# $\boldsymbol{X}\boldsymbol{X}^T=\boldsymbol{X}^T\boldsymbol{X}$ is not fulfilled.
#
-#
-#
-#
-#
# However, and this is the strength of the SVD algorithm, any general
# matrix $\boldsymbol{X}$ can be decomposed in terms of a diagonal matrix and
# two orthogonal/unitary matrices. The [Singular Value Decompostion
@@ -270,7 +248,6 @@
#
# The columns of $\boldsymbol{U}$ are called the left singular vectors while the columns of $\boldsymbol{V}$ are the right singular vectors.
#
-#
# If we assume that $n > p$, then our matrix $\boldsymbol{U}$ has dimension $n
# \times n$. The last $n-p$ columns of $\boldsymbol{U}$ become however
# irrelevant in our calculations since they are multiplied with the
@@ -287,7 +264,7 @@
# If $p > n$, then only the first $n$ columns of $\boldsymbol{V}$ are computed and $\boldsymbol{\Sigma}$ has dimension $n\times n$.
# The $n=p$ case is obvious, we retain the full SVD.
# In general the economy-size SVD leads to less FLOPS and still conserving the desired accuracy.
-#
+
# ## Codes for the SVD
# In[1]:
@@ -333,8 +310,6 @@ print(C-X)
# inversion algorithm for matrix inversion with $\boldsymbol{X}^T\boldsymbol{X}$ results
# in the program terminating due to a singular matrix.
#
-#
-#
# The $U$, $S$, and $V$ matrices returned from the **svd()** function
# cannot be multiplied directly.
#
@@ -347,8 +322,7 @@ print(C-X)
# If you wish to include the zero singular values, you will need to
# resize the matrices and set up a diagonal matrix as done in the above
# example
-#
-#
+
# ## Code for SVD and Inversion of Matrices
#
# How do we use the SVD to invert a matrix $\boldsymbol{X}^T\boldsymbol{X}$ which is singular or near singular?
@@ -410,7 +384,7 @@ print(np.abs(B-C))
# \boldsymbol{A}_{\mathrm{PI}}= \boldsymbol{V}\boldsymbol{D}_{\mathrm{PI}}\boldsymbol{U}^T,
# $$
-# where $\boldsymbol{D}_{\mathrm{PI}}$ can be calculated by creating a diagonal matrix from $\boldsymbol{Sigma}$ where we only keep the singular values (the non-zero values). The following code computes the pseudoinvers of the matrix based on the SVD.
+# where $\boldsymbol{D}_{\mathrm{PI}}$ can be calculated by creating a diagonal matrix from $\boldsymbol{\Sigma}$ where we only keep the singular values (the non-zero values). The following code computes the pseudoinvers of the matrix based on the SVD.
# In[4]:
@@ -441,11 +415,7 @@ print(np.abs(C-B))
# As you can see from these examples, our own decomposition based on the SVD agrees the pseudoinverse algorithm provided by **Numpy**.
-#
-#
-#
-#
-#
+
# ## Mathematics of the SVD and implications
#
# Let us take a closer look at the mathematics of the SVD and the various implications for machine learning studies.
@@ -481,7 +451,6 @@ print(np.abs(C-B))
# All values beyond $p-1$ are all zero.
#
-#
# As an example, consider the following $3\times 2$ example for the matrix $\boldsymbol{\Sigma}$
# $$
@@ -538,8 +507,6 @@ print(np.abs(C-B))
# contain only zeros. This will have important consequences for our SVD
# decomposition of the design matrix.
#
-#
-#
# The matrix that may cause problems for us is $\boldsymbol{X}^T\boldsymbol{X}$. Using the SVD we can rewrite this matrix as
# $$
@@ -554,12 +521,6 @@ print(np.abs(C-B))
# We define $\boldsymbol{\Sigma}^T\boldsymbol{\Sigma}=\tilde{\boldsymbol{\Sigma}}^2$ which is a diagonal matrix containing only the singular values squared. It has dimensionality $p \times p$.
#
-# This means, using the orthogonality of $\boldsymbol{V}$, that we get
-
-# $$
-# \boldsymbol{X}^T\boldsymbol{X}=\tilde{\boldsymbol{\Sigma}}^2.
-# $$
-
# We can now insert the result for the matrix $\boldsymbol{X}^T\boldsymbol{X}$ into our equation for ordinary least squares where
# $$
@@ -569,10 +530,10 @@ print(np.abs(C-B))
# and using our SVD decomposition of $\boldsymbol{X}$ we have
# $$
-# \tilde{y}_{\mathrm{OLS}}=\boldsymbol{U}\boldsymbol{\Sigma}\boldsymbol{V}^T\tilde{\boldsymbol{\Sigma}}^{-2}\boldsymbol{V}\boldsymbol{\Sigma}^T\boldsymbol{U}^T\boldsymbol{y},
+# \tilde{y}_{\mathrm{OLS}}=\boldsymbol{U}\boldsymbol{\Sigma}\boldsymbol{V}^T\left(\boldsymbol{V}\tilde{\boldsymbol{\Sigma}}^{2}(\boldsymbol{V}^T\right)^{-1}\boldsymbol{V}\boldsymbol{\Sigma}^T\boldsymbol{U}^T\boldsymbol{y},
# $$
-# which gives us, using the orthogonality of the matrices $\boldsymbol{U}$ and $\boldsymbol{V}$,
+# which gives us, using the orthogonality of the matrices $\boldsymbol{U}$ and $\boldsymbol{V}$,,
# $$
# \tilde{y}_{\mathrm{OLS}}=\boldsymbol{U}\boldsymbol{U}^T\boldsymbol{y}=\sum_{i=0}^{p-1}\boldsymbol{u}_i\boldsymbol{u}^T_j\boldsymbol{y},
@@ -587,8 +548,7 @@ print(np.abs(C-B))
# that belong to $i>p-1$, result in only zeros when we perform the multiplications. This means that the sum above has non-zero elements only up to $i=p-1$. This corresponds also to the number of singular values (these are all non-zero).
#
# It means that the ordinary least square model (with the optimal parameters) $\boldsymbol{\tilde{y}}$, corresponds to an orthogonal transformation of the output (or target) vector $\boldsymbol{y}$ by the vectors of the matrix $\boldsymbol{U}$.
-#
-#
+
# ## Further properties (important for our analyses later)
#
# Let us study again $\boldsymbol{X}^T\boldsymbol{X}$ in terms of our SVD,
@@ -638,11 +598,9 @@ print(np.abs(C-B))
# number of rows represents the number of data inputs. Note that in
# other texts you may find the opposite notation. This has consequences
# for the definition of for example the covariance matrix and its relation to the SVD.
-#
-#
+
# ## Meet the Covariance Matrix
#
-#
# Before we move on to a discussion of Ridge and Lasso regression, we want to show an important example of the above.
#
# We have already noted that the matrix $\boldsymbol{X}^T\boldsymbol{X}$ in ordinary
@@ -666,8 +624,6 @@ print(np.abs(C-B))
# the eigenvalues of the covariance matrix and the Hessian matrix in
# terms of the singular values. Let us develop these arguments, as they will play an important role in our machine learning studies.
#
-#
-#
# Before we discuss the link between for example Ridge regression and the singular value decomposition, we need to remind ourselves about
# the definition of the covariance and the correlation function. These are quantities that play a central role in machine learning methods.
#
@@ -709,7 +665,6 @@ print(np.abs(C-B))
# **Scikit-Learn** or **nunmpy's** function calculate the covariance, this
# quantity will be computed with a factor $1/(n-1)$.
#
-#
# The covariance takes values between zero and infinity and may thus
# lead to problems with loss of numerical precision for particularly
# large values. It is common to scale the covariance matrix by
@@ -733,8 +688,6 @@ print(np.abs(C-B))
# In the above example this is the function we constructed using **pandas**.
#
-#
-#
# In our derivation of the various regression algorithms like **Ordinary Least Squares** or **Ridge regression**
# we defined the design/feature matrix $\boldsymbol{X}$ as
@@ -865,8 +818,6 @@ print(C)
#
# The above procedure with **numpy** can be made more compact if we use **pandas**.
#
-#
-#
# We whow here how we can set up the correlation matrix using **pandas**, as done in this simple code
# In[7]:
@@ -947,8 +898,6 @@ print(covariance_matrix)
# drop these elements and construct a correlation
# matrix without these elements.
#
-#
-#
# We can rewrite the covariance matrix in a more compact form in terms of the design/feature matrix $\boldsymbol{X}$ as
# $$
@@ -983,12 +932,12 @@ print(covariance_matrix)
# \end{bmatrix},
# $$
-# where we wrote $$\boldsymbol{C}[\boldsymbol{x}_0,\boldsymbol{x}_1] = \boldsymbol{C}[\boldsymbol{x}]$$ to indicate that this is the covariance of the vectors $\boldsymbol{x}$ of the design/feature matrix $\boldsymbol{X}$.
+# where we wrote $\boldsymbol{C}[\boldsymbol{x}_0,\boldsymbol{x}_1]=\boldsymbol{C}[\boldsymbol{x}]$ to indicate
+# that this is the covariance of the vectors $\boldsymbol{x}$ of the
+# design/feature matrix $\boldsymbol{X}$.
#
# It is easy to generalize this to a matrix $\boldsymbol{X}\in {\mathbb{R}}^{n\times p}$.
-#
-#
-#
+
# ## Linking with the SVD
#
# We saw earlier that
@@ -1042,7 +991,6 @@ print(covariance_matrix)
# $\boldsymbol{v}_i$ are hierarchically ordered by how much correlation they
# encode from the columns of $\boldsymbol{X}$.
#
-#
# Note that these are also the eigenvectors and eigenvalues of the
# Hessian matrix.
#
@@ -1060,7 +1008,6 @@ print(covariance_matrix)
# self-adjoint, the singular values of $\boldsymbol{X}$ are equal to the
# absolute value of the eigenvalues of $\boldsymbol{X}$.
#
-#
# For $\boldsymbol{X}\boldsymbol{X}^T$ we found
# $$
@@ -1093,10 +1040,7 @@ print(covariance_matrix)
# Since we will mainly be interested in the correlations among the features
# of our data (the columns of $\boldsymbol{X}$, the quantity of interest for us are the non-zero singular
# values and the column vectors of $\boldsymbol{V}$.
-#
-#
-#
-#
+
# ## Ridge and Lasso Regression
#
# Let us remind ourselves about the expression for the standard Mean Squared Error (MSE) which we used to define our cost function and the equations for the ordinary least squares (OLS) method, that is
@@ -1184,15 +1128,12 @@ print(covariance_matrix)
# which can lead to singular matrices. However, with the SVD, we can always compute the inverse of the matrix $\boldsymbol{X}^T\boldsymbol{X}$.
#
-#
# We see that Ridge regression is nothing but the standard OLS with a
# modified diagonal term added to $\boldsymbol{X}^T\boldsymbol{X}$. The consequences, in
# particular for our discussion of the bias-variance tradeoff are rather
# interesting. We will see that for specific values of $\lambda$, we may
# even reduce the variance of the optimal parameters $\boldsymbol{\beta}$. These topics and other related ones, will be discussed after the more linear algebra oriented analysis here.
#
-#
-#
# Using our insights about the SVD of the design matrix $\boldsymbol{X}$
# We have already analyzed the OLS solutions in terms of the eigenvectors (the columns) of the right singular value matrix $\boldsymbol{U}$ as
@@ -1208,8 +1149,6 @@ print(covariance_matrix)
# with the vectors $\boldsymbol{u}_j$ being the columns of $\boldsymbol{U}$ from the SVD of the matrix $\boldsymbol{X}$.
#
-#
-#
# Since $\lambda \geq 0$, it means that compared to OLS, we have
# $$
@@ -1224,8 +1163,6 @@ print(covariance_matrix)
#
# For small eigenvalues $\sigma_i$ it means that their contributions become less important, a fact which can be used to reduce the number of degrees of freedom. More about this when we have covered the material on a statistical interpretation of various linear regression methods.
#
-#
-#
# For the sake of simplicity, let us assume that the design matrix is orthonormal, that is
# $$
@@ -1250,8 +1187,6 @@ print(covariance_matrix)
#
# We will come back to more interpreations after we have gone through some of the statistical analysis part.
#
-#
-#
# Using the matrix-vector expression for Lasso regression and dropping the parameter $1/n$ in front of the standard mean squared error equation, we have the following **cost** function
# $$
@@ -1278,10 +1213,6 @@ print(covariance_matrix)
# This equation does not lead to a nice analytical equation as in Ridge regression or ordinary least squares. This equation can however be solved by using standard convex optimization algorithms using for example the Python package [CVXOPT](https://cvxopt.org/). We will discuss this later.
#
-#
-#
-#
-#
# Let us assume that our design matrix is given by unit (identity) matrix, that is a square diagonal matrix with ones only along the
# diagonal. In this case we have an equal number of rows and columns $n=p$.
#
@@ -1331,7 +1262,6 @@ print(covariance_matrix)
# Plotting these results ([figure in handwritten notes for week 36](https://github.com/CompPhysics/MachineLearning/blob/master/doc/HandWrittenNotes/2021/NotesSeptember9.pdf)) shows clearly that Lasso regression suppresses (sets to zero) values of $\beta_i$ for specific values of $\lambda$. Ridge regression reduces on the other hand the values of $\beta_i$ as function of $\lambda$.
#
-#
# As another examples,
# let us assume we have a data set with outputs/targets given by the vector
@@ -1347,7 +1277,6 @@ print(covariance_matrix)
# meaning that we have two features and two unknown parameters $\beta_0$ and $\beta_1$ to be determined either by ordinary least squares, Ridge or Lasso regression.
#
-#
# For ordinary least squares (OLS) we know that the optimal solution is
# $$
@@ -1362,7 +1291,6 @@ print(covariance_matrix)
# The code which implements this simpler case is presented after the discussion of Ridge and Lasso.
#
-#
# For Ridge regression we have
# $$
@@ -1380,8 +1308,6 @@ print(covariance_matrix)
#
# To see this, let us write the cost function for Ridge regression.
#
-#
-#
# We define the MSE without the $1/n$ factor and have then, using that
# $$
@@ -1412,7 +1338,6 @@ print(covariance_matrix)
# which gives $\lambda=4.571$ and $\beta_0=0.933$ and $\beta_1=0.359$.
#
-#
# For Lasso we need now, keeping a constraint on $\vert\beta_0\vert+\vert\beta_1\vert=1$, to take the derivative of the absolute values of $\beta_0$
# and $\beta_1$. This gives us the following derivatives of the cost function
@@ -1465,7 +1390,6 @@ print(covariance_matrix)
# Using the constraint on $\beta_0$ and $\beta_1$ we can then find the optimal value of $\lambda$ for the different cases. We leave this as an exercise to you.
#
-#
# Here we set up the OLS, Ridge and Lasso functionality in order to study the above example. Note that here we have opted for a set of values of $\lambda$, meaning that we need to perform a search in order to find the optimal values.
#
# First we study and compare the OLS and Ridge results. The next code compares all three methods.
@@ -1694,285 +1618,8 @@ plt.show()
# for the optimal values of $\lambda$. We will see this throughout these
# series of lectures.
#
-#
# As a small addendum, we note that you can also solve this problem using the convex optimization package [CVXOPT](https://cvxopt.org/examples/mlbook/l1regls.html). This requires, in addition to having installed **CVXOPT**, you need to download the file *l1regl.py*.
-# The following code example solves the simpler problem we discussed above, where we have added the latter python file.
-# In[12]:
-
-
-from cvxopt import matrix, spdiag, mul, div, sqrt, normal, setseed
-from cvxopt import blas, lapack, solvers, sparse, spmatrix
-import math
-
-try:
- import mosek
- import sys
- __MOSEK = True
-except: __MOSEK = False
-
-if __MOSEK:
-
- def l1regls_mosek(A, b):
- """
-
- Returns the solution of l1-norm regularized least-squares problem
-
- minimize || A*x - b ||_2^2 + e'*u
-
- subject to -u <= x <= u
-
- """
-
- m, n = A.size
-
- env = mosek.Env()
- task = env.Task(0,0)
- task.set_Stream(mosek.streamtype.log, lambda x: sys.stdout.write(x))
-
- task.appendvars( 2*n) # number of variables
- task.appendcons( 2*n) # number of constraints
-
- # input quadratic objective
- Q = matrix(0.0, (n,n))
- blas.syrk(A, Q, alpha = 2.0, trans='T')
-
- I = []
- for i in range(n):
- I.extend(range(i,n))
-
- J = []
- for i in range(n):
- J.extend((n-i)*[i])
-
- task.putqobj(I, J, list(Q[matrix(I) + matrix(J)*n]))
- task.putclist(range(2*n), list(-2*A.T*b) + n*[1.0]) # setup linear objective
-
- # input constraint matrix row by row
- for i in range(n):
- task.putarow( i, [i, n+i], [1.0, -1.0])
- task.putarow( n+i, [i, n+i], [1.0, 1.0])
-
- # setup bounds on constraints
- task.putboundslice(mosek.accmode.con,
- 0, n, n*[mosek.boundkey.up], n*[0.0], n*[0.0])
- task.putboundslice(mosek.accmode.con,
- n, 2*n, n*[mosek.boundkey.lo], n*[0.0], n*[0.0])
-
- # setup variable bounds
- task.putboundslice(mosek.accmode.var,
- 0, 2*n, 2*n*[mosek.boundkey.fr], 2*n*[0.0], 2*n*[0.0])
-
- # optimize the task
- task.putobjsense(mosek.objsense.minimize)
- task.optimize()
- task.solutionsummary(mosek.streamtype.log)
- x = n*[0.0]
- task.getsolutionslice(mosek.soltype.itr, mosek.solitem.xx, 0, n, x)
-
- return matrix(x)
-
- def l1regls_mosek2(A, b):
- """
-
- Returns the solution of l1-norm regularized least-squares problem
-
- minimize w'*w + e'*u
-
- subject to -u <= x <= u
-
- A*x - w = b
-
- """
-
- m, n = A.size
-
- env = mosek.Env()
- task = env.Task(0,0)
- task.set_Stream(mosek.streamtype.log, lambda x: sys.stdout.write(x))
-
- task.appendvars(2*n + m) # number of variables
- task.appendcons(2*n + m) # number of constraints
-
- # input quadratic objective
- task.putqobj(range(2*n,2*n+m), range(2*n,2*n+m), m*[2.0])
-
- task.putclist(range(2*n+m), n*[0.0] + n*[1.0] + m*[0.0]) # setup linear objective
-
- # input constraint matrix row by row
- for i in range(n):
- task.putarow( i, [i, n+i], [1.0, -1.0])
- task.putarow( n+i, [i, n+i], [1.0, 1.0])
-
- for i in range(m):
- task.putarow( 2*n+i, range(n) + [2*n+i], list(A[i,:]) + [-1.0])
-
- # setup bounds on constraints
- task.putboundslice(mosek.accmode.con,
- 0, n, n*[mosek.boundkey.up], n*[0.0], n*[0.0])
- task.putboundslice(mosek.accmode.con,
- n, 2*n, n*[mosek.boundkey.lo], n*[0.0], n*[0.0])
- task.putboundslice(mosek.accmode.con,
- 2*n, 2*n+m, m*[mosek.boundkey.fx], list(b), list(b))
-
- # setup variable bounds
- task.putboundslice(mosek.accmode.var, 0, 2*n+m, (2*n+m)*[mosek.boundkey.fr],
- (2*n+m)*[0.0], (2*n+m)*[0.0])
-
- # optimize the task
- task.putobjsense(mosek.objsense.minimize)
- task.optimize()
- task.solutionsummary(mosek.streamtype.log)
- x = n*[0.0]
- task.getsolutionslice(mosek.soltype.itr, mosek.solitem.xx, 0, n, x)
-
- return matrix(x)
-
-def l1regls(A, b):
- """
-
- Returns the solution of l1-norm regularized least-squares problem
-
- minimize || A*x - b ||_2^2 + || x ||_1.
-
- """
-
- m, n = A.size
- q = matrix(1.0, (2*n,1))
- q[:n] = -2.0 * A.T * b
-
- def P(u, v, alpha = 1.0, beta = 0.0 ):
- """
- v := alpha * 2.0 * [ A'*A, 0; 0, 0 ] * u + beta * v
- """
- v *= beta
- v[:n] += alpha * 2.0 * A.T * (A * u[:n])
-
-
- def G(u, v, alpha=1.0, beta=0.0, trans='N'):
- """
- v := alpha*[I, -I; -I, -I] * u + beta * v (trans = 'N' or 'T')
- """
-
- v *= beta
- v[:n] += alpha*(u[:n] - u[n:])
- v[n:] += alpha*(-u[:n] - u[n:])
-
- h = matrix(0.0, (2*n,1))
-
-
- # Customized solver for the KKT system
- #
- # [ 2.0*A'*A 0 I -I ] [x[:n] ] [bx[:n] ]
- # [ 0 0 -I -I ] [x[n:] ] = [bx[n:] ].
- # [ I -I -D1^-1 0 ] [zl[:n]] [bzl[:n]]
- # [ -I -I 0 -D2^-1 ] [zl[n:]] [bzl[n:]]
- #
- # where D1 = W['di'][:n]**2, D2 = W['di'][:n]**2.
- #
- # We first eliminate zl and x[n:]:
- #
- # ( 2*A'*A + 4*D1*D2*(D1+D2)^-1 ) * x[:n] =
- # bx[:n] - (D2-D1)*(D1+D2)^-1 * bx[n:] +
- # D1 * ( I + (D2-D1)*(D1+D2)^-1 ) * bzl[:n] -
- # D2 * ( I - (D2-D1)*(D1+D2)^-1 ) * bzl[n:]
- #
- # x[n:] = (D1+D2)^-1 * ( bx[n:] - D1*bzl[:n] - D2*bzl[n:] )
- # - (D2-D1)*(D1+D2)^-1 * x[:n]
- #
- # zl[:n] = D1 * ( x[:n] - x[n:] - bzl[:n] )
- # zl[n:] = D2 * (-x[:n] - x[n:] - bzl[n:] ).
- #
- # The first equation has the form
- #
- # (A'*A + D)*x[:n] = rhs
- #
- # and is equivalent to
- #
- # [ D A' ] [ x:n] ] = [ rhs ]
- # [ A -I ] [ v ] [ 0 ].
- #
- # It can be solved as
- #
- # ( A*D^-1*A' + I ) * v = A * D^-1 * rhs
- # x[:n] = D^-1 * ( rhs - A'*v ).
-
- S = matrix(0.0, (m,m))
- Asc = matrix(0.0, (m,n))
- v = matrix(0.0, (m,1))
-
- def Fkkt(W):
-
- # Factor
- #
- # S = A*D^-1*A' + I
- #
- # where D = 2*D1*D2*(D1+D2)^-1, D1 = d[:n]**-2, D2 = d[n:]**-2.
-
- d1, d2 = W['di'][:n]**2, W['di'][n:]**2
-
- # ds is square root of diagonal of D
- ds = math.sqrt(2.0) * div( mul( W['di'][:n], W['di'][n:]),
- sqrt(d1+d2) )
- d3 = div(d2 - d1, d1 + d2)
-
- # Asc = A*diag(d)^-1/2
- Asc = A * spdiag(ds**-1)
-
- # S = I + A * D^-1 * A'
- blas.syrk(Asc, S)
- S[::m+1] += 1.0
- lapack.potrf(S)
-
- def g(x, y, z):
-
- x[:n] = 0.5 * ( x[:n] - mul(d3, x[n:]) +
- mul(d1, z[:n] + mul(d3, z[:n])) - mul(d2, z[n:] -
- mul(d3, z[n:])) )
- x[:n] = div( x[:n], ds)
-
- # Solve
- #
- # S * v = 0.5 * A * D^-1 * ( bx[:n] -
- # (D2-D1)*(D1+D2)^-1 * bx[n:] +
- # D1 * ( I + (D2-D1)*(D1+D2)^-1 ) * bzl[:n] -
- # D2 * ( I - (D2-D1)*(D1+D2)^-1 ) * bzl[n:] )
-
- blas.gemv(Asc, x, v)
- lapack.potrs(S, v)
-
- # x[:n] = D^-1 * ( rhs - A'*v ).
- blas.gemv(Asc, v, x, alpha=-1.0, beta=1.0, trans='T')
- x[:n] = div(x[:n], ds)
-
- # x[n:] = (D1+D2)^-1 * ( bx[n:] - D1*bzl[:n] - D2*bzl[n:] )
- # - (D2-D1)*(D1+D2)^-1 * x[:n]
- x[n:] = div( x[n:] - mul(d1, z[:n]) - mul(d2, z[n:]), d1+d2 ) - mul( d3, x[:n] )
-
- # zl[:n] = D1^1/2 * ( x[:n] - x[n:] - bzl[:n] )
- # zl[n:] = D2^1/2 * ( -x[:n] - x[n:] - bzl[n:] ).
- z[:n] = mul( W['di'][:n], x[:n] - x[n:] - z[:n] )
- z[n:] = mul( W['di'][n:], -x[:n] - x[n:] - z[n:] )
-
- return g
-
- return solvers.coneqp(P, q, G, h, kktsolver = Fkkt)['x'][:n]
-
-
-# Then we call the above functions and solve the problem, as done here
-
-# In[ ]:
-
-
-from cvxopt import matrix, normal
-
-X = matrix( [ [ 2, 0, 1], [0, 1, 3]])
-y = matrix( [4, 2, 3])
-x = l1regls(X,y)
-
-
-# **More text will be added to this example.**
-#
# ## Linking the regression analysis with a statistical interpretation
#
# We will now couple the discussions of ordinary least squares, Ridge
@@ -1983,7 +1630,6 @@ x = l1regls(X,y)
# parameter can reduce considerably the variance of the parameters
# $\beta$.
#
-#
# The
# advantage of doing linear regression is that we actually end up with
# analytical expressions for several statistical quantities.
@@ -1991,7 +1637,6 @@ x = l1regls(X,y)
# derive quantities like the variance and other expectation values in a
# rather straightforward way.
#
-#
# It is assumed that $\varepsilon_i
# \sim \mathcal{N}(0, \sigma^2)$ and the $\varepsilon_{i}$ are
# independent, i.e.:
@@ -2015,8 +1660,6 @@ x = l1regls(X,y)
# notation above $\mathbf{X}_{i,\ast}$ means that we are looking at the
# row number $i$ and perform a sum over all values $p$.
#
-#
-#
# The assumption we have made here can be summarized as (and this is going to be useful when we discuss the bias-variance trade off)
# that there exists a function $f(\boldsymbol{x})$ and a normal distributed error $\boldsymbol{\varepsilon}\sim \mathcal{N}(0, \sigma^2)$
# which describe our data
@@ -2063,7 +1706,6 @@ x = l1regls(X,y)
# Hence, $y_i \sim \mathcal{N}( \mathbf{X}_{i, \ast} \, \boldsymbol{\beta}, \sigma^2)$, that is $\boldsymbol{y}$ follows a normal distribution with
# mean value $\boldsymbol{X}\boldsymbol{\beta}$ and variance $\sigma^2$ (not be confused with the singular values of the SVD).
#
-#
# With the OLS expressions for the parameters $\boldsymbol{\beta}$ we can evaluate the expectation value
# $$
@@ -2107,7 +1749,6 @@ x = l1regls(X,y)
# $\boldsymbol{\sigma}^2 (\boldsymbol{\beta}_j ) = \boldsymbol{\sigma}^2 [(\mathbf{X}^{T} \mathbf{X})^{-1}]_{jj} $. This may be used to
# construct a confidence interval for the estimates.
#
-#
# In a similar way, we can obtain analytical expressions for say the
# expectation values of the parameters $\boldsymbol{\beta}$ and their variance
# when we employ Ridge regression, allowing us again to define a confidence interval.
@@ -2137,10 +1778,8 @@ x = l1regls(X,y)
# The difference is non-negative definite since each component of the
# matrix product is non-negative definite.
-# This means the variance we obtain with the standard OLS will always for $\lambda > 0$ be larger than the variance of $\boldsymbol{\beta}$ obtained with the Ridge estimator. This has interesting consequences when we discuss the so-called bias-variance trade-off below.
-#
-#
-#
+# This means the variance we obtain with the standard OLS will always for $\lambda > 0$ be larger than the variance of $\boldsymbol{\beta}$ obtained with the Ridge estimator. This has interesting consequences when we discuss the so-called bias-variance trade-off below.
+
# ## Deriving OLS from a probability distribution
#
# Our basic assumption when we derived the OLS equations was to assume
@@ -2193,21 +1832,18 @@ x = l1regls(X,y)
# likelihood of a domain of events $\boldsymbol{D}$ given a set of parameters
# $\boldsymbol{\beta}$.
#
-#
# In statistics, maximum likelihood estimation (MLE) is a method of
# estimating the parameters of an assumed probability distribution,
# given some observed data. This is achieved by maximizing a likelihood
# function so that, under the assumed statistical model, the observed
# data is the most probable.
#
-#
# We will assume here that our events are given by the above Gaussian
# distribution and we will determine the optimal parameters $\beta$ by
# maximizing the above PDF. However, computing the derivatives of a
# product function is cumbersome and can easily lead to overflow and/or
# underflowproblems, with potentials for loss of numerical precision.
#
-#
# In practice, it is more convenient to maximize the logarithm of the
# PDF because it is a monotonically increasing function of the argument.
# Alternatively, and this will be our option, we will minimize the
@@ -2217,9 +1853,6 @@ x = l1regls(X,y)
# Note also that maximization/minimization of the logarithm of the PDF
# is equivalent to the maximization/minimization of the function itself.
#
-#
-#
-#
# We could now define a new cost function to minimize, namely the negative logarithm of the above PDF
# $$
@@ -2246,7 +1879,6 @@ x = l1regls(X,y)
# Before we make a similar analysis for Ridge and Lasso regression, we need a short reminder on statistics.
#
-#
# A central theorem in statistics is Bayes' theorem. This theorem plays a similar role as the good old Pythagoras' theorem in geometry.
# Bayes' theorem is extremely simple to derive. But to do so we need some basic axioms from statistics.
#
@@ -2271,8 +1903,6 @@ x = l1regls(X,y)
#
# If we have independent events then $p(X,Y)=p(X)p(Y)$.
#
-#
-#
# The marginal probability is defined in terms of only one of the set of variables $X,Y$. For a discrete probability we have
# $$
@@ -2299,7 +1929,6 @@ x = l1regls(X,y)
# which is Bayes' theorem. It allows us to evaluate the uncertainty in in $X$ after we have observed $Y$. We can easily interchange $X$ with $Y$.
#
-#
# The quantity $p(Y\vert X)$ on the right-hand side of the theorem is
# evaluated for the observed data $Y$ and can be viewed as a function of
# the parameter space represented by $X$. This function is not
@@ -2312,7 +1941,6 @@ x = l1regls(X,y)
#
# Let us try to illustrate Bayes' theorem through an example.
#
-#
# Let us suppose that you are undergoing a series of mammography scans
# in order to rule out possible breast cancer cases. We define the
# sensitivity for a positive event by the variable $X$. It takes binary
@@ -2342,8 +1970,6 @@ x = l1regls(X,y)
# instead of $p(X=1\vert Y=1)$.
#
-#
-#
# If we look at various national surveys on breast cancer, the general
# likelihood of developing breast cancer is a very small number. Let us
# assume that the prior probability in the population as a whole is
@@ -2384,9 +2010,7 @@ x = l1regls(X,y)
# $$
# That is, in case of a positive test, there is only a $3\%$ chance of having breast cancer!
-#
-#
-#
+
# ## Bayes' Theorem and Ridge and Lasso Regression
#
# Hitherto we have discussed Ridge and Lasso regression in terms of a
@@ -2396,7 +2020,6 @@ x = l1regls(X,y)
#
# Before we proceed let us perform a Ridge, Lasso and OLS analysis of a polynomial fit.
#
-#
# We will play around with a study of the values for the optimal
# parameters $\boldsymbol{\beta}$ using OLS, Ridge and Lasso regression. For
# OLS, you will notice as function of the noise and polynomial degree,
@@ -2408,7 +2031,7 @@ x = l1regls(X,y)
# typically be reduced, providing thereby less fluctuations from one
# order to another one.
-# In[ ]:
+# In[12]:
import numpy as np
@@ -2497,7 +2120,7 @@ plt.show()
# quench the fluctuations in the parameters of $\beta_i$ which have a
# large variance (normally for higher orders in the polynomial).
-# In[ ]:
+# In[13]:
import numpy as np
@@ -2546,11 +2169,8 @@ for i in range(nlambdas):
# noise. Here we recommend to use $\sigma^2=1$ as variance for the
# added noise (which follows a normal distribution with mean value zero).
# Comment your results. If you have a large noise term, do the parameters $\beta_j$ vary more as function
-# model complexity? And what about their variance?
-#
-#
-#
-#
+# model complexity? And what about their variance?
+
# ## Linking Bayes' Theorem with Ridge and Lasso Regression
#
# We have seen that Ridge regression suppresses those features which
@@ -2585,8 +2205,6 @@ for i in range(nlambdas):
# We have a model for $p(\boldsymbol{D}\vert\boldsymbol{\beta})$ but need one for the **prior** $p(\boldsymbol{\beta}$!
#
-#
-#
# With the posterior probability defined by a likelihood which we have
# already modeled and an unknown prior, we are now ready to make
# additional models for the prior.
@@ -2594,7 +2212,6 @@ for i in range(nlambdas):
# We can, based on our discussions of the variance of $\boldsymbol{\beta}$ and
# the mean value, assume that the prior for the values $\boldsymbol{\beta}$ is
# given by a Gaussian with mean value zero and variance $\tau^2$, that
-# is
# $$
# p(\boldsymbol{\beta})=\prod_{j=0}^{p-1}\exp{\left(-\frac{\beta_j^2}{2\tau^2}\right)}.
@@ -2623,7 +2240,6 @@ for i in range(nlambdas):
# which is our Ridge cost function! Nice, isn't it?
#
-#
# To derive the Lasso cost function, we simply replace the Gaussian prior with an exponential distribution ([Laplace in this case](https://en.wikipedia.org/wiki/Laplace_distribution)) with zero mean value, that is
# $$
@@ -2652,7 +2268,6 @@ for i in range(nlambdas):
# which is our Lasso cost function!
#
-#
# Plotting these prior functions shows us that we can use the parameter
# $\lambda$ to shrink or increase the role of a given parameter
# $\beta_j$. The variance for the Laplace distribution is
diff --git a/doc/LectureNotes/_build/jupyter_execute/chapter2_254_1.png b/doc/LectureNotes/_build/jupyter_execute/chapter2_254_1.png
new file mode 100644
index 000000000..d8ec67fae
Binary files /dev/null and b/doc/LectureNotes/_build/jupyter_execute/chapter2_254_1.png differ
diff --git a/doc/LectureNotes/_build/jupyter_execute/chapter2_256_1.png b/doc/LectureNotes/_build/jupyter_execute/chapter2_256_1.png
new file mode 100644
index 000000000..866b6addf
Binary files /dev/null and b/doc/LectureNotes/_build/jupyter_execute/chapter2_256_1.png differ
diff --git a/doc/LectureNotes/_build/jupyter_execute/chapter2_258_1.png b/doc/LectureNotes/_build/jupyter_execute/chapter2_258_1.png
new file mode 100644
index 000000000..cf8636c6a
Binary files /dev/null and b/doc/LectureNotes/_build/jupyter_execute/chapter2_258_1.png differ
diff --git a/doc/LectureNotes/_build/jupyter_execute/chapter2_324_1.png b/doc/LectureNotes/_build/jupyter_execute/chapter2_324_1.png
new file mode 100644
index 000000000..e184a69c3
Binary files /dev/null and b/doc/LectureNotes/_build/jupyter_execute/chapter2_324_1.png differ
diff --git a/doc/LectureNotes/chapter2.ipynb b/doc/LectureNotes/chapter2.ipynb
index fc1dc3fa0..8bb203708 100644
--- a/doc/LectureNotes/chapter2.ipynb
+++ b/doc/LectureNotes/chapter2.ipynb
@@ -2,23 +2,45 @@
"cells": [
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "7146aabe",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ ""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "383d5dba",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "# Ridge and Lasso Regression"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "08812109",
+ "metadata": {
+ "editable": true
+ },
"source": [
- "# Ridge and Lasso Regression\n",
- "\n",
- "\n",
- "\n",
"## Mathematical Interpretation of Ordinary Least Squares\n",
"\n",
"What is presented here is a mathematical analysis of various regression algorithms (ordinary least squares, Ridge and Lasso Regression). The analysis is based on an important algorithm in linear algebra, the so-called Singular Value Decomposition (SVD). \n",
"\n",
- "\n",
"We have shown that in ordinary least squares (OLS) the optimal parameters $\\beta$ are given by"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "04ce00fc",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\hat{\\boldsymbol{\\beta}}_{\\mathrm{OLS}} = \\left(\\boldsymbol{X}^T\\boldsymbol{X}\\right)^{-1}\\boldsymbol{X}^T\\boldsymbol{y}.\n",
@@ -27,7 +49,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "88d4cd43",
+ "metadata": {
+ "editable": true
+ },
"source": [
"The **hat** over $\\boldsymbol{\\beta}$ means we have the optimal parameters after minimization of the cost function.\n",
"\n",
@@ -36,7 +61,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "b95f6106",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\tilde{\\boldsymbol{y}}=\\boldsymbol{X}\\hat{\\boldsymbol{\\beta}} = \\boldsymbol{X}\\left(\\boldsymbol{X}^T\\boldsymbol{X}\\right)^{-1}\\boldsymbol{X}^T\\boldsymbol{y}.\n",
@@ -45,14 +73,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "2ee3b8e9",
+ "metadata": {
+ "editable": true
+ },
"source": [
"We now define a matrix"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "72f7dde8",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{A}=\\boldsymbol{X}\\left(\\boldsymbol{X}^T\\boldsymbol{X}\\right)^{-1}\\boldsymbol{X}^T.\n",
@@ -61,14 +95,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "4b092bc7",
+ "metadata": {
+ "editable": true
+ },
"source": [
"We can rewrite"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "44b3e758",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\tilde{\\boldsymbol{y}}=\\boldsymbol{X}\\hat{\\boldsymbol{\\beta}} = \\boldsymbol{A}\\boldsymbol{y}.\n",
@@ -77,20 +117,23 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "6cec4c92",
+ "metadata": {
+ "editable": true
+ },
"source": [
"The matrix $\\boldsymbol{A}$ has the important property that $\\boldsymbol{A}^2=\\boldsymbol{A}$. This is the definition of a [projection matrix](https://en.wikipedia.org/wiki/Projection_matrix).\n",
"We can then interpret our optimal model $\\tilde{\\boldsymbol{y}}$ as being represented by an orthogonal projection of $\\boldsymbol{y}$ onto a space defined by the column vectors of $\\boldsymbol{X}$. In our case here the matrix $\\boldsymbol{A}$ is a square matrix. If it is a general rectangular matrix we have an oblique projection matrix.\n",
"\n",
- "\n",
- "\n",
- "\n",
"We have defined the residual error as"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "ef64424c",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{\\epsilon}=\\boldsymbol{y}-\\tilde{\\boldsymbol{y}}=\\left[\\boldsymbol{I}-\\boldsymbol{X}\\left(\\boldsymbol{X}^T\\boldsymbol{X}\\right)^{-1}\\boldsymbol{X}^T\\right]\\boldsymbol{y}.\n",
@@ -99,17 +142,22 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "cad57da0",
+ "metadata": {
+ "editable": true
+ },
"source": [
"The residual errors are then the projections of $\\boldsymbol{y}$ onto the orthogonal component of the space defined by the column vectors of $\\boldsymbol{X}$.\n",
"\n",
- "\n",
"If the matrix $\\boldsymbol{X}$ is an orthogonal (or unitary in case of complex values) matrix, we have"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "94355d54",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X}^T\\boldsymbol{X}=\\boldsymbol{X}\\boldsymbol{X}^T = \\boldsymbol{I}.\n",
@@ -118,14 +166,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "4c1ccdf5",
+ "metadata": {
+ "editable": true
+ },
"source": [
"In this case the matrix $\\boldsymbol{A}$ becomes"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "0d943ee1",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{A}=\\boldsymbol{X}\\left(\\boldsymbol{X}^T\\boldsymbol{X}\\right)^{-1}\\boldsymbol{X}^T)=\\boldsymbol{I},\n",
@@ -134,14 +188,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "3f951392",
+ "metadata": {
+ "editable": true
+ },
"source": [
"and we have the obvious case"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "ce1a6d6f",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{\\epsilon}=\\boldsymbol{y}-\\tilde{\\boldsymbol{y}}=0.\n",
@@ -150,16 +210,23 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "2861bd8e",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "This serves also as a useful test of our codes."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "1dfaffdb",
+ "metadata": {
+ "editable": true
+ },
"source": [
- "This serves also as a useful test of our codes. \n",
- "\n",
- "\n",
- "\n",
- "\n",
"## The singular value decomposition\n",
"\n",
- "\n",
"The examples we have looked at so far are cases where we normally can\n",
"invert the matrix $\\boldsymbol{X}^T\\boldsymbol{X}$. Using a polynomial expansion where we fit of various functions leads to\n",
"row vectors of the design matrix which are essentially orthogonal due\n",
@@ -167,7 +234,6 @@
"design matrix is then often done via a so-called LU, QR or Cholesky\n",
"decomposition.\n",
"\n",
- "\n",
"As we will also see in the first project, \n",
"this may\n",
"however not the be case in general and a standard matrix inversion\n",
@@ -191,9 +257,6 @@
"in the principal component analysis where high-dimensional data can be\n",
"reduced to the statistically relevant features.\n",
"\n",
- "\n",
- "\n",
- "\n",
"One of the typical problems we encounter with linear regression, in particular \n",
"when the matrix $\\boldsymbol{X}$ (our so-called design matrix) is high-dimensional, \n",
"are problems with near singular or singular matrices. The column vectors of $\\boldsymbol{X}$ \n",
@@ -204,7 +267,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "3e091b51",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\begin{align*}\n",
@@ -224,7 +290,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "2fcbdb36",
+ "metadata": {
+ "editable": true
+ },
"source": [
"The columns of $\\boldsymbol{X}$ are linearly dependent. We see this easily since the \n",
"the first column is the row-wise sum of the other two columns. The rank (more correct,\n",
@@ -238,7 +307,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "1f35594a",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\begin{align*}\n",
@@ -254,19 +326,23 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "093183cd",
+ "metadata": {
+ "editable": true
+ },
"source": [
"We see easily that $\\mbox{det}(\\boldsymbol{X}) = x_{11} x_{22} - x_{12} x_{21} = 1 \\times (-1) - 1 \\times (-1) = 0$. Hence, $\\mathbf{X}$ is singular and its inverse is undefined.\n",
"This is equivalent to saying that the matrix $\\boldsymbol{X}$ has at least an eigenvalue which is zero.\n",
"\n",
- "\n",
- "\n",
"If our design matrix $\\boldsymbol{X}$ which enters the linear regression problem"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "7a22cf10",
+ "metadata": {
+ "editable": true
+ },
"source": [
"\n",
"\n",
@@ -281,7 +357,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "a66feb94",
+ "metadata": {
+ "editable": true
+ },
"source": [
"has linearly dependent column vectors, we will not be able to compute the inverse\n",
"of $\\boldsymbol{X}^T\\boldsymbol{X}$ and we cannot find the parameters (estimators) $\\beta_i$. \n",
@@ -294,7 +373,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "b5b5978a",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X}^{T} \\boldsymbol{X} \\rightarrow \\boldsymbol{X}^{T} \\boldsymbol{X}+\\lambda \\boldsymbol{I},\n",
@@ -303,16 +385,23 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "bed64679",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "where $\\boldsymbol{I}$ is the identity matrix. When we discuss **Ridge** regression this is actually what we end up evaluating. The parameter $\\lambda$ is called a hyperparameter. More about this later."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "860c9b6d",
+ "metadata": {
+ "editable": true
+ },
"source": [
- "where $\\boldsymbol{I}$ is the identity matrix. When we discuss **Ridge** regression this is actually what we end up evaluating. The parameter $\\lambda$ is called a hyperparameter. More about this later. \n",
- "\n",
- "\n",
- "\n",
- "\n",
"## Basic math of the SVD\n",
"\n",
- "\n",
"From standard linear algebra we know that a square matrix $\\boldsymbol{X}$ can be diagonalized if and only it is \n",
"a so-called [normal matrix](https://en.wikipedia.org/wiki/Normal_matrix), that is if $\\boldsymbol{X}\\in {\\mathbb{R}}^{n\\times n}$\n",
"we have $\\boldsymbol{X}\\boldsymbol{X}^T=\\boldsymbol{X}^T\\boldsymbol{X}$ or if $\\boldsymbol{X}\\in {\\mathbb{C}}^{n\\times n}$ we have $\\boldsymbol{X}\\boldsymbol{X}^{\\dagger}=\\boldsymbol{X}^{\\dagger}\\boldsymbol{X}$.\n",
@@ -321,7 +410,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "724355a3",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"(\\lambda_1,\\boldsymbol{u}_1),\\dots, (\\lambda_n,\\boldsymbol{u}_n),\n",
@@ -330,14 +422,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "80fea225",
+ "metadata": {
+ "editable": true
+ },
"source": [
"and the eigenvalues are given by the diagonal matrix"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "4a7bc845",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{\\Sigma}=\\mathrm{Diag}(\\lambda_1, \\dots,\\lambda_n).\n",
@@ -346,14 +444,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "789f1977",
+ "metadata": {
+ "editable": true
+ },
"source": [
"The matrix $\\boldsymbol{X}$ can be written in terms of an orthogonal/unitary transformation $\\boldsymbol{U}$"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "56e422f4",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X} = \\boldsymbol{U}\\boldsymbol{\\Sigma}\\boldsymbol{V}^T,\n",
@@ -362,7 +466,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "f015c981",
+ "metadata": {
+ "editable": true
+ },
"source": [
"with $\\boldsymbol{U}\\boldsymbol{U}^T=\\boldsymbol{I}$ or $\\boldsymbol{U}\\boldsymbol{U}^{\\dagger}=\\boldsymbol{I}$.\n",
"\n",
@@ -371,7 +478,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "dfd219d0",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X} = \\begin{bmatrix} \n",
@@ -383,15 +493,14 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "9992b4d2",
+ "metadata": {
+ "editable": true
+ },
"source": [
"is not diagonalizable, it is a so-called [defective matrix](https://en.wikipedia.org/wiki/Defective_matrix). It is easy to see that the condition\n",
"$\\boldsymbol{X}\\boldsymbol{X}^T=\\boldsymbol{X}^T\\boldsymbol{X}$ is not fulfilled. \n",
"\n",
- "\n",
- "\n",
- "\n",
- "\n",
"However, and this is the strength of the SVD algorithm, any general\n",
"matrix $\\boldsymbol{X}$ can be decomposed in terms of a diagonal matrix and\n",
"two orthogonal/unitary matrices. The [Singular Value Decompostion\n",
@@ -405,7 +514,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "e41ce3a1",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X} = \\boldsymbol{U}\\boldsymbol{\\Sigma}\\boldsymbol{V}^T\n",
@@ -414,14 +526,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "916148d2",
+ "metadata": {
+ "editable": true
+ },
"source": [
"As an example, the above defective matrix can be decomposed as"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "8488b628",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X} = \\frac{1}{\\sqrt{2}}\\begin{bmatrix} 1& 1 \\\\ 1& -1\\\\ \\end{bmatrix} \\begin{bmatrix} 2& 0 \\\\ 0& 0\\\\ \\end{bmatrix} \\frac{1}{\\sqrt{2}}\\begin{bmatrix} 1& -1 \\\\ 1& 1\\\\ \\end{bmatrix}=\\boldsymbol{U}\\boldsymbol{\\Sigma}\\boldsymbol{V}^T,\n",
@@ -430,7 +548,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "eb7bb105",
+ "metadata": {
+ "editable": true
+ },
"source": [
"with eigenvalues $\\sigma_1=2$ and $\\sigma_2=0$. \n",
"The SVD exits always! \n",
@@ -453,7 +574,6 @@
"\n",
"The columns of $\\boldsymbol{U}$ are called the left singular vectors while the columns of $\\boldsymbol{V}$ are the right singular vectors.\n",
"\n",
- "\n",
"If we assume that $n > p$, then our matrix $\\boldsymbol{U}$ has dimension $n\n",
"\\times n$. The last $n-p$ columns of $\\boldsymbol{U}$ become however\n",
"irrelevant in our calculations since they are multiplied with the\n",
@@ -469,14 +589,23 @@
"If $n > p$, we keep only the first $p$ columns of $\\boldsymbol{U}$ and $\\boldsymbol{\\Sigma}$ has dimension $p\\times p$. \n",
"If $p > n$, then only the first $n$ columns of $\\boldsymbol{V}$ are computed and $\\boldsymbol{\\Sigma}$ has dimension $n\\times n$.\n",
"The $n=p$ case is obvious, we retain the full SVD. \n",
- "In general the economy-size SVD leads to less FLOPS and still conserving the desired accuracy.\n",
- "\n",
+ "In general the economy-size SVD leads to less FLOPS and still conserving the desired accuracy."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "86e39aa0",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
"## Codes for the SVD"
]
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 1,
+ "id": "9c3ae0cf",
"metadata": {
"collapsed": false,
"editable": true
@@ -516,7 +645,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "b5e02d16",
+ "metadata": {
+ "editable": true
+ },
"source": [
"The matrix $\\boldsymbol{X}$ has columns that are linearly dependent. The first\n",
"column is the row-wise sum of the other two columns. The rank of a\n",
@@ -527,8 +659,6 @@
"inversion algorithm for matrix inversion with $\\boldsymbol{X}^T\\boldsymbol{X}$ results\n",
"in the program terminating due to a singular matrix.\n",
"\n",
- "\n",
- "\n",
"The $U$, $S$, and $V$ matrices returned from the **svd()** function\n",
"cannot be multiplied directly.\n",
"\n",
@@ -540,9 +670,16 @@
"\n",
"If you wish to include the zero singular values, you will need to\n",
"resize the matrices and set up a diagonal matrix as done in the above\n",
- "example\n",
- "\n",
- "\n",
+ "example"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "ceac1ca3",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
"## Code for SVD and Inversion of Matrices\n",
"\n",
"How do we use the SVD to invert a matrix $\\boldsymbol{X}^T\\boldsymbol{X}$ which is singular or near singular?\n",
@@ -551,7 +688,8 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 2,
+ "id": "15a9c8e8",
"metadata": {
"collapsed": false,
"editable": true
@@ -563,14 +701,18 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "4a6e5469",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Let us first look at a matrix which does not causes problems and write our own function where we just use the SVD."
]
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 3,
+ "id": "ef3b6935",
"metadata": {
"collapsed": false,
"editable": true
@@ -610,7 +752,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "155ca008",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Although our matrix to invert $\\boldsymbol{X}^T\\boldsymbol{X}$ is a square matrix, our matrix may be singular. \n",
"\n",
@@ -625,7 +770,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "da493b94",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{A}_{\\mathrm{PI}}= \\boldsymbol{V}\\boldsymbol{D}_{\\mathrm{PI}}\\boldsymbol{U}^T,\n",
@@ -634,14 +782,18 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "8bf214ea",
+ "metadata": {
+ "editable": true
+ },
"source": [
- "where $\\boldsymbol{D}_{\\mathrm{PI}}$ can be calculated by creating a diagonal matrix from $\\boldsymbol{Sigma}$ where we only keep the singular values (the non-zero values). The following code computes the pseudoinvers of the matrix based on the SVD."
+ "where $\\boldsymbol{D}_{\\mathrm{PI}}$ can be calculated by creating a diagonal matrix from $\\boldsymbol{\\Sigma}$ where we only keep the singular values (the non-zero values). The following code computes the pseudoinvers of the matrix based on the SVD."
]
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 4,
+ "id": "e437b5d9",
"metadata": {
"collapsed": false,
"editable": true
@@ -675,14 +827,21 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "e711d30f",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "As you can see from these examples, our own decomposition based on the SVD agrees the pseudoinverse algorithm provided by **Numpy**."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "a0ba9d2f",
+ "metadata": {
+ "editable": true
+ },
"source": [
- "As you can see from these examples, our own decomposition based on the SVD agrees the pseudoinverse algorithm provided by **Numpy**.\n",
- "\n",
- "\n",
- "\n",
- "\n",
- "\n",
"## Mathematics of the SVD and implications\n",
"\n",
"Let us take a closer look at the mathematics of the SVD and the various implications for machine learning studies.\n",
@@ -692,7 +851,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "90951d11",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X}=\\begin{bmatrix}\n",
@@ -708,14 +870,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "91ff188a",
+ "metadata": {
+ "editable": true
+ },
"source": [
"We can SVD decompose our matrix as"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "61b2e6d7",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X}=\\boldsymbol{U}\\boldsymbol{\\Sigma}\\boldsymbol{V}^T,\n",
@@ -724,7 +892,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "3a5bf286",
+ "metadata": {
+ "editable": true
+ },
"source": [
"where $\\boldsymbol{U}$ is an orthogonal matrix of dimension $n\\times n$, meaning that $\\boldsymbol{U}\\boldsymbol{U}^T=\\boldsymbol{U}^T\\boldsymbol{U}=\\boldsymbol{I}_n$. Here $\\boldsymbol{I}_n$ is the unit matrix of dimension $n \\times n$.\n",
"\n",
@@ -735,7 +906,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "1bd0e480",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\sigma_0 > \\sigma_1 > \\sigma_2 > \\dots > \\sigma_{p-1} > 0.\n",
@@ -744,17 +918,22 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "6133bbea",
+ "metadata": {
+ "editable": true
+ },
"source": [
"All values beyond $p-1$ are all zero.\n",
"\n",
- "\n",
"As an example, consider the following $3\\times 2$ example for the matrix $\\boldsymbol{\\Sigma}$"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "c2f4ec9c",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{\\Sigma}=\n",
@@ -768,14 +947,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "d8e91a1a",
+ "metadata": {
+ "editable": true
+ },
"source": [
"The singular values are $\\sigma_0=2$ and $\\sigma_1=1$. It is common to rewrite the matrix $\\boldsymbol{\\Sigma}$ as"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "66510064",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{\\Sigma}=\n",
@@ -788,14 +973,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "0de239cf",
+ "metadata": {
+ "editable": true
+ },
"source": [
"where"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "ae4894a1",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{\\tilde{\\Sigma}}=\n",
@@ -808,14 +999,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "928421c0",
+ "metadata": {
+ "editable": true
+ },
"source": [
"contains only the singular values. Note also (and we will use this below) that"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "f707ba94",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{\\Sigma}^T\\boldsymbol{\\Sigma}=\n",
@@ -828,14 +1025,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "c2169a96",
+ "metadata": {
+ "editable": true
+ },
"source": [
"which is a $2\\times 2 $ matrix while"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "0fd7213a",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{\\Sigma}\\boldsymbol{\\Sigma}^T=\n",
@@ -849,20 +1052,24 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "014bf918",
+ "metadata": {
+ "editable": true
+ },
"source": [
"is a $3\\times 3 $ matrix. The last row and column of this last matrix\n",
"contain only zeros. This will have important consequences for our SVD\n",
"decomposition of the design matrix.\n",
"\n",
- "\n",
- "\n",
"The matrix that may cause problems for us is $\\boldsymbol{X}^T\\boldsymbol{X}$. Using the SVD we can rewrite this matrix as"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "5b371d72",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X}^T\\boldsymbol{X}=\\boldsymbol{V}\\boldsymbol{\\Sigma}^T\\boldsymbol{U}^T\\boldsymbol{U}\\boldsymbol{\\Sigma}\\boldsymbol{V}^T,\n",
@@ -871,14 +1078,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "5fdd06fb",
+ "metadata": {
+ "editable": true
+ },
"source": [
"and using the orthogonality of the matrix $\\boldsymbol{U}$ we have"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "416109ee",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X}^T\\boldsymbol{X}=\\boldsymbol{V}\\boldsymbol{\\Sigma}^T\\boldsymbol{\\Sigma}\\boldsymbol{V}^T.\n",
@@ -887,32 +1100,22 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "38a7766d",
+ "metadata": {
+ "editable": true
+ },
"source": [
"We define $\\boldsymbol{\\Sigma}^T\\boldsymbol{\\Sigma}=\\tilde{\\boldsymbol{\\Sigma}}^2$ which is a diagonal matrix containing only the singular values squared. It has dimensionality $p \\times p$.\n",
"\n",
- "This means, using the orthogonality of $\\boldsymbol{V}$, that we get"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "$$\n",
- "\\boldsymbol{X}^T\\boldsymbol{X}=\\tilde{\\boldsymbol{\\Sigma}}^2.\n",
- "$$"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
"We can now insert the result for the matrix $\\boldsymbol{X}^T\\boldsymbol{X}$ into our equation for ordinary least squares where"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "18839f7b",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\tilde{y}_{\\mathrm{OLS}}=\\boldsymbol{X}\\left(\\boldsymbol{X}^T\\boldsymbol{X}\\right)^{-1}\\boldsymbol{X}^T\\boldsymbol{y},\n",
@@ -921,30 +1124,42 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "b743da67",
+ "metadata": {
+ "editable": true
+ },
"source": [
"and using our SVD decomposition of $\\boldsymbol{X}$ we have"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "b91982c5",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
- "\\tilde{y}_{\\mathrm{OLS}}=\\boldsymbol{U}\\boldsymbol{\\Sigma}\\boldsymbol{V}^T\\tilde{\\boldsymbol{\\Sigma}}^{-2}\\boldsymbol{V}\\boldsymbol{\\Sigma}^T\\boldsymbol{U}^T\\boldsymbol{y},\n",
+ "\\tilde{y}_{\\mathrm{OLS}}=\\boldsymbol{U}\\boldsymbol{\\Sigma}\\boldsymbol{V}^T\\left(\\boldsymbol{V}\\tilde{\\boldsymbol{\\Sigma}}^{2}(\\boldsymbol{V}^T\\right)^{-1}\\boldsymbol{V}\\boldsymbol{\\Sigma}^T\\boldsymbol{U}^T\\boldsymbol{y},\n",
"$$"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "310034bb",
+ "metadata": {
+ "editable": true
+ },
"source": [
- "which gives us, using the orthogonality of the matrices $\\boldsymbol{U}$ and $\\boldsymbol{V}$,"
+ "which gives us, using the orthogonality of the matrices $\\boldsymbol{U}$ and $\\boldsymbol{V}$,,"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "efadf88e",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\tilde{y}_{\\mathrm{OLS}}=\\boldsymbol{U}\\boldsymbol{U}^T\\boldsymbol{y}=\\sum_{i=0}^{p-1}\\boldsymbol{u}_i\\boldsymbol{u}^T_j\\boldsymbol{y},\n",
@@ -953,14 +1168,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "293eece5",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Note here that when we perform the multiplication of the various matrices, the orthogonal vectors of the matrix $\\boldsymbol{U}$"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "66ead26c",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{U}=[\\boldsymbol{u}_0,\\boldsymbol{u}_1,\\dots,\\boldsymbol{u}_{n-1}],\n",
@@ -969,13 +1190,23 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "67b71310",
+ "metadata": {
+ "editable": true
+ },
"source": [
"that belong to $i>p-1$, result in only zeros when we perform the multiplications. This means that the sum above has non-zero elements only up to $i=p-1$. This corresponds also to the number of singular values (these are all non-zero).\n",
"\n",
- "It means that the ordinary least square model (with the optimal parameters) $\\boldsymbol{\\tilde{y}}$, corresponds to an orthogonal transformation of the output (or target) vector $\\boldsymbol{y}$ by the vectors of the matrix $\\boldsymbol{U}$.\n",
- "\n",
- "\n",
+ "It means that the ordinary least square model (with the optimal parameters) $\\boldsymbol{\\tilde{y}}$, corresponds to an orthogonal transformation of the output (or target) vector $\\boldsymbol{y}$ by the vectors of the matrix $\\boldsymbol{U}$."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "fa804884",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
"## Further properties (important for our analyses later)\n",
"\n",
"Let us study again $\\boldsymbol{X}^T\\boldsymbol{X}$ in terms of our SVD,"
@@ -983,7 +1214,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "ac661f44",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X}^T\\boldsymbol{X}=\\boldsymbol{V}\\boldsymbol{\\Sigma}^T\\boldsymbol{U}^T\\boldsymbol{U}\\boldsymbol{\\Sigma}\\boldsymbol{V}^T=\\boldsymbol{V}\\boldsymbol{\\Sigma}^T\\boldsymbol{\\Sigma}\\boldsymbol{V}^T.\n",
@@ -992,14 +1226,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "1d195b3c",
+ "metadata": {
+ "editable": true
+ },
"source": [
"If we now multiply from the right with $\\boldsymbol{V}$ (using the orthogonality of $\\boldsymbol{V}$) we get"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "38865678",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\left(\\boldsymbol{X}^T\\boldsymbol{X}\\right)\\boldsymbol{V}=\\boldsymbol{V}\\boldsymbol{\\Sigma}^T\\boldsymbol{\\Sigma}.\n",
@@ -1008,7 +1248,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "07a7126d",
+ "metadata": {
+ "editable": true
+ },
"source": [
"This means the vectors $\\boldsymbol{v}_i$ of the orthogonal matrix $\\boldsymbol{V}$ are the eigenvectors of the matrix $\\boldsymbol{X}^T\\boldsymbol{X}$\n",
"with eigenvalues given by the singular values squared, that is"
@@ -1016,7 +1259,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "1375bb2d",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\left(\\boldsymbol{X}^T\\boldsymbol{X}\\right)\\boldsymbol{v}_i=\\boldsymbol{v}_i\\sigma_i^2.\n",
@@ -1025,14 +1271,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "6b32590d",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Similarly, if we use the SVD decomposition for the matrix $\\boldsymbol{X}\\boldsymbol{X}^T$, we have"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "0bfefb07",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X}\\boldsymbol{X}^T=\\boldsymbol{U}\\boldsymbol{\\Sigma}\\boldsymbol{V}^T\\boldsymbol{V}\\boldsymbol{\\Sigma}^T\\boldsymbol{U}^T=\\boldsymbol{U}\\boldsymbol{\\Sigma}\\boldsymbol{\\Sigma}^T\\boldsymbol{U}^T.\n",
@@ -1041,14 +1293,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "c9a62b75",
+ "metadata": {
+ "editable": true
+ },
"source": [
"If we now multiply from the right with $\\boldsymbol{U}$ (using the orthogonality of $\\boldsymbol{U}$) we get"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "c591bfc0",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\left(\\boldsymbol{X}\\boldsymbol{X}^T\\right)\\boldsymbol{U}=\\boldsymbol{U}\\boldsymbol{\\Sigma}\\boldsymbol{\\Sigma}^T.\n",
@@ -1057,7 +1315,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "d7fa31d3",
+ "metadata": {
+ "editable": true
+ },
"source": [
"This means the vectors $\\boldsymbol{u}_i$ of the orthogonal matrix $\\boldsymbol{U}$ are the eigenvectors of the matrix $\\boldsymbol{X}\\boldsymbol{X}^T$\n",
"with eigenvalues given by the singular values squared, that is"
@@ -1065,7 +1326,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "d132cee3",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\left(\\boldsymbol{X}\\boldsymbol{X}^T\\right)\\boldsymbol{u}_i=\\boldsymbol{u}_i\\sigma_i^2.\n",
@@ -1074,7 +1338,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "7aa7f89c",
+ "metadata": {
+ "editable": true
+ },
"source": [
"**Important note**: we have defined our design matrix $\\boldsymbol{X}$ to be an\n",
"$n\\times p$ matrix. In most supervised learning cases we have that $n\n",
@@ -1084,12 +1351,18 @@
"always refer to the number of features in our data set, while the\n",
"number of rows represents the number of data inputs. Note that in\n",
"other texts you may find the opposite notation. This has consequences\n",
- "for the definition of for example the covariance matrix and its relation to the SVD.\n",
- "\n",
- "\n",
+ "for the definition of for example the covariance matrix and its relation to the SVD."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "8e546bb5",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
"## Meet the Covariance Matrix\n",
"\n",
- "\n",
"Before we move on to a discussion of Ridge and Lasso regression, we want to show an important example of the above.\n",
"\n",
"We have already noted that the matrix $\\boldsymbol{X}^T\\boldsymbol{X}$ in ordinary\n",
@@ -1099,7 +1372,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "96d8b53c",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\frac{\\partial^2 C(\\boldsymbol{\\beta})}{\\partial \\boldsymbol{\\beta}^T\\partial \\boldsymbol{\\beta}} =\\frac{2}{n}\\boldsymbol{X}^T\\boldsymbol{X}.\n",
@@ -1108,7 +1384,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "c7e05a9b",
+ "metadata": {
+ "editable": true
+ },
"source": [
"This quantity defines was what is called the Hessian matrix (the second derivative of a function we want to optimize).\n",
"\n",
@@ -1117,7 +1396,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "55fd14e4",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{H}=\\boldsymbol{X}^T\\boldsymbol{X}.\n",
@@ -1126,15 +1408,16 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "09320523",
+ "metadata": {
+ "editable": true
+ },
"source": [
"The Hessian matrix for ordinary least squares is also proportional to\n",
"the covariance matrix. This means also that we can use the SVD to find\n",
"the eigenvalues of the covariance matrix and the Hessian matrix in\n",
"terms of the singular values. Let us develop these arguments, as they will play an important role in our machine learning studies.\n",
"\n",
- "\n",
- "\n",
"Before we discuss the link between for example Ridge regression and the singular value decomposition, we need to remind ourselves about\n",
"the definition of the covariance and the correlation function. These are quantities that play a central role in machine learning methods.\n",
"\n",
@@ -1144,7 +1427,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "23b5cf2d",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{C}[\\boldsymbol{x},\\boldsymbol{y}] = \\begin{bmatrix} \\mathrm{cov}[\\boldsymbol{x},\\boldsymbol{x}] & \\mathrm{cov}[\\boldsymbol{x},\\boldsymbol{y}] \\\\\n",
@@ -1155,14 +1441,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "136c43bc",
+ "metadata": {
+ "editable": true
+ },
"source": [
"where for example"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "b52fc8e3",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\mathrm{cov}[\\boldsymbol{x},\\boldsymbol{y}] =\\frac{1}{n} \\sum_{i=0}^{n-1}(x_i- \\overline{x})(y_i- \\overline{y}).\n",
@@ -1171,14 +1463,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "fe153c88",
+ "metadata": {
+ "editable": true
+ },
"source": [
"With this definition and recalling that the variance is defined as"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "ea57dd81",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\mathrm{var}[\\boldsymbol{x}]=\\frac{1}{n} \\sum_{i=0}^{n-1}(x_i- \\overline{x})^2,\n",
@@ -1187,14 +1485,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "f8154bc8",
+ "metadata": {
+ "editable": true
+ },
"source": [
"we can rewrite the covariance matrix as"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "081adf91",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{C}[\\boldsymbol{x},\\boldsymbol{y}] = \\begin{bmatrix} \\mathrm{var}[\\boldsymbol{x}] & \\mathrm{cov}[\\boldsymbol{x},\\boldsymbol{y}] \\\\\n",
@@ -1205,7 +1509,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "d61424f0",
+ "metadata": {
+ "editable": true
+ },
"source": [
"**Note:** we have used $1/n$ in the above definitions of the *sample* variance and covariance. We assume then that we can calculate the exact mean value. \n",
"What you will find in essentially all statistics texts are equations\n",
@@ -1216,7 +1523,6 @@
"**Scikit-Learn** or **nunmpy's** function calculate the covariance, this\n",
"quantity will be computed with a factor $1/(n-1)$.\n",
"\n",
- "\n",
"The covariance takes values between zero and infinity and may thus\n",
"lead to problems with loss of numerical precision for particularly\n",
"large values. It is common to scale the covariance matrix by\n",
@@ -1226,7 +1532,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "1f517794",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\mathrm{corr}[\\boldsymbol{x},\\boldsymbol{y}]=\\frac{\\mathrm{cov}[\\boldsymbol{x},\\boldsymbol{y}]}{\\sqrt{\\mathrm{var}[\\boldsymbol{x}] \\mathrm{var}[\\boldsymbol{y}]}}.\n",
@@ -1235,7 +1544,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "27c43f34",
+ "metadata": {
+ "editable": true
+ },
"source": [
"The correlation function is then given by values $\\mathrm{corr}[\\boldsymbol{x},\\boldsymbol{y}]\n",
"\\in [-1,1]$. This avoids eventual problems with too large values. We\n",
@@ -1245,7 +1557,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "35ac64e2",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{K}[\\boldsymbol{x},\\boldsymbol{y}] = \\begin{bmatrix} 1 & \\mathrm{corr}[\\boldsymbol{x},\\boldsymbol{y}] \\\\\n",
@@ -1256,19 +1571,23 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "7ec11e59",
+ "metadata": {
+ "editable": true
+ },
"source": [
"In the above example this is the function we constructed using **pandas**.\n",
"\n",
- "\n",
- "\n",
"In our derivation of the various regression algorithms like **Ordinary Least Squares** or **Ridge regression**\n",
"we defined the design/feature matrix $\\boldsymbol{X}$ as"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "8d1a1a24",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X}=\\begin{bmatrix}\n",
@@ -1284,7 +1603,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "b12f1560",
+ "metadata": {
+ "editable": true
+ },
"source": [
"with $\\boldsymbol{X}\\in {\\mathbb{R}}^{n\\times p}$, with the predictors/features $p$ refering to the column numbers and the\n",
"entries $n$ being the row elements.\n",
@@ -1293,7 +1615,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "7975e5ec",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X}=\\begin{bmatrix} \\boldsymbol{x}_0 & \\boldsymbol{x}_1 & \\boldsymbol{x}_2 & \\dots & \\dots & \\boldsymbol{x}_{p-1}\\end{bmatrix},\n",
@@ -1302,14 +1627,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "4628dae3",
+ "metadata": {
+ "editable": true
+ },
"source": [
"with a given vector"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "6acd55ed",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{x}_i^T = \\begin{bmatrix}x_{0,i} & x_{1,i} & x_{2,i}& \\dots & \\dots x_{n-1,i}\\end{bmatrix}.\n",
@@ -1318,7 +1649,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "15268d5e",
+ "metadata": {
+ "editable": true
+ },
"source": [
"With these definitions, we can now rewrite our $2\\times 2$\n",
"correlation/covariance matrix in terms of a moe general design/feature\n",
@@ -1328,7 +1662,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "f7cc7e46",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{C}[\\boldsymbol{x}] = \\begin{bmatrix}\n",
@@ -1344,14 +1681,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "91f506bb",
+ "metadata": {
+ "editable": true
+ },
"source": [
"and the correlation matrix"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "3f65d15d",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{K}[\\boldsymbol{x}] = \\begin{bmatrix}\n",
@@ -1367,7 +1710,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "4dda44f3",
+ "metadata": {
+ "editable": true
+ },
"source": [
"The Numpy function **np.cov** calculates the covariance elements using\n",
"the factor $1/(n-1)$ instead of $1/n$ since it assumes we do not have\n",
@@ -1380,7 +1726,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "3a6e7b9b",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{W} = \\begin{bmatrix} x_0 & x_1 & x_2 & \\dots & x_{n-2} & x_{n-1} \\\\\n",
@@ -1391,7 +1740,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "d907b263",
+ "metadata": {
+ "editable": true
+ },
"source": [
"which in turn is converted into into the $2\\times 2$ covariance matrix\n",
"$\\boldsymbol{C}$ via the Numpy function **np.cov()**. We note that we can also calculate\n",
@@ -1402,7 +1754,8 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 5,
+ "id": "8dbb102f",
"metadata": {
"collapsed": false,
"editable": true
@@ -1423,7 +1776,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "25852e86",
+ "metadata": {
+ "editable": true
+ },
"source": [
"The previous example can be converted into the correlation matrix by\n",
"simply scaling the matrix elements with the variances. We should also\n",
@@ -1434,7 +1790,8 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 6,
+ "id": "cb3ee7b6",
"metadata": {
"collapsed": false,
"editable": true
@@ -1466,7 +1823,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "6f2860ea",
+ "metadata": {
+ "editable": true
+ },
"source": [
"We see that the matrix elements along the diagonal are one as they\n",
"should be and that the matrix is symmetric. Furthermore, diagonalizing\n",
@@ -1474,14 +1834,13 @@
"\n",
"The above procedure with **numpy** can be made more compact if we use **pandas**.\n",
"\n",
- "\n",
- "\n",
"We whow here how we can set up the correlation matrix using **pandas**, as done in this simple code"
]
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 7,
+ "id": "48781620",
"metadata": {
"collapsed": false,
"editable": true
@@ -1506,14 +1865,18 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "4ccdedad",
+ "metadata": {
+ "editable": true
+ },
"source": [
"We expand this model to the Franke function discussed earlier."
]
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 8,
+ "id": "e4090257",
"metadata": {
"collapsed": false,
"editable": true
@@ -1567,7 +1930,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "6547bf2f",
+ "metadata": {
+ "editable": true
+ },
"source": [
"We note here that the covariance is zero for the first rows and\n",
"columns since all matrix elements in the design matrix were set to one\n",
@@ -1578,14 +1944,15 @@
"drop these elements and construct a correlation\n",
"matrix without these elements. \n",
"\n",
- "\n",
- "\n",
"We can rewrite the covariance matrix in a more compact form in terms of the design/feature matrix $\\boldsymbol{X}$ as"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "4e26eab7",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{C}[\\boldsymbol{x}] = \\frac{1}{n}\\boldsymbol{X}^T\\boldsymbol{X}= \\mathbb{E}[\\boldsymbol{X}^T\\boldsymbol{X}].\n",
@@ -1594,14 +1961,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "7f6a0df9",
+ "metadata": {
+ "editable": true
+ },
"source": [
"To see this let us simply look at a design matrix $\\boldsymbol{X}\\in {\\mathbb{R}}^{2\\times 2}$"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "5ff73ba2",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X}=\\begin{bmatrix}\n",
@@ -1615,14 +1988,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "ae6e2e42",
+ "metadata": {
+ "editable": true
+ },
"source": [
"If we then compute the expectation value (note the $1/n$ factor instead of $1/(n-1)$)"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "87a8dccc",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\mathbb{E}[\\boldsymbol{X}^T\\boldsymbol{X}] = \\frac{1}{n}\\boldsymbol{X}^T\\boldsymbol{X}=\\frac{1}{n}\\begin{bmatrix}\n",
@@ -1634,14 +2013,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "1db8e000",
+ "metadata": {
+ "editable": true
+ },
"source": [
"which is just"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "59e0c46d",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{C}[\\boldsymbol{x}_0,\\boldsymbol{x}_1] = \\boldsymbol{C}[\\boldsymbol{x}]=\\begin{bmatrix} \\mathrm{var}[\\boldsymbol{x}_0] & \\mathrm{cov}[\\boldsymbol{x}_0,\\boldsymbol{x}_1] \\\\\n",
@@ -1652,14 +2037,25 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "ce39f8d0",
+ "metadata": {
+ "editable": true
+ },
"source": [
- "where we wrote $$\\boldsymbol{C}[\\boldsymbol{x}_0,\\boldsymbol{x}_1] = \\boldsymbol{C}[\\boldsymbol{x}]$$ to indicate that this is the covariance of the vectors $\\boldsymbol{x}$ of the design/feature matrix $\\boldsymbol{X}$.\n",
- "\n",
- "It is easy to generalize this to a matrix $\\boldsymbol{X}\\in {\\mathbb{R}}^{n\\times p}$.\n",
- "\n",
- "\n",
+ "where we wrote $\\boldsymbol{C}[\\boldsymbol{x}_0,\\boldsymbol{x}_1]=\\boldsymbol{C}[\\boldsymbol{x}]$ to indicate\n",
+ "that this is the covariance of the vectors $\\boldsymbol{x}$ of the\n",
+ "design/feature matrix $\\boldsymbol{X}$.\n",
"\n",
+ "It is easy to generalize this to a matrix $\\boldsymbol{X}\\in {\\mathbb{R}}^{n\\times p}$."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "526f22b3",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
"## Linking with the SVD\n",
"\n",
"We saw earlier that"
@@ -1667,7 +2063,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "5d16d7c8",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X}^T\\boldsymbol{X}=\\boldsymbol{V}\\boldsymbol{\\Sigma}^T\\boldsymbol{U}^T\\boldsymbol{U}\\boldsymbol{\\Sigma}\\boldsymbol{V}^T=\\boldsymbol{V}\\boldsymbol{\\Sigma}^T\\boldsymbol{\\Sigma}\\boldsymbol{V}^T.\n",
@@ -1676,14 +2075,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "11a74368",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Since the matrices here have dimension $p\\times p$, with $p$ corresponding to the singular values, we defined earlier the matrix"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "0ca3614f",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{\\Sigma}^T\\boldsymbol{\\Sigma} = \\begin{bmatrix} \\tilde{\\boldsymbol{\\Sigma}} & \\boldsymbol{0}\\\\ \\end{bmatrix}\\begin{bmatrix} \\tilde{\\boldsymbol{\\Sigma}} \\\\ \\boldsymbol{0}\\\\ \\end{bmatrix},\n",
@@ -1692,14 +2097,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "b98abb6c",
+ "metadata": {
+ "editable": true
+ },
"source": [
"where the tilde-matrix $\\tilde{\\boldsymbol{\\Sigma}}$ is a matrix of dimension $p\\times p$ containing only the singular values $\\sigma_i$, that is"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "813567cc",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\tilde{\\boldsymbol{\\Sigma}}=\\begin{bmatrix} \\sigma_0 & 0 & 0 & \\dots & 0 & 0 \\\\\n",
@@ -1713,14 +2124,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "ed905c7b",
+ "metadata": {
+ "editable": true
+ },
"source": [
"meaning we can write"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "0136bdac",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X}^T\\boldsymbol{X}=\\boldsymbol{V}\\tilde{\\boldsymbol{\\Sigma}}^2\\boldsymbol{V}^T.\n",
@@ -1729,14 +2146,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "d43e6609",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Multiplying from the right with $\\boldsymbol{V}$ (using the orthogonality of $\\boldsymbol{V}$) we get"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "15d2bb49",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\left(\\boldsymbol{X}^T\\boldsymbol{X}\\right)\\boldsymbol{V}=\\boldsymbol{V}\\tilde{\\boldsymbol{\\Sigma}}^2.\n",
@@ -1745,7 +2168,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "374104f4",
+ "metadata": {
+ "editable": true
+ },
"source": [
"This means the vectors $\\boldsymbol{v}_i$ of the orthogonal matrix $\\boldsymbol{V}$\n",
"are the eigenvectors of the matrix $\\boldsymbol{X}^T\\boldsymbol{X}$ with eigenvalues\n",
@@ -1754,7 +2180,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "86f4db59",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\left(\\boldsymbol{X}^T\\boldsymbol{X}\\right)\\boldsymbol{v}_i=\\boldsymbol{v}_i\\sigma_i^2.\n",
@@ -1763,7 +2192,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "9d007f11",
+ "metadata": {
+ "editable": true
+ },
"source": [
"In other words, each non-zero singular value of $\\boldsymbol{X}$ is a positive\n",
"square root of an eigenvalue of $\\boldsymbol{X}^T\\boldsymbol{X}$. It means also that\n",
@@ -1773,7 +2205,6 @@
"$\\boldsymbol{v}_i$ are hierarchically ordered by how much correlation they\n",
"encode from the columns of $\\boldsymbol{X}$. \n",
"\n",
- "\n",
"Note that these are also the eigenvectors and eigenvalues of the\n",
"Hessian matrix.\n",
"\n",
@@ -1783,7 +2214,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "03c93eed",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{C}[\\boldsymbol{X}]=\\frac{1}{n}\\boldsymbol{X}^T\\boldsymbol{X},\n",
@@ -1792,7 +2226,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "3ee37fac",
+ "metadata": {
+ "editable": true
+ },
"source": [
"meaning that every squared non-singular value of $\\boldsymbol{X}$ divided by $n$ (\n",
"the number of samples) are the eigenvalues of the covariance\n",
@@ -1801,13 +2238,15 @@
"self-adjoint, the singular values of $\\boldsymbol{X}$ are equal to the\n",
"absolute value of the eigenvalues of $\\boldsymbol{X}$.\n",
"\n",
- "\n",
"For $\\boldsymbol{X}\\boldsymbol{X}^T$ we found"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "13290881",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X}\\boldsymbol{X}^T=\\boldsymbol{U}\\boldsymbol{\\Sigma}\\boldsymbol{V}^T\\boldsymbol{V}\\boldsymbol{\\Sigma}^T\\boldsymbol{U}^T=\\boldsymbol{U}\\boldsymbol{\\Sigma}^T\\boldsymbol{\\Sigma}\\boldsymbol{U}^T.\n",
@@ -1816,14 +2255,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "3896b3e6",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Since the matrices here have dimension $n\\times n$, we have"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "ca47bd66",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{\\Sigma}\\boldsymbol{\\Sigma}^T = \\begin{bmatrix} \\tilde{\\boldsymbol{\\Sigma}} \\\\ \\boldsymbol{0}\\\\ \\end{bmatrix}\\begin{bmatrix} \\tilde{\\boldsymbol{\\Sigma}} \\boldsymbol{0}\\\\ \\end{bmatrix}=\\begin{bmatrix} \\tilde{\\boldsymbol{\\Sigma}} & \\boldsymbol{0} \\\\ \\boldsymbol{0} & \\boldsymbol{0}\\\\ \\end{bmatrix},\n",
@@ -1832,14 +2277,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "1513e1d0",
+ "metadata": {
+ "editable": true
+ },
"source": [
"leading to"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "4b9bf25a",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X}\\boldsymbol{X}^T=\\boldsymbol{U}\\begin{bmatrix} \\tilde{\\boldsymbol{\\Sigma}} & \\boldsymbol{0} \\\\ \\boldsymbol{0} & \\boldsymbol{0}\\\\ \\end{bmatrix}\\boldsymbol{U}^T.\n",
@@ -1848,14 +2299,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "2eeb03c8",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Multiplying with $\\boldsymbol{U}$ from the right gives us the eigenvalue problem"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "da278d8e",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"(\\boldsymbol{X}\\boldsymbol{X}^T)\\boldsymbol{U}=\\boldsymbol{U}\\begin{bmatrix} \\tilde{\\boldsymbol{\\Sigma}} & \\boldsymbol{0} \\\\ \\boldsymbol{0} & \\boldsymbol{0}\\\\ \\end{bmatrix}.\n",
@@ -1864,7 +2321,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "2b341903",
+ "metadata": {
+ "editable": true
+ },
"source": [
"It means that the eigenvalues of $\\boldsymbol{X}\\boldsymbol{X}^T$ are again given by\n",
"the non-zero singular values plus now a series of zeros. The column\n",
@@ -1873,11 +2333,16 @@
"\n",
"Since we will mainly be interested in the correlations among the features\n",
"of our data (the columns of $\\boldsymbol{X}$, the quantity of interest for us are the non-zero singular\n",
- "values and the column vectors of $\\boldsymbol{V}$.\n",
- "\n",
- "\n",
- "\n",
- "\n",
+ "values and the column vectors of $\\boldsymbol{V}$."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "e66723d1",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
"## Ridge and Lasso Regression\n",
"\n",
"Let us remind ourselves about the expression for the standard Mean Squared Error (MSE) which we used to define our cost function and the equations for the ordinary least squares (OLS) method, that is \n",
@@ -1886,7 +2351,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "85cff01a",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"{\\displaystyle \\min_{\\boldsymbol{\\beta}\\in {\\mathbb{R}}^{p}}}\\frac{1}{n}\\left\\{\\left(\\boldsymbol{y}-\\boldsymbol{X}\\boldsymbol{\\beta}\\right)^T\\left(\\boldsymbol{y}-\\boldsymbol{X}\\boldsymbol{\\beta}\\right)\\right\\}.\n",
@@ -1895,14 +2363,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "c3bdf4f5",
+ "metadata": {
+ "editable": true
+ },
"source": [
"or we can state it as"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "1306ed38",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"{\\displaystyle \\min_{\\boldsymbol{\\beta}\\in\n",
@@ -1912,14 +2386,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "00474af5",
+ "metadata": {
+ "editable": true
+ },
"source": [
"where we have used the definition of a norm-2 vector, that is"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "346ae1ad",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\vert\\vert \\boldsymbol{x}\\vert\\vert_2 = \\sqrt{\\sum_i x_i^2}.\n",
@@ -1928,7 +2408,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "36f83c2a",
+ "metadata": {
+ "editable": true
+ },
"source": [
"By minimizing the above equation with respect to the parameters\n",
"$\\boldsymbol{\\beta}$ we could then obtain an analytical expression for the\n",
@@ -1938,7 +2421,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "eb246827",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"{\\displaystyle \\min_{\\boldsymbol{\\beta}\\in\n",
@@ -1948,7 +2434,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "d38c34b0",
+ "metadata": {
+ "editable": true
+ },
"source": [
"which leads to the Ridge regression minimization problem where we\n",
"require that $\\vert\\vert \\boldsymbol{\\beta}\\vert\\vert_2^2\\le t$, where $t$ is\n",
@@ -1957,7 +2446,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "e3f2141f",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"C(\\boldsymbol{X},\\boldsymbol{\\beta})=\\frac{1}{n}\\vert\\vert \\boldsymbol{y}-\\boldsymbol{X}\\boldsymbol{\\beta}\\vert\\vert_2^2+\\lambda\\vert\\vert \\boldsymbol{\\beta}\\vert\\vert_1,\n",
@@ -1966,14 +2458,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "74f56599",
+ "metadata": {
+ "editable": true
+ },
"source": [
"we have a new optimization equation"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "ea246d4b",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"{\\displaystyle \\min_{\\boldsymbol{\\beta}\\in\n",
@@ -1983,7 +2481,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "c6b1faa8",
+ "metadata": {
+ "editable": true
+ },
"source": [
"which leads to Lasso regression. Lasso stands for least absolute shrinkage and selection operator. \n",
"\n",
@@ -1992,7 +2493,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "7b2fc09f",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\vert\\vert \\boldsymbol{x}\\vert\\vert_1 = \\sum_i \\vert x_i\\vert.\n",
@@ -2001,14 +2505,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "a9f2c69a",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Using the matrix-vector expression for Ridge regression and dropping the parameter $1/n$ in front of the standard means squared error equation, we have"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "2fb35c59",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"C(\\boldsymbol{X},\\boldsymbol{\\beta})=\\left\\{(\\boldsymbol{y}-\\boldsymbol{X}\\boldsymbol{\\beta})^T(\\boldsymbol{y}-\\boldsymbol{X}\\boldsymbol{\\beta})\\right\\}+\\lambda\\boldsymbol{\\beta}^T\\boldsymbol{\\beta},\n",
@@ -2017,7 +2527,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "2e7636c6",
+ "metadata": {
+ "editable": true
+ },
"source": [
"and \n",
"taking the derivatives with respect to $\\boldsymbol{\\beta}$ we obtain then\n",
@@ -2028,7 +2541,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "51bd5332",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\hat{\\boldsymbol{\\beta}}_{\\mathrm{Ridge}} = \\left(\\boldsymbol{X}^T\\boldsymbol{X}+\\lambda\\boldsymbol{I}\\right)^{-1}\\boldsymbol{X}^T\\boldsymbol{y},\n",
@@ -2037,14 +2553,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "bbd07896",
+ "metadata": {
+ "editable": true
+ },
"source": [
"with $\\boldsymbol{I}$ being a $p\\times p$ identity matrix with the constraint that"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "39cd7db8",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\sum_{i=0}^{p-1} \\beta_i^2 \\leq t,\n",
@@ -2053,7 +2575,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "245333af",
+ "metadata": {
+ "editable": true
+ },
"source": [
"with $t$ a finite positive number. \n",
"\n",
@@ -2062,7 +2587,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "5ea29678",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\hat{\\boldsymbol{\\beta}}_{\\mathrm{OLS}} = \\left(\\boldsymbol{X}^T\\boldsymbol{X}\\right)^{-1}\\boldsymbol{X}^T\\boldsymbol{y},\n",
@@ -2071,26 +2599,29 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "ad883534",
+ "metadata": {
+ "editable": true
+ },
"source": [
"which can lead to singular matrices. However, with the SVD, we can always compute the inverse of the matrix $\\boldsymbol{X}^T\\boldsymbol{X}$.\n",
"\n",
- "\n",
"We see that Ridge regression is nothing but the standard OLS with a\n",
"modified diagonal term added to $\\boldsymbol{X}^T\\boldsymbol{X}$. The consequences, in\n",
"particular for our discussion of the bias-variance tradeoff are rather\n",
"interesting. We will see that for specific values of $\\lambda$, we may\n",
"even reduce the variance of the optimal parameters $\\boldsymbol{\\beta}$. These topics and other related ones, will be discussed after the more linear algebra oriented analysis here.\n",
"\n",
- "\n",
- "\n",
"Using our insights about the SVD of the design matrix $\\boldsymbol{X}$ \n",
"We have already analyzed the OLS solutions in terms of the eigenvectors (the columns) of the right singular value matrix $\\boldsymbol{U}$ as"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "54e5791f",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\tilde{\\boldsymbol{y}}_{\\mathrm{OLS}}=\\boldsymbol{X}\\boldsymbol{\\beta} =\\boldsymbol{U}\\boldsymbol{U}^T\\boldsymbol{y}.\n",
@@ -2099,14 +2630,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "c406bcb3",
+ "metadata": {
+ "editable": true
+ },
"source": [
"For Ridge regression this becomes"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "1a6f9659",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\tilde{\\boldsymbol{y}}_{\\mathrm{Ridge}}=\\boldsymbol{X}\\boldsymbol{\\beta}_{\\mathrm{Ridge}} = \\boldsymbol{U\\Sigma V^T}\\left(\\boldsymbol{V}\\boldsymbol{\\Sigma}^2\\boldsymbol{V}^T+\\lambda\\boldsymbol{I} \\right)^{-1}(\\boldsymbol{U\\Sigma V^T})^T\\boldsymbol{y}=\\sum_{j=0}^{p-1}\\boldsymbol{u}_j\\boldsymbol{u}_j^T\\frac{\\sigma_j^2}{\\sigma_j^2+\\lambda}\\boldsymbol{y},\n",
@@ -2115,18 +2652,22 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "e2edbb3a",
+ "metadata": {
+ "editable": true
+ },
"source": [
"with the vectors $\\boldsymbol{u}_j$ being the columns of $\\boldsymbol{U}$ from the SVD of the matrix $\\boldsymbol{X}$. \n",
"\n",
- "\n",
- "\n",
"Since $\\lambda \\geq 0$, it means that compared to OLS, we have"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "402353ad",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\frac{\\sigma_j^2}{\\sigma_j^2+\\lambda} \\leq 1.\n",
@@ -2135,7 +2676,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "423b6396",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Ridge regression finds the coordinates of $\\boldsymbol{y}$ with respect to the\n",
"orthonormal basis $\\boldsymbol{U}$, it then shrinks the coordinates by\n",
@@ -2145,14 +2689,15 @@
"\n",
"For small eigenvalues $\\sigma_i$ it means that their contributions become less important, a fact which can be used to reduce the number of degrees of freedom. More about this when we have covered the material on a statistical interpretation of various linear regression methods.\n",
"\n",
- "\n",
- "\n",
"For the sake of simplicity, let us assume that the design matrix is orthonormal, that is"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "f1d49878",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X}^T\\boldsymbol{X}=(\\boldsymbol{X}^T\\boldsymbol{X})^{-1} =\\boldsymbol{I}.\n",
@@ -2161,14 +2706,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "29e021c6",
+ "metadata": {
+ "editable": true
+ },
"source": [
"In this case the standard OLS results in"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "7ea41670",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{\\beta}^{\\mathrm{OLS}} = \\boldsymbol{X}^T\\boldsymbol{y}=\\sum_{i=0}^{p-1}\\boldsymbol{u}_j\\boldsymbol{u}_j^T\\boldsymbol{y},\n",
@@ -2177,14 +2728,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "b5c24d1b",
+ "metadata": {
+ "editable": true
+ },
"source": [
"and"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "5cde9430",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{\\beta}^{\\mathrm{Ridge}} = \\left(\\boldsymbol{I}+\\lambda\\boldsymbol{I}\\right)^{-1}\\boldsymbol{X}^T\\boldsymbol{y}=\\left(1+\\lambda\\right)^{-1}\\boldsymbol{\\beta}^{\\mathrm{OLS}},\n",
@@ -2193,7 +2750,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "f8725e06",
+ "metadata": {
+ "editable": true
+ },
"source": [
"that is the Ridge estimator scales the OLS estimator by the inverse of a factor $1+\\lambda$, and\n",
"the Ridge estimator converges to zero when the hyperparameter goes to\n",
@@ -2201,14 +2761,15 @@
"\n",
"We will come back to more interpreations after we have gone through some of the statistical analysis part. \n",
"\n",
- "\n",
- "\n",
"Using the matrix-vector expression for Lasso regression and dropping the parameter $1/n$ in front of the standard mean squared error equation, we have the following **cost** function"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "77595d78",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"C(\\boldsymbol{X},\\boldsymbol{\\beta})=\\left\\{(\\boldsymbol{y}-\\boldsymbol{X}\\boldsymbol{\\beta})^T(\\boldsymbol{y}-\\boldsymbol{X}\\boldsymbol{\\beta})\\right\\}+\\lambda\\vert\\vert\\boldsymbol{\\beta}\\vert\\vert_1,\n",
@@ -2217,14 +2778,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "30d6a0a4",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Taking the derivative with respect to $\\boldsymbol{\\beta}$ and recalling that the derivative of the absolute value is (we drop the boldfaced vector symbol for simplicty)"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "e6aaeb07",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\frac{d \\vert \\beta\\vert}{d \\boldsymbol{\\beta}}=\\mathrm{sgn}(\\boldsymbol{\\beta})=\\left\\{\\begin{array}{cc} 1 & \\beta > 0 \\\\ 0 & \\beta =0\\\\-1 & \\beta < 0, \\end{array}\\right.\n",
@@ -2233,14 +2800,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "61f8860b",
+ "metadata": {
+ "editable": true
+ },
"source": [
"we have that the derivative of the cost function is"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "848fab1b",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\frac{\\partial C(\\boldsymbol{X},\\boldsymbol{\\beta})}{\\partial \\boldsymbol{\\beta}}=-2\\boldsymbol{X}^T(\\boldsymbol{y}-\\boldsymbol{X}\\boldsymbol{\\beta})+\\lambda sgn(\\boldsymbol{\\beta})=0,\n",
@@ -2249,14 +2822,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "6b3f9c65",
+ "metadata": {
+ "editable": true
+ },
"source": [
"and reordering we have"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "a4535489",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X}^T\\boldsymbol{X}\\boldsymbol{\\beta}+\\lambda sgn(\\boldsymbol{\\beta})=2\\boldsymbol{X}^T\\boldsymbol{y}.\n",
@@ -2265,14 +2844,13 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "08d1dcfc",
+ "metadata": {
+ "editable": true
+ },
"source": [
"This equation does not lead to a nice analytical equation as in Ridge regression or ordinary least squares. This equation can however be solved by using standard convex optimization algorithms using for example the Python package [CVXOPT](https://cvxopt.org/). We will discuss this later. \n",
"\n",
- "\n",
- "\n",
- "\n",
- "\n",
"Let us assume that our design matrix is given by unit (identity) matrix, that is a square diagonal matrix with ones only along the\n",
"diagonal. In this case we have an equal number of rows and columns $n=p$.\n",
"\n",
@@ -2281,7 +2859,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "bfad6360",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"C(\\boldsymbol{\\beta})=\\sum_{i=0}^{p-1}(y_i-\\beta_i)^2,\n",
@@ -2290,14 +2871,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "ececd781",
+ "metadata": {
+ "editable": true
+ },
"source": [
"and minimizing we have that"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "834ae242",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\hat{\\beta}_i^{\\mathrm{OLS}} = y_i.\n",
@@ -2306,14 +2893,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "ef16a3d3",
+ "metadata": {
+ "editable": true
+ },
"source": [
"For Ridge regression our cost function is"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "a40a2bf7",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"C(\\boldsymbol{\\beta})=\\sum_{i=0}^{p-1}(y_i-\\beta_i)^2+\\lambda\\sum_{i=0}^{p-1}\\beta_i^2,\n",
@@ -2322,14 +2915,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "6c6b14af",
+ "metadata": {
+ "editable": true
+ },
"source": [
"and minimizing we have that"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "d9fb8933",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\hat{\\beta}_i^{\\mathrm{Ridge}} = \\frac{y_i}{1+\\lambda}.\n",
@@ -2338,14 +2937,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "272cb2f8",
+ "metadata": {
+ "editable": true
+ },
"source": [
"For Lasso regression our cost function is"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "fadce691",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"C(\\boldsymbol{\\beta})=\\sum_{i=0}^{p-1}(y_i-\\beta_i)^2+\\lambda\\sum_{i=0}^{p-1}\\vert\\beta_i\\vert=\\sum_{i=0}^{p-1}(y_i-\\beta_i)^2+\\lambda\\sum_{i=0}^{p-1}\\sqrt{\\beta_i^2},\n",
@@ -2354,14 +2959,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "c7cd5640",
+ "metadata": {
+ "editable": true
+ },
"source": [
"and minimizing we have that"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "463185a0",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"-2\\sum_{i=0}^{p-1}(y_i-\\beta_i)+\\lambda \\sum_{i=0}^{p-1}\\frac{(\\beta_i)}{\\vert\\beta_i\\vert}=0,\n",
@@ -2370,14 +2981,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "7b2748c6",
+ "metadata": {
+ "editable": true
+ },
"source": [
"which leads to"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "14027ed3",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\hat{\\boldsymbol{\\beta}}_i^{\\mathrm{Lasso}} = \\left\\{\\begin{array}{ccc}y_i-\\frac{\\lambda}{2} &\\mathrm{if} & y_i> \\frac{\\lambda}{2}\\\\\n",
@@ -2388,18 +3005,23 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "6ee85f1d",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Plotting these results ([figure in handwritten notes for week 36](https://github.com/CompPhysics/MachineLearning/blob/master/doc/HandWrittenNotes/2021/NotesSeptember9.pdf)) shows clearly that Lasso regression suppresses (sets to zero) values of $\\beta_i$ for specific values of $\\lambda$. Ridge regression reduces on the other hand the values of $\\beta_i$ as function of $\\lambda$.\n",
"\n",
- "\n",
"As another examples, \n",
"let us assume we have a data set with outputs/targets given by the vector"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "b5208771",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{y}=\\begin{bmatrix}4 \\\\ 2 \\\\3\\end{bmatrix},\n",
@@ -2408,14 +3030,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "c1b21b70",
+ "metadata": {
+ "editable": true
+ },
"source": [
"and our inputs as a $3\\times 2$ design matrix"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "c7f60db1",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X}=\\begin{bmatrix}2 & 0\\\\ 0 & 1 \\\\ 0 & 0\\end{bmatrix},\n",
@@ -2424,17 +3052,22 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "908ab8d8",
+ "metadata": {
+ "editable": true
+ },
"source": [
"meaning that we have two features and two unknown parameters $\\beta_0$ and $\\beta_1$ to be determined either by ordinary least squares, Ridge or Lasso regression.\n",
"\n",
- "\n",
"For ordinary least squares (OLS) we know that the optimal solution is"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "aebb6349",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\hat{\\boldsymbol{\\beta}}^{\\mathrm{OLS}}=\\left( \\boldsymbol{X}^T\\boldsymbol{X}\\right)^{-1}\\boldsymbol{X}^T\\boldsymbol{y}.\n",
@@ -2443,14 +3076,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "c5e7c53f",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Inserting the above values we obtain that"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "2197be2d",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\hat{\\boldsymbol{\\beta}}^{\\mathrm{OLS}}=\\begin{bmatrix}2 \\\\ 2\\end{bmatrix},\n",
@@ -2459,17 +3098,22 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "3d6f2196",
+ "metadata": {
+ "editable": true
+ },
"source": [
"The code which implements this simpler case is presented after the discussion of Ridge and Lasso.\n",
"\n",
- "\n",
"For Ridge regression we have"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "5f340903",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\hat{\\boldsymbol{\\beta}}^{\\mathrm{Ridge}}=\\left( \\boldsymbol{X}^T\\boldsymbol{X}+\\lambda\\boldsymbol{I}\\right)^{-1}\\boldsymbol{X}^T\\boldsymbol{y}.\n",
@@ -2478,14 +3122,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "11b0427e",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Inserting the above values we obtain that"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "963a0089",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\hat{\\boldsymbol{\\beta}}^{\\mathrm{Ridge}}=\\begin{bmatrix}\\frac{8}{4+\\lambda} \\\\ \\frac{2}{1+\\lambda}\\end{bmatrix},\n",
@@ -2494,21 +3144,25 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "7db2daaa",
+ "metadata": {
+ "editable": true
+ },
"source": [
"There is normally a constraint on the value of $\\vert\\vert \\boldsymbol{\\beta}\\vert\\vert_2$ via the parameter $\\lambda$.\n",
"Let us for simplicity assume that $\\beta_0^2+\\beta_1^2=1$ as constraint. This will allow us to find an expression for the optimal values of $\\beta$ and $\\lambda$.\n",
"\n",
"To see this, let us write the cost function for Ridge regression. \n",
"\n",
- "\n",
- "\n",
"We define the MSE without the $1/n$ factor and have then, using that"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "688d8588",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X}\\boldsymbol{\\beta}=\\begin{bmatrix} 2\\beta_0 \\\\ \\beta_1 \\\\0 \\end{bmatrix},\n",
@@ -2517,7 +3171,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "711738d9",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"C(\\boldsymbol{\\beta})=(4-2\\beta_0)^2+(2-\\beta_1)^2+\\lambda(\\beta_0^2+\\beta_1^2),\n",
@@ -2526,14 +3183,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "6c949f8e",
+ "metadata": {
+ "editable": true
+ },
"source": [
"and taking the derivative with respect to $\\beta_0$ we get"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "0bbc3b07",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\beta_0=\\frac{8}{4+\\lambda},\n",
@@ -2542,14 +3205,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "1cbf8a76",
+ "metadata": {
+ "editable": true
+ },
"source": [
"and for $\\beta_1$ we obtain"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "8f10e5bd",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\beta_1=\\frac{2}{1+\\lambda},\n",
@@ -2558,14 +3227,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "b547328c",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Using the constraint for $\\beta_0^2+\\beta_1^2=1$ we can constrain $\\lambda$ by solving"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "707c1a57",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\left(\\frac{8}{4+\\lambda}\\right)^2+\\left(\\frac{2}{1+\\lambda}\\right)^2=1,\n",
@@ -2574,18 +3249,23 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "b90e6997",
+ "metadata": {
+ "editable": true
+ },
"source": [
"which gives $\\lambda=4.571$ and $\\beta_0=0.933$ and $\\beta_1=0.359$.\n",
"\n",
- "\n",
"For Lasso we need now, keeping a constraint on $\\vert\\beta_0\\vert+\\vert\\beta_1\\vert=1$, to take the derivative of the absolute values of $\\beta_0$\n",
"and $\\beta_1$. This gives us the following derivatives of the cost function"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "e4f6ca20",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"C(\\boldsymbol{\\beta})=(4-2\\beta_0)^2+(2-\\beta_1)^2+\\lambda(\\vert\\beta_0\\vert+\\vert\\beta_1\\vert),\n",
@@ -2594,7 +3274,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "b3d7018c",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\frac{\\partial C(\\boldsymbol{\\beta})}{\\partial \\beta_0}=-4(4-2\\beta_0)+\\lambda\\mathrm{sgn}(\\beta_0)=0,\n",
@@ -2603,14 +3286,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "9e6f1823",
+ "metadata": {
+ "editable": true
+ },
"source": [
"and"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "ea3b2bf0",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\frac{\\partial C(\\boldsymbol{\\beta})}{\\partial \\beta_1}=-2(2-\\beta_1)+\\lambda\\mathrm{sgn}(\\beta_1)=0.\n",
@@ -2619,7 +3308,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "484b5cd4",
+ "metadata": {
+ "editable": true
+ },
"source": [
"We have now four cases to solve besides the trivial cases $\\beta_0$ and/or $\\beta_1$ are zero, namely\n",
"1. $\\beta_0 > 0$ and $\\beta_1 > 0$,\n",
@@ -2635,7 +3327,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "4861f625",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"-4(4-2\\beta_0)+\\lambda=0,\n",
@@ -2644,14 +3339,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "9928eadb",
+ "metadata": {
+ "editable": true
+ },
"source": [
"and"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "c94a1223",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"-2(2-\\beta_1)+\\lambda=0.\n",
@@ -2660,14 +3361,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "9bcaff12",
+ "metadata": {
+ "editable": true
+ },
"source": [
"which yields"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "1b7020d6",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\beta_0=\\frac{16+\\lambda}{8},\n",
@@ -2676,14 +3383,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "51fce0e9",
+ "metadata": {
+ "editable": true
+ },
"source": [
"and"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "c1fe81b2",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\beta_1=\\frac{4+\\lambda}{2}.\n",
@@ -2692,11 +3405,13 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "414a2e5b",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Using the constraint on $\\beta_0$ and $\\beta_1$ we can then find the optimal value of $\\lambda$ for the different cases. We leave this as an exercise to you.\n",
"\n",
- "\n",
"Here we set up the OLS, Ridge and Lasso functionality in order to study the above example. Note that here we have opted for a set of values of $\\lambda$, meaning that we need to perform a search in order to find the optimal values.\n",
"\n",
"First we study and compare the OLS and Ridge results. The next code compares all three methods.\n",
@@ -2705,7 +3420,8 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 9,
+ "id": "57451fca",
"metadata": {
"collapsed": false,
"editable": true
@@ -2767,7 +3483,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "6d10b060",
+ "metadata": {
+ "editable": true
+ },
"source": [
"We see here that we reach a plateau for the Ridge results. Writing out the coefficients $\\boldsymbol{\\beta}$, we that they are getting smaller and smaller and our error stabilizes since the predicted values of $\\tilde{\\boldsymbol{y}}$ approach zero.\n",
"\n",
@@ -2780,7 +3499,8 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 10,
+ "id": "100f7dbb",
"metadata": {
"collapsed": false,
"editable": true
@@ -2847,7 +3567,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "3d50bfd5",
+ "metadata": {
+ "editable": true
+ },
"source": [
"We bring then back our exponential function example and study all\n",
"three regression methods. Depending on the level of noise, we note\n",
@@ -2862,7 +3585,8 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 11,
+ "id": "409f405d",
"metadata": {
"collapsed": false,
"editable": true
@@ -2951,315 +3675,26 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "50e9be28",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Both these example send a clear message. The addition of a\n",
"shrinkage/regularization term implies that we need to perform a search\n",
"for the optimal values of $\\lambda$. We will see this throughout these\n",
"series of lectures.\n",
"\n",
- "\n",
- "As a small addendum, we note that you can also solve this problem using the convex optimization package [CVXOPT](https://cvxopt.org/examples/mlbook/l1regls.html). This requires, in addition to having installed **CVXOPT**, you need to download the file *l1regl.py*.\n",
- "The following code example solves the simpler problem we discussed above, where we have added the latter python file."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {
- "collapsed": false,
- "editable": true
- },
- "outputs": [],
- "source": [
- "from cvxopt import matrix, spdiag, mul, div, sqrt, normal, setseed\n",
- "from cvxopt import blas, lapack, solvers, sparse, spmatrix\n",
- "import math\n",
- "\n",
- "try:\n",
- " import mosek\n",
- " import sys\n",
- " __MOSEK = True\n",
- "except: __MOSEK = False\n",
- "\n",
- "if __MOSEK:\n",
- "\n",
- " def l1regls_mosek(A, b):\n",
- " \"\"\"\n",
- "\n",
- " Returns the solution of l1-norm regularized least-squares problem\n",
- "\n",
- " minimize || A*x - b ||_2^2 + e'*u\n",
- "\n",
- " subject to -u <= x <= u\n",
- "\n",
- " \"\"\"\n",
- "\n",
- " m, n = A.size\n",
- "\n",
- " env = mosek.Env()\n",
- " task = env.Task(0,0)\n",
- " task.set_Stream(mosek.streamtype.log, lambda x: sys.stdout.write(x))\n",
- "\n",
- " task.appendvars( 2*n) # number of variables\n",
- " task.appendcons( 2*n) # number of constraints\n",
- "\n",
- " # input quadratic objective\n",
- " Q = matrix(0.0, (n,n)) \n",
- " blas.syrk(A, Q, alpha = 2.0, trans='T')\n",
- "\n",
- " I = []\n",
- " for i in range(n):\n",
- " I.extend(range(i,n))\n",
- "\n",
- " J = []\n",
- " for i in range(n):\n",
- " J.extend((n-i)*[i])\n",
- "\n",
- " task.putqobj(I, J, list(Q[matrix(I) + matrix(J)*n]))\n",
- " task.putclist(range(2*n), list(-2*A.T*b) + n*[1.0]) # setup linear objective\n",
- "\n",
- " # input constraint matrix row by row\n",
- " for i in range(n):\n",
- " task.putarow( i, [i, n+i], [1.0, -1.0])\n",
- " task.putarow( n+i, [i, n+i], [1.0, 1.0])\n",
- "\n",
- " # setup bounds on constraints\n",
- " task.putboundslice(mosek.accmode.con,\n",
- " 0, n, n*[mosek.boundkey.up], n*[0.0], n*[0.0])\n",
- " task.putboundslice(mosek.accmode.con,\n",
- " n, 2*n, n*[mosek.boundkey.lo], n*[0.0], n*[0.0])\n",
- "\n",
- " # setup variable bounds\n",
- " task.putboundslice(mosek.accmode.var,\n",
- " 0, 2*n, 2*n*[mosek.boundkey.fr], 2*n*[0.0], 2*n*[0.0])\n",
- "\n",
- " # optimize the task\n",
- " task.putobjsense(mosek.objsense.minimize)\n",
- " task.optimize()\n",
- " task.solutionsummary(mosek.streamtype.log)\n",
- " x = n*[0.0]\n",
- " task.getsolutionslice(mosek.soltype.itr, mosek.solitem.xx, 0, n, x)\n",
- "\n",
- " return matrix(x)\n",
- "\n",
- " def l1regls_mosek2(A, b):\n",
- " \"\"\"\n",
- "\n",
- " Returns the solution of l1-norm regularized least-squares problem\n",
- "\n",
- " minimize w'*w + e'*u\n",
- "\n",
- " subject to -u <= x <= u\n",
- "\n",
- " A*x - w = b\n",
- "\n",
- " \"\"\"\n",
- "\n",
- " m, n = A.size\n",
- "\n",
- " env = mosek.Env()\n",
- " task = env.Task(0,0)\n",
- " task.set_Stream(mosek.streamtype.log, lambda x: sys.stdout.write(x))\n",
- "\n",
- " task.appendvars(2*n + m) # number of variables\n",
- " task.appendcons(2*n + m) # number of constraints\n",
- "\n",
- " # input quadratic objective\n",
- " task.putqobj(range(2*n,2*n+m), range(2*n,2*n+m), m*[2.0])\n",
- "\n",
- " task.putclist(range(2*n+m), n*[0.0] + n*[1.0] + m*[0.0]) # setup linear objective\n",
- "\n",
- " # input constraint matrix row by row\n",
- " for i in range(n):\n",
- " task.putarow( i, [i, n+i], [1.0, -1.0])\n",
- " task.putarow( n+i, [i, n+i], [1.0, 1.0])\n",
- "\n",
- " for i in range(m):\n",
- " task.putarow( 2*n+i, range(n) + [2*n+i], list(A[i,:]) + [-1.0])\n",
- "\n",
- " # setup bounds on constraints\n",
- " task.putboundslice(mosek.accmode.con,\n",
- " 0, n, n*[mosek.boundkey.up], n*[0.0], n*[0.0])\n",
- " task.putboundslice(mosek.accmode.con,\n",
- " n, 2*n, n*[mosek.boundkey.lo], n*[0.0], n*[0.0])\n",
- " task.putboundslice(mosek.accmode.con,\n",
- " 2*n, 2*n+m, m*[mosek.boundkey.fx], list(b), list(b))\n",
- "\n",
- " # setup variable bounds\n",
- " task.putboundslice(mosek.accmode.var, 0, 2*n+m, (2*n+m)*[mosek.boundkey.fr], \n",
- " (2*n+m)*[0.0], (2*n+m)*[0.0])\n",
- "\n",
- " # optimize the task\n",
- " task.putobjsense(mosek.objsense.minimize)\n",
- " task.optimize()\n",
- " task.solutionsummary(mosek.streamtype.log)\n",
- " x = n*[0.0]\n",
- " task.getsolutionslice(mosek.soltype.itr, mosek.solitem.xx, 0, n, x)\n",
- "\n",
- " return matrix(x)\n",
- "\n",
- "def l1regls(A, b):\n",
- " \"\"\"\n",
- " \n",
- " Returns the solution of l1-norm regularized least-squares problem\n",
- " \n",
- " minimize || A*x - b ||_2^2 + || x ||_1.\n",
- "\n",
- " \"\"\"\n",
- "\n",
- " m, n = A.size\n",
- " q = matrix(1.0, (2*n,1))\n",
- " q[:n] = -2.0 * A.T * b\n",
- "\n",
- " def P(u, v, alpha = 1.0, beta = 0.0 ):\n",
- " \"\"\"\n",
- " v := alpha * 2.0 * [ A'*A, 0; 0, 0 ] * u + beta * v \n",
- " \"\"\"\n",
- " v *= beta\n",
- " v[:n] += alpha * 2.0 * A.T * (A * u[:n])\n",
- "\n",
- "\n",
- " def G(u, v, alpha=1.0, beta=0.0, trans='N'):\n",
- " \"\"\"\n",
- " v := alpha*[I, -I; -I, -I] * u + beta * v (trans = 'N' or 'T')\n",
- " \"\"\"\n",
- "\n",
- " v *= beta\n",
- " v[:n] += alpha*(u[:n] - u[n:])\n",
- " v[n:] += alpha*(-u[:n] - u[n:])\n",
- "\n",
- " h = matrix(0.0, (2*n,1))\n",
- "\n",
- "\n",
- " # Customized solver for the KKT system \n",
- " #\n",
- " # [ 2.0*A'*A 0 I -I ] [x[:n] ] [bx[:n] ]\n",
- " # [ 0 0 -I -I ] [x[n:] ] = [bx[n:] ].\n",
- " # [ I -I -D1^-1 0 ] [zl[:n]] [bzl[:n]]\n",
- " # [ -I -I 0 -D2^-1 ] [zl[n:]] [bzl[n:]]\n",
- " #\n",
- " # where D1 = W['di'][:n]**2, D2 = W['di'][:n]**2.\n",
- " # \n",
- " # We first eliminate zl and x[n:]:\n",
- " #\n",
- " # ( 2*A'*A + 4*D1*D2*(D1+D2)^-1 ) * x[:n] = \n",
- " # bx[:n] - (D2-D1)*(D1+D2)^-1 * bx[n:] + \n",
- " # D1 * ( I + (D2-D1)*(D1+D2)^-1 ) * bzl[:n] - \n",
- " # D2 * ( I - (D2-D1)*(D1+D2)^-1 ) * bzl[n:] \n",
- " #\n",
- " # x[n:] = (D1+D2)^-1 * ( bx[n:] - D1*bzl[:n] - D2*bzl[n:] ) \n",
- " # - (D2-D1)*(D1+D2)^-1 * x[:n] \n",
- " #\n",
- " # zl[:n] = D1 * ( x[:n] - x[n:] - bzl[:n] )\n",
- " # zl[n:] = D2 * (-x[:n] - x[n:] - bzl[n:] ).\n",
- " #\n",
- " # The first equation has the form\n",
- " #\n",
- " # (A'*A + D)*x[:n] = rhs\n",
- " #\n",
- " # and is equivalent to\n",
- " #\n",
- " # [ D A' ] [ x:n] ] = [ rhs ]\n",
- " # [ A -I ] [ v ] [ 0 ].\n",
- " #\n",
- " # It can be solved as \n",
- " #\n",
- " # ( A*D^-1*A' + I ) * v = A * D^-1 * rhs\n",
- " # x[:n] = D^-1 * ( rhs - A'*v ).\n",
- "\n",
- " S = matrix(0.0, (m,m))\n",
- " Asc = matrix(0.0, (m,n))\n",
- " v = matrix(0.0, (m,1))\n",
- "\n",
- " def Fkkt(W):\n",
- "\n",
- " # Factor \n",
- " #\n",
- " # S = A*D^-1*A' + I \n",
- " #\n",
- " # where D = 2*D1*D2*(D1+D2)^-1, D1 = d[:n]**-2, D2 = d[n:]**-2.\n",
- "\n",
- " d1, d2 = W['di'][:n]**2, W['di'][n:]**2\n",
- "\n",
- " # ds is square root of diagonal of D\n",
- " ds = math.sqrt(2.0) * div( mul( W['di'][:n], W['di'][n:]), \n",
- " sqrt(d1+d2) )\n",
- " d3 = div(d2 - d1, d1 + d2)\n",
- " \n",
- " # Asc = A*diag(d)^-1/2\n",
- " Asc = A * spdiag(ds**-1)\n",
- "\n",
- " # S = I + A * D^-1 * A'\n",
- " blas.syrk(Asc, S)\n",
- " S[::m+1] += 1.0 \n",
- " lapack.potrf(S)\n",
- "\n",
- " def g(x, y, z):\n",
- "\n",
- " x[:n] = 0.5 * ( x[:n] - mul(d3, x[n:]) + \n",
- " mul(d1, z[:n] + mul(d3, z[:n])) - mul(d2, z[n:] - \n",
- " mul(d3, z[n:])) )\n",
- " x[:n] = div( x[:n], ds) \n",
- "\n",
- " # Solve\n",
- " #\n",
- " # S * v = 0.5 * A * D^-1 * ( bx[:n] - \n",
- " # (D2-D1)*(D1+D2)^-1 * bx[n:] + \n",
- " # D1 * ( I + (D2-D1)*(D1+D2)^-1 ) * bzl[:n] - \n",
- " # D2 * ( I - (D2-D1)*(D1+D2)^-1 ) * bzl[n:] )\n",
- " \n",
- " blas.gemv(Asc, x, v)\n",
- " lapack.potrs(S, v)\n",
- " \n",
- " # x[:n] = D^-1 * ( rhs - A'*v ).\n",
- " blas.gemv(Asc, v, x, alpha=-1.0, beta=1.0, trans='T')\n",
- " x[:n] = div(x[:n], ds)\n",
- "\n",
- " # x[n:] = (D1+D2)^-1 * ( bx[n:] - D1*bzl[:n] - D2*bzl[n:] ) \n",
- " # - (D2-D1)*(D1+D2)^-1 * x[:n] \n",
- " x[n:] = div( x[n:] - mul(d1, z[:n]) - mul(d2, z[n:]), d1+d2 )\\\n",
- " - mul( d3, x[:n] )\n",
- " \n",
- " # zl[:n] = D1^1/2 * ( x[:n] - x[n:] - bzl[:n] )\n",
- " # zl[n:] = D2^1/2 * ( -x[:n] - x[n:] - bzl[n:] ).\n",
- " z[:n] = mul( W['di'][:n], x[:n] - x[n:] - z[:n] ) \n",
- " z[n:] = mul( W['di'][n:], -x[:n] - x[n:] - z[n:] ) \n",
- "\n",
- " return g\n",
- "\n",
- " return solvers.coneqp(P, q, G, h, kktsolver = Fkkt)['x'][:n]"
+ "As a small addendum, we note that you can also solve this problem using the convex optimization package [CVXOPT](https://cvxopt.org/examples/mlbook/l1regls.html). This requires, in addition to having installed **CVXOPT**, you need to download the file *l1regl.py*."
]
},
{
"cell_type": "markdown",
- "metadata": {},
- "source": [
- "Then we call the above functions and solve the problem, as done here"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
+ "id": "4c5c2565",
"metadata": {
- "collapsed": false,
"editable": true
},
- "outputs": [],
"source": [
- "from cvxopt import matrix, normal\n",
- "\n",
- "X = matrix( [ [ 2, 0, 1], [0, 1, 3]])\n",
- "y = matrix( [4, 2, 3])\n",
- "x = l1regls(X,y)"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "**More text will be added to this example.**\n",
- "\n",
"## Linking the regression analysis with a statistical interpretation\n",
"\n",
"We will now couple the discussions of ordinary least squares, Ridge\n",
@@ -3270,7 +3705,6 @@
"parameter can reduce considerably the variance of the parameters\n",
"$\\beta$.\n",
"\n",
- "\n",
"The\n",
"advantage of doing linear regression is that we actually end up with\n",
"analytical expressions for several statistical quantities. \n",
@@ -3278,7 +3712,6 @@
"derive quantities like the variance and other expectation values in a\n",
"rather straightforward way.\n",
"\n",
- "\n",
"It is assumed that $\\varepsilon_i\n",
"\\sim \\mathcal{N}(0, \\sigma^2)$ and the $\\varepsilon_{i}$ are\n",
"independent, i.e.:"
@@ -3286,7 +3719,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "f264b531",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\begin{align*} \n",
@@ -3299,7 +3735,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "800b179f",
+ "metadata": {
+ "editable": true
+ },
"source": [
"The randomness of $\\varepsilon_i$ implies that\n",
"$\\mathbf{y}_i$ is also a random variable. In particular,\n",
@@ -3312,8 +3751,6 @@
"notation above $\\mathbf{X}_{i,\\ast}$ means that we are looking at the\n",
"row number $i$ and perform a sum over all values $p$.\n",
"\n",
- "\n",
- "\n",
"The assumption we have made here can be summarized as (and this is going to be useful when we discuss the bias-variance trade off)\n",
"that there exists a function $f(\\boldsymbol{x})$ and a normal distributed error $\\boldsymbol{\\varepsilon}\\sim \\mathcal{N}(0, \\sigma^2)$\n",
"which describe our data"
@@ -3321,7 +3758,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "b4815186",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{y} = f(\\boldsymbol{x})+\\boldsymbol{\\varepsilon}\n",
@@ -3330,7 +3770,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "2a343970",
+ "metadata": {
+ "editable": true
+ },
"source": [
"We approximate this function with our model from the solution of the linear regression equations, that is our\n",
"function $f$ is approximated by $\\boldsymbol{\\tilde{y}}$ where we want to minimize $(\\boldsymbol{y}-\\boldsymbol{\\tilde{y}})^2$, our MSE, with"
@@ -3338,7 +3781,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "358077b0",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{\\tilde{y}} = \\boldsymbol{X}\\boldsymbol{\\beta}.\n",
@@ -3347,14 +3793,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "73f23e81",
+ "metadata": {
+ "editable": true
+ },
"source": [
"We can calculate the expectation value of $\\boldsymbol{y}$ for a given element $i$"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "bebdffa9",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\begin{align*} \n",
@@ -3367,7 +3819,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "8c38cb47",
+ "metadata": {
+ "editable": true
+ },
"source": [
"while\n",
"its variance is"
@@ -3375,7 +3830,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "193c47ee",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\begin{align*} \\mbox{Var}(y_i) & = \\mathbb{E} \\{ [y_i\n",
@@ -3395,18 +3853,23 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "92832b0a",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Hence, $y_i \\sim \\mathcal{N}( \\mathbf{X}_{i, \\ast} \\, \\boldsymbol{\\beta}, \\sigma^2)$, that is $\\boldsymbol{y}$ follows a normal distribution with \n",
"mean value $\\boldsymbol{X}\\boldsymbol{\\beta}$ and variance $\\sigma^2$ (not be confused with the singular values of the SVD). \n",
"\n",
- "\n",
"With the OLS expressions for the parameters $\\boldsymbol{\\beta}$ we can evaluate the expectation value"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "5f517886",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\mathbb{E}(\\boldsymbol{\\beta}) = \\mathbb{E}[ (\\mathbf{X}^{\\top} \\mathbf{X})^{-1}\\mathbf{X}^{T} \\mathbf{Y}]=(\\mathbf{X}^{T} \\mathbf{X})^{-1}\\mathbf{X}^{T} \\mathbb{E}[ \\mathbf{Y}]=(\\mathbf{X}^{T} \\mathbf{X})^{-1} \\mathbf{X}^{T}\\mathbf{X}\\boldsymbol{\\beta}=\\boldsymbol{\\beta}.\n",
@@ -3415,7 +3878,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "f9dea445",
+ "metadata": {
+ "editable": true
+ },
"source": [
"This means that the estimator of the regression parameters is unbiased.\n",
"\n",
@@ -3426,7 +3892,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "3aececb1",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\begin{eqnarray*}\n",
@@ -3454,7 +3923,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "f38f2849",
+ "metadata": {
+ "editable": true
+ },
"source": [
"where we have used that $\\mathbb{E} (\\mathbf{Y} \\mathbf{Y}^{T}) =\n",
"\\mathbf{X} \\, \\boldsymbol{\\beta} \\, \\boldsymbol{\\beta}^{T} \\, \\mathbf{X}^{T} +\n",
@@ -3464,7 +3936,6 @@
"$\\boldsymbol{\\sigma}^2 (\\boldsymbol{\\beta}_j ) = \\boldsymbol{\\sigma}^2 [(\\mathbf{X}^{T} \\mathbf{X})^{-1}]_{jj} $. This may be used to\n",
"construct a confidence interval for the estimates.\n",
"\n",
- "\n",
"In a similar way, we can obtain analytical expressions for say the\n",
"expectation values of the parameters $\\boldsymbol{\\beta}$ and their variance\n",
"when we employ Ridge regression, allowing us again to define a confidence interval. \n",
@@ -3474,7 +3945,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "47dbc181",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\mathbb{E} \\big[ \\boldsymbol{\\beta}^{\\mathrm{Ridge}} \\big]=(\\mathbf{X}^{T} \\mathbf{X} + \\lambda \\mathbf{I}_{pp})^{-1} (\\mathbf{X}^{\\top} \\mathbf{X})\\boldsymbol{\\beta}^{\\mathrm{OLS}}.\n",
@@ -3483,7 +3957,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "a409614d",
+ "metadata": {
+ "editable": true
+ },
"source": [
"We see clearly that \n",
"$\\mathbb{E} \\big[ \\boldsymbol{\\beta}^{\\mathrm{Ridge}} \\big] \\not= \\boldsymbol{\\beta}^{\\mathrm{OLS}}$ for any $\\lambda > 0$. We say then that the ridge estimator is biased.\n",
@@ -3493,7 +3970,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "32e59beb",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\mbox{Var}[\\boldsymbol{\\beta}^{\\mathrm{Ridge}}]=\\sigma^2[ \\mathbf{X}^{T} \\mathbf{X} + \\lambda \\mathbf{I} ]^{-1} \\mathbf{X}^{T} \\mathbf{X} \\{ [ \\mathbf{X}^{\\top} \\mathbf{X} + \\lambda \\mathbf{I} ]^{-1}\\}^{T},\n",
@@ -3502,7 +3982,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "e5d38011",
+ "metadata": {
+ "editable": true
+ },
"source": [
"and it is easy to see that if the parameter $\\lambda$ goes to infinity then the variance of Ridge parameters $\\boldsymbol{\\beta}$ goes to zero. \n",
"\n",
@@ -3511,7 +3994,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "999a6bc6",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\mbox{Var}[\\boldsymbol{\\beta}^{\\mathrm{OLS}}]-\\mbox{Var}(\\boldsymbol{\\beta}^{\\mathrm{Ridge}})=\\sigma^2 [ \\mathbf{X}^{T} \\mathbf{X} + \\lambda \\mathbf{I} ]^{-1}[ 2\\lambda\\mathbf{I} + \\lambda^2 (\\mathbf{X}^{T} \\mathbf{X})^{-1} ] \\{ [ \\mathbf{X}^{T} \\mathbf{X} + \\lambda \\mathbf{I} ]^{-1}\\}^{T}.\n",
@@ -3520,14 +4006,23 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "888f1db7",
+ "metadata": {
+ "editable": true
+ },
"source": [
"The difference is non-negative definite since each component of the\n",
"matrix product is non-negative definite. \n",
- "This means the variance we obtain with the standard OLS will always for $\\lambda > 0$ be larger than the variance of $\\boldsymbol{\\beta}$ obtained with the Ridge estimator. This has interesting consequences when we discuss the so-called bias-variance trade-off below. \n",
- "\n",
- "\n",
- "\n",
+ "This means the variance we obtain with the standard OLS will always for $\\lambda > 0$ be larger than the variance of $\\boldsymbol{\\beta}$ obtained with the Ridge estimator. This has interesting consequences when we discuss the so-called bias-variance trade-off below."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "76360bbe",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
"## Deriving OLS from a probability distribution\n",
"\n",
"Our basic assumption when we derived the OLS equations was to assume\n",
@@ -3546,7 +4041,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "6b1976cd",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"y_i\\sim \\mathcal{N}(\\boldsymbol{X}_{i,*}\\boldsymbol{\\beta}, \\sigma^2)=\\frac{1}{\\sqrt{2\\pi\\sigma^2}}\\exp{\\left[-\\frac{(y_i-\\boldsymbol{X}_{i,*}\\boldsymbol{\\beta})^2}{2\\sigma^2}\\right]}.\n",
@@ -3555,7 +4053,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "5ff419a1",
+ "metadata": {
+ "editable": true
+ },
"source": [
"We assume now that the various $y_i$ values are stochastically distributed according to the above Gaussian distribution. \n",
"We define this distribution as"
@@ -3563,7 +4064,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "82730c14",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"p(y_i, \\boldsymbol{X}\\vert\\boldsymbol{\\beta})=\\frac{1}{\\sqrt{2\\pi\\sigma^2}}\\exp{\\left[-\\frac{(y_i-\\boldsymbol{X}_{i,*}\\boldsymbol{\\beta})^2}{2\\sigma^2}\\right]},\n",
@@ -3572,7 +4076,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "4982965d",
+ "metadata": {
+ "editable": true
+ },
"source": [
"which reads as finding the likelihood of an event $y_i$ with the input variables $\\boldsymbol{X}$ given the parameters (to be determined) $\\boldsymbol{\\beta}$.\n",
"\n",
@@ -3581,7 +4088,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "ab4c31a7",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"p(\\boldsymbol{y},\\boldsymbol{X}\\vert\\boldsymbol{\\beta})=\\prod_{i=0}^{n-1}\\frac{1}{\\sqrt{2\\pi\\sigma^2}}\\exp{\\left[-\\frac{(y_i-\\boldsymbol{X}_{i,*}\\boldsymbol{\\beta})^2}{2\\sigma^2}\\right]}=\\prod_{i=0}^{n-1}p(y_i,\\boldsymbol{X}\\vert\\boldsymbol{\\beta}).\n",
@@ -3590,7 +4100,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "768cb1fc",
+ "metadata": {
+ "editable": true
+ },
"source": [
"We will write this in a more compact form reserving $\\boldsymbol{D}$ for the domain of events, including the ouputs (targets) and the inputs. That is\n",
"in case we have a simple one-dimensional input and output case"
@@ -3598,7 +4111,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "f9f0c7f3",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{D}=[(x_0,y_0), (x_1,y_1),\\dots, (x_{n-1},y_{n-1})].\n",
@@ -3607,7 +4123,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "c617cdd7",
+ "metadata": {
+ "editable": true
+ },
"source": [
"In the more general case the various inputs should be replaced by the possible features represented by the input data set $\\boldsymbol{X}$. \n",
"We can now rewrite the above probability as"
@@ -3615,7 +4134,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "760dd73f",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"p(\\boldsymbol{D}\\vert\\boldsymbol{\\beta})=\\prod_{i=0}^{n-1}\\frac{1}{\\sqrt{2\\pi\\sigma^2}}\\exp{\\left[-\\frac{(y_i-\\boldsymbol{X}_{i,*}\\boldsymbol{\\beta})^2}{2\\sigma^2}\\right]}.\n",
@@ -3624,27 +4146,27 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "0fd8cbb0",
+ "metadata": {
+ "editable": true
+ },
"source": [
"It is a conditional probability (see below) and reads as the\n",
"likelihood of a domain of events $\\boldsymbol{D}$ given a set of parameters\n",
"$\\boldsymbol{\\beta}$.\n",
"\n",
- "\n",
"In statistics, maximum likelihood estimation (MLE) is a method of\n",
"estimating the parameters of an assumed probability distribution,\n",
"given some observed data. This is achieved by maximizing a likelihood\n",
"function so that, under the assumed statistical model, the observed\n",
"data is the most probable. \n",
"\n",
- "\n",
"We will assume here that our events are given by the above Gaussian\n",
"distribution and we will determine the optimal parameters $\\beta$ by\n",
"maximizing the above PDF. However, computing the derivatives of a\n",
"product function is cumbersome and can easily lead to overflow and/or\n",
"underflowproblems, with potentials for loss of numerical precision.\n",
"\n",
- "\n",
"In practice, it is more convenient to maximize the logarithm of the\n",
"PDF because it is a monotonically increasing function of the argument.\n",
"Alternatively, and this will be our option, we will minimize the\n",
@@ -3654,15 +4176,15 @@
"Note also that maximization/minimization of the logarithm of the PDF\n",
"is equivalent to the maximization/minimization of the function itself.\n",
"\n",
- "\n",
- "\n",
- "\n",
"We could now define a new cost function to minimize, namely the negative logarithm of the above PDF"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "bbfab5d3",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"C(\\boldsymbol{\\beta}=-\\log{\\prod_{i=0}^{n-1}p(y_i,\\boldsymbol{X}\\vert\\boldsymbol{\\beta})}=-\\sum_{i=0}^{n-1}\\log{p(y_i,\\boldsymbol{X}\\vert\\boldsymbol{\\beta})},\n",
@@ -3671,14 +4193,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "f4ee97d7",
+ "metadata": {
+ "editable": true
+ },
"source": [
"which becomes"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "1e74d52d",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"C(\\boldsymbol{\\beta}=\\frac{n}{2}\\log{2\\pi\\sigma^2}+\\frac{\\vert\\vert (\\boldsymbol{y}-\\boldsymbol{X}\\boldsymbol{\\beta})\\vert\\vert_2^2}{2\\sigma^2}.\n",
@@ -3687,14 +4215,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "b983cb4c",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Taking the derivative of the *new* cost function with respect to the parameters $\\beta$ we recognize our familiar OLS equation, namely"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "c90a8ed0",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{X}^T\\left(\\boldsymbol{y}-\\boldsymbol{X}\\boldsymbol{\\beta}\\right) =0,\n",
@@ -3703,14 +4237,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "f38fcc19",
+ "metadata": {
+ "editable": true
+ },
"source": [
"which leads to the well-known OLS equation for the optimal paramters $\\beta$"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "348010f6",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\hat{\\boldsymbol{\\beta}}^{\\mathrm{OLS}}=\\left(\\boldsymbol{X}^T\\boldsymbol{X}\\right)^{-1}\\boldsymbol{X}^T\\boldsymbol{y}!\n",
@@ -3719,11 +4259,13 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "cd33a62d",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Before we make a similar analysis for Ridge and Lasso regression, we need a short reminder on statistics. \n",
"\n",
- "\n",
"A central theorem in statistics is Bayes' theorem. This theorem plays a similar role as the good old Pythagoras' theorem in geometry.\n",
"Bayes' theorem is extremely simple to derive. But to do so we need some basic axioms from statistics.\n",
"\n",
@@ -3737,7 +4279,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "2bb675c1",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"p(X \\cup Y)= p(X)+p(Y)-p(X \\cap Y).\n",
@@ -3746,14 +4291,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "d1ff7ab5",
+ "metadata": {
+ "editable": true
+ },
"source": [
"The product rule (aka joint probability) is given by"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "80d51bf1",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"p(X \\cup Y)= p(X,Y)= p(X\\vert Y)p(Y)=p(Y\\vert X)p(X),\n",
@@ -3762,20 +4313,24 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "3eb856c7",
+ "metadata": {
+ "editable": true
+ },
"source": [
"where we read $p(X\\vert Y)$ as the likelihood of obtaining $X$ given $Y$.\n",
"\n",
"If we have independent events then $p(X,Y)=p(X)p(Y)$.\n",
"\n",
- "\n",
- "\n",
"The marginal probability is defined in terms of only one of the set of variables $X,Y$. For a discrete probability we have"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "84c98a40",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"p(X)=\\sum_{i=0}^{n-1}p(X,Y=y_i)=\\sum_{i=0}^{n-1}p(X\\vert Y=y_i)p(Y=y_i)=\\sum_{i=0}^{n-1}p(X\\vert y_i)p(y_i).\n",
@@ -3784,14 +4339,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "094f6489",
+ "metadata": {
+ "editable": true
+ },
"source": [
"The conditional probability, if $p(Y) > 0$, is"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "40b87dab",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"p(X\\vert Y)= \\frac{p(X,Y)}{p(Y)}=\\frac{p(X,Y)}{\\sum_{i=0}^{n-1}p(Y\\vert X=x_i)p(x_i)}.\n",
@@ -3800,14 +4361,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "02ee6009",
+ "metadata": {
+ "editable": true
+ },
"source": [
"If we combine the conditional probability with the marginal probability and the standard product rule, we have"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "c9b83f7e",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"p(X\\vert Y)= \\frac{p(X,Y)}{p(Y)},\n",
@@ -3816,14 +4383,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "28693db1",
+ "metadata": {
+ "editable": true
+ },
"source": [
"which we can rewrite as"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "cd0819c2",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"p(X\\vert Y)= \\frac{p(X,Y)}{\\sum_{i=0}^{n-1}p(Y\\vert X=x_i)p(x_i)}=\\frac{p(Y\\vert X)p(X)}{\\sum_{i=0}^{n-1}p(Y\\vert X=x_i)p(x_i)},\n",
@@ -3832,11 +4405,13 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "c73d36a3",
+ "metadata": {
+ "editable": true
+ },
"source": [
"which is Bayes' theorem. It allows us to evaluate the uncertainty in in $X$ after we have observed $Y$. We can easily interchange $X$ with $Y$. \n",
"\n",
- "\n",
"The quantity $p(Y\\vert X)$ on the right-hand side of the theorem is\n",
"evaluated for the observed data $Y$ and can be viewed as a function of\n",
"the parameter space represented by $X$. This function is not\n",
@@ -3849,7 +4424,6 @@
"\n",
"Let us try to illustrate Bayes' theorem through an example.\n",
"\n",
- "\n",
"Let us suppose that you are undergoing a series of mammography scans\n",
"in order to rule out possible breast cancer cases. We define the\n",
"sensitivity for a positive event by the variable $X$. It takes binary\n",
@@ -3867,7 +4441,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "779d9389",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"p(X=1\\vert Y=1) =0.8.\n",
@@ -3876,7 +4453,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "63db00a0",
+ "metadata": {
+ "editable": true
+ },
"source": [
"This obviously sounds scary since many would conclude that if the test\n",
"is positive, there is a likelihood of $80\\%$ for having cancer. It is\n",
@@ -3886,7 +4466,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "ab01099c",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"p(Y=1\\vert X=1),\n",
@@ -3895,12 +4478,13 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "ec0ebb28",
+ "metadata": {
+ "editable": true
+ },
"source": [
"instead of $p(X=1\\vert Y=1)$.\n",
"\n",
- "\n",
- "\n",
"If we look at various national surveys on breast cancer, the general\n",
"likelihood of developing breast cancer is a very small number. Let us\n",
"assume that the prior probability in the population as a whole is"
@@ -3908,7 +4492,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "4c432161",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"p(Y=1) =0.004.\n",
@@ -3917,7 +4504,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "03d0cdb8",
+ "metadata": {
+ "editable": true
+ },
"source": [
"We need also to account for the fact that the test may produce a false\n",
"positive result (false alarm). Let us here assume that we have"
@@ -3925,7 +4515,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "8d7a0ad2",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"p(X=1\\vert Y=0) =0.1.\n",
@@ -3934,7 +4527,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "fcdc27a1",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Using Bayes' theorem we can then find the posterior probability that\n",
"the person has breast cancer in case of a positive test, that is we\n",
@@ -3943,7 +4539,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "e773eb9e",
+ "metadata": {
+ "editable": true
+ },
"source": [
"\n",
"\n",
@@ -3958,7 +4557,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "3892720e",
+ "metadata": {
+ "editable": true
+ },
"source": [
"\n",
"\n",
@@ -3973,12 +4575,21 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "c68513be",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
+ "That is, in case of a positive test, there is only a $3\\%$ chance of having breast cancer!"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "db1bcf38",
+ "metadata": {
+ "editable": true
+ },
"source": [
- "That is, in case of a positive test, there is only a $3\\%$ chance of having breast cancer!\n",
- "\n",
- "\n",
- "\n",
"## Bayes' Theorem and Ridge and Lasso Regression\n",
"\n",
"Hitherto we have discussed Ridge and Lasso regression in terms of a\n",
@@ -3988,7 +4599,6 @@
"\n",
"Before we proceed let us perform a Ridge, Lasso and OLS analysis of a polynomial fit. \n",
"\n",
- "\n",
"We will play around with a study of the values for the optimal\n",
"parameters $\\boldsymbol{\\beta}$ using OLS, Ridge and Lasso regression. For\n",
"OLS, you will notice as function of the noise and polynomial degree,\n",
@@ -4003,7 +4613,8 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 12,
+ "id": "aa27ede9",
"metadata": {
"collapsed": false,
"editable": true
@@ -4077,7 +4688,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "66975598",
+ "metadata": {
+ "editable": true
+ },
"source": [
"How can we understand this?\n",
"\n",
@@ -4103,7 +4717,8 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 13,
+ "id": "f90a238f",
"metadata": {
"collapsed": false,
"editable": true
@@ -4152,7 +4767,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "d32f4700",
+ "metadata": {
+ "editable": true
+ },
"source": [
"As an exercise, repeat these calculations with ordinary least squares\n",
"only with and without noise. Calculate thereafter the variance of the\n",
@@ -4160,11 +4778,16 @@
"noise. Here we recommend to use $\\sigma^2=1$ as variance for the\n",
"added noise (which follows a normal distribution with mean value zero).\n",
"Comment your results. If you have a large noise term, do the parameters $\\beta_j$ vary more as function\n",
- "model complexity? And what about their variance? \n",
- "\n",
- "\n",
- "\n",
- "\n",
+ "model complexity? And what about their variance?"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "5292b482",
+ "metadata": {
+ "editable": true
+ },
+ "source": [
"## Linking Bayes' Theorem with Ridge and Lasso Regression\n",
"\n",
"We have seen that Ridge regression suppresses those features which\n",
@@ -4178,7 +4801,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "6b827637",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"\\boldsymbol{D}=[(x_0,y_0), (x_1,y_1),\\dots, (x_{n-1},y_{n-1})],\n",
@@ -4187,14 +4813,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "6e73b7d4",
+ "metadata": {
+ "editable": true
+ },
"source": [
"is given by"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "ead2878e",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"p(\\boldsymbol{D}\\vert\\boldsymbol{\\beta})=\\prod_{i=0}^{n-1}\\frac{1}{\\sqrt{2\\pi\\sigma^2}}\\exp{\\left[-\\frac{(y_i-\\boldsymbol{X}_{i,*}\\boldsymbol{\\beta})^2}{2\\sigma^2}\\right]}.\n",
@@ -4203,14 +4835,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "1302f31e",
+ "metadata": {
+ "editable": true
+ },
"source": [
"In Bayes' theorem this function plays the role of the so-called likelihood. We could now ask the question what is the posterior probability of a parameter set $\\boldsymbol{\\beta}$ given a domain of events $\\boldsymbol{D}$? That is, how can we define the posterior probability"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "dd411d77",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"p(\\boldsymbol{\\beta}\\vert\\boldsymbol{D}).\n",
@@ -4219,14 +4857,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "01dcd800",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Bayes' theorem comes to our rescue here since (omitting the normalization constant)"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "0a3fa1e5",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"p(\\boldsymbol{\\beta}\\vert\\boldsymbol{D})\\propto p(\\boldsymbol{D}\\vert\\boldsymbol{\\beta})p(\\boldsymbol{\\beta}).\n",
@@ -4235,25 +4879,28 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "e5ce5ac4",
+ "metadata": {
+ "editable": true
+ },
"source": [
"We have a model for $p(\\boldsymbol{D}\\vert\\boldsymbol{\\beta})$ but need one for the **prior** $p(\\boldsymbol{\\beta}$! \n",
"\n",
- "\n",
- "\n",
"With the posterior probability defined by a likelihood which we have\n",
"already modeled and an unknown prior, we are now ready to make\n",
"additional models for the prior.\n",
"\n",
"We can, based on our discussions of the variance of $\\boldsymbol{\\beta}$ and\n",
"the mean value, assume that the prior for the values $\\boldsymbol{\\beta}$ is\n",
- "given by a Gaussian with mean value zero and variance $\\tau^2$, that\n",
- "is"
+ "given by a Gaussian with mean value zero and variance $\\tau^2$, that"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "9221bb65",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"p(\\boldsymbol{\\beta})=\\prod_{j=0}^{p-1}\\exp{\\left(-\\frac{\\beta_j^2}{2\\tau^2}\\right)}.\n",
@@ -4262,14 +4909,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "0e7f22c4",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Our posterior probability becomes then (omitting the normalization factor which is just a constant)"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "3565934d",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"p(\\boldsymbol{\\beta\\vert\\boldsymbol{D})}=\\prod_{i=0}^{n-1}\\frac{1}{\\sqrt{2\\pi\\sigma^2}}\\exp{\\left[-\\frac{(y_i-\\boldsymbol{X}_{i,*}\\boldsymbol{\\beta})^2}{2\\sigma^2}\\right]}\\prod_{j=0}^{p-1}\\exp{\\left(-\\frac{\\beta_j^2}{2\\tau^2}\\right)}.\n",
@@ -4278,7 +4931,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "5c4b9c3a",
+ "metadata": {
+ "editable": true
+ },
"source": [
"We can now optimize this quantity with respect to $\\boldsymbol{\\beta}$. As we\n",
"did for OLS, this is most conveniently done by taking the negative\n",
@@ -4288,7 +4944,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "f91f265b",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"C(\\boldsymbol{\\beta})=\\frac{\\vert\\vert (\\boldsymbol{y}-\\boldsymbol{X}\\boldsymbol{\\beta})\\vert\\vert_2^2}{2\\sigma^2}+\\frac{1}{2\\tau^2}\\vert\\vert\\boldsymbol{\\beta}\\vert\\vert_2^2,\n",
@@ -4297,14 +4956,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "a0427716",
+ "metadata": {
+ "editable": true
+ },
"source": [
"and replacing $1/2\\tau^2$ with $\\lambda$ we have"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "117eb03b",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"C(\\boldsymbol{\\beta})=\\frac{\\vert\\vert (\\boldsymbol{y}-\\boldsymbol{X}\\boldsymbol{\\beta})\\vert\\vert_2^2}{2\\sigma^2}+\\lambda\\vert\\vert\\boldsymbol{\\beta}\\vert\\vert_2^2,\n",
@@ -4313,17 +4978,22 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "9015a44a",
+ "metadata": {
+ "editable": true
+ },
"source": [
"which is our Ridge cost function! Nice, isn't it?\n",
"\n",
- "\n",
"To derive the Lasso cost function, we simply replace the Gaussian prior with an exponential distribution ([Laplace in this case](https://en.wikipedia.org/wiki/Laplace_distribution)) with zero mean value, that is"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "a184ac5a",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"p(\\boldsymbol{\\beta})=\\prod_{j=0}^{p-1}\\exp{\\left(-\\frac{\\vert\\beta_j\\vert}{\\tau}\\right)}.\n",
@@ -4332,14 +5002,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "ae799fbe",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Our posterior probability becomes then (omitting the normalization factor which is just a constant)"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "055d1b54",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"p(\\boldsymbol{\\beta}\\vert\\boldsymbol{D})=\\prod_{i=0}^{n-1}\\frac{1}{\\sqrt{2\\pi\\sigma^2}}\\exp{\\left[-\\frac{(y_i-\\boldsymbol{X}_{i,*}\\boldsymbol{\\beta})^2}{2\\sigma^2}\\right]}\\prod_{j=0}^{p-1}\\exp{\\left(-\\frac{\\vert\\beta_j\\vert}{\\tau}\\right)}.\n",
@@ -4348,7 +5024,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "104615f6",
+ "metadata": {
+ "editable": true
+ },
"source": [
"Taking the negative\n",
"logarithm of the posterior probability and leaving out the\n",
@@ -4357,7 +5036,10 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "8d868c3b",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"C(\\boldsymbol{\\beta}=\\frac{\\vert\\vert (\\boldsymbol{y}-\\boldsymbol{X}\\boldsymbol{\\beta})\\vert\\vert_2^2}{2\\sigma^2}+\\frac{1}{\\tau}\\vert\\vert\\boldsymbol{\\beta}\\vert\\vert_1,\n",
@@ -4366,14 +5048,20 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "c88440ff",
+ "metadata": {
+ "editable": true
+ },
"source": [
"and replacing $1/\\tau$ with $\\lambda$ we have"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "07c1232a",
+ "metadata": {
+ "editable": true
+ },
"source": [
"$$\n",
"C(\\boldsymbol{\\beta}=\\frac{\\vert\\vert (\\boldsymbol{y}-\\boldsymbol{X}\\boldsymbol{\\beta})\\vert\\vert_2^2}{2\\sigma^2}+\\lambda\\vert\\vert\\boldsymbol{\\beta}\\vert\\vert_1,\n",
@@ -4382,11 +5070,13 @@
},
{
"cell_type": "markdown",
- "metadata": {},
+ "id": "8416dffb",
+ "metadata": {
+ "editable": true
+ },
"source": [
"which is our Lasso cost function! \n",
"\n",
- "\n",
"Plotting these prior functions shows us that we can use the parameter\n",
"$\\lambda$ to shrink or increase the role of a given parameter\n",
"$\\beta_j$. The variance for the Laplace distribution is\n",
@@ -4399,5 +5089,5 @@
],
"metadata": {},
"nbformat": 4,
- "nbformat_minor": 4
+ "nbformat_minor": 5
}