diff --git a/README.md b/README.md index e69c369eb..1a66beaac 100644 --- a/README.md +++ b/README.md @@ -308,6 +308,7 @@ Recommended prereading: Chapters 1-2 (linear algebra) and chapter 3 (statistics) ### Week 38 September 20-24 - Lab Wednesday: Work on Project 1 - Lecture Thursday: Classification problems and Logistic Regression, from binary cases to several categories + - Video of Lecture at https://www.uio.no/studier/emner/matnat/fys/FYS-STK4155/h21/forelesningsvideoer/LectureSeptember23.mp4?vrtx=view-as-webpage - Lecture Friday: Logistic Regression and start discussions of gradient optimization - Reading recommendations: diff --git a/doc/BookChapters/chapter3.do.txt b/doc/BookChapters/chapter3.do.txt index f83d7feb4..bc4fc936d 100644 --- a/doc/BookChapters/chapter3.do.txt +++ b/doc/BookChapters/chapter3.do.txt @@ -1211,6 +1211,967 @@ plt.show() !ec +===== More on Rescaling data ===== + +We end this chapter by adding some words on scaling and how to deal with the intercept for regression cases. + +When you are comparing your own code with for example _Scikit-Learn_'s +library, there are some technicalities to keep in mind. The examples +here demonstrate some of these aspects with potential pitfalls. + +The discussion here focuses on the role of the intercept, how we can +set up the design matrix, what scaling we should use and other topics +which tend confuse us. + +The intercept can be interpreted as the expected value of our +target/output variables when all other predictors are set to zero. +Thus, if we cannot assume that the expected outputs/targets are zero +when all predictors are zero (the columns in the design matrix), it +may be a bad idea to implement a model which penalizes the intercept. +Furthermore, in for example Ridge and Lasso regression, the default solutions +from the library _Scikit-Learn_ (when not shrinking $\beta_0$) for the unknown parameters +$\bm{\beta}$, are derived under the assumption that both $\bm{y}$ and +$\bm{X}$ are zero centered, that is we subtract the mean values. + + +If our predictors represent different scales, then it is important to +standardize the design matrix $\bm{X}$ by subtracting the mean of each +column from the corresponding column and dividing the column with its +standard deviation. Most machine learning libraries do this as a default. This means that if you compare your code with the results from a given library, +the results may differ. + +The +"Standadscaler":"https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.StandardScaler.html" +function in _Scikit-Learn_ does this for us. For the data sets we +have been studying in our various examples, the data are in many cases +already scaled and there is no need to scale them. You as a user of different machine learning algorithms, should always perform a +survey of your data, with a critical assessment of them in case you need to scale the data. + +If you need to scale the data, not doing so will give an *unfair* +penalization of the parameters since their magnitude depends on the +scale of their corresponding predictor. + +Suppose as an example that you +you have an input variable given by the heights of different persons. +Human height might be measured in inches or meters or +kilometers. If measured in kilometers, a standard linear regression +model with this predictor would probably give a much bigger +coefficient term, than if measured in millimeters. +This can clearly lead to problems in evaluating the cost/loss functions. + + + +Keep in mind that when you transform your data set before training a model, the same transformation needs to be done +on your eventual new data set before making a prediction. If we translate this into a Python code, it would could be implemented as follows + +!bc pycod +""" +#Model training, we compute the mean value of y and X +y_train_mean = np.mean(y_train) +X_train_mean = np.mean(X_train,axis=0) +X_train = X_train - X_train_mean +y_train = y_train - y_train_mean + +# The we fit our model with the training data +trained_model = some_model.fit(X_train,y_train) + + +#Model prediction, we need also to transform our data set used for the prediction. +X_test = X_test - X_train_mean #Use mean from training data +y_pred = trained_model(X_test) +y_pred = y_pred + y_train_mean +""" +!ec + + +Let us try to understand what this may imply mathematically when we +subtract the mean values, also known as *zero centering*. For +simplicity, we will focus on ordinary regression, as done in the above example. + +The cost/loss function for regression is +!bt +\[ +C(\beta_0, \beta_1, ... , \beta_{p-1}) = \frac{1}{n}\sum_{i=0}^{n} \left(y_i - \beta_0 - \sum_{j=1}^{p-1} X_{ij}\beta_j\right)^2,. +\] +!et +Recall also that we use the squared value since this leads to an increase of the penalty for higher differences between predicted and output/target values. + +What we have done is to single out the $\beta_0$ term in the definition of the mean squared error (MSE). +The design matrix +$X$ does in this case not contain any intercept column. +When we take the derivative with respect to $\beta_0$, we want the derivative to obey +!bt +\[ +\frac{\partial C}{\partial \beta_j} = 0, +\] +!et + +for all $j$. For $\beta_0$ we have + +!bt +\[ +\frac{\partial C}{\partial \beta_0} = -\frac{2}{n}\sum_{i=0}^{n-1} \left(y_i - \beta_0 - \sum_{j=1}^{p-1} X_{ij} \beta_j\right). +\] +!et +Multiplying away the constant $2/n$, we obtain +!bt +\[ +\sum_{i=0}^{n-1} \beta_0 = \sum_{i=0}^{n-1}y_i - \sum_{i=0}^{n-1} \sum_{j=1}^{p-1} X_{ij} \beta_j. +\] +!et + + +We assume +that every column of $\bm{X}$ is centered, which we can do by subtracting the mean, +!bc pycod +X = X - np.mean(X,axis=0) +!ec + +This means that we need to rewrite $X_{ij}$ as $\tilde{X}_{ij}=X_{ij}-\mu_j$, where +!bt +\[ +\mu_j = \frac{1}{n}\sum_{i=0}^{n-1}X_{ij}. +\] +!et + +Let us special first to the case where we have only two parameters $\beta_0$ and $\beta_1$. +Our result for $\beta_0$ simplifies then to +!bt +\[ +n\beta_0 = \sum_{i=0}^{n-1}y_i - \sum_{i=0}^{n-1} X_{i1} \beta_1. +\] +!et +Assuming that the matrix elements $X_{i1}$ are centered, what we have is +!bt +\[ +\beta_0 = \frac{1}{n}\sum_{i=0}^{n-1}y_i - \beta_1\frac{1}{n}\sum_{i=0}^{n-1} \left(X_{i1}-\mu_{1}\right), +\] +!et +where +!bt +\[ +\mu_1=\frac{1}{n}\sum_{i=0}^{n-1} (X_{i1}, +\] +!et +and if we define the mean value of the outputs as +!bt +\[ +\mu_y=\frac{1}{n}\sum_{i=0}^{n-1}y_i, +\] +!et +we have +!bt +\[ +\beta_0 = \mu_y - \beta_1\frac{1}{n}\sum_{i=0}^{n-1} (X_{i1}-\mu_{1}), +\] +!et +and it is easy to see that the last sum equals zero! This means that we have +!bt +\[ +\beta_0 = \mu_y, +\] +!et +if the columns of the design matrix are centered. It is straight forward to generalize this results to more values of $\beta$. +We have thus +!bt +\[ +\beta_0 = \frac{1}{n}\sum_{i=0}^{n-1} y_i = \overline{\bm{y}}, +\] +!et +the average value of $\bm{y}$. + +Replacing $y_i$ with $y_i - \beta_0 = y_i - \overline{\bm{y}}$ and centering also our design matrix results in a cost function (in vector-matrix disguise) +!bt +\[ +C(\boldsymbol{\beta}) = (\boldsymbol{\tilde{y}} - \tilde{X}\boldsymbol{\beta})^T(\boldsymbol{\tilde{y}} - \tilde{X}\boldsymbol{\beta}). +\] +!et + + +If we minimize with respect to $\bm{\beta}$ we have then + +!bt +\[ +\hat{\bm{\beta}} = (\tilde{X}^T\tilde{X})^{-1}\tilde{X}^T\boldsymbol{\tilde{y}}, +\] +!et + +where $\boldsymbol{\tilde{y}} = \boldsymbol{y} - \overline{\bm{y}}$ +and $\tilde{X}_{ij} = X_{ij} - \frac{1}{n}\sum_{k=0}^{n-1}X_{kj}$. + +For Ridge regression we need to add $\lambda \boldsymbol{\beta}^T\boldsymbol{\beta}$ to the cost function and get then +!bt +\[ +\hat{\bm{\beta}} = (\tilde{X}^T\tilde{X} + \lambda I)^{-1}\tilde{X}^T\boldsymbol{\tilde{y}}. +\] +!et + +What does this mean? And why do we insist on all this? Let us look at some examples. + + +This code shows a simple first-order fit to a data set using the above transformed data, where we consider the role of the intercept first, by either excluding it or including it (*code example thanks to Øyvind Sigmundson Schøyen*). Here our scaling of the data is done by subtracting the mean values only. +Note also that we do not split the data into training and test. + +!bc pycod +import numpy as np +import matplotlib.pyplot as plt + +from sklearn.linear_model import LinearRegression + + +np.random.seed(2021) + +def MSE(y_data,y_model): + n = np.size(y_model) + return np.sum((y_data-y_model)**2)/n + + +def fit_beta(X, y): + return np.linalg.pinv(X.T @ X) @ X.T @ y + + +true_beta = [2, 0.5, 3.7] + +x = np.linspace(0, 1, 11) +y = np.sum( + np.asarray([x ** p * b for p, b in enumerate(true_beta)]), axis=0 +) + 0.1 * np.random.normal(size=len(x)) + +degree = 3 +X = np.zeros((len(x), degree)) + +# Include the intercept in the design matrix +for p in range(degree): + X[:, p] = x ** p + +beta = fit_beta(X, y) + +# Intercept is included in the design matrix +skl = LinearRegression(fit_intercept=False).fit(X, y) + +print(f"True beta: {true_beta}") +print(f"Fitted beta: {beta}") +print(f"Sklearn fitted beta: {skl.coef_}") +ypredictOwn = X @ beta +ypredictSKL = skl.predict(X) +print(f"MSE with intercept column") +print(MSE(y,ypredictOwn)) +print(f"MSE with intercept column from SKL") +print(MSE(y,ypredictSKL)) + + +plt.figure() +plt.scatter(x, y, label="Data") +plt.plot(x, X @ beta, label="Fit") +plt.plot(x, skl.predict(X), label="Sklearn (fit_intercept=False)") + + +# Do not include the intercept in the design matrix +X = np.zeros((len(x), degree - 1)) + +for p in range(degree - 1): + X[:, p] = x ** (p + 1) + +# Intercept is not included in the design matrix +skl = LinearRegression(fit_intercept=True).fit(X, y) + +# Use centered values for X and y when computing coefficients +y_offset = np.average(y, axis=0) +X_offset = np.average(X, axis=0) + +beta = fit_beta(X - X_offset, y - y_offset) +intercept = np.mean(y_offset - X_offset @ beta) + +print(f"Manual intercept: {intercept}") +print(f"Fitted beta (wiothout intercept): {beta}") +print(f"Sklearn intercept: {skl.intercept_}") +print(f"Sklearn fitted beta (without intercept): {skl.coef_}") +ypredictOwn = X @ beta +ypredictSKL = skl.predict(X) +print(f"MSE with Manual intercept") +print(MSE(y,ypredictOwn+intercept)) +print(f"MSE with Sklearn intercept") +print(MSE(y,ypredictSKL)) + +plt.plot(x, X @ beta + intercept, "--", label="Fit (manual intercept)") +plt.plot(x, skl.predict(X), "--", label="Sklearn (fit_intercept=True)") +plt.grid() +plt.legend() + +plt.show() + +!ec + +The intercept is the value of our output/target variable +when all our features are zero and our function crosses the $y$-axis (for a one-dimensional case). + +Printing the MSE, we see first that both methods give the same MSE, as +they should. However, when we move to for example Ridge regression, +the way we treat the intercept may give a larger or smaller MSE, +meaning that the MSE can be penalized by the value of the +intercept. Not including the intercept in the fit, means that the +regularization term does not include $\beta_0$. For different values +of $\lambda$, this may lead to differeing MSE values. + +To remind the reader, the regularization term, with the intercept in Ridge regression, is given by +!bt +\[ +\lambda \vert\vert \bm{\beta} \vert\vert_2^2 = \lambda \sum_{j=0}^{p-1}\beta_j^2, +\] +!et +but when we take out the intercept, this equation becomes +!bt +\[ +\lambda \vert\vert \bm{\beta} \vert\vert_2^2 = \lambda \sum_{j=1}^{p-1}\beta_j^2. +\] +!et + +For Lasso regression we have +!bt +\[ +\lambda \vert\vert \bm{\beta} \vert\vert_1 = \lambda \sum_{j=1}^{p-1}\vert\beta_j\vert. +\] +!et + +It means that, when scaling the design matrix and the outputs/targets, +by subtracting the mean values, we have an optimization problem which +is not penalized by the intercept. The MSE value can then be smaller +since it focuses only on the remaining quantities. If we however bring +back the intercept, we will get a MSE which then contains the +intercept. + + +Armed with this wisdom, we attempt first to simply set the intercept equal to _False_ in our implementation of Ridge regression for our well-known vanilla data set. + +!bc pycod +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt +from sklearn.model_selection import train_test_split +from sklearn import linear_model + +def MSE(y_data,y_model): + n = np.size(y_model) + return np.sum((y_data-y_model)**2)/n + + +# A seed just to ensure that the random numbers are the same for every run. +# Useful for eventual debugging. +np.random.seed(3155) + +n = 100 +x = np.random.rand(n) +y = np.exp(-x**2) + 1.5 * np.exp(-(x-2)**2) + +Maxpolydegree = 20 +X = np.zeros((n,Maxpolydegree)) +#We include explicitely the intercept column +for degree in range(Maxpolydegree): + X[:,degree] = x**degree +# We split the data in test and training data +X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2) + +p = Maxpolydegree +I = np.eye(p,p) +# Decide which values of lambda to use +nlambdas = 6 +MSEOwnRidgePredict = np.zeros(nlambdas) +MSERidgePredict = np.zeros(nlambdas) +lambdas = np.logspace(-4, 2, nlambdas) +for i in range(nlambdas): + lmb = lambdas[i] + OwnRidgeBeta = np.linalg.pinv(X_train.T @ X_train+lmb*I) @ X_train.T @ y_train + # Note: we include the intercept column and no scaling + RegRidge = linear_model.Ridge(lmb,fit_intercept=False) + RegRidge.fit(X_train,y_train) + # and then make the prediction + ytildeOwnRidge = X_train @ OwnRidgeBeta + ypredictOwnRidge = X_test @ OwnRidgeBeta + ytildeRidge = RegRidge.predict(X_train) + ypredictRidge = RegRidge.predict(X_test) + MSEOwnRidgePredict[i] = MSE(y_test,ypredictOwnRidge) + MSERidgePredict[i] = MSE(y_test,ypredictRidge) + print("Beta values for own Ridge implementation") + print(OwnRidgeBeta) + print("Beta values for Scikit-Learn Ridge implementation") + print(RegRidge.coef_) + print("MSE values for own Ridge implementation") + print(MSEOwnRidgePredict[i]) + print("MSE values for Scikit-Learn Ridge implementation") + print(MSERidgePredict[i]) + +# Now plot the results +plt.figure() +plt.plot(np.log10(lambdas), MSEOwnRidgePredict, 'r', label = 'MSE own Ridge Test') +plt.plot(np.log10(lambdas), MSERidgePredict, 'g', label = 'MSE Ridge Test') + +plt.xlabel('log10(lambda)') +plt.ylabel('MSE') +plt.legend() +plt.show() + +!ec + +The results here agree when we force _Scikit-Learn_'s Ridge function to include the first column in our design matrix. +We see that the results agree very well. Here we have thus explicitely included the intercept column in the design matrix. +What happens if we do not include the intercept in our fit? +Let us see how we can change this code by zero centering. + +!bc pycod +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt +from sklearn.model_selection import train_test_split +from sklearn import linear_model +from sklearn.preprocessing import StandardScaler + +def MSE(y_data,y_model): + n = np.size(y_model) + return np.sum((y_data-y_model)**2)/n +# A seed just to ensure that the random numbers are the same for every run. +# Useful for eventual debugging. +np.random.seed(315) + +n = 100 +x = np.random.rand(n) +y = np.exp(-x**2) + 1.5 * np.exp(-(x-2)**2) + +Maxpolydegree = 20 +X = np.zeros((n,Maxpolydegree-1)) + +for degree in range(1,Maxpolydegree): #No intercept column + X[:,degree-1] = x**(degree) + +# We split the data in test and training data +X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2) + +#For our own implementation, we will need to deal with the intercept by centering the design matrix and the target variable +X_train_mean = np.mean(X_train,axis=0) +#Center by removing mean from each feature +X_train_scaled = X_train - X_train_mean +X_test_scaled = X_test - X_train_mean +#The model intercept (called y_scaler) is given by the mean of the target variable (IF X is centered) +#Remove the intercept from the training data. +y_scaler = np.mean(y_train) +y_train_scaled = y_train - y_scaler + +p = Maxpolydegree-1 +I = np.eye(p,p) +# Decide which values of lambda to use +nlambdas = 6 +MSEOwnRidgePredict = np.zeros(nlambdas) +MSERidgePredict = np.zeros(nlambdas) + +lambdas = np.logspace(-4, 2, nlambdas) +for i in range(nlambdas): + lmb = lambdas[i] + OwnRidgeBeta = np.linalg.pinv(X_train_scaled.T @ X_train_scaled+lmb*I) @ X_train_scaled.T @ (y_train_scaled) + intercept_ = y_scaler - X_train_mean@OwnRidgeBeta #The intercept can be shifted so the model can predict on uncentered data + #Add intercept to prediction + ypredictOwnRidge = X_test @ OwnRidgeBeta + intercept_ + #Add intercept to prediction + ypredictOwnRidge = X_test_scaled @ OwnRidgeBeta + y_scaler + RegRidge = linear_model.Ridge(lmb) + RegRidge.fit(X_train,y_train) + ypredictRidge = RegRidge.predict(X_test) + MSEOwnRidgePredict[i] = MSE(y_test,ypredictOwnRidge) + MSERidgePredict[i] = MSE(y_test,ypredictRidge) + print("Beta values for own Ridge implementation") + print(OwnRidgeBeta) #Intercept is given by mean of target variable + print("Beta values for Scikit-Learn Ridge implementation") + print(RegRidge.coef_) + print('Intercept from own implementation:') + print(intercept_) + print('Intercept from Scikit-Learn Ridge implementation') + print(RegRidge.intercept_) + print("MSE values for own Ridge implementation") + print(MSEOwnRidgePredict[i]) + print("MSE values for Scikit-Learn Ridge implementation") + print(MSERidgePredict[i]) + + +# Now plot the results +plt.figure() +plt.plot(np.log10(lambdas), MSEOwnRidgePredict, 'b--', label = 'MSE own Ridge Test') +plt.plot(np.log10(lambdas), MSERidgePredict, 'g--', label = 'MSE SL Ridge Test') +plt.xlabel('log10(lambda)') +plt.ylabel('MSE') +plt.legend() +plt.show() +!ec +We see here, when compared to the code which includes explicitely the +intercept column, that our MSE value is actually smaller. This is +because the regularization term does not include the intercept value +$\beta_0$ in the fitting. This applies to Lasso regularization as +well. It means that our optimization is now done only with the +centered matrix and/or vector that enter the fitting procedure. Note +also that the problem with the intercept occurs mainly in these type +of polynomial fitting problem. + +The next example is indeed an example where all these discussions about the role of intercept are not present. + +===== More complicated Example: The Ising model ===== + +The one-dimensional Ising model with nearest neighbor interaction, no +external field and a constant coupling constant $J$ is given by + +!bt +\begin{align} + H = -J \sum_{k}^L s_k s_{k + 1}, +\end{align} +!et + +where $s_i \in \{-1, 1\}$ and $s_{N + 1} = s_1$. The number of spins +in the system is determined by $L$. For the one-dimensional system +there is no phase transition. + +We will look at a system of $L = 40$ spins with a coupling constant of +$J = 1$. To get enough training data we will generate 10000 states +with their respective energies. + + +!bc pycod +import numpy as np +import matplotlib.pyplot as plt +from mpl_toolkits.axes_grid1 import make_axes_locatable +import seaborn as sns +import scipy.linalg as scl +from sklearn.model_selection import train_test_split +import tqdm +sns.set(color_codes=True) +cmap_args=dict(vmin=-1., vmax=1., cmap='seismic') + +L = 40 +n = int(1e4) + +spins = np.random.choice([-1, 1], size=(n, L)) +J = 1.0 + +energies = np.zeros(n) + +for i in range(n): + energies[i] = - J * np.dot(spins[i], np.roll(spins[i], 1)) +!ec + +Here we use ordinary least squares +regression to predict the energy for the nearest neighbor +one-dimensional Ising model on a ring, i.e., the endpoints wrap +around. We will use linear regression to fit a value for +the coupling constant to achieve this. + +A more general form for the one-dimensional Ising model is + +!bt +\begin{align} + H = - \sum_j^L \sum_k^L s_j s_k J_{jk}. +\end{align} +!et + +Here we allow for interactions beyond the nearest neighbors and a state dependent +coupling constant. This latter expression can be formulated as +a matrix-product +!bt +\begin{align} + \bm{H} = \bm{X} J, +\end{align} +!et + +where $X_{jk} = s_j s_k$ and $J$ is a matrix which consists of the +elements $-J_{jk}$. This form of writing the energy fits perfectly +with the form utilized in linear regression, that is + +!bt +\begin{align} + \bm{y} = \bm{X}\bm{\beta} + \bm{\epsilon}, +\end{align} +!et + +We split the data in training and test data as discussed in the previous example + +!bc pycod +X = np.zeros((n, L ** 2)) +for i in range(n): + X[i] = np.outer(spins[i], spins[i]).ravel() +y = energies +X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2) +!ec + + +In the ordinary least squares method we choose the cost function + +!bt +\begin{align} + C(\bm{X}, \bm{\beta})= \frac{1}{n}\left\{(\bm{X}\bm{\beta} - \bm{y})^T(\bm{X}\bm{\beta} - \bm{y})\right\}. +\end{align} +!et + +We then find the extremal point of $C$ by taking the derivative with respect to $\bm{\beta}$ as discussed above. +This yields the expression for $\bm{\beta}$ to be + +!bt +\[ + \bm{\beta} = \frac{\bm{X}^T \bm{y}}{\bm{X}^T \bm{X}}, +\] +!et + +which immediately imposes some requirements on $\bm{X}$ as there must exist +an inverse of $\bm{X}^T \bm{X}$. If the expression we are modeling contains an +intercept, i.e., a constant term, we must make sure that the +first column of $\bm{X}$ consists of $1$. We do this here + +!bc pycod +X_train_own = np.concatenate( + (np.ones(len(X_train))[:, np.newaxis], X_train), + axis=1 +) +X_test_own = np.concatenate( + (np.ones(len(X_test))[:, np.newaxis], X_test), + axis=1 +) +!ec + + + +Doing the inversion directly turns out to be a bad idea since the matrix +$\bm{X}^T\bm{X}$ is singular. An alternative approach is to use the _singular +value decomposition_. Using the definition of the Moore-Penrose +pseudoinverse we can write the equation for $\bm{\beta}$ as + +!bt +\[ + \bm{\beta} = \bm{X}^{+}\bm{y}, +\] +!et + +where the pseudoinverse of $\bm{X}$ is given by + +!bt +\[ + \bm{X}^{+} = \frac{\bm{X}^T}{\bm{X}^T\bm{X}}. +\] +!et + +Using singular value decomposition we can decompose the matrix $\bm{X} = \bm{U}\bm{\Sigma} \bm{V}^T$, +where $\bm{U}$ and $\bm{V}$ are orthogonal(unitary) matrices and $\bm{\Sigma}$ contains the singular values (more details below). +where $X^{+} = V\Sigma^{+} U^T$. This reduces the equation for +$\omega$ to +!bt +\begin{align} + \bm{\beta} = \bm{V}\bm{\Sigma}^{+} \bm{U}^T \bm{y}. +\end{align} +!et + +Note that solving this equation by actually doing the pseudoinverse +(which is what we will do) is not a good idea as this operation scales +as $\mathcal{O}(n^3)$, where $n$ is the number of elements in a +general matrix. Instead, doing $QR$-factorization and solving the +linear system as an equation would reduce this down to +$\mathcal{O}(n^2)$ operations. + + +!bc pycod +def ols_svd(x: np.ndarray, y: np.ndarray) -> np.ndarray: + u, s, v = scl.svd(x) + return v.T @ scl.pinv(scl.diagsvd(s, u.shape[0], v.shape[0])) @ u.T @ y +!ec + +!bc pycod +beta = ols_svd(X_train_own,y_train) +!ec + +When extracting the $J$-matrix we need to make sure that we remove the intercept, as is done here + +!bc pycod +J = beta[1:].reshape(L, L) +!ec + +A way of looking at the coefficients in $J$ is to plot the matrices as images. + + +!bc pycod +fig = plt.figure(figsize=(20, 14)) +im = plt.imshow(J, **cmap_args) +plt.title("OLS", fontsize=18) +plt.xticks(fontsize=18) +plt.yticks(fontsize=18) +cb = fig.colorbar(im) +cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18) +plt.show() +!ec +It is interesting to note that OLS +considers both $J_{j, j + 1} = -0.5$ and $J_{j, j - 1} = -0.5$ as +valid matrix elements for $J$. +In our discussion below on hyperparameters and Ridge and Lasso regression we will see that +this problem can be removed, partly and only with Lasso regression. + +In this case our matrix inversion was actually possible. The obvious question now is what is the mathematics behind the SVD? + + + + + +Let us now +focus on Ridge and Lasso regression as well. We repeat some of the +basic parts of the Ising model and the setup of the training and test +data. The one-dimensional Ising model with nearest neighbor +interaction, no external field and a constant coupling constant $J$ is +given by + +!bt +\begin{align} + H = -J \sum_{k}^L s_k s_{k + 1}, +\end{align} +!et +where $s_i \in \{-1, 1\}$ and $s_{N + 1} = s_1$. The number of spins in the system is determined by $L$. For the one-dimensional system there is no phase transition. + +We will look at a system of $L = 40$ spins with a coupling constant of $J = 1$. To get enough training data we will generate 10000 states with their respective energies. + + +!bc pycod +import numpy as np +import matplotlib.pyplot as plt +from mpl_toolkits.axes_grid1 import make_axes_locatable +import seaborn as sns +import scipy.linalg as scl +from sklearn.model_selection import train_test_split +import sklearn.linear_model as skl +import tqdm +sns.set(color_codes=True) +cmap_args=dict(vmin=-1., vmax=1., cmap='seismic') + +L = 40 +n = int(1e4) + +spins = np.random.choice([-1, 1], size=(n, L)) +J = 1.0 + +energies = np.zeros(n) + +for i in range(n): + energies[i] = - J * np.dot(spins[i], np.roll(spins[i], 1)) +!ec + +A more general form for the one-dimensional Ising model is + +!bt +\begin{align} + H = - \sum_j^L \sum_k^L s_j s_k J_{jk}. +\end{align} +!et + +Here we allow for interactions beyond the nearest neighbors and a more +adaptive coupling matrix. This latter expression can be formulated as +a matrix-product on the form +!bt +\begin{align} + H = X J, +\end{align} +!et + +where $X_{jk} = s_j s_k$ and $J$ is the matrix consisting of the +elements $-J_{jk}$. This form of writing the energy fits perfectly +with the form utilized in linear regression, viz. +!bt +\begin{align} + \bm{y} = \bm{X}\bm{\beta} + \bm{\epsilon}. +\end{align} +!et +We organize the data as we did above +!bc pycod +X = np.zeros((n, L ** 2)) +for i in range(n): + X[i] = np.outer(spins[i], spins[i]).ravel() +y = energies +X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.96) + +X_train_own = np.concatenate( + (np.ones(len(X_train))[:, np.newaxis], X_train), + axis=1 +) + +X_test_own = np.concatenate( + (np.ones(len(X_test))[:, np.newaxis], X_test), + axis=1 +) +!ec + +We will do all fitting with _Scikit-Learn_, + +!bc pycod +clf = skl.LinearRegression().fit(X_train, y_train) +!ec +When extracting the $J$-matrix we make sure to remove the intercept +!bc pycod +J_sk = clf.coef_.reshape(L, L) +!ec +And then we plot the results +!bc pycod +fig = plt.figure(figsize=(20, 14)) +im = plt.imshow(J_sk, **cmap_args) +plt.title("LinearRegression from Scikit-learn", fontsize=18) +plt.xticks(fontsize=18) +plt.yticks(fontsize=18) +cb = fig.colorbar(im) +cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18) +plt.show() +!ec +The results agree perfectly with our previous discussion where we used our own code. + + +Having explored the ordinary least squares we move on to ridge +regression. In ridge regression we include a _regularizer_. This +involves a new cost function which leads to a new estimate for the +weights $\bm{\beta}$. This results in a penalized regression problem. The +cost function is given by + +!bt +\begin{align} + C(\bm{X}, \bm{\beta}; \lambda) = (\bm{X}\bm{\beta} - \bm{y})^T(\bm{X}\bm{\beta} - \bm{y}) + \lambda \bm{\beta}^T\bm{\beta}. +\end{align} +!et +!bc pycod +_lambda = 0.1 +clf_ridge = skl.Ridge(alpha=_lambda).fit(X_train, y_train) +J_ridge_sk = clf_ridge.coef_.reshape(L, L) +fig = plt.figure(figsize=(20, 14)) +im = plt.imshow(J_ridge_sk, **cmap_args) +plt.title("Ridge from Scikit-learn", fontsize=18) +plt.xticks(fontsize=18) +plt.yticks(fontsize=18) +cb = fig.colorbar(im) +cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18) + +plt.show() +!ec + +In the _Least Absolute Shrinkage and Selection Operator_ (LASSO)-method we get a third cost function. + +!bt +\begin{align} + C(\bm{X}, \bm{\beta}; \lambda) = (\bm{X}\bm{\beta} - \bm{y})^T(\bm{X}\bm{\beta} - \bm{y}) + \lambda \sqrt{\bm{\beta}^T\bm{\beta}}. +\end{align} +!et + +Finding the extremal point of this cost function is not so straight-forward as in least squares and ridge. We will therefore rely solely on the function ``Lasso`` from _Scikit-Learn_. + +!bc pycod +clf_lasso = skl.Lasso(alpha=_lambda).fit(X_train, y_train) +J_lasso_sk = clf_lasso.coef_.reshape(L, L) +fig = plt.figure(figsize=(20, 14)) +im = plt.imshow(J_lasso_sk, **cmap_args) +plt.title("Lasso from Scikit-learn", fontsize=18) +plt.xticks(fontsize=18) +plt.yticks(fontsize=18) +cb = fig.colorbar(im) +cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18) + +plt.show() +!ec + +It is quite striking how LASSO breaks the symmetry of the coupling +constant as opposed to ridge and OLS. We get a sparse solution with +$J_{j, j + 1} = -1$. + + + + +We see how the different models perform for a different set of values for $\lambda$. + + +!bc pycod +lambdas = np.logspace(-4, 5, 10) + +train_errors = { + "ols_sk": np.zeros(lambdas.size), + "ridge_sk": np.zeros(lambdas.size), + "lasso_sk": np.zeros(lambdas.size) +} + +test_errors = { + "ols_sk": np.zeros(lambdas.size), + "ridge_sk": np.zeros(lambdas.size), + "lasso_sk": np.zeros(lambdas.size) +} + +plot_counter = 1 + +fig = plt.figure(figsize=(32, 54)) + +for i, _lambda in enumerate(tqdm.tqdm(lambdas)): + for key, method in zip( + ["ols_sk", "ridge_sk", "lasso_sk"], + [skl.LinearRegression(), skl.Ridge(alpha=_lambda), skl.Lasso(alpha=_lambda)] + ): + method = method.fit(X_train, y_train) + + train_errors[key][i] = method.score(X_train, y_train) + test_errors[key][i] = method.score(X_test, y_test) + + omega = method.coef_.reshape(L, L) + + plt.subplot(10, 5, plot_counter) + plt.imshow(omega, **cmap_args) + plt.title(r"%s, $\lambda = %.4f$" % (key, _lambda)) + plot_counter += 1 + +plt.show() +!ec + +We see that LASSO reaches a good solution for low +values of $\lambda$, but will "wither" when we increase $\lambda$ too +much. Ridge is more stable over a larger range of values for +$\lambda$, but eventually also fades away. + + +To determine which value of $\lambda$ is best we plot the accuracy of +the models when predicting the training and the testing set. We expect +the accuracy of the training set to be quite good, but if the accuracy +of the testing set is much lower this tells us that we might be +subject to an overfit model. The ideal scenario is an accuracy on the +testing set that is close to the accuracy of the training set. + + +!bc pycod +fig = plt.figure(figsize=(20, 14)) + +colors = { + "ols_sk": "r", + "ridge_sk": "y", + "lasso_sk": "c" +} + +for key in train_errors: + plt.semilogx( + lambdas, + train_errors[key], + colors[key], + label="Train {0}".format(key), + linewidth=4.0 + ) + +for key in test_errors: + plt.semilogx( + lambdas, + test_errors[key], + colors[key] + "--", + label="Test {0}".format(key), + linewidth=4.0 + ) +plt.legend(loc="best", fontsize=18) +plt.xlabel(r"$\lambda$", fontsize=18) +plt.ylabel(r"$R^2$", fontsize=18) +plt.tick_params(labelsize=18) +plt.show() +!ec + +From the above figure we can see that LASSO with $\lambda = 10^{-2}$ +achieves a very good accuracy on the test set. This by far surpasses the +other models for all values of $\lambda$. + + + + + ===== Exercises and Projects ===== @@ -1499,6 +2460,7 @@ Here is a simple part of a Python code which reads and plots the data from such files !bc pycod +""" import numpy as np from imageio import imread import matplotlib.pyplot as plt @@ -1514,6 +2476,7 @@ plt.imshow(terrain1, cmap='gray') plt.xlabel('X') plt.ylabel('Y') plt.show() +""" !ec If you should have problems in downloading the digital terrain data, @@ -1537,3 +2500,5 @@ of data presented here (either the terrain data we propose or other data sets). + + diff --git a/doc/LectureNotes/_build/.doctrees/chapter3.doctree b/doc/LectureNotes/_build/.doctrees/chapter3.doctree index b39c4cbe3..5bead3ef4 100644 Binary files a/doc/LectureNotes/_build/.doctrees/chapter3.doctree and b/doc/LectureNotes/_build/.doctrees/chapter3.doctree differ diff --git a/doc/LectureNotes/_build/.doctrees/environment.pickle b/doc/LectureNotes/_build/.doctrees/environment.pickle index a077be970..ca2dc039c 100644 Binary files a/doc/LectureNotes/_build/.doctrees/environment.pickle and b/doc/LectureNotes/_build/.doctrees/environment.pickle differ diff --git a/doc/LectureNotes/_build/.doctrees/schedule.doctree b/doc/LectureNotes/_build/.doctrees/schedule.doctree index 1dd90ad5b..0d58348e4 100644 Binary files a/doc/LectureNotes/_build/.doctrees/schedule.doctree and b/doc/LectureNotes/_build/.doctrees/schedule.doctree differ diff --git a/doc/LectureNotes/_build/html/_images/chapter3_110_1.png b/doc/LectureNotes/_build/html/_images/chapter3_110_1.png new file mode 100644 index 000000000..0d08a7f4f Binary files /dev/null and b/doc/LectureNotes/_build/html/_images/chapter3_110_1.png differ diff --git a/doc/LectureNotes/_build/html/_images/chapter3_118_1.png b/doc/LectureNotes/_build/html/_images/chapter3_118_1.png new file mode 100644 index 000000000..78fb94a30 Binary files /dev/null and b/doc/LectureNotes/_build/html/_images/chapter3_118_1.png differ diff --git a/doc/LectureNotes/_build/html/_images/chapter3_120_1.png b/doc/LectureNotes/_build/html/_images/chapter3_120_1.png new file mode 100644 index 000000000..92f4ae772 Binary files /dev/null and b/doc/LectureNotes/_build/html/_images/chapter3_120_1.png differ diff --git a/doc/LectureNotes/_build/html/_images/chapter3_151_1.png b/doc/LectureNotes/_build/html/_images/chapter3_151_1.png new file mode 100644 index 000000000..a518cb04b Binary files /dev/null and b/doc/LectureNotes/_build/html/_images/chapter3_151_1.png differ diff --git a/doc/LectureNotes/_build/html/_images/chapter3_169_1.png b/doc/LectureNotes/_build/html/_images/chapter3_169_1.png new file mode 100644 index 000000000..8098b2e40 Binary files /dev/null and b/doc/LectureNotes/_build/html/_images/chapter3_169_1.png differ diff --git a/doc/LectureNotes/_build/html/_images/chapter3_172_1.png b/doc/LectureNotes/_build/html/_images/chapter3_172_1.png new file mode 100644 index 000000000..32745c831 Binary files /dev/null and b/doc/LectureNotes/_build/html/_images/chapter3_172_1.png differ diff --git a/doc/LectureNotes/_build/html/_images/chapter3_176_1.png b/doc/LectureNotes/_build/html/_images/chapter3_176_1.png new file mode 100644 index 000000000..f629a218c Binary files /dev/null and b/doc/LectureNotes/_build/html/_images/chapter3_176_1.png differ diff --git a/doc/LectureNotes/_build/html/_images/chapter3_178_13.png b/doc/LectureNotes/_build/html/_images/chapter3_178_13.png new file mode 100644 index 000000000..118120ef6 Binary files /dev/null and b/doc/LectureNotes/_build/html/_images/chapter3_178_13.png differ diff --git a/doc/LectureNotes/_build/html/_images/chapter3_180_0.png b/doc/LectureNotes/_build/html/_images/chapter3_180_0.png new file mode 100644 index 000000000..e6bb9a232 Binary files /dev/null and b/doc/LectureNotes/_build/html/_images/chapter3_180_0.png differ diff --git a/doc/LectureNotes/_build/html/_images/chapter3_184_0.png b/doc/LectureNotes/_build/html/_images/chapter3_184_0.png new file mode 100644 index 000000000..ef5da849b Binary files /dev/null and b/doc/LectureNotes/_build/html/_images/chapter3_184_0.png differ diff --git a/doc/LectureNotes/_build/html/_images/chapter3_47_0.png b/doc/LectureNotes/_build/html/_images/chapter3_47_0.png index 34a363f1c..74f910023 100644 Binary files a/doc/LectureNotes/_build/html/_images/chapter3_47_0.png and b/doc/LectureNotes/_build/html/_images/chapter3_47_0.png differ diff --git a/doc/LectureNotes/_build/html/_images/chapter3_62_5.png b/doc/LectureNotes/_build/html/_images/chapter3_62_5.png new file mode 100644 index 000000000..2116c169f Binary files /dev/null and b/doc/LectureNotes/_build/html/_images/chapter3_62_5.png differ diff --git a/doc/LectureNotes/_build/html/_images/chapter3_65_10.png b/doc/LectureNotes/_build/html/_images/chapter3_65_10.png new file mode 100644 index 000000000..df911b5f7 Binary files /dev/null and b/doc/LectureNotes/_build/html/_images/chapter3_65_10.png differ diff --git a/doc/LectureNotes/_build/html/_sources/chapter3.ipynb b/doc/LectureNotes/_build/html/_sources/chapter3.ipynb index 413c54051..18cd038f8 100644 --- a/doc/LectureNotes/_build/html/_sources/chapter3.ipynb +++ b/doc/LectureNotes/_build/html/_sources/chapter3.ipynb @@ -1598,6 +1598,1604 @@ "cell_type": "markdown", "metadata": {}, "source": [ + "## More on Rescaling data\n", + "\n", + "We end this chapter by adding some words on scaling and how to deal with the intercept for regression cases.\n", + "\n", + "When you are comparing your own code with for example **Scikit-Learn**'s\n", + "library, there are some technicalities to keep in mind. The examples\n", + "here demonstrate some of these aspects with potential pitfalls.\n", + "\n", + "The discussion here focuses on the role of the intercept, how we can\n", + "set up the design matrix, what scaling we should use and other topics\n", + "which tend confuse us.\n", + "\n", + "The intercept can be interpreted as the expected value of our\n", + "target/output variables when all other predictors are set to zero.\n", + "Thus, if we cannot assume that the expected outputs/targets are zero\n", + "when all predictors are zero (the columns in the design matrix), it\n", + "may be a bad idea to implement a model which penalizes the intercept.\n", + "Furthermore, in for example Ridge and Lasso regression, the default solutions\n", + "from the library **Scikit-Learn** (when not shrinking $\\beta_0$) for the unknown parameters\n", + "$\\boldsymbol{\\beta}$, are derived under the assumption that both $\\boldsymbol{y}$ and\n", + "$\\boldsymbol{X}$ are zero centered, that is we subtract the mean values.\n", + "\n", + "\n", + "If our predictors represent different scales, then it is important to\n", + "standardize the design matrix $\\boldsymbol{X}$ by subtracting the mean of each\n", + "column from the corresponding column and dividing the column with its\n", + "standard deviation. Most machine learning libraries do this as a default. This means that if you compare your code with the results from a given library,\n", + "the results may differ. \n", + "\n", + "The\n", + "[Standadscaler](https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.StandardScaler.html)\n", + "function in **Scikit-Learn** does this for us. For the data sets we\n", + "have been studying in our various examples, the data are in many cases\n", + "already scaled and there is no need to scale them. You as a user of different machine learning algorithms, should always perform a\n", + "survey of your data, with a critical assessment of them in case you need to scale the data.\n", + "\n", + "If you need to scale the data, not doing so will give an *unfair*\n", + "penalization of the parameters since their magnitude depends on the\n", + "scale of their corresponding predictor.\n", + "\n", + "Suppose as an example that you \n", + "you have an input variable given by the heights of different persons.\n", + "Human height might be measured in inches or meters or\n", + "kilometers. If measured in kilometers, a standard linear regression\n", + "model with this predictor would probably give a much bigger\n", + "coefficient term, than if measured in millimeters.\n", + "This can clearly lead to problems in evaluating the cost/loss functions.\n", + "\n", + "\n", + "\n", + "Keep in mind that when you transform your data set before training a model, the same transformation needs to be done\n", + "on your eventual new data set before making a prediction. If we translate this into a Python code, it would could be implemented as follows" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "\"\"\"\n", + "#Model training, we compute the mean value of y and X\n", + "y_train_mean = np.mean(y_train)\n", + "X_train_mean = np.mean(X_train,axis=0)\n", + "X_train = X_train - X_train_mean\n", + "y_train = y_train - y_train_mean\n", + "\n", + "# The we fit our model with the training data\n", + "trained_model = some_model.fit(X_train,y_train)\n", + "\n", + "\n", + "#Model prediction, we need also to transform our data set used for the prediction.\n", + "X_test = X_test - X_train_mean #Use mean from training data\n", + "y_pred = trained_model(X_test)\n", + "y_pred = y_pred + y_train_mean\n", + "\"\"\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Let us try to understand what this may imply mathematically when we\n", + "subtract the mean values, also known as *zero centering*. For\n", + "simplicity, we will focus on ordinary regression, as done in the above example.\n", + "\n", + "The cost/loss function for regression is" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "C(\\beta_0, \\beta_1, ... , \\beta_{p-1}) = \\frac{1}{n}\\sum_{i=0}^{n} \\left(y_i - \\beta_0 - \\sum_{j=1}^{p-1} X_{ij}\\beta_j\\right)^2,.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Recall also that we use the squared value since this leads to an increase of the penalty for higher differences between predicted and output/target values.\n", + "\n", + "What we have done is to single out the $\\beta_0$ term in the definition of the mean squared error (MSE).\n", + "The design matrix\n", + "$X$ does in this case not contain any intercept column.\n", + "When we take the derivative with respect to $\\beta_0$, we want the derivative to obey" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\frac{\\partial C}{\\partial \\beta_j} = 0,\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "for all $j$. For $\\beta_0$ we have" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\frac{\\partial C}{\\partial \\beta_0} = -\\frac{2}{n}\\sum_{i=0}^{n-1} \\left(y_i - \\beta_0 - \\sum_{j=1}^{p-1} X_{ij} \\beta_j\\right).\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Multiplying away the constant $2/n$, we obtain" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\sum_{i=0}^{n-1} \\beta_0 = \\sum_{i=0}^{n-1}y_i - \\sum_{i=0}^{n-1} \\sum_{j=1}^{p-1} X_{ij} \\beta_j.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We assume \n", + "that every column of $\\boldsymbol{X}$ is centered, which we can do by subtracting the mean," + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "X = X - np.mean(X,axis=0)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This means that we need to rewrite $X_{ij}$ as $\\tilde{X}_{ij}=X_{ij}-\\mu_j$, where" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\mu_j = \\frac{1}{n}\\sum_{i=0}^{n-1}X_{ij}.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Let us special first to the case where we have only two parameters $\\beta_0$ and $\\beta_1$.\n", + "Our result for $\\beta_0$ simplifies then to" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "n\\beta_0 = \\sum_{i=0}^{n-1}y_i - \\sum_{i=0}^{n-1} X_{i1} \\beta_1.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Assuming that the matrix elements $X_{i1}$ are centered, what we have is" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\beta_0 = \\frac{1}{n}\\sum_{i=0}^{n-1}y_i - \\beta_1\\frac{1}{n}\\sum_{i=0}^{n-1} \\left(X_{i1}-\\mu_{1}\\right),\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "where" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\mu_1=\\frac{1}{n}\\sum_{i=0}^{n-1} (X_{i1},\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "and if we define the mean value of the outputs as" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\mu_y=\\frac{1}{n}\\sum_{i=0}^{n-1}y_i,\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "we have" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\beta_0 = \\mu_y - \\beta_1\\frac{1}{n}\\sum_{i=0}^{n-1} (X_{i1}-\\mu_{1}),\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "and it is easy to see that the last sum equals zero! This means that we have" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\beta_0 = \\mu_y,\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "if the columns of the design matrix are centered. It is straight forward to generalize this results to more values of $\\beta$.\n", + "We have thus" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\beta_0 = \\frac{1}{n}\\sum_{i=0}^{n-1} y_i = \\overline{\\boldsymbol{y}},\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "the average value of $\\boldsymbol{y}$.\n", + "\n", + "Replacing $y_i$ with $y_i - \\beta_0 = y_i - \\overline{\\boldsymbol{y}}$ and centering also our design matrix results in a cost function (in vector-matrix disguise)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "C(\\boldsymbol{\\beta}) = (\\boldsymbol{\\tilde{y}} - \\tilde{X}\\boldsymbol{\\beta})^T(\\boldsymbol{\\tilde{y}} - \\tilde{X}\\boldsymbol{\\beta}).\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "If we minimize with respect to $\\boldsymbol{\\beta}$ we have then" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\hat{\\boldsymbol{\\beta}} = (\\tilde{X}^T\\tilde{X})^{-1}\\tilde{X}^T\\boldsymbol{\\tilde{y}},\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "where $\\boldsymbol{\\tilde{y}} = \\boldsymbol{y} - \\overline{\\boldsymbol{y}}$\n", + "and $\\tilde{X}_{ij} = X_{ij} - \\frac{1}{n}\\sum_{k=0}^{n-1}X_{kj}$.\n", + "\n", + "For Ridge regression we need to add $\\lambda \\boldsymbol{\\beta}^T\\boldsymbol{\\beta}$ to the cost function and get then" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\hat{\\boldsymbol{\\beta}} = (\\tilde{X}^T\\tilde{X} + \\lambda I)^{-1}\\tilde{X}^T\\boldsymbol{\\tilde{y}}.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "What does this mean? And why do we insist on all this? Let us look at some examples.\n", + "\n", + "\n", + "This code shows a simple first-order fit to a data set using the above transformed data, where we consider the role of the intercept first, by either excluding it or including it (*code example thanks to Øyvind Sigmundson Schøyen*). Here our scaling of the data is done by subtracting the mean values only.\n", + "Note also that we do not split the data into training and test." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "\n", + "from sklearn.linear_model import LinearRegression\n", + "\n", + "\n", + "np.random.seed(2021)\n", + "\n", + "def MSE(y_data,y_model):\n", + " n = np.size(y_model)\n", + " return np.sum((y_data-y_model)**2)/n\n", + "\n", + "\n", + "def fit_beta(X, y):\n", + " return np.linalg.pinv(X.T @ X) @ X.T @ y\n", + "\n", + "\n", + "true_beta = [2, 0.5, 3.7]\n", + "\n", + "x = np.linspace(0, 1, 11)\n", + "y = np.sum(\n", + " np.asarray([x ** p * b for p, b in enumerate(true_beta)]), axis=0\n", + ") + 0.1 * np.random.normal(size=len(x))\n", + "\n", + "degree = 3\n", + "X = np.zeros((len(x), degree))\n", + "\n", + "# Include the intercept in the design matrix\n", + "for p in range(degree):\n", + " X[:, p] = x ** p\n", + "\n", + "beta = fit_beta(X, y)\n", + "\n", + "# Intercept is included in the design matrix\n", + "skl = LinearRegression(fit_intercept=False).fit(X, y)\n", + "\n", + "print(f\"True beta: {true_beta}\")\n", + "print(f\"Fitted beta: {beta}\")\n", + "print(f\"Sklearn fitted beta: {skl.coef_}\")\n", + "ypredictOwn = X @ beta\n", + "ypredictSKL = skl.predict(X)\n", + "print(f\"MSE with intercept column\")\n", + "print(MSE(y,ypredictOwn))\n", + "print(f\"MSE with intercept column from SKL\")\n", + "print(MSE(y,ypredictSKL))\n", + "\n", + "\n", + "plt.figure()\n", + "plt.scatter(x, y, label=\"Data\")\n", + "plt.plot(x, X @ beta, label=\"Fit\")\n", + "plt.plot(x, skl.predict(X), label=\"Sklearn (fit_intercept=False)\")\n", + "\n", + "\n", + "# Do not include the intercept in the design matrix\n", + "X = np.zeros((len(x), degree - 1))\n", + "\n", + "for p in range(degree - 1):\n", + " X[:, p] = x ** (p + 1)\n", + "\n", + "# Intercept is not included in the design matrix\n", + "skl = LinearRegression(fit_intercept=True).fit(X, y)\n", + "\n", + "# Use centered values for X and y when computing coefficients\n", + "y_offset = np.average(y, axis=0)\n", + "X_offset = np.average(X, axis=0)\n", + "\n", + "beta = fit_beta(X - X_offset, y - y_offset)\n", + "intercept = np.mean(y_offset - X_offset @ beta)\n", + "\n", + "print(f\"Manual intercept: {intercept}\")\n", + "print(f\"Fitted beta (wiothout intercept): {beta}\")\n", + "print(f\"Sklearn intercept: {skl.intercept_}\")\n", + "print(f\"Sklearn fitted beta (without intercept): {skl.coef_}\")\n", + "ypredictOwn = X @ beta\n", + "ypredictSKL = skl.predict(X)\n", + "print(f\"MSE with Manual intercept\")\n", + "print(MSE(y,ypredictOwn+intercept))\n", + "print(f\"MSE with Sklearn intercept\")\n", + "print(MSE(y,ypredictSKL))\n", + "\n", + "plt.plot(x, X @ beta + intercept, \"--\", label=\"Fit (manual intercept)\")\n", + "plt.plot(x, skl.predict(X), \"--\", label=\"Sklearn (fit_intercept=True)\")\n", + "plt.grid()\n", + "plt.legend()\n", + "\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The intercept is the value of our output/target variable\n", + "when all our features are zero and our function crosses the $y$-axis (for a one-dimensional case). \n", + "\n", + "Printing the MSE, we see first that both methods give the same MSE, as\n", + "they should. However, when we move to for example Ridge regression,\n", + "the way we treat the intercept may give a larger or smaller MSE,\n", + "meaning that the MSE can be penalized by the value of the\n", + "intercept. Not including the intercept in the fit, means that the\n", + "regularization term does not include $\\beta_0$. For different values\n", + "of $\\lambda$, this may lead to differeing MSE values. \n", + "\n", + "To remind the reader, the regularization term, with the intercept in Ridge regression, is given by" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\lambda \\vert\\vert \\boldsymbol{\\beta} \\vert\\vert_2^2 = \\lambda \\sum_{j=0}^{p-1}\\beta_j^2,\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "but when we take out the intercept, this equation becomes" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\lambda \\vert\\vert \\boldsymbol{\\beta} \\vert\\vert_2^2 = \\lambda \\sum_{j=1}^{p-1}\\beta_j^2.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "For Lasso regression we have" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\lambda \\vert\\vert \\boldsymbol{\\beta} \\vert\\vert_1 = \\lambda \\sum_{j=1}^{p-1}\\vert\\beta_j\\vert.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "It means that, when scaling the design matrix and the outputs/targets,\n", + "by subtracting the mean values, we have an optimization problem which\n", + "is not penalized by the intercept. The MSE value can then be smaller\n", + "since it focuses only on the remaining quantities. If we however bring\n", + "back the intercept, we will get a MSE which then contains the\n", + "intercept.\n", + "\n", + "\n", + "Armed with this wisdom, we attempt first to simply set the intercept equal to **False** in our implementation of Ridge regression for our well-known vanilla data set." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "import numpy as np\n", + "import pandas as pd\n", + "import matplotlib.pyplot as plt\n", + "from sklearn.model_selection import train_test_split\n", + "from sklearn import linear_model\n", + "\n", + "def MSE(y_data,y_model):\n", + " n = np.size(y_model)\n", + " return np.sum((y_data-y_model)**2)/n\n", + "\n", + "\n", + "# A seed just to ensure that the random numbers are the same for every run.\n", + "# Useful for eventual debugging.\n", + "np.random.seed(3155)\n", + "\n", + "n = 100\n", + "x = np.random.rand(n)\n", + "y = np.exp(-x**2) + 1.5 * np.exp(-(x-2)**2)\n", + "\n", + "Maxpolydegree = 20\n", + "X = np.zeros((n,Maxpolydegree))\n", + "#We include explicitely the intercept column\n", + "for degree in range(Maxpolydegree):\n", + " X[:,degree] = x**degree\n", + "# We split the data in test and training data\n", + "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)\n", + "\n", + "p = Maxpolydegree\n", + "I = np.eye(p,p)\n", + "# Decide which values of lambda to use\n", + "nlambdas = 6\n", + "MSEOwnRidgePredict = np.zeros(nlambdas)\n", + "MSERidgePredict = np.zeros(nlambdas)\n", + "lambdas = np.logspace(-4, 2, nlambdas)\n", + "for i in range(nlambdas):\n", + " lmb = lambdas[i]\n", + " OwnRidgeBeta = np.linalg.pinv(X_train.T @ X_train+lmb*I) @ X_train.T @ y_train\n", + " # Note: we include the intercept column and no scaling\n", + " RegRidge = linear_model.Ridge(lmb,fit_intercept=False)\n", + " RegRidge.fit(X_train,y_train)\n", + " # and then make the prediction\n", + " ytildeOwnRidge = X_train @ OwnRidgeBeta\n", + " ypredictOwnRidge = X_test @ OwnRidgeBeta\n", + " ytildeRidge = RegRidge.predict(X_train)\n", + " ypredictRidge = RegRidge.predict(X_test)\n", + " MSEOwnRidgePredict[i] = MSE(y_test,ypredictOwnRidge)\n", + " MSERidgePredict[i] = MSE(y_test,ypredictRidge)\n", + " print(\"Beta values for own Ridge implementation\")\n", + " print(OwnRidgeBeta)\n", + " print(\"Beta values for Scikit-Learn Ridge implementation\")\n", + " print(RegRidge.coef_)\n", + " print(\"MSE values for own Ridge implementation\")\n", + " print(MSEOwnRidgePredict[i])\n", + " print(\"MSE values for Scikit-Learn Ridge implementation\")\n", + " print(MSERidgePredict[i])\n", + "\n", + "# Now plot the results\n", + "plt.figure()\n", + "plt.plot(np.log10(lambdas), MSEOwnRidgePredict, 'r', label = 'MSE own Ridge Test')\n", + "plt.plot(np.log10(lambdas), MSERidgePredict, 'g', label = 'MSE Ridge Test')\n", + "\n", + "plt.xlabel('log10(lambda)')\n", + "plt.ylabel('MSE')\n", + "plt.legend()\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The results here agree when we force **Scikit-Learn**'s Ridge function to include the first column in our design matrix.\n", + "We see that the results agree very well. Here we have thus explicitely included the intercept column in the design matrix.\n", + "What happens if we do not include the intercept in our fit?\n", + "Let us see how we can change this code by zero centering." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "import numpy as np\n", + "import pandas as pd\n", + "import matplotlib.pyplot as plt\n", + "from sklearn.model_selection import train_test_split\n", + "from sklearn import linear_model\n", + "from sklearn.preprocessing import StandardScaler\n", + "\n", + "def MSE(y_data,y_model):\n", + " n = np.size(y_model)\n", + " return np.sum((y_data-y_model)**2)/n\n", + "# A seed just to ensure that the random numbers are the same for every run.\n", + "# Useful for eventual debugging.\n", + "np.random.seed(315)\n", + "\n", + "n = 100\n", + "x = np.random.rand(n)\n", + "y = np.exp(-x**2) + 1.5 * np.exp(-(x-2)**2)\n", + "\n", + "Maxpolydegree = 20\n", + "X = np.zeros((n,Maxpolydegree-1))\n", + "\n", + "for degree in range(1,Maxpolydegree): #No intercept column\n", + " X[:,degree-1] = x**(degree)\n", + "\n", + "# We split the data in test and training data\n", + "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)\n", + "\n", + "#For our own implementation, we will need to deal with the intercept by centering the design matrix and the target variable\n", + "X_train_mean = np.mean(X_train,axis=0)\n", + "#Center by removing mean from each feature\n", + "X_train_scaled = X_train - X_train_mean \n", + "X_test_scaled = X_test - X_train_mean\n", + "#The model intercept (called y_scaler) is given by the mean of the target variable (IF X is centered)\n", + "#Remove the intercept from the training data.\n", + "y_scaler = np.mean(y_train) \n", + "y_train_scaled = y_train - y_scaler \n", + "\n", + "p = Maxpolydegree-1\n", + "I = np.eye(p,p)\n", + "# Decide which values of lambda to use\n", + "nlambdas = 6\n", + "MSEOwnRidgePredict = np.zeros(nlambdas)\n", + "MSERidgePredict = np.zeros(nlambdas)\n", + "\n", + "lambdas = np.logspace(-4, 2, nlambdas)\n", + "for i in range(nlambdas):\n", + " lmb = lambdas[i]\n", + " OwnRidgeBeta = np.linalg.pinv(X_train_scaled.T @ X_train_scaled+lmb*I) @ X_train_scaled.T @ (y_train_scaled)\n", + " intercept_ = y_scaler - X_train_mean@OwnRidgeBeta #The intercept can be shifted so the model can predict on uncentered data\n", + " #Add intercept to prediction\n", + " ypredictOwnRidge = X_test @ OwnRidgeBeta + intercept_ \n", + " #Add intercept to prediction\n", + " ypredictOwnRidge = X_test_scaled @ OwnRidgeBeta + y_scaler \n", + " RegRidge = linear_model.Ridge(lmb)\n", + " RegRidge.fit(X_train,y_train)\n", + " ypredictRidge = RegRidge.predict(X_test)\n", + " MSEOwnRidgePredict[i] = MSE(y_test,ypredictOwnRidge)\n", + " MSERidgePredict[i] = MSE(y_test,ypredictRidge)\n", + " print(\"Beta values for own Ridge implementation\")\n", + " print(OwnRidgeBeta) #Intercept is given by mean of target variable\n", + " print(\"Beta values for Scikit-Learn Ridge implementation\")\n", + " print(RegRidge.coef_)\n", + " print('Intercept from own implementation:')\n", + " print(intercept_)\n", + " print('Intercept from Scikit-Learn Ridge implementation')\n", + " print(RegRidge.intercept_)\n", + " print(\"MSE values for own Ridge implementation\")\n", + " print(MSEOwnRidgePredict[i])\n", + " print(\"MSE values for Scikit-Learn Ridge implementation\")\n", + " print(MSERidgePredict[i])\n", + "\n", + "\n", + "# Now plot the results\n", + "plt.figure()\n", + "plt.plot(np.log10(lambdas), MSEOwnRidgePredict, 'b--', label = 'MSE own Ridge Test')\n", + "plt.plot(np.log10(lambdas), MSERidgePredict, 'g--', label = 'MSE SL Ridge Test')\n", + "plt.xlabel('log10(lambda)')\n", + "plt.ylabel('MSE')\n", + "plt.legend()\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We see here, when compared to the code which includes explicitely the\n", + "intercept column, that our MSE value is actually smaller. This is\n", + "because the regularization term does not include the intercept value\n", + "$\\beta_0$ in the fitting. This applies to Lasso regularization as\n", + "well. It means that our optimization is now done only with the\n", + "centered matrix and/or vector that enter the fitting procedure. Note\n", + "also that the problem with the intercept occurs mainly in these type\n", + "of polynomial fitting problem.\n", + "\n", + "The next example is indeed an example where all these discussions about the role of intercept are not present.\n", + "\n", + "## More complicated Example: The Ising model\n", + "\n", + "The one-dimensional Ising model with nearest neighbor interaction, no\n", + "external field and a constant coupling constant $J$ is given by" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
\n", + "\n", + "$$\n", + "\\begin{equation}\n", + " H = -J \\sum_{k}^L s_k s_{k + 1},\n", + "\\label{_auto1} \\tag{1}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "where $s_i \\in \\{-1, 1\\}$ and $s_{N + 1} = s_1$. The number of spins\n", + "in the system is determined by $L$. For the one-dimensional system\n", + "there is no phase transition.\n", + "\n", + "We will look at a system of $L = 40$ spins with a coupling constant of\n", + "$J = 1$. To get enough training data we will generate 10000 states\n", + "with their respective energies." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "from mpl_toolkits.axes_grid1 import make_axes_locatable\n", + "import seaborn as sns\n", + "import scipy.linalg as scl\n", + "from sklearn.model_selection import train_test_split\n", + "import tqdm\n", + "sns.set(color_codes=True)\n", + "cmap_args=dict(vmin=-1., vmax=1., cmap='seismic')\n", + "\n", + "L = 40\n", + "n = int(1e4)\n", + "\n", + "spins = np.random.choice([-1, 1], size=(n, L))\n", + "J = 1.0\n", + "\n", + "energies = np.zeros(n)\n", + "\n", + "for i in range(n):\n", + " energies[i] = - J * np.dot(spins[i], np.roll(spins[i], 1))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Here we use ordinary least squares\n", + "regression to predict the energy for the nearest neighbor\n", + "one-dimensional Ising model on a ring, i.e., the endpoints wrap\n", + "around. We will use linear regression to fit a value for\n", + "the coupling constant to achieve this.\n", + "\n", + "A more general form for the one-dimensional Ising model is" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
\n", + "\n", + "$$\n", + "\\begin{equation}\n", + " H = - \\sum_j^L \\sum_k^L s_j s_k J_{jk}.\n", + "\\label{_auto2} \\tag{2}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Here we allow for interactions beyond the nearest neighbors and a state dependent\n", + "coupling constant. This latter expression can be formulated as\n", + "a matrix-product" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
\n", + "\n", + "$$\n", + "\\begin{equation}\n", + " \\boldsymbol{H} = \\boldsymbol{X} J,\n", + "\\label{_auto3} \\tag{3}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "where $X_{jk} = s_j s_k$ and $J$ is a matrix which consists of the\n", + "elements $-J_{jk}$. This form of writing the energy fits perfectly\n", + "with the form utilized in linear regression, that is" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
\n", + "\n", + "$$\n", + "\\begin{equation}\n", + " \\boldsymbol{y} = \\boldsymbol{X}\\boldsymbol{\\beta} + \\boldsymbol{\\epsilon},\n", + "\\label{_auto4} \\tag{4}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We split the data in training and test data as discussed in the previous example" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "X = np.zeros((n, L ** 2))\n", + "for i in range(n):\n", + " X[i] = np.outer(spins[i], spins[i]).ravel()\n", + "y = energies\n", + "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In the ordinary least squares method we choose the cost function" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
\n", + "\n", + "$$\n", + "\\begin{equation}\n", + " C(\\boldsymbol{X}, \\boldsymbol{\\beta})= \\frac{1}{n}\\left\\{(\\boldsymbol{X}\\boldsymbol{\\beta} - \\boldsymbol{y})^T(\\boldsymbol{X}\\boldsymbol{\\beta} - \\boldsymbol{y})\\right\\}.\n", + "\\label{_auto5} \\tag{5}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We then find the extremal point of $C$ by taking the derivative with respect to $\\boldsymbol{\\beta}$ as discussed above.\n", + "This yields the expression for $\\boldsymbol{\\beta}$ to be" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\boldsymbol{\\beta} = \\frac{\\boldsymbol{X}^T \\boldsymbol{y}}{\\boldsymbol{X}^T \\boldsymbol{X}},\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "which immediately imposes some requirements on $\\boldsymbol{X}$ as there must exist\n", + "an inverse of $\\boldsymbol{X}^T \\boldsymbol{X}$. If the expression we are modeling contains an\n", + "intercept, i.e., a constant term, we must make sure that the\n", + "first column of $\\boldsymbol{X}$ consists of $1$. We do this here" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "X_train_own = np.concatenate(\n", + " (np.ones(len(X_train))[:, np.newaxis], X_train),\n", + " axis=1\n", + ")\n", + "X_test_own = np.concatenate(\n", + " (np.ones(len(X_test))[:, np.newaxis], X_test),\n", + " axis=1\n", + ")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Doing the inversion directly turns out to be a bad idea since the matrix\n", + "$\\boldsymbol{X}^T\\boldsymbol{X}$ is singular. An alternative approach is to use the **singular\n", + "value decomposition**. Using the definition of the Moore-Penrose\n", + "pseudoinverse we can write the equation for $\\boldsymbol{\\beta}$ as" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\boldsymbol{\\beta} = \\boldsymbol{X}^{+}\\boldsymbol{y},\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "where the pseudoinverse of $\\boldsymbol{X}$ is given by" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\boldsymbol{X}^{+} = \\frac{\\boldsymbol{X}^T}{\\boldsymbol{X}^T\\boldsymbol{X}}.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Using singular value decomposition we can decompose the matrix $\\boldsymbol{X} = \\boldsymbol{U}\\boldsymbol{\\Sigma} \\boldsymbol{V}^T$,\n", + "where $\\boldsymbol{U}$ and $\\boldsymbol{V}$ are orthogonal(unitary) matrices and $\\boldsymbol{\\Sigma}$ contains the singular values (more details below).\n", + "where $X^{+} = V\\Sigma^{+} U^T$. This reduces the equation for\n", + "$\\omega$ to" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
\n", + "\n", + "$$\n", + "\\begin{equation}\n", + " \\boldsymbol{\\beta} = \\boldsymbol{V}\\boldsymbol{\\Sigma}^{+} \\boldsymbol{U}^T \\boldsymbol{y}.\n", + "\\label{_auto6} \\tag{6}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Note that solving this equation by actually doing the pseudoinverse\n", + "(which is what we will do) is not a good idea as this operation scales\n", + "as $\\mathcal{O}(n^3)$, where $n$ is the number of elements in a\n", + "general matrix. Instead, doing $QR$-factorization and solving the\n", + "linear system as an equation would reduce this down to\n", + "$\\mathcal{O}(n^2)$ operations." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "def ols_svd(x: np.ndarray, y: np.ndarray) -> np.ndarray:\n", + " u, s, v = scl.svd(x)\n", + " return v.T @ scl.pinv(scl.diagsvd(s, u.shape[0], v.shape[0])) @ u.T @ y" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "beta = ols_svd(X_train_own,y_train)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "When extracting the $J$-matrix we need to make sure that we remove the intercept, as is done here" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "J = beta[1:].reshape(L, L)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "A way of looking at the coefficients in $J$ is to plot the matrices as images." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "fig = plt.figure(figsize=(20, 14))\n", + "im = plt.imshow(J, **cmap_args)\n", + "plt.title(\"OLS\", fontsize=18)\n", + "plt.xticks(fontsize=18)\n", + "plt.yticks(fontsize=18)\n", + "cb = fig.colorbar(im)\n", + "cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "It is interesting to note that OLS\n", + "considers both $J_{j, j + 1} = -0.5$ and $J_{j, j - 1} = -0.5$ as\n", + "valid matrix elements for $J$.\n", + "In our discussion below on hyperparameters and Ridge and Lasso regression we will see that\n", + "this problem can be removed, partly and only with Lasso regression. \n", + "\n", + "In this case our matrix inversion was actually possible. The obvious question now is what is the mathematics behind the SVD?\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "Let us now \n", + "focus on Ridge and Lasso regression as well. We repeat some of the\n", + "basic parts of the Ising model and the setup of the training and test\n", + "data. The one-dimensional Ising model with nearest neighbor\n", + "interaction, no external field and a constant coupling constant $J$ is\n", + "given by" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
\n", + "\n", + "$$\n", + "\\begin{equation}\n", + " H = -J \\sum_{k}^L s_k s_{k + 1},\n", + "\\label{_auto7} \\tag{7}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "where $s_i \\in \\{-1, 1\\}$ and $s_{N + 1} = s_1$. The number of spins in the system is determined by $L$. For the one-dimensional system there is no phase transition.\n", + "\n", + "We will look at a system of $L = 40$ spins with a coupling constant of $J = 1$. To get enough training data we will generate 10000 states with their respective energies." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "from mpl_toolkits.axes_grid1 import make_axes_locatable\n", + "import seaborn as sns\n", + "import scipy.linalg as scl\n", + "from sklearn.model_selection import train_test_split\n", + "import sklearn.linear_model as skl\n", + "import tqdm\n", + "sns.set(color_codes=True)\n", + "cmap_args=dict(vmin=-1., vmax=1., cmap='seismic')\n", + "\n", + "L = 40\n", + "n = int(1e4)\n", + "\n", + "spins = np.random.choice([-1, 1], size=(n, L))\n", + "J = 1.0\n", + "\n", + "energies = np.zeros(n)\n", + "\n", + "for i in range(n):\n", + " energies[i] = - J * np.dot(spins[i], np.roll(spins[i], 1))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "A more general form for the one-dimensional Ising model is" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
\n", + "\n", + "$$\n", + "\\begin{equation}\n", + " H = - \\sum_j^L \\sum_k^L s_j s_k J_{jk}.\n", + "\\label{_auto8} \\tag{8}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Here we allow for interactions beyond the nearest neighbors and a more\n", + "adaptive coupling matrix. This latter expression can be formulated as\n", + "a matrix-product on the form" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
\n", + "\n", + "$$\n", + "\\begin{equation}\n", + " H = X J,\n", + "\\label{_auto9} \\tag{9}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "where $X_{jk} = s_j s_k$ and $J$ is the matrix consisting of the\n", + "elements $-J_{jk}$. This form of writing the energy fits perfectly\n", + "with the form utilized in linear regression, viz." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
\n", + "\n", + "$$\n", + "\\begin{equation}\n", + " \\boldsymbol{y} = \\boldsymbol{X}\\boldsymbol{\\beta} + \\boldsymbol{\\epsilon}.\n", + "\\label{_auto10} \\tag{10}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We organize the data as we did above" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "X = np.zeros((n, L ** 2))\n", + "for i in range(n):\n", + " X[i] = np.outer(spins[i], spins[i]).ravel()\n", + "y = energies\n", + "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.96)\n", + "\n", + "X_train_own = np.concatenate(\n", + " (np.ones(len(X_train))[:, np.newaxis], X_train),\n", + " axis=1\n", + ")\n", + "\n", + "X_test_own = np.concatenate(\n", + " (np.ones(len(X_test))[:, np.newaxis], X_test),\n", + " axis=1\n", + ")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We will do all fitting with **Scikit-Learn**," + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "clf = skl.LinearRegression().fit(X_train, y_train)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "When extracting the $J$-matrix we make sure to remove the intercept" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "J_sk = clf.coef_.reshape(L, L)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "And then we plot the results" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "fig = plt.figure(figsize=(20, 14))\n", + "im = plt.imshow(J_sk, **cmap_args)\n", + "plt.title(\"LinearRegression from Scikit-learn\", fontsize=18)\n", + "plt.xticks(fontsize=18)\n", + "plt.yticks(fontsize=18)\n", + "cb = fig.colorbar(im)\n", + "cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The results agree perfectly with our previous discussion where we used our own code.\n", + "\n", + "\n", + "Having explored the ordinary least squares we move on to ridge\n", + "regression. In ridge regression we include a **regularizer**. This\n", + "involves a new cost function which leads to a new estimate for the\n", + "weights $\\boldsymbol{\\beta}$. This results in a penalized regression problem. The\n", + "cost function is given by" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "6\n", + "0\n", + " \n", + "<\n", + "<\n", + "<\n", + "!\n", + "!\n", + "M\n", + "A\n", + "T\n", + "H\n", + "_\n", + "B\n", + "L\n", + "O\n", + "C\n", + "K" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "_lambda = 0.1\n", + "clf_ridge = skl.Ridge(alpha=_lambda).fit(X_train, y_train)\n", + "J_ridge_sk = clf_ridge.coef_.reshape(L, L)\n", + "fig = plt.figure(figsize=(20, 14))\n", + "im = plt.imshow(J_ridge_sk, **cmap_args)\n", + "plt.title(\"Ridge from Scikit-learn\", fontsize=18)\n", + "plt.xticks(fontsize=18)\n", + "plt.yticks(fontsize=18)\n", + "cb = fig.colorbar(im)\n", + "cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)\n", + "\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In the **Least Absolute Shrinkage and Selection Operator** (LASSO)-method we get a third cost function." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
\n", + "\n", + "$$\n", + "\\begin{equation}\n", + " C(\\boldsymbol{X}, \\boldsymbol{\\beta}; \\lambda) = (\\boldsymbol{X}\\boldsymbol{\\beta} - \\boldsymbol{y})^T(\\boldsymbol{X}\\boldsymbol{\\beta} - \\boldsymbol{y}) + \\lambda \\sqrt{\\boldsymbol{\\beta}^T\\boldsymbol{\\beta}}.\n", + "\\label{_auto12} \\tag{12}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Finding the extremal point of this cost function is not so straight-forward as in least squares and ridge. We will therefore rely solely on the function ``Lasso`` from **Scikit-Learn**." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "clf_lasso = skl.Lasso(alpha=_lambda).fit(X_train, y_train)\n", + "J_lasso_sk = clf_lasso.coef_.reshape(L, L)\n", + "fig = plt.figure(figsize=(20, 14))\n", + "im = plt.imshow(J_lasso_sk, **cmap_args)\n", + "plt.title(\"Lasso from Scikit-learn\", fontsize=18)\n", + "plt.xticks(fontsize=18)\n", + "plt.yticks(fontsize=18)\n", + "cb = fig.colorbar(im)\n", + "cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)\n", + "\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "It is quite striking how LASSO breaks the symmetry of the coupling\n", + "constant as opposed to ridge and OLS. We get a sparse solution with\n", + "$J_{j, j + 1} = -1$.\n", + "\n", + "\n", + "\n", + "\n", + "We see how the different models perform for a different set of values for $\\lambda$." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "lambdas = np.logspace(-4, 5, 10)\n", + "\n", + "train_errors = {\n", + " \"ols_sk\": np.zeros(lambdas.size),\n", + " \"ridge_sk\": np.zeros(lambdas.size),\n", + " \"lasso_sk\": np.zeros(lambdas.size)\n", + "}\n", + "\n", + "test_errors = {\n", + " \"ols_sk\": np.zeros(lambdas.size),\n", + " \"ridge_sk\": np.zeros(lambdas.size),\n", + " \"lasso_sk\": np.zeros(lambdas.size)\n", + "}\n", + "\n", + "plot_counter = 1\n", + "\n", + "fig = plt.figure(figsize=(32, 54))\n", + "\n", + "for i, _lambda in enumerate(tqdm.tqdm(lambdas)):\n", + " for key, method in zip(\n", + " [\"ols_sk\", \"ridge_sk\", \"lasso_sk\"],\n", + " [skl.LinearRegression(), skl.Ridge(alpha=_lambda), skl.Lasso(alpha=_lambda)]\n", + " ):\n", + " method = method.fit(X_train, y_train)\n", + "\n", + " train_errors[key][i] = method.score(X_train, y_train)\n", + " test_errors[key][i] = method.score(X_test, y_test)\n", + "\n", + " omega = method.coef_.reshape(L, L)\n", + "\n", + " plt.subplot(10, 5, plot_counter)\n", + " plt.imshow(omega, **cmap_args)\n", + " plt.title(r\"%s, $\\lambda = %.4f$\" % (key, _lambda))\n", + " plot_counter += 1\n", + "\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We see that LASSO reaches a good solution for low\n", + "values of $\\lambda$, but will \"wither\" when we increase $\\lambda$ too\n", + "much. Ridge is more stable over a larger range of values for\n", + "$\\lambda$, but eventually also fades away.\n", + "\n", + "\n", + "To determine which value of $\\lambda$ is best we plot the accuracy of\n", + "the models when predicting the training and the testing set. We expect\n", + "the accuracy of the training set to be quite good, but if the accuracy\n", + "of the testing set is much lower this tells us that we might be\n", + "subject to an overfit model. The ideal scenario is an accuracy on the\n", + "testing set that is close to the accuracy of the training set." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "fig = plt.figure(figsize=(20, 14))\n", + "\n", + "colors = {\n", + " \"ols_sk\": \"r\",\n", + " \"ridge_sk\": \"y\",\n", + " \"lasso_sk\": \"c\"\n", + "}\n", + "\n", + "for key in train_errors:\n", + " plt.semilogx(\n", + " lambdas,\n", + " train_errors[key],\n", + " colors[key],\n", + " label=\"Train {0}\".format(key),\n", + " linewidth=4.0\n", + " )\n", + "\n", + "for key in test_errors:\n", + " plt.semilogx(\n", + " lambdas,\n", + " test_errors[key],\n", + " colors[key] + \"--\",\n", + " label=\"Test {0}\".format(key),\n", + " linewidth=4.0\n", + " )\n", + "plt.legend(loc=\"best\", fontsize=18)\n", + "plt.xlabel(r\"$\\lambda$\", fontsize=18)\n", + "plt.ylabel(r\"$R^2$\", fontsize=18)\n", + "plt.tick_params(labelsize=18)\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "From the above figure we can see that LASSO with $\\lambda = 10^{-2}$\n", + "achieves a very good accuracy on the test set. This by far surpasses the\n", + "other models for all values of $\\lambda$.\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "## Exercises and Projects\n", "\n", "\n", @@ -1980,6 +3578,7 @@ }, "outputs": [], "source": [ + "\"\"\"\n", "import numpy as np\n", "from imageio import imread\n", "import matplotlib.pyplot as plt\n", @@ -1994,7 +3593,8 @@ "plt.imshow(terrain1, cmap='gray')\n", "plt.xlabel('X')\n", "plt.ylabel('Y')\n", - "plt.show()" + "plt.show()\n", + "\"\"\"" ] }, { diff --git a/doc/LectureNotes/_build/html/_sources/schedule.md b/doc/LectureNotes/_build/html/_sources/schedule.md index a33d7bf3e..8fb9c6ab3 100644 --- a/doc/LectureNotes/_build/html/_sources/schedule.md +++ b/doc/LectureNotes/_build/html/_sources/schedule.md @@ -78,6 +78,7 @@ For the reading assignments we use the following abbreviations: ### Week 38 September 20-24 - Lab Wednesday: Work on Project 1 - Lecture Thursday: Classification problems and Logistic Regression, from binary cases to several categories + - Video of Lecture at https://www.uio.no/studier/emner/matnat/fys/FYS-STK4155/h21/forelesningsvideoer/LectureSeptember23.mp4?vrtx=view-as-webpage - Lecture Friday: Logistic Regression and gradient optimization - Reading recommendations: diff --git a/doc/LectureNotes/_build/html/chapter3.html b/doc/LectureNotes/_build/html/chapter3.html index 71542c6b8..43a2d40ef 100644 --- a/doc/LectureNotes/_build/html/chapter3.html +++ b/doc/LectureNotes/_build/html/chapter3.html @@ -321,39 +321,49 @@ 5.5. Cross-validation +
  • + + 5.6. More on Rescaling data + +
  • +
  • + + 5.7. More complicated Example: The Ising model + +
  • - 5.6. Exercises and Projects + 5.8. Exercises and Projects @@ -630,10 +640,10 @@ number \(i\) is left out. Usin
    -
    Runtime: 0.13859 sec
    +
    Runtime: 0.139992 sec
     Jackknife Statistics :
     original           bias      std. error
    - 99.9054        99.8954        0.149328
    + 99.9142        99.9042        0.148517
     
    @@ -852,7 +862,7 @@ theorem.

    Bootstrap Statistics :
     original           bias      std. error
    - 99.7442  15.0015        99.7465        0.148127
    + 100.028  14.8941        100.026        0.148225
     
    @@ -1054,15 +1064,14 @@ Error: 0.32149601703519126 Bias^2: 0.3123314713548606 Var: 0.009164545680330616 0.32149601703519126 >= 0.3123314713548606 + 0.009164545680330616 = 0.3214960170351912 -Polynomial degree: -
    -
    -
     1
    +Polynomial degree: 1
     Error: 0.08426840630693411
     Bias^2: 0.07968918676726028
     Var: 0.004579219539673833
     0.08426840630693411 >= 0.07968918676726028 + 0.004579219539673833 = 0.08426840630693411
    -Polynomial degree: 2
    +
    +
    +
    Polynomial degree: 2
     Error: 0.10398646080125035
     Bias^2: 0.10077114273548986
     Var: 0.0032153180657605086
    @@ -1089,14 +1098,14 @@ Error: 0.03781367141738898
     Bias^2: 0.03365768507152761
     Var: 0.004155986345861379
     0.03781367141738898 >= 0.03365768507152761 + 0.004155986345861379 = 0.03781367141738899
    -Polynomial degree: 7
    +
    +
    +
    Polynomial degree: 7
     Error: 0.027609773491022498
     Bias^2: 0.02299949826036597
     Var: 0.004610275230656537
     0.027609773491022498 >= 0.02299949826036597 + 0.004610275230656537 = 0.027609773491022505
    -
    -
    -
    Polynomial degree: 8
    +Polynomial degree: 8
     Error: 0.017355848195591973
     Bias^2: 0.010331721306655588
     Var: 0.007024126888936384
    @@ -1123,17 +1132,14 @@ Error: 0.1154777721897675
     Bias^2: 0.01628578269590588
     Var: 0.09919198949386163
     0.1154777721897675 >= 0.01628578269590588 + 0.09919198949386163 = 0.11547777218976751
    -Polynomial degree:
    -
    -
    -
     13
    +Polynomial degree: 13
     Error: 0.22842468702166951
     Bias^2: 0.01975416527163567
     Var: 0.20867052175003387
     0.22842468702166951 >= 0.01975416527163567 + 0.20867052175003387 = 0.22842468702166954
     
    -_images/chapter3_62_6.png +_images/chapter3_62_5.png

    The bias-variance tradeoff summarizes the fundamental tension in @@ -1367,84 +1373,82 @@ Mean squared error on training data: 3.66204648 Mean squared error on test data: 8.14812206 Degree of polynomial: 7 Mean squared error on training data: 0.47075725 +Mean squared error on test data: 2.00607783 -

    Mean squared error on test data: 2.00607783
    -Degree of polynomial:   8
    +
    Degree of polynomial:   8
     Mean squared error on training data: 0.04912436
     Mean squared error on test data: 0.21596432
     Degree of polynomial:   9
     Mean squared error on training data: 0.02522069
     Mean squared error on test data: 0.08576932
    -
    -
    -
    Degree of polynomial:  10
    +Degree of polynomial:  10
     Mean squared error on training data: 0.02511518
     Mean squared error on test data: 1.20015436
     Degree of polynomial:  11
     Mean squared error on training data: 0.01640891
     Mean squared error on test data: 1.35533773
    -Degree of polynomial:  12
    -Mean squared error on training data: 0.00813803
    -Mean squared error on test data: 0.17446471
     
    -
    Degree of polynomial:  13
    +
    Degree of polynomial:  12
    +Mean squared error on training data: 0.00813803
    +Mean squared error on test data: 0.17446471
    +Degree of polynomial:  13
     Mean squared error on training data: 0.00759119
     Mean squared error on test data: 1.08131003
     Degree of polynomial:  14
     Mean squared error on training data: 0.00472199
     Mean squared error on test data: 0.81333793
    -Degree of polynomial:  15
    -Mean squared error on training data: 0.00410478
    -Mean squared error on test data: 92.09145189
     
    -
    Degree of polynomial:  16
    +
    Degree of polynomial:  15
    +Mean squared error on training data: 0.00410478
    +Mean squared error on test data: 92.09145189
    +Degree of polynomial:  16
     Mean squared error on training data: 0.00315593
     Mean squared error on test data: 234.39716546
     Degree of polynomial:  17
     Mean squared error on training data: 0.00242998
     Mean squared error on test data: 1271.05295709
    -Degree of polynomial:  18
    -Mean squared error on training data: 0.00228740
    -Mean squared error on test data: 108.42208194
     
    -
    Degree of polynomial:  19
    +
    Degree of polynomial:  18
    +Mean squared error on training data: 0.00228740
    +Mean squared error on test data: 108.42208194
    +Degree of polynomial:  19
     Mean squared error on training data: 0.00156372
     Mean squared error on test data: 1388.41078073
     Degree of polynomial:  20
     Mean squared error on training data: 0.00137982
     Mean squared error on test data: 1761.43341615
    -Degree of polynomial:  21
    -Mean squared error on training data: 0.00118170
    -Mean squared error on test data: 15061.31603087
     
    -
    Degree of polynomial:  22
    +
    Degree of polynomial:  21
    +Mean squared error on training data: 0.00118170
    +Mean squared error on test data: 15061.31603087
    +Degree of polynomial:  22
     Mean squared error on training data: 0.00092354
     Mean squared error on test data: 890.63488525
     Degree of polynomial:  23
     Mean squared error on training data: 0.00085887
     Mean squared error on test data: 5483.16796929
    -Degree of polynomial:  24
    -Mean squared error on training data: 0.00084589
    -Mean squared error on test data: 1695.57143061
     
    -
    Degree of polynomial:  25
    +
    Degree of polynomial:  24
    +Mean squared error on training data: 0.00084589
    +Mean squared error on test data: 1695.57143061
    +Degree of polynomial:  25
     Mean squared error on training data: 0.00078806
     Mean squared error on test data: 131343.30655001
     Degree of polynomial:  26
     Mean squared error on training data: 0.00076916
     Mean squared error on test data: 17709.14370264
    -Degree of polynomial:  27
    -Mean squared error on training data: 0.00068970
    -Mean squared error on test data: 2975.38903780
     
    -
    Degree of polynomial:  28
    +
    Degree of polynomial:  27
    +Mean squared error on training data: 0.00068970
    +Mean squared error on test data: 2975.38903780
    +Degree of polynomial:  28
     Mean squared error on training data: 0.00062588
     Mean squared error on test data: 3848.64522721
     Degree of polynomial:  29
    @@ -1458,7 +1462,7 @@ Mean squared error on test data: 2988.64001211
       plt.plot(polynomial, np.log10(testerror), label='Test Error')
     
    -_images/chapter3_65_11.png +_images/chapter3_65_10.png
    @@ -1740,8 +1744,1276 @@ cross-validation (LOOCV).

    +
    +

    5.6. More on Rescaling data

    +

    We end this chapter by adding some words on scaling and how to deal with the intercept for regression cases.

    +

    When you are comparing your own code with for example Scikit-Learn’s +library, there are some technicalities to keep in mind. The examples +here demonstrate some of these aspects with potential pitfalls.

    +

    The discussion here focuses on the role of the intercept, how we can +set up the design matrix, what scaling we should use and other topics +which tend confuse us.

    +

    The intercept can be interpreted as the expected value of our +target/output variables when all other predictors are set to zero. +Thus, if we cannot assume that the expected outputs/targets are zero +when all predictors are zero (the columns in the design matrix), it +may be a bad idea to implement a model which penalizes the intercept. +Furthermore, in for example Ridge and Lasso regression, the default solutions +from the library Scikit-Learn (when not shrinking \(\beta_0\)) for the unknown parameters +\(\boldsymbol{\beta}\), are derived under the assumption that both \(\boldsymbol{y}\) and +\(\boldsymbol{X}\) are zero centered, that is we subtract the mean values.

    +

    If our predictors represent different scales, then it is important to +standardize the design matrix \(\boldsymbol{X}\) by subtracting the mean of each +column from the corresponding column and dividing the column with its +standard deviation. Most machine learning libraries do this as a default. This means that if you compare your code with the results from a given library, +the results may differ.

    +

    The +Standadscaler +function in Scikit-Learn does this for us. For the data sets we +have been studying in our various examples, the data are in many cases +already scaled and there is no need to scale them. You as a user of different machine learning algorithms, should always perform a +survey of your data, with a critical assessment of them in case you need to scale the data.

    +

    If you need to scale the data, not doing so will give an unfair +penalization of the parameters since their magnitude depends on the +scale of their corresponding predictor.

    +

    Suppose as an example that you +you have an input variable given by the heights of different persons. +Human height might be measured in inches or meters or +kilometers. If measured in kilometers, a standard linear regression +model with this predictor would probably give a much bigger +coefficient term, than if measured in millimeters. +This can clearly lead to problems in evaluating the cost/loss functions.

    +

    Keep in mind that when you transform your data set before training a model, the same transformation needs to be done +on your eventual new data set before making a prediction. If we translate this into a Python code, it would could be implemented as follows

    +
    +
    +
    """
    +#Model training, we compute the mean value of y and X
    +y_train_mean = np.mean(y_train)
    +X_train_mean = np.mean(X_train,axis=0)
    +X_train = X_train - X_train_mean
    +y_train = y_train - y_train_mean
    +
    +# The we fit our model with the training data
    +trained_model = some_model.fit(X_train,y_train)
    +
    +
    +#Model prediction, we need also to transform our data set used for the prediction.
    +X_test = X_test - X_train_mean #Use mean from training data
    +y_pred = trained_model(X_test)
    +y_pred = y_pred + y_train_mean
    +"""
    +
    +
    +
    +
    +
    '\n#Model training, we compute the mean value of y and X\ny_train_mean = np.mean(y_train)\nX_train_mean = np.mean(X_train,axis=0)\nX_train = X_train - X_train_mean\ny_train = y_train - y_train_mean\n\n# The we fit our model with the training data\ntrained_model = some_model.fit(X_train,y_train)\n\n\n#Model prediction, we need also to transform our data set used for the prediction.\nX_test = X_test - X_train_mean #Use mean from training data\ny_pred = trained_model(X_test)\ny_pred = y_pred + y_train_mean\n'
    +
    +
    +
    +
    +

    Let us try to understand what this may imply mathematically when we +subtract the mean values, also known as zero centering. For +simplicity, we will focus on ordinary regression, as done in the above example.

    +

    The cost/loss function for regression is

    +
    +\[ +C(\beta_0, \beta_1, ... , \beta_{p-1}) = \frac{1}{n}\sum_{i=0}^{n} \left(y_i - \beta_0 - \sum_{j=1}^{p-1} X_{ij}\beta_j\right)^2,. +\]
    +

    Recall also that we use the squared value since this leads to an increase of the penalty for higher differences between predicted and output/target values.

    +

    What we have done is to single out the \(\beta_0\) term in the definition of the mean squared error (MSE). +The design matrix +\(X\) does in this case not contain any intercept column. +When we take the derivative with respect to \(\beta_0\), we want the derivative to obey

    +
    +\[ +\frac{\partial C}{\partial \beta_j} = 0, +\]
    +

    for all \(j\). For \(\beta_0\) we have

    +
    +\[ +\frac{\partial C}{\partial \beta_0} = -\frac{2}{n}\sum_{i=0}^{n-1} \left(y_i - \beta_0 - \sum_{j=1}^{p-1} X_{ij} \beta_j\right). +\]
    +

    Multiplying away the constant \(2/n\), we obtain

    +
    +\[ +\sum_{i=0}^{n-1} \beta_0 = \sum_{i=0}^{n-1}y_i - \sum_{i=0}^{n-1} \sum_{j=1}^{p-1} X_{ij} \beta_j. +\]
    +

    We assume +that every column of \(\boldsymbol{X}\) is centered, which we can do by subtracting the mean,

    +
    +
    +
    X = X - np.mean(X,axis=0)
    +
    +
    +
    +
    +

    This means that we need to rewrite \(X_{ij}\) as \(\tilde{X}_{ij}=X_{ij}-\mu_j\), where

    +
    +\[ +\mu_j = \frac{1}{n}\sum_{i=0}^{n-1}X_{ij}. +\]
    +

    Let us special first to the case where we have only two parameters \(\beta_0\) and \(\beta_1\). +Our result for \(\beta_0\) simplifies then to

    +
    +\[ +n\beta_0 = \sum_{i=0}^{n-1}y_i - \sum_{i=0}^{n-1} X_{i1} \beta_1. +\]
    +

    Assuming that the matrix elements \(X_{i1}\) are centered, what we have is

    +
    +\[ +\beta_0 = \frac{1}{n}\sum_{i=0}^{n-1}y_i - \beta_1\frac{1}{n}\sum_{i=0}^{n-1} \left(X_{i1}-\mu_{1}\right), +\]
    +

    where

    +
    +\[ +\mu_1=\frac{1}{n}\sum_{i=0}^{n-1} (X_{i1}, +\]
    +

    and if we define the mean value of the outputs as

    +
    +\[ +\mu_y=\frac{1}{n}\sum_{i=0}^{n-1}y_i, +\]
    +

    we have

    +
    +\[ +\beta_0 = \mu_y - \beta_1\frac{1}{n}\sum_{i=0}^{n-1} (X_{i1}-\mu_{1}), +\]
    +

    and it is easy to see that the last sum equals zero! This means that we have

    +
    +\[ +\beta_0 = \mu_y, +\]
    +

    if the columns of the design matrix are centered. It is straight forward to generalize this results to more values of \(\beta\). +We have thus

    +
    +\[ +\beta_0 = \frac{1}{n}\sum_{i=0}^{n-1} y_i = \overline{\boldsymbol{y}}, +\]
    +

    the average value of \(\boldsymbol{y}\).

    +

    Replacing \(y_i\) with \(y_i - \beta_0 = y_i - \overline{\boldsymbol{y}}\) and centering also our design matrix results in a cost function (in vector-matrix disguise)

    +
    +\[ +C(\boldsymbol{\beta}) = (\boldsymbol{\tilde{y}} - \tilde{X}\boldsymbol{\beta})^T(\boldsymbol{\tilde{y}} - \tilde{X}\boldsymbol{\beta}). +\]
    +

    If we minimize with respect to \(\boldsymbol{\beta}\) we have then

    +
    +\[ +\hat{\boldsymbol{\beta}} = (\tilde{X}^T\tilde{X})^{-1}\tilde{X}^T\boldsymbol{\tilde{y}}, +\]
    +

    where \(\boldsymbol{\tilde{y}} = \boldsymbol{y} - \overline{\boldsymbol{y}}\) +and \(\tilde{X}_{ij} = X_{ij} - \frac{1}{n}\sum_{k=0}^{n-1}X_{kj}\).

    +

    For Ridge regression we need to add \(\lambda \boldsymbol{\beta}^T\boldsymbol{\beta}\) to the cost function and get then

    +
    +\[ +\hat{\boldsymbol{\beta}} = (\tilde{X}^T\tilde{X} + \lambda I)^{-1}\tilde{X}^T\boldsymbol{\tilde{y}}. +\]
    +

    What does this mean? And why do we insist on all this? Let us look at some examples.

    +

    This code shows a simple first-order fit to a data set using the above transformed data, where we consider the role of the intercept first, by either excluding it or including it (code example thanks to Øyvind Sigmundson Schøyen). Here our scaling of the data is done by subtracting the mean values only. +Note also that we do not split the data into training and test.

    +
    +
    +
    import numpy as np
    +import matplotlib.pyplot as plt
    +
    +from sklearn.linear_model import LinearRegression
    +
    +
    +np.random.seed(2021)
    +
    +def MSE(y_data,y_model):
    +    n = np.size(y_model)
    +    return np.sum((y_data-y_model)**2)/n
    +
    +
    +def fit_beta(X, y):
    +    return np.linalg.pinv(X.T @ X) @ X.T @ y
    +
    +
    +true_beta = [2, 0.5, 3.7]
    +
    +x = np.linspace(0, 1, 11)
    +y = np.sum(
    +    np.asarray([x ** p * b for p, b in enumerate(true_beta)]), axis=0
    +) + 0.1 * np.random.normal(size=len(x))
    +
    +degree = 3
    +X = np.zeros((len(x), degree))
    +
    +# Include the intercept in the design matrix
    +for p in range(degree):
    +    X[:, p] = x ** p
    +
    +beta = fit_beta(X, y)
    +
    +# Intercept is included in the design matrix
    +skl = LinearRegression(fit_intercept=False).fit(X, y)
    +
    +print(f"True beta: {true_beta}")
    +print(f"Fitted beta: {beta}")
    +print(f"Sklearn fitted beta: {skl.coef_}")
    +ypredictOwn = X @ beta
    +ypredictSKL = skl.predict(X)
    +print(f"MSE with intercept column")
    +print(MSE(y,ypredictOwn))
    +print(f"MSE with intercept column from SKL")
    +print(MSE(y,ypredictSKL))
    +
    +
    +plt.figure()
    +plt.scatter(x, y, label="Data")
    +plt.plot(x, X @ beta, label="Fit")
    +plt.plot(x, skl.predict(X), label="Sklearn (fit_intercept=False)")
    +
    +
    +# Do not include the intercept in the design matrix
    +X = np.zeros((len(x), degree - 1))
    +
    +for p in range(degree - 1):
    +    X[:, p] = x ** (p + 1)
    +
    +# Intercept is not included in the design matrix
    +skl = LinearRegression(fit_intercept=True).fit(X, y)
    +
    +# Use centered values for X and y when computing coefficients
    +y_offset = np.average(y, axis=0)
    +X_offset = np.average(X, axis=0)
    +
    +beta = fit_beta(X - X_offset, y - y_offset)
    +intercept = np.mean(y_offset - X_offset @ beta)
    +
    +print(f"Manual intercept: {intercept}")
    +print(f"Fitted beta (wiothout intercept): {beta}")
    +print(f"Sklearn intercept: {skl.intercept_}")
    +print(f"Sklearn fitted beta (without intercept): {skl.coef_}")
    +ypredictOwn = X @ beta
    +ypredictSKL = skl.predict(X)
    +print(f"MSE with Manual intercept")
    +print(MSE(y,ypredictOwn+intercept))
    +print(f"MSE with Sklearn intercept")
    +print(MSE(y,ypredictSKL))
    +
    +plt.plot(x, X @ beta + intercept, "--", label="Fit (manual intercept)")
    +plt.plot(x, skl.predict(X), "--", label="Sklearn (fit_intercept=True)")
    +plt.grid()
    +plt.legend()
    +
    +plt.show()
    +
    +
    +
    +
    +
    True beta: [2, 0.5, 3.7]
    +Fitted beta: [2.08376632 0.19569961 3.97898392]
    +Sklearn fitted beta: [2.08376632 0.19569961 3.97898392]
    +MSE with intercept column
    +0.004113634617443137
    +MSE with intercept column from SKL
    +0.0041136346174431284
    +Manual intercept: 2.083766322923905
    +Fitted beta (wiothout intercept): [0.19569961 3.97898392]
    +Sklearn intercept: 2.0837663229239025
    +Sklearn fitted beta (without intercept): [0.19569961 3.97898392]
    +MSE with Manual intercept
    +0.004113634617443136
    +MSE with Sklearn intercept
    +0.004113634617443135
    +
    +
    +_images/chapter3_110_1.png +
    +
    +

    The intercept is the value of our output/target variable +when all our features are zero and our function crosses the \(y\)-axis (for a one-dimensional case).

    +

    Printing the MSE, we see first that both methods give the same MSE, as +they should. However, when we move to for example Ridge regression, +the way we treat the intercept may give a larger or smaller MSE, +meaning that the MSE can be penalized by the value of the +intercept. Not including the intercept in the fit, means that the +regularization term does not include \(\beta_0\). For different values +of \(\lambda\), this may lead to differeing MSE values.

    +

    To remind the reader, the regularization term, with the intercept in Ridge regression, is given by

    +
    +\[ +\lambda \vert\vert \boldsymbol{\beta} \vert\vert_2^2 = \lambda \sum_{j=0}^{p-1}\beta_j^2, +\]
    +

    but when we take out the intercept, this equation becomes

    +
    +\[ +\lambda \vert\vert \boldsymbol{\beta} \vert\vert_2^2 = \lambda \sum_{j=1}^{p-1}\beta_j^2. +\]
    +

    For Lasso regression we have

    +
    +\[ +\lambda \vert\vert \boldsymbol{\beta} \vert\vert_1 = \lambda \sum_{j=1}^{p-1}\vert\beta_j\vert. +\]
    +

    It means that, when scaling the design matrix and the outputs/targets, +by subtracting the mean values, we have an optimization problem which +is not penalized by the intercept. The MSE value can then be smaller +since it focuses only on the remaining quantities. If we however bring +back the intercept, we will get a MSE which then contains the +intercept.

    +

    Armed with this wisdom, we attempt first to simply set the intercept equal to False in our implementation of Ridge regression for our well-known vanilla data set.

    +
    +
    +
    import numpy as np
    +import pandas as pd
    +import matplotlib.pyplot as plt
    +from sklearn.model_selection import train_test_split
    +from sklearn import linear_model
    +
    +def MSE(y_data,y_model):
    +    n = np.size(y_model)
    +    return np.sum((y_data-y_model)**2)/n
    +
    +
    +# A seed just to ensure that the random numbers are the same for every run.
    +# Useful for eventual debugging.
    +np.random.seed(3155)
    +
    +n = 100
    +x = np.random.rand(n)
    +y = np.exp(-x**2) + 1.5 * np.exp(-(x-2)**2)
    +
    +Maxpolydegree = 20
    +X = np.zeros((n,Maxpolydegree))
    +#We include explicitely the intercept column
    +for degree in range(Maxpolydegree):
    +    X[:,degree] = x**degree
    +# We split the data in test and training data
    +X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)
    +
    +p = Maxpolydegree
    +I = np.eye(p,p)
    +# Decide which values of lambda to use
    +nlambdas = 6
    +MSEOwnRidgePredict = np.zeros(nlambdas)
    +MSERidgePredict = np.zeros(nlambdas)
    +lambdas = np.logspace(-4, 2, nlambdas)
    +for i in range(nlambdas):
    +    lmb = lambdas[i]
    +    OwnRidgeBeta = np.linalg.pinv(X_train.T @ X_train+lmb*I) @ X_train.T @ y_train
    +    # Note: we include the intercept column and no scaling
    +    RegRidge = linear_model.Ridge(lmb,fit_intercept=False)
    +    RegRidge.fit(X_train,y_train)
    +    # and then make the prediction
    +    ytildeOwnRidge = X_train @ OwnRidgeBeta
    +    ypredictOwnRidge = X_test @ OwnRidgeBeta
    +    ytildeRidge = RegRidge.predict(X_train)
    +    ypredictRidge = RegRidge.predict(X_test)
    +    MSEOwnRidgePredict[i] = MSE(y_test,ypredictOwnRidge)
    +    MSERidgePredict[i] = MSE(y_test,ypredictRidge)
    +    print("Beta values for own Ridge implementation")
    +    print(OwnRidgeBeta)
    +    print("Beta values for Scikit-Learn Ridge implementation")
    +    print(RegRidge.coef_)
    +    print("MSE values for own Ridge implementation")
    +    print(MSEOwnRidgePredict[i])
    +    print("MSE values for Scikit-Learn Ridge implementation")
    +    print(MSERidgePredict[i])
    +
    +# Now plot the results
    +plt.figure()
    +plt.plot(np.log10(lambdas), MSEOwnRidgePredict, 'r', label = 'MSE own Ridge Test')
    +plt.plot(np.log10(lambdas), MSERidgePredict, 'g', label = 'MSE Ridge Test')
    +
    +plt.xlabel('log10(lambda)')
    +plt.ylabel('MSE')
    +plt.legend()
    +plt.show()
    +
    +
    +
    +
    +
    Beta values for own Ridge implementation
    +[ 1.03032441e+00  6.28336218e-02 -6.24175744e-01  5.21169159e-02
    +  2.80847477e-01  2.12552073e-01  8.13220609e-02 -1.69634577e-02
    + -6.50846112e-02 -7.38962192e-02 -5.94226022e-02 -3.50227564e-02
    + -9.80609614e-03  1.08299273e-02  2.41882037e-02  2.93492130e-02
    +  2.64742912e-02  1.63249532e-02 -5.01831250e-05 -2.15098090e-02]
    +Beta values for Scikit-Learn Ridge implementation
    +[ 1.03032441e+00  6.28336218e-02 -6.24175744e-01  5.21169159e-02
    +  2.80847477e-01  2.12552073e-01  8.13220608e-02 -1.69634577e-02
    + -6.50846112e-02 -7.38962192e-02 -5.94226022e-02 -3.50227564e-02
    + -9.80609615e-03  1.08299273e-02  2.41882037e-02  2.93492130e-02
    +  2.64742912e-02  1.63249532e-02 -5.01831152e-05 -2.15098090e-02]
    +MSE values for own Ridge implementation
    +4.3632959273186007e-07
    +MSE values for Scikit-Learn Ridge implementation
    +4.363295916523824e-07
    +Beta values for own Ridge implementation
    +[ 1.03630548 -0.01963611 -0.37900111 -0.07062318  0.12182967  0.16343471
    +  0.13003291  0.07490892  0.02365049 -0.01449782 -0.03814292 -0.04909093
    + -0.05009826 -0.04389027 -0.03279636 -0.01866537 -0.00289724  0.01348565
    +  0.02976145  0.04543942]
    +Beta values for Scikit-Learn Ridge implementation
    +[ 1.03630548 -0.01963611 -0.37900111 -0.07062318  0.12182967  0.16343471
    +  0.13003291  0.07490892  0.02365049 -0.01449782 -0.03814292 -0.04909093
    + -0.05009826 -0.04389027 -0.03279636 -0.01866537 -0.00289724  0.01348565
    +  0.02976145  0.04543942]
    +MSE values for own Ridge implementation
    +5.194042826640948e-06
    +MSE values for Scikit-Learn Ridge implementation
    +5.194042826840599e-06
    +Beta values for own Ridge implementation
    +[ 1.04220758 -0.10931453 -0.17641709 -0.06020587  0.02208512  0.05789007
    +  0.06491736  0.05785343  0.04537385  0.03196357  0.01969145  0.00934499
    +  0.00107405 -0.00526348 -0.00992331 -0.01318643 -0.01531845 -0.01655318
    + -0.01708852 -0.01708781]
    +Beta values for Scikit-Learn Ridge implementation
    +[ 1.04220758 -0.10931453 -0.17641709 -0.06020587  0.02208512  0.05789007
    +  0.06491736  0.05785343  0.04537385  0.03196357  0.01969145  0.00934499
    +  0.00107405 -0.00526348 -0.00992331 -0.01318643 -0.01531845 -0.01655318
    + -0.01708852 -0.01708781]
    +MSE values for own Ridge implementation
    +2.094082198961287e-05
    +MSE values for Scikit-Learn Ridge implementation
    +2.0940821989631478e-05
    +Beta values for own Ridge implementation
    +[ 1.01219292 -0.06043581 -0.10391807 -0.05651951 -0.01898855  0.00312361
    +  0.01463049  0.01975848  0.02123176  0.02068067  0.01905883  0.01691985
    +  0.01458337  0.01223198  0.00996754  0.00784393  0.00588657  0.00410387
    +  0.00249435  0.00105081]
    +Beta values for Scikit-Learn Ridge implementation
    +[ 1.01219292 -0.06043581 -0.10391807 -0.05651951 -0.01898855  0.00312361
    +  0.01463049  0.01975848  0.02123176  0.02068067  0.01905883  0.01691985
    +  0.01458337  0.01223198  0.00996754  0.00784393  0.00588657  0.00410387
    +  0.00249435  0.00105081]
    +MSE values for own Ridge implementation
    +0.00031535148309579146
    +MSE values for Scikit-Learn Ridge implementation
    +0.00031535148309581185
    +Beta values for own Ridge implementation
    +[ 8.38916861e-01  1.31276579e-01  8.97497404e-03 -1.72271878e-02
    + -2.11744554e-02 -1.91492986e-02 -1.57201944e-02 -1.23002365e-02
    + -9.30466214e-03 -6.81048318e-03 -4.78184120e-03 -3.15130074e-03
    + -1.84923989e-03 -8.13661243e-04  7.46984697e-06  6.56636616e-04
    +  1.16805821e-03  1.56912044e-03  1.88168312e-03  2.12318726e-03]
    +Beta values for Scikit-Learn Ridge implementation
    +[ 8.38916861e-01  1.31276579e-01  8.97497404e-03 -1.72271878e-02
    + -2.11744554e-02 -1.91492986e-02 -1.57201944e-02 -1.23002365e-02
    + -9.30466214e-03 -6.81048318e-03 -4.78184120e-03 -3.15130074e-03
    + -1.84923989e-03 -8.13661243e-04  7.46984697e-06  6.56636616e-04
    +  1.16805821e-03  1.56912044e-03  1.88168312e-03  2.12318726e-03]
    +MSE values for own Ridge implementation
    +0.01507238889517716
    +MSE values for Scikit-Learn Ridge implementation
    +0.015072388895177083
    +Beta values for own Ridge implementation
    +[0.37396662 0.14174745 0.0764924  0.04892055 0.03447512 0.02586427
    + 0.02024962 0.01633913 0.01347916 0.0113104  0.0096208  0.00827728
    + 0.00719176 0.00630331 0.00556826 0.0049544  0.00443743 0.0039987
    + 0.0036237  0.003301  ]
    +Beta values for Scikit-Learn Ridge implementation
    +[0.37396662 0.14174745 0.0764924  0.04892055 0.03447512 0.02586427
    + 0.02024962 0.01633913 0.01347916 0.0113104  0.0096208  0.00827728
    + 0.00719176 0.00630331 0.00556826 0.0049544  0.00443743 0.0039987
    + 0.0036237  0.003301  ]
    +MSE values for own Ridge implementation
    +0.2640931530791003
    +MSE values for Scikit-Learn Ridge implementation
    +0.26409315307910036
    +
    +
    +_images/chapter3_118_1.png +
    +
    +

    The results here agree when we force Scikit-Learn’s Ridge function to include the first column in our design matrix. +We see that the results agree very well. Here we have thus explicitely included the intercept column in the design matrix. +What happens if we do not include the intercept in our fit? +Let us see how we can change this code by zero centering.

    +
    +
    +
    import numpy as np
    +import pandas as pd
    +import matplotlib.pyplot as plt
    +from sklearn.model_selection import train_test_split
    +from sklearn import linear_model
    +from sklearn.preprocessing import StandardScaler
    +
    +def MSE(y_data,y_model):
    +    n = np.size(y_model)
    +    return np.sum((y_data-y_model)**2)/n
    +# A seed just to ensure that the random numbers are the same for every run.
    +# Useful for eventual debugging.
    +np.random.seed(315)
    +
    +n = 100
    +x = np.random.rand(n)
    +y = np.exp(-x**2) + 1.5 * np.exp(-(x-2)**2)
    +
    +Maxpolydegree = 20
    +X = np.zeros((n,Maxpolydegree-1))
    +
    +for degree in range(1,Maxpolydegree): #No intercept column
    +    X[:,degree-1] = x**(degree)
    +
    +# We split the data in test and training data
    +X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)
    +
    +#For our own implementation, we will need to deal with the intercept by centering the design matrix and the target variable
    +X_train_mean = np.mean(X_train,axis=0)
    +#Center by removing mean from each feature
    +X_train_scaled = X_train - X_train_mean 
    +X_test_scaled = X_test - X_train_mean
    +#The model intercept (called y_scaler) is given by the mean of the target variable (IF X is centered)
    +#Remove the intercept from the training data.
    +y_scaler = np.mean(y_train)           
    +y_train_scaled = y_train - y_scaler   
    +
    +p = Maxpolydegree-1
    +I = np.eye(p,p)
    +# Decide which values of lambda to use
    +nlambdas = 6
    +MSEOwnRidgePredict = np.zeros(nlambdas)
    +MSERidgePredict = np.zeros(nlambdas)
    +
    +lambdas = np.logspace(-4, 2, nlambdas)
    +for i in range(nlambdas):
    +    lmb = lambdas[i]
    +    OwnRidgeBeta = np.linalg.pinv(X_train_scaled.T @ X_train_scaled+lmb*I) @ X_train_scaled.T @ (y_train_scaled)
    +    intercept_ = y_scaler - X_train_mean@OwnRidgeBeta #The intercept can be shifted so the model can predict on uncentered data
    +    #Add intercept to prediction
    +    ypredictOwnRidge = X_test @ OwnRidgeBeta + intercept_ 
    +    #Add intercept to prediction
    +    ypredictOwnRidge = X_test_scaled @ OwnRidgeBeta + y_scaler 
    +    RegRidge = linear_model.Ridge(lmb)
    +    RegRidge.fit(X_train,y_train)
    +    ypredictRidge = RegRidge.predict(X_test)
    +    MSEOwnRidgePredict[i] = MSE(y_test,ypredictOwnRidge)
    +    MSERidgePredict[i] = MSE(y_test,ypredictRidge)
    +    print("Beta values for own Ridge implementation")
    +    print(OwnRidgeBeta) #Intercept is given by mean of target variable
    +    print("Beta values for Scikit-Learn Ridge implementation")
    +    print(RegRidge.coef_)
    +    print('Intercept from own implementation:')
    +    print(intercept_)
    +    print('Intercept from Scikit-Learn Ridge implementation')
    +    print(RegRidge.intercept_)
    +    print("MSE values for own Ridge implementation")
    +    print(MSEOwnRidgePredict[i])
    +    print("MSE values for Scikit-Learn Ridge implementation")
    +    print(MSERidgePredict[i])
    +
    +
    +# Now plot the results
    +plt.figure()
    +plt.plot(np.log10(lambdas), MSEOwnRidgePredict, 'b--', label = 'MSE own Ridge Test')
    +plt.plot(np.log10(lambdas), MSERidgePredict, 'g--', label = 'MSE SL Ridge Test')
    +plt.xlabel('log10(lambda)')
    +plt.ylabel('MSE')
    +plt.legend()
    +plt.show()
    +
    +
    +
    +
    +
    Beta values for own Ridge implementation
    +[ 3.43579948e-02 -5.43330971e-01 -3.10141414e-03  2.47116868e-01
    +  2.18613217e-01  1.02054837e-01 -4.25617662e-04 -5.90475506e-02
    + -7.68534263e-02 -6.68929213e-02 -4.24906604e-02 -1.40927184e-02
    +  1.11482289e-02  2.88529063e-02  3.67047975e-02  3.38135733e-02
    +  2.02198702e-02 -3.46383924e-03 -3.63025821e-02]
    +Beta values for Scikit-Learn Ridge implementation
    +[ 3.43579948e-02 -5.43330971e-01 -3.10141413e-03  2.47116868e-01
    +  2.18613217e-01  1.02054837e-01 -4.25617658e-04 -5.90475506e-02
    + -7.68534263e-02 -6.68929213e-02 -4.24906604e-02 -1.40927184e-02
    +  1.11482289e-02  2.88529063e-02  3.67047975e-02  3.38135733e-02
    +  2.02198702e-02 -3.46383925e-03 -3.63025821e-02]
    +Intercept from own implementation:
    +1.0330308045181225
    +Intercept from Scikit-Learn Ridge implementation
    +1.033030804518383
    +MSE values for own Ridge implementation
    +3.139255958275475e-06
    +MSE values for Scikit-Learn Ridge implementation
    +3.139255958572018e-06
    +Beta values for own Ridge implementation
    +[-0.05807125 -0.29822833 -0.08551306  0.08156108  0.13679863  0.12333649
    +  0.08251519  0.03815288  0.00111756 -0.02498832 -0.04010697 -0.04566964
    + -0.04355837 -0.03562355 -0.02348765 -0.00848904  0.00831018  0.0260906
    +  0.04423486]
    +Beta values for Scikit-Learn Ridge implementation
    +[-0.05807125 -0.29822833 -0.08551306  0.08156108  0.13679863  0.12333649
    +  0.08251519  0.03815288  0.00111756 -0.02498832 -0.04010697 -0.04566964
    + -0.04355837 -0.03562355 -0.02348765 -0.00848904  0.00831018  0.0260906
    +  0.04423486]
    +Intercept from own implementation:
    +1.0411487294305548
    +Intercept from Scikit-Learn Ridge implementation
    +1.0411487294305266
    +MSE values for own Ridge implementation
    +1.9601304850163794e-05
    +MSE values for Scikit-Learn Ridge implementation
    +1.9601304850085328e-05
    +Beta values for own Ridge implementation
    +[-0.1416398  -0.14021063 -0.05383795  0.01367553  0.04784395  0.05796251
    +  0.05447415  0.044613    0.03267527  0.02098261  0.01066519  0.00217499
    + -0.00440346 -0.00917248 -0.01231917 -0.01405935 -0.0146081  -0.01416528
    + -0.01290947]
    +Beta values for Scikit-Learn Ridge implementation
    +[-0.1416398  -0.14021063 -0.05383795  0.01367553  0.04784395  0.05796251
    +  0.05447415  0.044613    0.03267527  0.02098261  0.01066519  0.00217499
    + -0.00440346 -0.00917248 -0.01231917 -0.01405935 -0.0146081  -0.01416528
    + -0.01290947]
    +Intercept from own implementation:
    +1.0495569966278282
    +Intercept from Scikit-Learn Ridge implementation
    +1.0495569966278269
    +MSE values for own Ridge implementation
    +5.4959161509370406e-05
    +MSE values for Scikit-Learn Ridge implementation
    +5.4959161509366834e-05
    +Beta values for own Ridge implementation
    +[-0.13535942 -0.08593216 -0.03568439 -0.0036367   0.01397146  0.02229529
    +  0.02503753  0.0245528   0.02228115  0.01908936  0.01549377  0.01179792
    +  0.00817631  0.00472512  0.00149311 -0.00149956 -0.00424967 -0.00676387
    + -0.00905423]
    +Beta values for Scikit-Learn Ridge implementation
    +[-0.13535942 -0.08593216 -0.03568439 -0.0036367   0.01397146  0.02229529
    +  0.02503753  0.0245528   0.02228115  0.01908936  0.01549377  0.01179792
    +  0.00817631  0.00472512  0.00149311 -0.00149956 -0.00424967 -0.00676387
    + -0.00905423]
    +Intercept from own implementation:
    +1.039967668952797
    +Intercept from Scikit-Learn Ridge implementation
    +1.0399676689527975
    +MSE values for own Ridge implementation
    +7.571105947979326e-05
    +MSE values for Scikit-Learn Ridge implementation
    +7.57110594797945e-05
    +Beta values for own Ridge implementation
    +[-0.05100875 -0.04063602 -0.02723445 -0.01713366 -0.0100706  -0.00517114
    + -0.00174276  0.00068734  0.00243186  0.00369758  0.00462287  0.0053018
    +  0.00579953  0.006162    0.00642221  0.00660427  0.00672607  0.0068011
    +  0.00683964]
    +Beta values for Scikit-Learn Ridge implementation
    +[-0.05100875 -0.04063602 -0.02723445 -0.01713366 -0.0100706  -0.00517114
    + -0.00174276  0.00068734  0.00243186  0.00369758  0.00462287  0.0053018
    +  0.00579953  0.006162    0.00642221  0.00660427  0.00672607  0.0068011
    +  0.00683964]
    +Intercept from own implementation:
    +0.999955585168597
    +Intercept from Scikit-Learn Ridge implementation
    +0.999955585168597
    +MSE values for own Ridge implementation
    +0.0007698473260556339
    +MSE values for Scikit-Learn Ridge implementation
    +0.000769847326055633
    +Beta values for own Ridge implementation
    +[-0.00834567 -0.00803064 -0.00673407 -0.00554552 -0.00458878 -0.0038335
    + -0.00323332 -0.00274989 -0.0023548  -0.00202756 -0.00175331 -0.00152117
    + -0.001323   -0.0011526  -0.00100519 -0.00087697 -0.00076495 -0.00066668
    + -0.00058016]
    +Beta values for Scikit-Learn Ridge implementation
    +[-0.00834567 -0.00803064 -0.00673407 -0.00554552 -0.00458878 -0.0038335
    + -0.00323332 -0.00274989 -0.0023548  -0.00202756 -0.00175331 -0.00152117
    + -0.001323   -0.0011526  -0.00100519 -0.00087697 -0.00076495 -0.00066668
    + -0.00058016]
    +Intercept from own implementation:
    +0.9637117593816477
    +Intercept from Scikit-Learn Ridge implementation
    +0.9637117593816477
    +MSE values for own Ridge implementation
    +0.0023813163025848865
    +MSE values for Scikit-Learn Ridge implementation
    +0.002381316302584886
    +
    +
    +_images/chapter3_120_1.png +
    +
    +

    We see here, when compared to the code which includes explicitely the +intercept column, that our MSE value is actually smaller. This is +because the regularization term does not include the intercept value +\(\beta_0\) in the fitting. This applies to Lasso regularization as +well. It means that our optimization is now done only with the +centered matrix and/or vector that enter the fitting procedure. Note +also that the problem with the intercept occurs mainly in these type +of polynomial fitting problem.

    +

    The next example is indeed an example where all these discussions about the role of intercept are not present.

    +
    +
    +

    5.7. More complicated Example: The Ising model

    +

    The one-dimensional Ising model with nearest neighbor interaction, no +external field and a constant coupling constant \(J\) is given by

    + +
    +
    +\[ +\begin{equation} + H = -J \sum_{k}^L s_k s_{k + 1}, +\label{_auto1} \tag{1} +\end{equation} +\]
    +

    where \(s_i \in \{-1, 1\}\) and \(s_{N + 1} = s_1\). The number of spins +in the system is determined by \(L\). For the one-dimensional system +there is no phase transition.

    +

    We will look at a system of \(L = 40\) spins with a coupling constant of +\(J = 1\). To get enough training data we will generate 10000 states +with their respective energies.

    +
    +
    +
    import numpy as np
    +import matplotlib.pyplot as plt
    +from mpl_toolkits.axes_grid1 import make_axes_locatable
    +import seaborn as sns
    +import scipy.linalg as scl
    +from sklearn.model_selection import train_test_split
    +import tqdm
    +sns.set(color_codes=True)
    +cmap_args=dict(vmin=-1., vmax=1., cmap='seismic')
    +
    +L = 40
    +n = int(1e4)
    +
    +spins = np.random.choice([-1, 1], size=(n, L))
    +J = 1.0
    +
    +energies = np.zeros(n)
    +
    +for i in range(n):
    +    energies[i] = - J * np.dot(spins[i], np.roll(spins[i], 1))
    +
    +
    +
    +
    +

    Here we use ordinary least squares +regression to predict the energy for the nearest neighbor +one-dimensional Ising model on a ring, i.e., the endpoints wrap +around. We will use linear regression to fit a value for +the coupling constant to achieve this.

    +

    A more general form for the one-dimensional Ising model is

    + +
    +
    +\[ +\begin{equation} + H = - \sum_j^L \sum_k^L s_j s_k J_{jk}. +\label{_auto2} \tag{2} +\end{equation} +\]
    +

    Here we allow for interactions beyond the nearest neighbors and a state dependent +coupling constant. This latter expression can be formulated as +a matrix-product

    + +
    +
    +\[ +\begin{equation} + \boldsymbol{H} = \boldsymbol{X} J, +\label{_auto3} \tag{3} +\end{equation} +\]
    +

    where \(X_{jk} = s_j s_k\) and \(J\) is a matrix which consists of the +elements \(-J_{jk}\). This form of writing the energy fits perfectly +with the form utilized in linear regression, that is

    + +
    +
    +\[ +\begin{equation} + \boldsymbol{y} = \boldsymbol{X}\boldsymbol{\beta} + \boldsymbol{\epsilon}, +\label{_auto4} \tag{4} +\end{equation} +\]
    +

    We split the data in training and test data as discussed in the previous example

    +
    +
    +
    X = np.zeros((n, L ** 2))
    +for i in range(n):
    +    X[i] = np.outer(spins[i], spins[i]).ravel()
    +y = energies
    +X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)
    +
    +
    +
    +
    +

    In the ordinary least squares method we choose the cost function

    + +
    +
    +\[ +\begin{equation} + C(\boldsymbol{X}, \boldsymbol{\beta})= \frac{1}{n}\left\{(\boldsymbol{X}\boldsymbol{\beta} - \boldsymbol{y})^T(\boldsymbol{X}\boldsymbol{\beta} - \boldsymbol{y})\right\}. +\label{_auto5} \tag{5} +\end{equation} +\]
    +

    We then find the extremal point of \(C\) by taking the derivative with respect to \(\boldsymbol{\beta}\) as discussed above. +This yields the expression for \(\boldsymbol{\beta}\) to be

    +
    +\[ +\boldsymbol{\beta} = \frac{\boldsymbol{X}^T \boldsymbol{y}}{\boldsymbol{X}^T \boldsymbol{X}}, +\]
    +

    which immediately imposes some requirements on \(\boldsymbol{X}\) as there must exist +an inverse of \(\boldsymbol{X}^T \boldsymbol{X}\). If the expression we are modeling contains an +intercept, i.e., a constant term, we must make sure that the +first column of \(\boldsymbol{X}\) consists of \(1\). We do this here

    +
    +
    +
    X_train_own = np.concatenate(
    +    (np.ones(len(X_train))[:, np.newaxis], X_train),
    +    axis=1
    +)
    +X_test_own = np.concatenate(
    +    (np.ones(len(X_test))[:, np.newaxis], X_test),
    +    axis=1
    +)
    +
    +
    +
    +
    +

    Doing the inversion directly turns out to be a bad idea since the matrix +\(\boldsymbol{X}^T\boldsymbol{X}\) is singular. An alternative approach is to use the singular +value decomposition. Using the definition of the Moore-Penrose +pseudoinverse we can write the equation for \(\boldsymbol{\beta}\) as

    +
    +\[ +\boldsymbol{\beta} = \boldsymbol{X}^{+}\boldsymbol{y}, +\]
    +

    where the pseudoinverse of \(\boldsymbol{X}\) is given by

    +
    +\[ +\boldsymbol{X}^{+} = \frac{\boldsymbol{X}^T}{\boldsymbol{X}^T\boldsymbol{X}}. +\]
    +

    Using singular value decomposition we can decompose the matrix \(\boldsymbol{X} = \boldsymbol{U}\boldsymbol{\Sigma} \boldsymbol{V}^T\), +where \(\boldsymbol{U}\) and \(\boldsymbol{V}\) are orthogonal(unitary) matrices and \(\boldsymbol{\Sigma}\) contains the singular values (more details below). +where \(X^{+} = V\Sigma^{+} U^T\). This reduces the equation for +\(\omega\) to

    + +
    +
    +\[ +\begin{equation} + \boldsymbol{\beta} = \boldsymbol{V}\boldsymbol{\Sigma}^{+} \boldsymbol{U}^T \boldsymbol{y}. +\label{_auto6} \tag{6} +\end{equation} +\]
    +

    Note that solving this equation by actually doing the pseudoinverse +(which is what we will do) is not a good idea as this operation scales +as \(\mathcal{O}(n^3)\), where \(n\) is the number of elements in a +general matrix. Instead, doing \(QR\)-factorization and solving the +linear system as an equation would reduce this down to +\(\mathcal{O}(n^2)\) operations.

    +
    +
    +
    def ols_svd(x: np.ndarray, y: np.ndarray) -> np.ndarray:
    +    u, s, v = scl.svd(x)
    +    return v.T @ scl.pinv(scl.diagsvd(s, u.shape[0], v.shape[0])) @ u.T @ y
    +
    +
    +
    +
    +
    +
    +
    beta = ols_svd(X_train_own,y_train)
    +
    +
    +
    +
    +

    When extracting the \(J\)-matrix we need to make sure that we remove the intercept, as is done here

    +
    +
    +
    J = beta[1:].reshape(L, L)
    +
    +
    +
    +
    +

    A way of looking at the coefficients in \(J\) is to plot the matrices as images.

    +
    +
    +
    fig = plt.figure(figsize=(20, 14))
    +im = plt.imshow(J, **cmap_args)
    +plt.title("OLS", fontsize=18)
    +plt.xticks(fontsize=18)
    +plt.yticks(fontsize=18)
    +cb = fig.colorbar(im)
    +cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)
    +plt.show()
    +
    +
    +
    +
    +
    <ipython-input-22-6f7a6bd7d79f>:7: UserWarning: FixedFormatter should only be used together with FixedLocator
    +  cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)
    +
    +
    +_images/chapter3_151_1.png +
    +
    +

    It is interesting to note that OLS +considers both \(J_{j, j + 1} = -0.5\) and \(J_{j, j - 1} = -0.5\) as +valid matrix elements for \(J\). +In our discussion below on hyperparameters and Ridge and Lasso regression we will see that +this problem can be removed, partly and only with Lasso regression.

    +

    In this case our matrix inversion was actually possible. The obvious question now is what is the mathematics behind the SVD?

    +

    Let us now +focus on Ridge and Lasso regression as well. We repeat some of the +basic parts of the Ising model and the setup of the training and test +data. The one-dimensional Ising model with nearest neighbor +interaction, no external field and a constant coupling constant \(J\) is +given by

    + +
    +
    +\[ +\begin{equation} + H = -J \sum_{k}^L s_k s_{k + 1}, +\label{_auto7} \tag{7} +\end{equation} +\]
    +

    where \(s_i \in \{-1, 1\}\) and \(s_{N + 1} = s_1\). The number of spins in the system is determined by \(L\). For the one-dimensional system there is no phase transition.

    +

    We will look at a system of \(L = 40\) spins with a coupling constant of \(J = 1\). To get enough training data we will generate 10000 states with their respective energies.

    +
    +
    +
    import numpy as np
    +import matplotlib.pyplot as plt
    +from mpl_toolkits.axes_grid1 import make_axes_locatable
    +import seaborn as sns
    +import scipy.linalg as scl
    +from sklearn.model_selection import train_test_split
    +import sklearn.linear_model as skl
    +import tqdm
    +sns.set(color_codes=True)
    +cmap_args=dict(vmin=-1., vmax=1., cmap='seismic')
    +
    +L = 40
    +n = int(1e4)
    +
    +spins = np.random.choice([-1, 1], size=(n, L))
    +J = 1.0
    +
    +energies = np.zeros(n)
    +
    +for i in range(n):
    +    energies[i] = - J * np.dot(spins[i], np.roll(spins[i], 1))
    +
    +
    +
    +
    +

    A more general form for the one-dimensional Ising model is

    + +
    +
    +\[ +\begin{equation} + H = - \sum_j^L \sum_k^L s_j s_k J_{jk}. +\label{_auto8} \tag{8} +\end{equation} +\]
    +

    Here we allow for interactions beyond the nearest neighbors and a more +adaptive coupling matrix. This latter expression can be formulated as +a matrix-product on the form

    + +
    +
    +\[ +\begin{equation} + H = X J, +\label{_auto9} \tag{9} +\end{equation} +\]
    +

    where \(X_{jk} = s_j s_k\) and \(J\) is the matrix consisting of the +elements \(-J_{jk}\). This form of writing the energy fits perfectly +with the form utilized in linear regression, viz.

    + +
    +
    +\[ +\begin{equation} + \boldsymbol{y} = \boldsymbol{X}\boldsymbol{\beta} + \boldsymbol{\epsilon}. +\label{_auto10} \tag{10} +\end{equation} +\]
    +

    We organize the data as we did above

    +
    +
    +
    X = np.zeros((n, L ** 2))
    +for i in range(n):
    +    X[i] = np.outer(spins[i], spins[i]).ravel()
    +y = energies
    +X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.96)
    +
    +X_train_own = np.concatenate(
    +    (np.ones(len(X_train))[:, np.newaxis], X_train),
    +    axis=1
    +)
    +
    +X_test_own = np.concatenate(
    +    (np.ones(len(X_test))[:, np.newaxis], X_test),
    +    axis=1
    +)
    +
    +
    +
    +
    +

    We will do all fitting with Scikit-Learn,

    +
    +
    +
    clf = skl.LinearRegression().fit(X_train, y_train)
    +
    +
    +
    +
    +

    When extracting the \(J\)-matrix we make sure to remove the intercept

    +
    +
    +
    J_sk = clf.coef_.reshape(L, L)
    +
    +
    +
    +
    +

    And then we plot the results

    +
    +
    +
    fig = plt.figure(figsize=(20, 14))
    +im = plt.imshow(J_sk, **cmap_args)
    +plt.title("LinearRegression from Scikit-learn", fontsize=18)
    +plt.xticks(fontsize=18)
    +plt.yticks(fontsize=18)
    +cb = fig.colorbar(im)
    +cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)
    +plt.show()
    +
    +
    +
    +
    +
    <ipython-input-27-5dd54edf2138>:7: UserWarning: FixedFormatter should only be used together with FixedLocator
    +  cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)
    +
    +
    +_images/chapter3_169_1.png +
    +
    +

    The results agree perfectly with our previous discussion where we used our own code.

    +

    Having explored the ordinary least squares we move on to ridge +regression. In ridge regression we include a regularizer. This +involves a new cost function which leads to a new estimate for the +weights \(\boldsymbol{\beta}\). This results in a penalized regression problem. The +cost function is given by

    +

    6 +0

    +

    < +< +< +! +! +M +A +T +H +_ +B +L +O +C +K

    +
    +
    +
    _lambda = 0.1
    +clf_ridge = skl.Ridge(alpha=_lambda).fit(X_train, y_train)
    +J_ridge_sk = clf_ridge.coef_.reshape(L, L)
    +fig = plt.figure(figsize=(20, 14))
    +im = plt.imshow(J_ridge_sk, **cmap_args)
    +plt.title("Ridge from Scikit-learn", fontsize=18)
    +plt.xticks(fontsize=18)
    +plt.yticks(fontsize=18)
    +cb = fig.colorbar(im)
    +cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)
    +
    +plt.show()
    +
    +
    +
    +
    +
    <ipython-input-28-fe5b9d300cc0>:10: UserWarning: FixedFormatter should only be used together with FixedLocator
    +  cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)
    +
    +
    +_images/chapter3_172_1.png +
    +
    +

    In the Least Absolute Shrinkage and Selection Operator (LASSO)-method we get a third cost function.

    + +
    +
    +\[ +\begin{equation} + C(\boldsymbol{X}, \boldsymbol{\beta}; \lambda) = (\boldsymbol{X}\boldsymbol{\beta} - \boldsymbol{y})^T(\boldsymbol{X}\boldsymbol{\beta} - \boldsymbol{y}) + \lambda \sqrt{\boldsymbol{\beta}^T\boldsymbol{\beta}}. +\label{_auto12} \tag{12} +\end{equation} +\]
    +

    Finding the extremal point of this cost function is not so straight-forward as in least squares and ridge. We will therefore rely solely on the function Lasso from Scikit-Learn.

    +
    +
    +
    clf_lasso = skl.Lasso(alpha=_lambda).fit(X_train, y_train)
    +J_lasso_sk = clf_lasso.coef_.reshape(L, L)
    +fig = plt.figure(figsize=(20, 14))
    +im = plt.imshow(J_lasso_sk, **cmap_args)
    +plt.title("Lasso from Scikit-learn", fontsize=18)
    +plt.xticks(fontsize=18)
    +plt.yticks(fontsize=18)
    +cb = fig.colorbar(im)
    +cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)
    +
    +plt.show()
    +
    +
    +
    +
    +
    <ipython-input-29-25845e8df859>:9: UserWarning: FixedFormatter should only be used together with FixedLocator
    +  cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)
    +
    +
    +_images/chapter3_176_1.png +
    +
    +

    It is quite striking how LASSO breaks the symmetry of the coupling +constant as opposed to ridge and OLS. We get a sparse solution with +\(J_{j, j + 1} = -1\).

    +

    We see how the different models perform for a different set of values for \(\lambda\).

    +
    +
    +
    lambdas = np.logspace(-4, 5, 10)
    +
    +train_errors = {
    +    "ols_sk": np.zeros(lambdas.size),
    +    "ridge_sk": np.zeros(lambdas.size),
    +    "lasso_sk": np.zeros(lambdas.size)
    +}
    +
    +test_errors = {
    +    "ols_sk": np.zeros(lambdas.size),
    +    "ridge_sk": np.zeros(lambdas.size),
    +    "lasso_sk": np.zeros(lambdas.size)
    +}
    +
    +plot_counter = 1
    +
    +fig = plt.figure(figsize=(32, 54))
    +
    +for i, _lambda in enumerate(tqdm.tqdm(lambdas)):
    +    for key, method in zip(
    +        ["ols_sk", "ridge_sk", "lasso_sk"],
    +        [skl.LinearRegression(), skl.Ridge(alpha=_lambda), skl.Lasso(alpha=_lambda)]
    +    ):
    +        method = method.fit(X_train, y_train)
    +
    +        train_errors[key][i] = method.score(X_train, y_train)
    +        test_errors[key][i] = method.score(X_test, y_test)
    +
    +        omega = method.coef_.reshape(L, L)
    +
    +        plt.subplot(10, 5, plot_counter)
    +        plt.imshow(omega, **cmap_args)
    +        plt.title(r"%s, $\lambda = %.4f$" % (key, _lambda))
    +        plot_counter += 1
    +
    +plt.show()
    +
    +
    +
    +
    +
      0%|          | 0/10 [00:00<?, ?it/s]
    +
    +
    +
    /Users/mhjensen/opt/anaconda3/lib/python3.8/site-packages/sklearn/linear_model/_coordinate_descent.py:529: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations. Duality gap: 3.924197515789051, tolerance: 1.796796
    +  model = cd_fast.enet_coordinate_descent(
    +
    + 10%|█         | 1/10 [00:00<00:04,  2.06it/s]
    +
    +
    +
     20%|██        | 2/10 [00:00<00:03,  2.39it/s]
    +
    +
    +
     30%|███       | 3/10 [00:00<00:02,  3.03it/s]
    +
    +
    +
     40%|████      | 4/10 [00:00<00:01,  3.75it/s]
    +
    +
    +
     50%|█████     | 5/10 [00:01<00:01,  4.51it/s]
    +
    +
    +
     60%|██████    | 6/10 [00:01<00:00,  5.17it/s]
    +
    +
    +
     70%|███████   | 7/10 [00:01<00:00,  5.94it/s]
    +
    +
    +
     80%|████████  | 8/10 [00:01<00:00,  6.59it/s]
    +
    +
    +
     90%|█████████ | 9/10 [00:01<00:00,  7.10it/s]
    +
    +
    +
    100%|██████████| 10/10 [00:01<00:00,  7.07it/s]
    +
    +
    +
    100%|██████████| 10/10 [00:01<00:00,  5.83it/s]
    +
    +
    +
    
    +
    +
    +_images/chapter3_178_13.png +
    +
    +

    We see that LASSO reaches a good solution for low +values of \(\lambda\), but will “wither” when we increase \(\lambda\) too +much. Ridge is more stable over a larger range of values for +\(\lambda\), but eventually also fades away.

    +

    To determine which value of \(\lambda\) is best we plot the accuracy of +the models when predicting the training and the testing set. We expect +the accuracy of the training set to be quite good, but if the accuracy +of the testing set is much lower this tells us that we might be +subject to an overfit model. The ideal scenario is an accuracy on the +testing set that is close to the accuracy of the training set.

    +
    +
    +
    fig = plt.figure(figsize=(20, 14))
    +
    +colors = {
    +    "ols_sk": "r",
    +    "ridge_sk": "y",
    +    "lasso_sk": "c"
    +}
    +
    +for key in train_errors:
    +    plt.semilogx(
    +        lambdas,
    +        train_errors[key],
    +        colors[key],
    +        label="Train {0}".format(key),
    +        linewidth=4.0
    +    )
    +
    +for key in test_errors:
    +    plt.semilogx(
    +        lambdas,
    +        test_errors[key],
    +        colors[key] + "--",
    +        label="Test {0}".format(key),
    +        linewidth=4.0
    +    )
    +plt.legend(loc="best", fontsize=18)
    +plt.xlabel(r"$\lambda$", fontsize=18)
    +plt.ylabel(r"$R^2$", fontsize=18)
    +plt.tick_params(labelsize=18)
    +plt.show()
    +
    +
    +
    +
    +_images/chapter3_180_0.png +
    +
    +

    From the above figure we can see that LASSO with \(\lambda = 10^{-2}\) +achieves a very good accuracy on the test set. This by far surpasses the +other models for all values of \(\lambda\).

    +
    -

    5.6. Exercises and Projects

    +

    5.8. Exercises and Projects

    The main aim of this project is to study in more detail various regression methods, including the Ordinary Least Squares (OLS) method, The total score is 100 points. Each subtask has its own final score.

    @@ -1825,11 +3097,11 @@ which polynomial fits the data best.

    -_images/chapter3_78_0.png +_images/chapter3_184_0.png
    -

    5.6.1. Exercise: Ordinary Least Square (OLS) on the Franke function

    +

    5.8.1. Exercise: Ordinary Least Square (OLS) on the Franke function

    We will generate our own dataset for a function \(\mathrm{FrankeFunction}(x,y)\) with \(x,y \in [0,1]\). The function \(f(x,y)\) is the Franke function. You should explore also the addition @@ -1874,7 +3146,7 @@ approximately \(2/3\) to You can easily reuse the solutions to your exercises from week 35 and week 36.

    -

    5.6.2. Exercise: Bias-variance trade-off and resampling techniques

    +

    5.8.2. Exercise: Bias-variance trade-off and resampling techniques

    Our aim here is to study the bias-variance trade-off by implementing the bootstrap resampling technique.

    With a code which does OLS and includes resampling techniques, we will now discuss the bias-variance trade-off in the context of @@ -1923,7 +3195,7 @@ of data points, and possibly also your training and test data using the

    Note also that when you calculate the bias, in all applications you don’t know the function values \(f_i\). You would hence replace them with the actual data points \(y_i\).

    -

    5.6.3. Exercise: Cross-validation as resampling techniques, adding more complexity

    +

    5.8.3. Exercise: Cross-validation as resampling techniques, adding more complexity

    The aim here is to write your own code for another widely popular resampling technique, the so-called cross-validation method. Again, before you start with cross-validation approach, you should scale your @@ -1938,7 +3210,7 @@ folds. You can also compare your own cross-validation code with the one provided by Scikit-Learn.

    -

    5.6.4. Exercise: Ridge Regression on the Franke function with resampling

    +

    5.8.4. Exercise: Ridge Regression on the Franke function with resampling

    Write your own code for the Ridge method, either using matrix inversion or the singular value decomposition as done in the previous exercise. Perform the same bootstrap analysis as in the @@ -1949,7 +3221,7 @@ dependence on \(\lambda\).

    the parameter \(\lambda\). For the bias-variance trade-off, use the bootstrap resampling method. Comment your results.

    -

    5.6.5. Exercise: Lasso Regression on the Franke function with resampling

    +

    5.8.5. Exercise: Lasso Regression on the Franke function with resampling

    This exercise is essentially a repeat of the previous two ones, but now with Lasso regression. Write either your own code (difficult and optional) or, in this case, you can also use the functionalities of Scikit-Learn (recommended). @@ -1958,7 +3230,7 @@ critical discussion of the three methods and a judgement of which model fits the data best. Perform here as well an analysis of the bias-variance trade-off using the bootstrap resampling technique and an analysis of the mean squared error using cross-validation.

    -

    5.6.6. Exercise: Analysis of real data

    +

    5.8.6. Exercise: Analysis of real data

    With our codes functioning and having been tested properly on a simpler function we are now ready to look at real data. We will essentially repeat in this exercise what was done in exercises 1-5. However, we @@ -1982,7 +3254,7 @@ Python program using

    ---------------------------------------------------------------------------
     NameError                                 Traceback (most recent call last)
    -<ipython-input-12-d985fb40c43d> in <module>
    +<ipython-input-33-d985fb40c43d> in <module>
     ----> 1 scipy.misc.imread
     
     NameError: name 'scipy' is not defined
    @@ -1994,21 +3266,23 @@ Python program using

    from such files

    -
    import numpy as np
    -from imageio import imread
    -import matplotlib.pyplot as plt
    -from mpl_toolkits.mplot3d import Axes3D
    -from matplotlib import cm
    +
    """
    +import numpy as np
    +from imageio import imread
    +import matplotlib.pyplot as plt
    +from mpl_toolkits.mplot3d import Axes3D
    +from matplotlib import cm
     
    -# Load the terrain
    -terrain1 = imread('SRTM_data_Norway_1.tif')
    -# Show the terrain
    -plt.figure()
    -plt.title('Terrain over Norway 1')
    -plt.imshow(terrain1, cmap='gray')
    -plt.xlabel('X')
    -plt.ylabel('Y')
    -plt.show()
    +# Load the terrain
    +terrain1 = imread('SRTM_data_Norway_1.tif')
    +# Show the terrain
    +plt.figure()
    +plt.title('Terrain over Norway 1')
    +plt.imshow(terrain1, cmap='gray')
    +plt.xlabel('X')
    +plt.ylabel('Y')
    +plt.show()
    +"""
     
    diff --git a/doc/LectureNotes/_build/html/schedule.html b/doc/LectureNotes/_build/html/schedule.html index cd20a5fcb..5202fa593 100644 --- a/doc/LectureNotes/_build/html/schedule.html +++ b/doc/LectureNotes/_build/html/schedule.html @@ -489,7 +489,11 @@

    Week 38 September 20-24

    • Lab Wednesday: Work on Project 1

    • -
    • Lecture Thursday: Classification problems and Logistic Regression, from binary cases to several categories

    • +
    • Lecture Thursday: Classification problems and Logistic Regression, from binary cases to several categories

      + +
    • Lecture Friday: Logistic Regression and gradient optimization

    • Reading recommendations:

        diff --git a/doc/LectureNotes/_build/html/searchindex.js b/doc/LectureNotes/_build/html/searchindex.js index 8d6889083..3510073c9 100644 --- a/doc/LectureNotes/_build/html/searchindex.js +++ b/doc/LectureNotes/_build/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({docnames:["Clustering","chapter1","chapter10","chapter2","chapter3","chapter4","chapter5","chapter6","chapter7","chapter8","chapter9","chapteroptimization","content","intro","linalg","schedule","statistics","teachers","textbooks"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":3,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":2,"sphinx.domains.rst":2,"sphinx.domains.std":1,"sphinx.ext.intersphinx":1,sphinx:56},filenames:["Clustering.ipynb","chapter1.ipynb","chapter10.ipynb","chapter2.ipynb","chapter3.ipynb","chapter4.ipynb","chapter5.ipynb","chapter6.ipynb","chapter7.ipynb","chapter8.ipynb","chapter9.ipynb","chapteroptimization.ipynb","content.md","intro.md","linalg.ipynb","schedule.md","statistics.ipynb","teachers.md","textbooks.md"],objects:{},objnames:{},objtypes:{},terms:{"000":2,"000000":[1,3,9],"00000000e":3,"0001":2,"00015921913736794912":7,"00019998":3,"00024087":3,"00029012":3,"0003451":3,"00034944":3,"00042089":3,"00050694":3,"00060728":4,"00061058":3,"00062588":4,"00068970":4,"00073541":3,"00076916":4,"00078806":4,"00079968":3,"00084589":4,"00085887":4,"00088573":3,"00092354":4,"00096314":3,"001":[2,6,11],"0010479246398391328":4,"00106677":3,"00109273":[],"00115999":3,"00118170":4,"00128479":3,"00137982":4,"00139705":3,"0015":4,"00154733":3,"00156372":4,"00168251":3,"00186347":3,"001880":3,"00200":6,"00202624":3,"00224413":3,"00228740":4,"00242998":4,"0024401":3,"00247083e":1,"00270244":3,"00293838":3,"00315593":4,"0032153180657605086":4,"0032542":3,"0032873138755776365":16,"0033955154592040936":4,"00353823":3,"003704":1,"003717":1,"003759":1,"003774":1,"003788":1,"00384936":[],"003909404072811237":4,"00391839":3,"004":3,"004091940707753964":4,"00410478":4,"004155986345861379":4,"00426027":3,"00433417":9,"004456043243408203":0,"00445655":9,"004579219539673833":4,"004610275230656537":4,"00471782":3,"00472199":4,"0049999999999999845":[],"004999999999999996":[],"004999999999999997":[],"0050000000000000044":[],"005000000000000007":1,"00512927":3,"0056799":3,"00607783":4,"00617499":3,"006530396683779109":1,"00683748":3,"006968283076248407":[],"007024126888936384":4,"00717152":11,"00727646693":1,"00728323e":[],"007315":1,"0074331":3,"00759119":4,"007789":[],"007824":1,"007931713723267314":[],"00813803":4,"008171076530362356":1,"00823002":3,"0086649156":1,"008675369724976777":3,"008885578722629236":[],"00890601":[],"00894639":3,"009154":1,"009163470508352228":3,"009164545680330616":4,"009735":9,"00973536":9,"009790":1,"009883615646716182":[],"009883615646716184":[],"009883615646716186":[],"009883615646716188":1,"00990475":3,"009911":1,"010018312644140933":4,"010331721306655588":4,"010516485576652981":4,"01057384067458835":[],"010679893512872646":[],"01076611":3,"0110":16,"011076219011390184":4,"011347":1,"01191824":3,"012073649480472317":4,"01210814993019007":[],"01295356":3,"01312157412031145":4,"0140617":[],"01433809":3,"01443680008897583":4,"01503674":[],"015037":[],"01514394":[],"015144":[],"01558197":3,"01628578269590588":4,"01640891":4,"016587414993048166":4,"0169643":3,"0170259":[],"01724499":3,"017355848195591973":4,"017665":3,"018232":1,"01825571":[],"01867234e":16,"01873344":9,"01873869":3,"01887348":[],"019":[],"01975416527163567":4,"02073509":3,"02096350e":1,"021544346900318832":[],"021592704588043153":4,"021592704588043167":4,"02161783e":16,"021901":9,"02190139":9,"02252765":3,"02299949826036597":4,"02492265":3,"02493044e":[],"02511518":4,"02522069":4,"02568378":[],"025709":[1,9],"02625193":6,"026605727637189085":4,"0266057276371891":4,"02707227":3,"02730126581656065":16,"027609773491022498":4,"027609773491022505":4,"02881304":[],"029":[],"029483":3,"029688":[],"02968834":[],"029733":1,"02994311":3,"02f":4,"03019554":[],"030196":[],"030670":[],"03067028":[],"03099776":3,"031":3,"03193199":[],"03251863":3,"03256632e":2,"03303359":[],"033037772005753835":[],"03308408":3,"03365768507152761":4,"034342":[],"0344707":[],"0354":[],"0359565":3,"03607832":[],"03652792":[],"036528":[],"03697069":[],"03707133":9,"03750367":14,"03781367141738898":4,"03781367141738899":4,"03787596148305236":1,"03791824e":16,"038300":[1,9],"03871832":[],"039039":3,"03929932":[],"040102":3,"04205220e":16,"04260073e":[],"04315108":3,"04330858":[],"04346721":3,"04421672e":[],"044334":1,"044402":1,"04455272":[],"044553":[],"04529095":[],"0458":7,"04648335":3,"04683565":3,"04757618e":[],"048187277304303125":4,"04829457939163212":16,"04912436":4,"051115":[],"051418":3,"051649":[1,9],"0517473":3,"05227921801205707":4,"05227921801205709":4,"052645":[],"05295709":4,"053053":[],"0530533":[],"05318162":[],"053182":[],"05364854":6,"053849":3,"05396545e":[],"054187":[],"054276":[],"0545103":[],"054674":[],"055":[],"055085":[],"05531364":[],"055314":[],"055529303095955385":3,"055676":1,"055744":[],"055774":[],"055831":[],"055887":[],"055916":[],"05614483":3,"056326":[],"056329":9,"056484":[],"057035":[],"057088709963637":1,"0571636815533073":4,"057320":[],"057332":[],"05755374":[],"057571":[],"057654":[],"057919":[],"05802766":[],"058178":[],"058247":[],"058282":[],"058719":[],"058805":[],"058856":3,"058892":[],"059225":[],"059245":[],"059344":9,"059406":[],"059455":[],"059531":[],"059571":[],"059680303635344434":[],"059765":[],"059806":[],"059865":[],"059908":[],"059994":[],"060064":9,"060070":9,"060308":[],"060335":[],"06041458e":[],"060520":[],"060748":3,"060919":[],"061164":[],"061176":[],"061255":[],"06126507e":16,"061330":[],"061601":9,"061652":[],"061774":[],"061783":3,"061842":[],"061855":[],"061896":[],"06200174":3,"062082386342319454":4,"06209126":[],"062188":[],"062327":[],"062376":[],"062639":[],"062659":[],"062660":9,"062731":[],"062822":[],"062829":[],"062879":[],"062885":[],"062923":9,"062979":[],"063055":[],"063097":[],"063114":3,"063122":[],"063178":9,"063190":[],"063324":9,"063395":[],"063415":[],"063523":[],"063526":[],"063615":[],"063670":[],"063727":[],"063759":[],"063763":[],"063880":[],"063882":[],"063925":[],"063982":[],"064000":[],"064013":[],"064075":[],"064078":[],"064101":[],"06412177e":16,"064156":[],"064257":[],"064273":[],"064304":[],"064354":[],"064357":[],"064393":[],"064410":[],"064449":[],"064472":[],"06453579006728317":4,"064591":[],"064647":[],"064648":9,"064686":[],"064689":[],"064783":9,"064795":[],"06492086e":[],"064929":[],"064958":[],"064964":[],"064982":[],"065":[],"065003":[],"065016":3,"065086":[],"065110":9,"065144":[],"065151":[],"065188":[],"065200":[],"065202":[],"065204":[],"065334":[],"065355":[],"065408":[],"06540809":[],"06547790180152352":4,"06547790180152355":4,"065545":3,"065591":[],"065618":[],"065660":[],"065680":[],"065762":[],"065860":9,"065994":[],"066002":9,"06600226":9,"066030":9,"066047":[],"066074":9,"066092":[],"066098":3,"066116":[],"06619182206626131":[],"066249":[],"066272":[],"066294":[],"066312":9,"066389":[],"066403":9,"066487":[],"066629":[],"066683":9,"066705":[],"066761":[],"066788":[],"066835":[],"066837":[1,9],"066949":3,"066951":9,"066963":[],"067043":[],"067061":[],"067123":[],"067132":9,"067175":9,"067202":[],"06724062":3,"067326":[],"067355":[],"067440":9,"067504":[],"067531":[],"067577":[],"067601":[],"067610":[],"067667":9,"067685":9,"067711":[],"067718":[],"067769":[],"067777":[],"067793":3,"067794":[],"067811":3,"067844":[],"067865":[],"067889":[],"067892":[],"067985":[],"067990":[],"068056":[],"068073":[],"068165":[],"068185":[],"068213":[],"068244":[],"068276":[],"068293":[],"06834":[],"068351":9,"068385":[],"068427":[],"06844519414009441":4,"06844519414009442":4,"068460":[],"068491":[],"068514":[],"068515":3,"068593":[],"068633":3,"068640":[],"068654":[],"068667":[],"068673":[],"068686":[],"068697":9,"068717":[],"068818":9,"068821":[],"068828":[],"068838":9,"068840":[],"068873":[],"068896":[],"068920":[],"068928":[],"068945":[],"069005":[],"069028":[],"069071":[],"069081":[],"069098":[],"069195":9,"069243":9,"069282":[],"069369":[],"069371":[],"069413":9,"069496":[],"069503":[],"069510":[],"069516":[],"069519":3,"069528":[],"069542":[],"069584":1,"069635":[],"069641":9,"069775":9,"069814":[],"069848":[],"069853":[],"069859":[],"069872":[],"069890":[],"069902":[],"069956":3,"069988":9,"070043":1,"070103":[],"070129":[],"070131":[],"070138":[],"070166":[],"070182":[],"070188":[],"070212":3,"070254":[],"070337":9,"070456":[],"070473":[],"070517":[],"070548":9,"070653":[],"070762":9,"070764":[],"070769":3,"07076926":3,"070791":9,"070812":[],"070815":[],"070866":3,"070867":9,"070889":[1,9],"070949":[],"070955":3,"070967":[],"071016":[],"071049":9,"07106781e":[],"071096":[],"07110274":14,"071156":[],"071248":[],"071268":[],"0713":1,"071313":[],"071325":[],"071359":[],"071435":9,"071447584032141":1,"07145103":9,"071453":[],"071481":[],"071502":[],"071547":9,"071549":[],"07155335":[],"071576":[],"071579":[],"07159175":[],"07160048164228312":4,"07160048164228314":4,"07160764":[],"071660":9,"071667":[],"071681":[],"071684":[],"071714":[],"071761":[],"071841":3,"071855":[],"071887":[],"071917":[],"072012":[],"072046":3,"072094":[],"072197":3,"072198":[],"072246":[],"072279":[],"072296":3,"072424":[],"072468":[],"072471":[],"072555":9,"072557":3,"072589":[],"072598":[],"072620":[],"072654":9,"072661":[],"072710":9,"072826":[],"072862":[],"072879":9,"072910":[],"072995":3,"073":[],"073020":[],"073035":[],"073052":3,"073096":9,"073162":3,"073310":9,"073333":[],"073352":[],"073371":9,"073372":[],"073483":[],"073546":[],"073567":[],"073591":[],"073598":[1,9],"073602":[],"073607":[],"073656":9,"073681":[],"073695":[],"073765":9,"073827":3,"073851":[],"073902":[],"073915":1,"073926":[],"073966":[],"074":[],"074027":[],"074036":[],"074037":[],"074044":[],"074067":[1,9],"074077":[],"074096":[],"074099":[],"074130":3,"074134":[],"074154":3,"074170":[],"074191":[],"074201":9,"074207":[],"07421084":3,"074230":[],"07423848370736122":[],"074248":[],"074285":[],"074286":[],"074331":9,"074432":[],"074434":[],"074453":[],"074488":[],"074557":3,"07456491":3,"074568":[],"074618":9,"074665":[],"074693":[],"074696":[],"074848":[],"074979":9,"074996":[],"075084":[],"075119":[],"075151":3,"075163":[],"075194":9,"075212":[],"07521771":[],"075218":[],"075261":[],"075266":[],"075289":[],"075296":9,"075309":[],"075526":9,"075542":[],"075545":9,"0755452":9,"075562":[],"075567":[],"075615":9,"075754":[],"075772":[],"07581375":[],"075814":[],"075818":[],"075821":[],"075865":[],"075869":3,"075975":[],"075993":9,"076026":[],"076062":[],"076068":3,"076121":3,"076166":[],"076169":[],"076189":[],"076213":[],"076251":[],"076283":[],"076320":[],"076367":9,"076377":3,"076398":[],"076408":[],"076410":9,"076466":9,"076469":[],"07670437":[],"076730":[],"076774":3,"076810":3,"076822":[],"076938":[1,9],"076954":3,"077005":[],"077010":9,"077021":3,"077026":3,"077046":9,"077115":[],"077143":9,"077160":[],"077163":[],"077212":[],"07729012413236423":9,"077303":[],"077305":9,"077338":[],"077339":[],"077386":[],"077407":[],"077416":[],"07744472306026946":7,"077469":[],"077533":[],"077623":[],"077645":3,"077771":9,"07777777777777778":2,"077891":[],"077927":9,"077968":3,"078049":[],"078076":[],"078099":9,"078103":9,"078197":[],"078244":9,"078279":[],"078311":[],"078342":[],"078388":[],"078390":[],"078399":[],"07839924":[],"078451":[],"078474":[],"078529":3,"078646":[],"078649":[],"078674":[],"078693":9,"078710":9,"078717":3,"078720":3,"078746":9,"078750":[],"078892":[],"078927":[],"078930":[],"078937":[],"078966":[],"079001":[],"079029":[],"079037":[],"079137":[],"079139":[],"079333":[],"079337":[],"079351":3,"079365":[],"07944154":14,"079597":[],"079598":3,"079624":[],"079643":[],"07968918676726028":4,"07972177":[],"079785":9,"079801":3,"079848":9,"079956":[],"080024":9,"080084":1,"080101":[],"080115":[],"080173":3,"080182":[],"080223":[],"080249":[],"080264":9,"080265":3,"080325":9,"080336":[],"080341":[],"080381":[],"080387":[],"080398":[],"08043851":3,"080565":3,"080570":9,"080612":3,"080626":9,"080633":[],"080675":9,"080678":3,"080738":[],"080806":[],"080845":[],"080846":3,"080871":[],"081024":[],"081077":9,"081092":[],"081102":[],"081103":[],"081129":9,"081210":9,"081227":[],"081260":[],"081270":3,"081309":[],"08131003":4,"081402":[],"081414":3,"081425":[],"081435":[],"081474":[],"081480":[],"081489":9,"081514":[],"081632":[],"08170444":[],"081732":3,"081744":[],"081778":[],"081816":[],"081886":[],"082032":[],"082091":[],"082211":9,"082225":9,"082239":[],"082247":9,"082272":[],"082303":3,"082382":3,"08248290e":[],"08251898":16,"082549":[],"082616":[],"082666":3,"082687":[],"08271336":[],"082866":[],"08292574":3,"082926":3,"082990":[],"083015":[],"083128":[],"083138":[],"083177":[],"08318298e":2,"0832":[],"083221":[],"083228":3,"083246":[],"083295":9,"083337":3,"083376":[],"083384":[],"083495":[],"083527":1,"083577":[],"083618":[],"08362077210702115":[],"083622":[],"083657":[],"083658":9,"083659":3,"083672":3,"083682":3,"083728":[],"083775":[],"083797":3,"083808":[],"08380813":[],"083855":[],"083905":[],"084":[],"084092":[],"084103":[],"08415761":[],"084167":[],"084181":[],"084221":[],"084249":9,"084251":[],"08426840630693411":4,"08429424":11,"084461":[],"084604":9,"084813":9,"084826":[],"084864":[],"084873":[],"084916":[],"084931":[],"08501147":[],"085041":3,"085121":9,"085253":[],"085259":[],"085285":[],"085289":[],"085484":3,"085510":[],"085544":[],"085597":[],"085598":[],"085610":[],"085627":3,"085646":9,"085676":[],"085748":[],"085763":[],"08576932":4,"085811":[],"085928":[],"085951":[],"086006":3,"086052":[],"086076":3,"08611111111111111":2,"086116":[],"086325":[],"086430":[],"086465":[],"086561":[],"086592":[],"08665060086846632":[],"086652":9,"086757":[],"086920":3,"086974":9,"086985":[],"087032":3,"087096":3,"087148":3,"087202":9,"087205":3,"087242":[],"087334":[],"087482":[],"087526":[],"087544":[],"087563":9,"088085":3,"088137":[],"0881981":3,"088209":[],"088258":[],"088260":3,"08839750e":[],"088414":[],"088484":[],"088556":[],"088660":[],"08871404":3,"088871":[],"08888888888888889":2,"088983":3,"089039":[],"089250":3,"089300":[],"089326":[],"089352":[],"089425":9,"089437":[],"089504":[],"089540":[],"089693":[],"089881":[],"089916":[],"089928":3,"089931":[],"090099":3,"090107":3,"090274":9,"090355":[],"090817":[],"09103481e":16,"091159":[],"091253":3,"091318":[],"09145189":4,"091535":[],"091542":3,"091566":3,"091578":[],"091659":[],"09166666666666666":2,"0917":7,"091756":3,"091855":3,"091979":[],"092276":3,"092288":[],"092375":[],"092378":3,"092659":[],"092932":[],"092936":3,"093236":[],"093248":[],"093328":[],"093573":[],"093725":3,"093755":9,"093928":[],"094":[],"094513":[],"09456011349477329":[],"094708":3,"094774":[],"09487315108590391":9,"095173":[],"095180":3,"095275":3,"095472":[],"095786152583691":3,"095941":[],"09609807":3,"096406":[],"096639":[],"096726":[],"09672604":[],"096763":[],"09678277e":16,"096802":[],"097150":3,"097346":[],"09741585e":[],"097452":[],"098028":3,"098187":3,"09903804":6,"099079":3,"09919198949386163":4,"099504":3,"099609":3,"099763":[],"09976319":[],"0x7f8830b3a340":11,"0x7f88524ba760":11,"0x7fda9123e220":[],"0x7fdab4f97430":[],"0x7febdb109490":[],"0x7febdb6780d0":[],"100":[0,1,2,3,4,5,6,7,8,9,11,14,16,17],"1000":[0,1,2,3,6,9,11,13,16],"10000":[0,3,4,8,9,16],"100000":6,"10001":8,"1001":16,"1002":16,"1003":16,"1005":16,"1007125":[],"10077114273548986":4,"1009":16,"10094646e":[],"1011":16,"1013":16,"10131725":[],"1013904243":16,"1015":16,"101781":3,"102":1,"1022964509394572":2,"1023":16,"1026":16,"1027":16,"103":2,"1030":16,"10307631":[],"10327559":14,"1037":16,"10378326e":2,"1038":16,"10398646080125035":4,"10398646080125036":4,"1040":16,"10405456":9,"104411":1,"1047":16,"104887":3,"105137868830763":16,"105387":3,"10555555555555556":2,"10589577":3,"106095":[1,9],"106946":3,"108":[1,4],"10806972":[],"108070":[],"10896672e":16,"10898112e":[],"10913":4,"109794":3,"10979444":3,"10th":7,"10x":1,"110":1,"1100":16,"1101":16,"11022302e":3,"111":[2,5,10],"1111111111111111":2,"112283":1,"112383":[1,9],"11304709e":16,"11388888888888889":2,"11456076e":[],"11462415":3,"11507992e":2,"1154777721897675":4,"11547777218976751":4,"115822":4,"11666666666666667":2,"117":6,"118318":1,"11892185":[],"11944444444444445":2,"12002944":[],"1203284":6,"121":[6,7,8],"122":[6,7,8],"12222222222222222":2,"12283463":[],"123190":1,"123459876":16,"12366979e":16,"123711":4,"124":1,"12497018e":[],"12618549":3,"1271":4,"127773":16,"12777777777777777":2,"12908963":1,"1298":7,"12adb44b1c20":[],"13055555555555556":2,"13060772":[],"131343":4,"13140162":[],"13162821e":[],"13209041":[],"13266452e":[],"133":5,"13328820e":[],"134102":[],"13410232":[],"13457922":[],"13519106":1,"13579199e":[],"1361111111111111":2,"13646574":3,"136687":[],"137268":[],"137400784702912":1,"1375":[],"137546":[],"137652":[1,9],"138":[],"13803928":[],"138472":[],"13859":4,"13865173":3,"138775":[1,9],"1388":4,"13891144e":[],"139462":[],"139475":[],"1404":1,"141725":[],"141955":3,"14195542":3,"143":5,"14309733":[],"1437":2,"14370264":4,"1440501043841336":2,"1445":[],"14459063":[],"1446":[],"1447":[],"1448":[],"1449":[],"14662074":[],"14722222222222223":2,"147400":[1,9],"147420":[1,9],"147722":[],"148":[],"14812206":4,"148127":4,"149076":[],"1492":[],"149233":[],"149328":4,"149366":[],"149667":[],"149739":[],"149832":[],"149894":[],"149903":[],"14g":4,"150":6,"15005476":3,"15024669":[],"150306":[],"150581":[],"15061":4,"151":[],"152636":[],"1527777777777778":2,"153036":1,"153106":1,"15324631":[],"15332528e":[],"154720":1,"15475232":[],"154911":1,"155491":1,"155687":1,"155883":1,"156":1,"156956":3,"157":1,"15751596":[],"158":1,"159":1,"15979239e":16,"15g":4,"160":1,"16111111111111112":2,"16211139":3,"162246":3,"16342407":3,"16496581e":[],"16553696":[],"16637855e":16,"16666666666666666":2,"167787":3,"16796929":4,"16807":16,"16831012":[],"16861772":[],"168618":[],"1695":4,"16b8e3cda33a":2,"17117385":[],"17174962e":2,"17234827e":[],"17248441e":[],"172737":3,"17273709":3,"17385778e":[],"17446471":4,"174497":[],"17449733":[],"175300":1,"1758506":[],"1761":4,"17654307":[],"17666625":11,"17707436":[],"17709":4,"17777777777777778":2,"17801022":3,"17861098":4,"17917768":3,"17949575":3,"17953942":9,"1797":2,"180092462880674":[],"18029127":3,"18063928":[],"18123182":11,"18220995":[],"18224665":[],"1831277634928002":[],"18333333333333332":2,"18404906e":[],"184519":1,"1856411":[],"18611111111111112":2,"18620601e":[],"18673098":9,"189496":1,"18954529":[],"189622":1,"18968431e":16,"1914224774238273":[],"19207979":3,"1940":1,"1943":10,"197":[],"1970":14,"1973":7,"197370":[1,9],"19742904e":[],"1979":4,"1989":16,"19937":16,"19955871":[],"199559":[],"19972087e":16,"1_1":10,"1_2":10,"1_3":10,"1cm":[1,6,8,16],"1e10":0,"1ec254875e1a":11,"200":[1,6,7,8,16],"2000":1,"200000":1,"20015436":4,"2004":11,"2006":18,"2010":2,"2011":2,"2015":2,"2016":1,"2018":[1,4],"201841":[],"20184113":[],"2021":[0,4,15],"20277777777777778":2,"203757":[],"20375701":[],"205466494327873":[],"20632410e":[],"20738183":[],"207545":[1,9],"20772452":[],"20819609e":[],"20833333333333334":2,"20843563e":[],"20867052175003387":4,"20906175e":16,"210340":[1,9],"21058097":3,"212":[],"21208310e":[],"212327334149492":[],"21244261":3,"212443":3,"2125":[],"2126":[],"2127":[],"2128":[],"2129":[],"213":[],"213103":[1,9],"21347282":[],"213743":[1,9],"214":[],"2147483647":16,"215":[],"21596432":4,"216":[],"21623344":[],"216290":[1,9],"216683":[1,9],"21698969":11,"22044605e":3,"22076362":[],"221":6,"221180":1,"221921":3,"22209371e":[],"222400":1,"22443803":[],"22527008e":16,"22690428":3,"22717936e":16,"22842468702166951":4,"22842468702166954":4,"22847924":3,"22999784":[],"229998":[],"23117916e":16,"23167717":3,"232435":1,"23333333333333334":2,"2335879":[],"23382086e":[],"234":4,"23438810e":[],"236913":3,"23691315":3,"23744178":[],"240792":3,"2407922":3,"241262":[],"24126232":[],"2433e":3,"24340751":[],"243484":3,"24348403":3,"24444444444444444":2,"246138":[],"24613822":[],"24829908":3,"250":[5,7],"25000":1,"250000":1,"250154":1,"251559":[],"2515593":[],"251879":1,"25190225e":[],"25226753e":16,"25240108":[],"252436":1,"252639":[],"25263916":[],"253":[],"25303483":[],"253775":1,"254":[],"254509":[],"25450941":[],"25457052":[],"255":[],"255001":1,"2551":1,"256":[],"256962":1,"257":[],"2571699":[],"25726439e":[],"2572e3a4b38d":2,"25803281":[],"259107":[],"25910749":[],"259125":3,"25912505":3,"259153":[1,9],"259815":[],"25981533":[],"260227742627244":[],"2627588":14,"26301436":3,"26381865":[],"263819":[],"264":1,"26412372":[],"265":1,"2653678":[],"266":1,"26666667":11,"267":1,"26710969":3,"26780278":3,"2683":[],"2684":[],"2685":[],"2686":[],"2687":[],"26890510e":[],"269":1,"26974938e":[],"270":1,"27262964":[],"27296891e":[],"276263":[1,9],"27753165e":16,"27852549":[],"27924636":3,"27n_":16,"280573":3,"280647":[1,9],"28166741":[],"282":[],"282727":[1,9],"28310983":[],"283110":[],"2836":16,"28475098":6,"2861":16,"28712116":[],"2873":7,"2882":16,"2886":16,"2890":1,"2892":16,"28971976":9,"289720":9,"290":[],"291":[],"2915":16,"291614":[],"29167186":3,"292":[],"293":[],"2931":[],"294":[],"29424824":[],"295656121491569":[],"296247":1,"2968":[],"297219777724628":9,"297260":1,"29737229":11,"29748212":11,"2975":4,"2980":[],"298273":1,"2983233":14,"298375":1,"2988":4,"2990":[],"299444":9,"29944428":9,"299748":1,"2_1":10,"2_2":10,"2_3":10,"2_i":10,"2_m":[4,16],"2_t":11,"2_x":16,"2cm":6,"2ff97f4bf03b":16,"2nd":7,"2x_ix_jy_iy_j":6,"2x_j":6,"2y_i":8,"2y_j":6,"30000":1,"300162456113691":[],"30119421":6,"303":4,"3041320306136366":[],"3043053":11,"30626706":[],"30655001":4,"306854":[],"30685416":[],"30787294":4,"30879705":[],"30968181":[],"310811":[],"31081134":[],"31109204e":[],"3123314713548606":4,"31318084":3,"31457796":3,"315208":3,"31520842":3,"3155":[3,4],"3156929654100207":7,"31603087":4,"31608475e":[],"31718909":9,"31730641":[],"317367":9,"31853484":[],"31896852":6,"3200":2,"32047562":1,"3214960170351912":4,"32149601703519126":4,"323291478597321":16,"3250":2,"32521615e":16,"326238":1,"327631":1,"32938847":14,"32945844e":16,"3304":1,"33066907e":3,"3310":1,"3317":1,"331939":1,"333":5,"333333":1,"33333333":11,"3338":1,"3344":1,"33443859e":[],"33544681":[],"33569998e":[],"33861512":[],"338869":[],"33886902":[],"339535706819584":16,"33953571":16,"340782":[1,9],"34108726":[],"34114547":3,"34114641e":[],"34172919":[],"342680":1,"3436":1,"3437":1,"344172":1,"34569596":3,"346433":9,"34643337":9,"34902789e":16,"3498837":11,"350387":[],"35038714":[],"351636":[1,9],"35176067":[],"35182854":3,"35216172e":[],"35367281e":[],"35386868":11,"35533773":4,"356399":1,"357508":1,"358869339268145":16,"35886934":16,"359":3,"359640894899012":[],"360":2,"360688":1,"361556":1,"3621311":3,"36436520e":[],"36468301":[],"3655222":3,"369139":[1,9],"36941772":[],"369418":[],"37186301":[],"372889":[],"3728892":[],"37416969":9,"374170":9,"37732":11,"37738324":[],"38207279e":[],"38216436":[],"3848":4,"38561052":3,"385611":3,"38629436":14,"38777878e":3,"38892672":[],"388927":[],"38903780":4,"3893239":[],"389324":[],"38937995e":16,"38986237":[],"39579407":3,"396740":9,"39674043":9,"39706038":3,"39716546":4,"397700":[1,9],"39792608e":[],"399836":1,"3cd19a0768e1":[],"4000":18,"401842":[1,9],"40212127":[],"404":1,"40425078e":16,"405890":[1,9],"40702":[],"40708470e":[],"40859":[],"4087793":3,"40902095":[],"40968888":[],"409689":[],"41078073":4,"412374":[],"41237437":[],"4140e":3,"41433969":3,"41511965e":2,"415634483874318":[],"416694683938511":9,"4171578884124756":0,"41754964":[],"41770932":[],"418506":[1,9],"41876428e":[],"4200e":3,"4201e":3,"4203e":3,"42208194":4,"423756":3,"42375621":3,"42441033":3,"426":[4,5],"42847770e":16,"42937310e":16,"43054282":3,"4332e":3,"43341615":4,"435163":1,"435490":[],"43549028":[],"43766686":9,"438136":1,"439230":4,"44089210e":3,"442600":[1,9],"443217":1,"44395541":[],"44625466e":16,"44655382":3,"446554":3,"44970586e":2,"45013332e":[],"45019484":[],"450257":[1,9],"4557763":9,"455947":1,"458027":1,"458078":[1,9],"45937170e":[],"45960079":3,"46016532e":[],"461":16,"461838":[],"46183815":[],"462":5,"46323168e":16,"4632e":3,"46415888336127775":[],"46423858e":[],"465564":[],"46556436":[],"466":16,"46675058":[],"46914544e":[],"46929603e":[],"469730":[],"46973015":[],"47042744":3,"470714":1,"47075725":4,"47079457e":16,"47125748":3,"47132891":3,"472652":[],"47265243":[],"47441766":[],"47566390e":16,"47610036":4,"47654764e":[],"47815203":9,"47862383":[],"478624":[],"480170":3,"48017006":3,"48019541":[],"48154187202453613":0,"481979":4,"48257387":17,"48471852e":[],"48476997":9,"48608063e":[],"48994188":3,"491837":[],"4918372":[],"493230":[],"49323032":[],"4940954":1,"497221":[],"49722108":[],"49841285":[],"498413":[],"49865673":[],"4990":16,"4992":16,"4997":16,"49b0ef2e51e2":4,"4c4c7f":[7,8],"4y_i":8,"500":[2,4,7,8,11,16],"500000":1,"50000455":3,"50000553":3,"50000718":3,"50000855":3,"50000969":3,"50001063":3,"50001142":3,"50001207":3,"50001261":3,"50001306":3,"50001343":3,"50001374":3,"500014":3,"50001414":3,"50001422":3,"50001439":3,"50001454":3,"50001466":3,"50001476":3,"50001485":3,"50001492":3,"50001498":3,"50001502":3,"50001506":3,"5000151":3,"50001512":3,"50001515":3,"50001517":3,"50001518":3,"50001519":3,"50001521":3,"50001522":3,"50001523":3,"50001524":3,"50001525":3,"5018":16,"50321091":3,"50394742":[],"506":1,"507d50":[7,8],"5098779":[],"509878":[],"50j":11,"50x10":2,"510":2,"511888":3,"5120":0,"512132":1,"51257863e":[],"51345668e":[],"51363731e":[],"514219":1,"51523276e":[],"515768":[],"51576807":[],"51707172":[],"517072":[],"51893804e":[],"51943726":9,"519842":1,"52158335":[],"5222222222222223":2,"52570079":[],"525701":[],"526744":[1,9],"52687171":[],"526872":[],"52722156":[],"52874252":3,"52d2c51caad1":[],"5303329":9,"5305555555555556":2,"531280":1,"535457":[],"53545715":[],"53703498":4,"5378811":9,"539261":[1,9],"54039921":3,"54096582":[],"540966":[],"54121682":[],"541217":[],"54152940e":[],"541605":1,"54237024":16,"543169":[],"54316925":[],"544439":1,"546972":[],"54697204":[],"54702088e":[],"54710530e":1,"5483":4,"55111512e":3,"55138385":9,"551384":9,"55280484":[],"5555555555555556":2,"55707065":[],"557071":[],"557795":[1,9],"55795935":[],"55854694":9,"56033697":3,"56198284":3,"56216797e":[],"564374":[1,9],"56536":1,"56831157":3,"568312":3,"569":2,"56939714":3,"57051369":[],"571":3,"57143061":4,"574465":[1,9],"5755035":[],"57781668":[],"57871326":[],"579842":3,"57984245":3,"581766":9,"58176612":9,"582":[1,2],"58228342e":16,"58239999":[],"582400":[],"583595":1,"584804":1,"58521266":9,"585213":9,"58596975":[],"585970":[],"5864689451163851":3,"587401":1,"58836420e":16,"5888888888888889":2,"59007674e":16,"59304755e":[],"5944444444444444":2,"59480085":[],"5cm":16,"60122668e":16,"60293962":3,"60394236e":[],"60420593":3,"60673226":9,"606760":3,"60949193":[],"609492":[],"60999846":[],"61069091e":16,"6111111111111112":2,"61124978":[],"61234223":[],"612939":1,"613579":1,"614808":[1,9],"61505887e":[],"61745046e":[],"618":1,"61825186":11,"6183694":[],"61869821":[],"618982":1,"622539":9,"62253933":9,"622625":[],"62262506":[],"6226921":[],"62316154e":16,"62359224e":16,"62373464":9,"625":5,"62783293":[],"62856593":[],"62894215":3,"629961":1,"6300745149331701":1,"63315151":[],"63339159":[],"63374631":[],"63437572":[],"63442451e":[],"63488525":4,"63498144":3,"636323":9,"63632311":9,"63680118":[],"637129335071195":1,"63993205e":[],"64001211":4,"64012627":3,"640782":[],"64078247":[],"64166831e":[],"64447921":[],"64522721":4,"64580686":[],"646283":[1,9],"64669382":[],"646694":[],"647473":[1,9],"64857826e":[],"649382":[1,9],"64x50":2,"650024":[],"65002433":[],"6510573774179256":16,"65105738":16,"65238878":14,"65245958":[],"653095390463358":[],"653702":14,"653725417896576":1,"6544e":3,"65482578":[],"65572035":[],"65599927":[],"65766387":[],"65885453":3,"65933852":[],"65939208e":[],"6600855222624895":[],"66020213e":[],"6614":[],"66152576":3,"661526":3,"66183486":9,"661835":9,"66204648":4,"6628996975186952":1,"66302359":[],"66383151":[],"66677842":[],"66800261":[],"668172":1,"66880047":[],"67006792":[],"67060602":[],"671089":1,"6713619":3,"6714":[],"67171347e":16,"672721":1,"67279536":[],"67298546":11,"67303655":9,"673037":9,"67407338e":16,"67450955":[],"67708423":[],"677149":[],"67714918":[],"6796265324852733":[],"68002363":[],"680024":[],"68034946e":[],"6813":[],"6814":[],"6815":[],"6816":[],"6817":[],"6818813252071303":16,"68188133":16,"68192193":3,"68316185":[],"68342382":[],"68386076":11,"68542204":3,"68616263":14,"68729414":[],"68887763":11,"68937695":[],"689519":[1,9],"690617":1,"69069n_":16,"693361":1,"69347005":[],"6936767":3,"693677":3,"693850":9,"69385025":9,"69504801":4,"69519693":[],"695197":[],"69573183":[],"69695259":3,"69843037":[],"6996584":[],"69981195e":16,"6999536":9,"6ea927cc6e88":2,"6n_":16,"701370":3,"70183798":[],"7022283":[],"70234019":[],"70415861":[],"70523024e":[],"70589906":[],"7070e":3,"70710678":3,"70790937":[],"70832814":3,"70885528e":[],"70886748":[],"70900891":[],"70946493e":[],"712018":[1,9],"712199063818309":[],"71281409":[],"71351486":[],"71442781":14,"71606852":[],"7162":[],"71669651":[],"7172":[],"718165":3,"72108703":[],"72174172":9,"72218808":[],"72312577":[],"7236674":3,"7240496":[],"725394195434945":[],"72780613e":16,"72859758":3,"72879865e":[],"72981762":6,"73091052e":[],"731000":1,"73153522":11,"733096":1,"73453972":[],"7371165871823337":[],"737349":[],"73734906":[],"73921714":[],"74081822":6,"74107697":9,"74143127e":[],"7432283":[],"74382593":[],"7442":4,"74495014":[],"745136489050356":[],"7465":4,"74840212":3,"74845978":[],"74921867":[],"749765":1,"750445":1,"751699":[1,9],"75170092":3,"75195757":[],"7522047280566193":[],"75322913":11,"75382481":[],"75524378":[],"75629493":[],"756352":1,"75841112":[],"75932862":[],"76172241e":[],"762":[5,9],"7621419":[],"76290332":[],"763880":[],"76388013":[],"76497666":[],"765":5,"76504618":[],"76570177":[],"76648901e":[],"76936315":3,"7693978131030923":9,"7701384":[],"77152076":3,"77156117e":3,"7718":7,"772b904ae9cb":[],"77317984":[],"7733":[],"77350269e":[],"774300":1,"776223":[],"77622336":[],"77636e":11,"77661393e":16,"77714169":6,"78080633":[],"78082":[],"78195":[],"78857629":[],"78941903":3,"78944806":[],"7899453":[],"79111643":3,"7925146":[],"792515":[],"79295029e":16,"793167":1,"79326583e":16,"79328828":[],"793701":1,"794282":[1,9],"79459035":[],"79648291":[],"79902342":[],"7c394b1e8b71":7,"7d7d58":[7,8],"800":5,"80004454e":[],"80021057":3,"800266":[],"80026635":[],"80121":[],"80354994":4,"80469739":3,"8055555555555556":2,"81160425":3,"81333793":4,"81441779":[],"81620806":[],"81633628":9,"816454":1,"816847":1,"81712976":[],"817130":[],"81781888":9,"819202":[],"81920231":[],"82198978":3,"8265786":3,"827265":1,"82889306e":16,"8305555555555556":2,"83425361":9,"834254":9,"83512277":3,"83614019":[],"8388888888888889":2,"839313":[],"8393131":[],"83935285":[],"84008474":[],"840085":[],"84087101":[],"842":[],"842436":1,"84251485":[],"842515":[],"8429949116841184":[],"84355903e":2,"84372853":[],"84443254e":2,"84658093e":16,"84780262":4,"8479552268981934":0,"84860939":[],"849766":[],"84976606":[],"84994524":3,"850164":3,"85058354":[],"850584":[],"8520127":[],"85218118":[],"85263220":4,"85278450e":[],"85396354":[],"85450859":9,"85463934e":[],"85497163e":[],"85546305e":[],"85601992":3,"860114":3,"86011441":3,"861":1,"86117291":3,"86134827":3,"86145244":9,"8638888888888889":2,"86436607":[],"86574276":[],"8666666666666667":2,"86692943":[],"87030083":[],"870301":[],"8718475896381779":16,"87184759":16,"8722222222222222":2,"87381451":3,"875":2,"8759":11,"87761937":[],"8777777777777778":2,"878843":[],"8788431":[],"87972591":[],"8802":[],"88046261":3,"88046462":[],"8805555555555555":2,"881323":[],"88297395":[],"88336879":3,"88559559":[],"8867467323038865":[],"88693966e":16,"88712946":[],"88730288":[],"8888888888888888":2,"890":4,"8901":[],"8914984":[],"89156955":[],"8921171964770647":9,"8923":[],"89288636":9,"8931":[],"89383322":[],"89410423":3,"8944444444444445":2,"8954":4,"89704131":[],"89742056":[],"897421":[],"898500":9,"89850037":9,"89928965":[],"89942598":[],"89975818":[],"89992521":1,"8dc29df57a8c":4,"8x8":2,"90075537":3,"9011":4,"90220243":3,"90233874":[],"90266948":3,"9031":[],"90316476":[],"9040":7,"9054":4,"9055555555555556":2,"90618734e":16,"906747":3,"907307":9,"90730735":9,"90825063":[],"9096":[],"91012519e":[],"9111111111111111":2,"91128596":3,"91145266e":16,"91417278":[],"9154537458386387":3,"91549644":1,"9166666666666666":2,"916978":[],"91697817":[],"9171356":[],"91760278":3,"91812702":3,"918992":1,"9196":[],"91960881":11,"9222222222222223":2,"922312":[],"92231203":[],"92280994":[],"924018":1,"925":2,"92507116e":2,"92578916":3,"92605247":[],"92645039":9,"92646965":9,"926470":9,"92732185e":[],"9277777777777778":2,"9279671770201344":16,"92814088":[],"928141":[],"92857143":5,"92919670e":16,"9305555555555556":2,"931":1,"93100040e":16,"931066":3,"93155188":3,"93158979":3,"932734":[],"93273404":[],"933":3,"9354":[],"9361111111111111":2,"93679587":[],"936796":[],"937":16,"937082":1,"93799826":3,"938":16,"9388888888888889":2,"939":[1,16],"94019247e":[],"94034531":[],"94240779":[],"942726":[],"94284104":3,"94320205":3,"94327895":3,"9444444444444444":2,"94536341":16,"94591015":14,"94639099":9,"946893955211749":[],"946957":3,"947543":9,"9482527":3,"948729":[],"95008046":4,"95014575":[],"95231424":3,"9527777777777777":2,"95284275":3,"95351665":3,"954":16,"95443703e":[],"9547578478889096":1,"95517094":[],"955171":[],"9555555555555556":2,"95628168":[],"956282":[],"956563":[1,9],"95684892":3,"958228616652075":3,"9583333333333334":2,"959247":[],"960":16,"96024953":3,"96084663":3,"961":16,"96104648":[],"9611111111111111":2,"962":16,"963499":9,"96349948":9,"9640435":3,"965548":1,"965885569080809":[],"96688672":3,"9674916":3,"967809":[1,9],"96793117e":[],"97005689":3,"97101567e":16,"97108e":11,"9722222222222222":2,"97243128":3,"97300836":3,"975":2,"97507735":3,"9756404":[],"976":6,"97622676":[],"976227":[],"9765":[],"9769":[],"97705827":3,"97723801":[],"97758848":3,"9777777777777777":2,"9780387310732":18,"9780387848570":18,"9781492032632":18,"978553":3,"97900797":11,"97926491":3,"9804422":[],"98046438":[],"9805555555555555":2,"98091621":3,"981321":1,"98139097":3,"98275501":3,"98314755":[],"983148":[],"983310":1,"98413059":3,"98452685":[],"98454786":3,"985":16,"98526763":[],"98528992":[],"98531221":[],"98566191":3,"986":16,"9860803":[],"98609175":16,"986091753050161":16,"9861111111111112":2,"98661465":[],"986699":3,"98680716":3,"98716878":3,"9877742":[],"987902":[],"98808176":3,"98822371":4,"988663":[],"9888888888888889":2,"98892195e":16,"98893512":[],"989":16,"9890348":3,"98927731":[],"9893447":3,"9898ff":[7,8],"99009525":3,"99009739":[],"9901168":[],"99013921":[],"99016161":[],"99018401":[],"99043999":[],"99088801":3,"9909252":[],"991":16,"991072":9,"99107239":9,"99115119":3,"99126104":[],"99133007":[],"99160404":[],"99176998":3,"99190487":[],"99194716":[],"992":16,"99218987":[],"99219378":[],"99242605":[],"99242921":3,"99248001":[],"99265097":3,"99273355":[],"99276945":[],"993":16,"99305549":[],"99305802":[],"99311297":[],"99316252":3,"9933":[],"99346398":[],"99363129":[],"99363383":[],"99371056":3,"99389612":3,"99393624":[],"994":[],"99400444":[],"9941":[],"99418903":9,"99420743":[],"99420997":[],"99428016":[],"9943201":3,"9945452":[],"99462421":[],"99473581":[],"9947756":3,"99478645":[],"99478898":[],"99492986":3,"99498985":[],"995":[],"99501236":[],"99503487":[],"99505739":[],"9950799":[],"99527696":[],"99528218":3,"9953048353087299":[],"99536326":[],"9953658":[],"99539415":3,"99544872":[],"9954538761021741":[],"99566069":3,"995774":[],"9957744":[],"99578809":3,"99579317":[],"99581841":[],"99594294":[],"996":3,"99600927":[],"99608161":3,"99620088364924":1,"99636015":[],"9963961":3,"99650061":3,"99652042":[],"99652296":[],"99655111":[],"9966744029509663":[],"9967292151090247":[],"9967458":3,"9968966158779216":1,"9969":[],"99696351":[],"997":[],"99700706":3,"99709215":3,"99709325":[],"99710078":[],"99723611":[],"99728435":[],"99729756":3,"99730848":[],"99751458":3,"99758326":3,"99763569":[],"99767893":[],"99775587":3,"99782689":[],"99793613":3,"99799099":3,"998":[],"99813653":3,"99817842":[],"99825997":[],"99828624":3,"9983295":3,"99836973":[],"99845267":3,"9984806":[],"998577":3,"99861053":3,"99871521":3,"99881845":3,"99883879":[],"99884384":3,"99891285":[],"99893323":3,"999":[7,16],"99901896":3,"99903755":3,"99911427":3,"99918546":3,"99919837":3,"99926459":3,"9993237":3,"99933188":3,"99938942":3,"9994385":3,"99944272":3,"99945628":[],"99949306":3,"99953381":3,"99953475":3,"99957911":3,"99961294":3,"99965056":3,"99967865":3,"99970988":3,"9997332":3,"99975913":3,"99977849":3,"99980002":3,"9998161":3,"99984732":3,"99987324":3,"99988687":[],"99989476":3,"9999095":[],"99991263":3,"99992746":3,"99993212":[],"99993978":3,"99995":3,"99995475":[],"99995818594196":[],"999974281880048":[],"99997737":[],"9999787681537219":[],"9999794306626945":[],"9999822527140678":[],"9999850282256434":1,"9999864543345858":[],"9999868619217517":[],"9999869956119286":[],"9999878260589065":[],"9999887274726137":1,"9999910208315801":[],"9b9cf4fa1a95":[],"\u00f8yvind":17,"abstract":2,"break":[0,1,9],"byte":14,"case":[1,2,3,4,5,9,10,11,13,14,15],"catch":1,"char":16,"class":[1,2,4,5,6,7,9,10,11,16],"const":16,"default":[1,2,5,14],"ekstr\u00f8m":17,"export":7,"f\u00f8470":17,"final":[0,1,2,3,4,5,6,7,8,9,11,15,16,17],"float":[0,1,3,7,9,11,14,16],"function":[0,3,7,13,14],"import":[0,1,2,4,5,6,7,8,9,10,11],"int":[0,1,2,3,4,9,11,14,16],"long":[1,2,10,11,16],"m\u00f8svatn":4,"new":[0,1,2,3,4,5,6,7,8,9,11,14,16],"null":16,"public":[1,13],"return":[0,1,2,3,4,5,6,7,9,11,14,16],"s\u00f8rli":17,"sch\u00f8yen":17,"short":[0,3,12],"steinsv\u00e5g":17,"super":3,"switch":[0,1],"throw":[4,16],"true":[0,1,2,3,4,5,6,7,8,10,11,16],"try":[0,1,2,3,4,5,6,7,8,9,11,13,14,16],"var":[3,4,8,9,16],"while":[0,1,2,3,4,5,6,7,9,10,11,16],AGE:1,Adding:2,Age:5,And:[0,1,3,4,7,11,13,16],Are:9,Being:11,But:[0,1,2,3,4,7,8,16],CAS:[],DIS:1,Doing:[3,8,11],EoS:[1,4],FYS:15,For:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,15,16,18],Going:2,Ising:[3,10],Its:[2,9],MDS:9,NNs:10,N_s:6,Not:[1,2,3,4,15],OLS:1,One:[1,2,3,4,5,6,9,10,11,16],PCs:[9,13],RMS:16,Such:[4,10,16],That:[0,1,3,5,8,9,10,16],The:[8,11,14,15,17,18],Then:[0,1,2,3,4,6,7,8,9,10,11,14,16],There:[0,1,3,4,6,7,9,10,12,14,15,16,17],These:[0,1,3,6,7,8,9,10,11,14,16],Use:[1,7],Useful:[3,4,14],Using:[1,3,4,6,8,10,14],With:[1,3,4,6,7,8,9,10,14,16],__class__:8,__doc__:4,__future__:[6,7],__getattr__:[],__init__:2,__mosek:3,__name__:8,_auto10:10,_auto1:[3,5,10,11,14,16],_auto2:[3,10,11,14,16],_auto3:[3,10,11,14],_auto4:[10,11,14],_auto5:[10,11,14],_auto6:[10,14],_auto7:[10,14],_auto8:10,_auto9:10,_ax:[],_base:6,_build:[13,18],_check_optimize_result:[5,9],_compon:9,_datafram:[],_depth:7,_fraction:7,_lambda:[],_leaf:7,_logist:[5,9],_make_index:[],_make_vjp:11,_multilayer_perceptron:[1,2],_node:[7,11],_num_sampl:[],_ratio:9,_sampl:7,_split:[4,7],_test:4,_trace:11,_valu:11,_varianc:9,_weight:7,a0faa0:[7,8],a77d5ac269b2:[],a_0:1,a_1a:1,a_2a:1,a_3:1,a_3a:1,a_4:1,a_4a:1,a_h:2,a_i:[1,2,10],a_j:[2,10],a_k:[2,10],aaron:18,ab_channel:13,abandon:2,abbrevi:15,abid:16,abil:[1,8],abl:[2,3,4,5,8,10,11,16],abort:16,about:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,18],abov:[0,1,2,3,4,5,6,7,8,9,10,11,14,16],abovement:4,abs:[0,1,3,11],abscissa:11,absolut:[1,3,4,11],acccess:[],acceler:11,accept:[1,4,7],access:[1,9,16],accid:4,accmod:3,accompani:1,accomplish:[6,7,11],accord:[0,1,2,3,4,7,10,11,16],accordingli:9,account:[1,3,11,16],accumul:[10,16],accur:[1,4,8,11,16],accuraci:[1,2,3,5,7,8,9,10],accuracy_scor:[1,2,8],accuracy_score_numpi:2,achiev:[1,2,3,4,6,10,14],aco:16,acquaint:13,acquir:[2,13],acr:1,across:[2,4,7,13],act:[2,14],action:16,activ:[0,1,7,15],actual:[1,2,3,4,6,9,14],ada_clf:8,adaboostclassifi:8,adadelta:11,adagrad:11,adam:2,adapt:[1,4,11,18],add:[1,2,3,4,6,8,9,10,16],add_subplot:[0,2,5,10],added:[1,2,3,4,6,11,14],addendum:3,adding:[0,2,14],addit:[0,1,3,4,5,6,7,8,10,11,13,14,16,17,18],addition:[10,11],address:[2,7,9,11,18],adjac:10,adjoint:3,adjust:[1,3,10,11],admir:1,advanc:[4,10,18],advantag:[2,3,4,8,11,14],afecionado:[],affect:[],affin:[1,6,9],aficionado:[],aforement:0,african:1,after:[0,1,2,3,4,7,9,10,11,13,14,16],afterward:1,again:[0,1,2,3,4,5,6,8,9,10,11,16],against:[2,5,8],age:[1,5],agegroup:5,agegroupmean:5,aggreg:[7,8],agorithm:8,agre:[3,4,16],ahead:7,aid:9,aim:[0,1,2,4,5,9,13,14],ainv:3,aka:3,alarm:3,albeit:0,algebra:[1,3,11,13,15],algo:16,algorithm:[1,2,3,4,5,6,11,13,14,15,16,18],align:[1,3,4,5,6,11,16],all:[0,1,2,3,4,5,7,8,9,10,11,13,14,15,16,17,18],allevi:[2,11],alloc:14,allow:[1,2,3,4,6,8,11,13,14],almost:[1,2,4,6,9,11,16],alon:7,along:[0,3,4,7,8,9,13,14],alpha:[0,1,2,3,4,5,6,7,8,11,16],alpha_:8,alpha_i:11,alpha_k:11,alpha_m:8,alpha_opt:11,alreadi:[3,8,10,13,14,16],also:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,15,16,18],alter:[2,16],altern:[1,2,3,4,5,6,7,9,11,14],although:[2,3,4,6,8,11],alwai:[0,1,3,4,10,11,16],ame2016:1,american:1,among:[1,3,7,8,10],amongst:3,amount:[0,1,2,4,6,8,13],an_:16,anaconda3:[1,2,5,6,9,11],anaconda:[1,2,13],analog:11,analys:[4,16],analysi:[2,5,14,15,18],analyt:[1,3,4,5,10,11,13],analyz:[1,2,3,4,16],andrew:2,angl:[1,7,16],ani:[0,1,2,3,4,5,6,7,8,10,16],anim:10,ann:10,annot:[1,2,5,6],anoth:[1,2,3,4,5,6,8,9,10,11,14,16],ans:[11,16],ansatz:1,answer:[1,2,3,4,14],antialias:4,anymor:[2,6],anyon:6,anyth:[2,16],anytim:17,apach:2,apart:[9,11],api:[2,13],appear:[1,2,11,14,16],append:[2,6,7,11,16],appendcon:3,appendvar:3,appli:[1,2,4,5,6,7,8,9,10,11,16,18],applic:[1,2,3,4,5,7,10,11,15,16,18],approach:[2,3,4,7,8,9,10,11,13,16,18],appropri:[4,7,10,11,13,16],approx:[1,4,8,9,11,16],approxim:[1,2,3,4,5,8,9,11,16],apt:[1,13],aptli:0,aragorn:[],arang:[2,4,5,7,8,10],arbitrari:[2,4,6,10,11,16],arbitrarili:[1,2,9],arc:4,architectur:[10,18],area:[1,4,18],arg:11,argc:16,argmax:[2,9],argmin:[0,8],argnum:11,argsort:9,argu:[2,11],arguabl:0,argument:[1,3,9,10,11,16],argv:16,aris:[1,4,10,11,16],arithmet:[1,11,14],arma:16,armadillo:[14,16],around:[1,2,3,4,9,16],arrai:[0,1,2,3,4,5,6,7,9,10,11,13,16],arraybox:11,arriv:[1,4,7,9,14,16],arrow:10,arrowprop:6,art3d:11,art:[1,2,13],articl:[0,1,4,8,16],artifici:[1,5,10,18],artificialneuron:10,artist:[],arug:11,asarrai:[1,7],asc:3,ascii:16,ask:[3,4,9,10],aspect:[1,4,13],assembl:1,assess:[1,4],assign:[0,1,5,6,7,10,11,15,18],assign_points_to_clust:0,associ:[0,1,4,7,10,16],assum:[0,1,2,3,4,5,6,7,8,9,10,11,14,16],assumpt:[1,3,4,7,9,16],ast:[1,3,4],astyp:[7,8],asymmetri:1,asymptot:4,atoi:16,atom:1,attempt:[1,5,6,8],attend:15,attent:[1,14],attr:[],attract:[1,8],attribut:[1,7,11],attributeerror:11,audi:1,aurelien:[1,15,18],austfjel:4,author:[1,2,8,16],authour:1,auto:[7,8,16],autocor:16,autocorrelation_tim:16,autocorrelform:16,autocovari:16,autoencod:13,autoencond:13,autograd:[11,13],autom:[1,13],automac:14,automag:[],automat:[1,2,9,13,14],autonom:18,avail:[1,2,4,8,9,13,14,15,18],averag:[0,1,2,4,7,8,11,16,17],avg:16,avoid:[0,1,3,4,7,9,11,14],awai:16,awar:8,award:17,axes3d:[4,11],axes:[1,5,6,7,8,9],axessubplot:1,axhlin:6,axi:[0,1,2,4,5,6,7,8,9,10,11,16],axiom:3,axlabel:1,axvlin:6,b_1:[10,11],b_2:11,b_5:11,b_group:7,b_i:[1,2,10],b_ia_:1,b_index:7,b_j:[2,10],b_k:[2,10,11],b_m:10,b_score:7,b_valu:7,bachelor:15,back:[1,3,6,7,8,14,15,16],backbon:14,backend:2,background:[15,18],backpropag:2,backtrack:7,backup:14,backward:[2,10,14],bad:16,badli:16,bag:[7,13,15],bag_clf:8,baggin:[],baggingboot:8,baggingclassifi:8,baggingtre:8,balanc:4,band:14,bandwidth:14,bar:[1,4,9],barber:18,bare:8,barebon:0,base:[0,1,2,3,5,6,7,8,13,16,17,18],basi:[3,5,6,8,9,10,11,14],basic:[4,6,10,11,13,15,16],batch:[9,10,11],batch_siz:2,bay:5,bayesian:[3,13,18],be0d226abb41:[],becaus:[0,1,2,3,4,6,7,10,11],becom:[0,1,2,3,4,5,7,10,11,16],been:[1,2,3,4,9,10,11,13,14],befor:[0,1,2,3,4,5,6,10,11,14,16],beforehand:[0,1,16],begin:[0,1,2,3,4,5,6,7,9,10,11,14,16],behav:[2,4,11],behavior:[1,2,11],behaviour:10,behind:[1,2,6,11],being:[0,1,2,3,5,6,8,9,10,11,16],believ:[7,14],belong:[0,3,5,6,7,11],below:[1,2,3,4,5,6,7,8,9,10,11,14,16],benchmark:8,bendik:17,benefici:[2,11],benefit:[1,2,9,11,13],bengio:[2,15,18],benign:[2,5],besid:3,bessel:3,best:[0,1,2,3,4,5,6,7,8,10,11,16,17],beta:[1,2,3,4,5,8,9,11],beta_0:[1,2,3,5,11],beta_0x_:1,beta_1:[1,2,3,5,8,11],beta_1x_0:1,beta_1x_1:[1,5],beta_1x_2:1,beta_1x_:1,beta_1x_i:[5,11],beta_2:[1,11],beta_2x_0:1,beta_2x_1:1,beta_2x_2:[1,5],beta_2x_:1,beta_:[1,5,11],beta_i:[1,3],beta_j:[1,3,11],beta_k:11,beta_linreg:11,beta_m:8,beta_mg_m:8,beta_p:5,beta_px_p:5,betavalu:3,better:[0,1,2,4,7,8,9,10,11],between:[0,1,2,3,4,5,6,7,9,10,11,16],beyond:[1,2,3,4,6,11],bia:[1,2,3,6,7,8,10,11,15,16],bias:[2,3,4,7,10],big:[0,1,2,3,4],bigger:2,bigr:10,bike:7,bilbo:[],bilek:17,billion:[10,13],bin:[1,5,16],binari:[1,3,5,7,8,10,15,16],bind:1,binomi:13,binsboot:4,bioinformat:1,biolog:[2,10,18],bios1100:13,bird:1,birth:[],bishop:[15,18],bit:[0,2,14,16],bitwis:16,bla:[3,14],black:[0,6,7],block:[0,4,8,13,14],blockingavg:16,blockingstd:16,blockingvar:16,blocksiz:16,blocksizemax:16,blocksizemin:16,blue:1,bmatrix:[1,2,3,5,6,9,11,14],bmi:2,bodi:[1,2,10],bold:2,boldfac:[1,3],boldsymbol:[0,1,2,3,4,5,6,8,9,11],boltzmann:[10,13],book:18,bool:0,boost:[2,7,13,15],boostrap:8,bootavg:16,bootstd:16,bootstrap:[2,13,15],bootvar:16,bootvec:16,borrow:[],boston_dataset:1,bot:6,both:[0,1,2,3,4,6,7,8,11,13,14,16,17],bottl:5,bottom:[],bound:[1,3,6,10],boundari:[6,9,10],boundkei:3,box:7,boyd:[6,11],bracket:16,brain:[2,5,10],branch:7,breast:[3,5,9],breviti:11,brew:[1,13],brg:6,briefli:1,bring:[1,3,8],broad:1,broadcast:0,browser:[],brute:[3,9],bsol:[],bsubex:[],build:[1,3,4,8,14,16],built:[1,2,4],bunch:9,busi:1,bzl:3,c46dd114b2af:6,c_0:16,c_1:10,c_2:10,c_3:10,c_4:10,c_i:[10,11],c_k:16,cabc613b8702:[],cach:8,cal:[1,6,8,10,11],calcul:[0,1,2,3,4,6,7,8,9,10,11,14],call:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,16,18],callabl:[],calor:1,cambridg:[11,18],came:0,can:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,16,18],cancel:[1,11],cancer:[3,8],cancerpd:5,candid:[6,7,8],cannot:[1,2,3,5,6,7,15,16],canopi:[1,13],cap:3,capabl:[1,2,6,11,13],capita:1,captur:[9,10],card:[1,5],cardin:2,care:[0,9],carefulli:11,carlo:[1,4,13,16,18],carri:[4,5],cart:8,casella:18,cast:2,categor:[1,2,7,9],categori:[0,1,2,5,8,10,15],categorical_crossentropi:2,caus:[1,3,4,16],causal:1,causat:1,cax:2,cbar:2,ccc:[3,10],cdf:16,cdot:[0,1,4,10,11,14,16],celebr:11,center:[0,1,2,4,5,6,7,9,16],centr:18,central:[1,3,4,6,14],centroid:[0,16],centroid_differ:0,centroid_list:0,certain:[0,1,4,5,7,16],cha:1,chain:[2,11,13,16],challeng:0,chanc:[2,3,11,16],chang:[0,1,2,3,4,6,7,9,10,11,14,16],chapter:[0,1,4,8,9,14,15,18],charact:[1,3,6,16],character:[6,7,8,10,16],characterist:[1,2,8,11],charg:1,charl:1,chd:5,chddata:5,cheap:3,cheaper:[2,11],chebychev:0,check:[1,2,3,9,11,14],check_consistent_length:[],chemic:16,chen:8,choic:[0,1,2,4,7,10,11,14,16],choleski:[3,14],choos:[0,4,7,8,9,11,16],chosen:[1,2,4,6,7,8,11,16],chosen_datapoint:2,christian:18,christoph:[15,18],cin:16,circ:[2,10],circl:[1,6,10],circumfer:7,circumv:[2,3,11],clariti:[0,16],class_nam:7,class_val:7,class_valu:7,classic:[5,7,11],classif:[1,3,4,5,6,9,10,13,15,18],classifi:[1,2,5,7,8,9],classificaton:2,classifii:8,clean:2,clear:[2,3,8,10,11],clearer:0,clearli:[1,3,4,5,6,16],clever:[0,2,8],clf3:1,clf:[1,6,7,8],clf_ridg:[],clip:16,close:[0,1,2,4,6,7,9,10,11,16,18],closer:[3,11],closest:[0,6,9,11],closur:13,cloud:13,clust:0,cluster:[1,2,4,9,13,15],cluster_label:0,cmap:[1,2,4,6,7,8],cmath:16,cmb:15,cmd:7,cn_:16,cnn:[10,15],cntk:13,code:[4,5,6,11,13,14,15,18],coef0:6,coef:1,coef_:[1,3,6,7,11],coeff:3,coeffici:[1,3,4,5,6,7,11,14],coerc:[1,4],coin:[8,16],coin_toss:8,col:[1,9],colab:13,cold:7,colinear:1,collaps:6,collect:[1,4,8,9,13,16,18],collinear:3,color:[1,4,6,7,8,16],colorbar:[2,4],colsample_bytre:8,colsaobject:8,column:[1,2,3,4,5,6,7,9,10,14],columntransform:7,com:[4,13,17,18],combin:[2,3,4,5,8,16],come:[0,1,2,3,10,11,15],comma:[],command:[1,2,16],comment:[1,3,4],commerci:[1,13],commod:1,common:[0,1,2,3,4,5,7,9,16],commonli:[0,1,2,4,5,7,11],commun:[1,10],compact:[0,1,2,3,4,5,7,9,10,11],compar:[0,1,3,4,9,11,14],comparison:11,compat:5,compet:1,competit:8,compil:[1,2,13,14,16],complet:[1,7,10],completenn:10,complex:[2,3,6,7,9,10,11],complic:[0,1,2,4,7,11],compon:[0,1,2,3,4,5,7,13,15],components_:9,compos:[0,7,10],compphys:[4,13,15,18],compress:1,compris:4,compromis:3,compulsori:13,comput:[0,1,2,3,4,5,6,8,9,10,11,13,14,15,18],computation:[1,4,7,11,16],con:3,concaten:0,concav:[2,11],concentr:[1,8],concept:[0,1,13],conceptu:[10,11],concern:[0,1,2,5],concic:[],conclud:[1,3],conclus:2,conda:[1,2,13],condit:[1,3,4,6,7,9,11,16],conduct:13,coneqp:3,confid:[1,3,4,5,6],confirm:[3,10],confus:[3,4,8,14],confusion_matrix:7,congruenti:16,conjug:6,conjugaci:11,connect:[1,2,7,9,10,11,14],consequ:[3,4,6,8,10,11],conserv:[0,3],consid:[0,1,2,3,4,5,6,7,8,10,11,14,16],consider:[1,2,3,11],consist:[1,2,4,10,11,16],constant:[1,3,6,10,11,16],constitu:1,constitut:4,constrain:[2,3,5,9],constraint:[3,4,6,11],construct:[1,2,3,4,5,6,7,8,9,14,16,18],contact:1,contain:[0,1,3,4,5,6,7,9,10,11,14,16,18],contemporari:18,content:[2,13,14],context:[4,8,11],continu:[1,2,3,4,5,6,7,8,10,11,14],contour:[7,8,11],contourf:[6,7,8],contrast:[2,7,8,10],contribut:[1,3,16],contributor:1,control:[1,2,7,11,13],conveni:[1,3,4,10,11,14],convent:10,converg:[0,1,2,3,5,6,9,11],convergencewarn:[1,2,5,6,9],convert:[1,2,3,7,9,11,14],convex:[3,5],convinc:11,convolut:[2,13,15],cool:7,coolwarm:4,coordin:[0,3,10],coorel:1,copi:[0,1,2],core:[8,11],corel:1,coronari:5,corr:[1,3,5,9],correalt:[9,13],correct:[0,1,2,3,11,14,16],correctli:[2,4,8],correl:[1,2,3,4,5,8,10,11,13],correlation_matrix:[1,3,5,9],correspond:[0,1,3,4,6,7,9,10,13,14,16],cortex:10,cos:[1,4,7,11],cosin:[0,4],cost:[1,3,4,5,6,7,10,11,16],could:[1,2,3,4,5,6,7,8,9,10,11,14,16],coulomb:1,count:[1,7,15,16,17],countor:11,coupl:3,cours:[1,2,3,9,15,16],courvil:[15,18],cout:16,cov:[3,4,9,14,16],cov_xi:[3,9],cov_xx:[3,9],cov_yi:[3,9],covari:[1,5,13,14],covariance_matrix:[0,3,9],cover:[1,3,12,13,15,18],covert:1,covxi:16,covxx:16,covxz:16,covyi:16,covyz:16,covzz:16,cpu:2,creat:[2,3,7,8,9,10,13],create_biases_and_weight:2,create_neural_network_kera:2,create_x:[3,9],credit:[1,5],crim:1,crime:1,criteria:[0,1,7,8,16],criterion:[7,8,11],critic:4,cross:[1,2,5,7,8,11,13,15,16],cross_val_scor:4,cross_valid:[5,8],crossvalid:4,crucial:[2,16],csr_matrix:14,cstdlib:16,csv:[1,4,5,7],ctnk:2,cubic:1,cumbersom:3,cumsum:[8,9],cumul:8,cumulative_heads_ratio:8,cup:3,current:[0,2,11],curs:1,curv:[4,5,8,10],curvatur:11,custom:[0,3,4],custom_cmap2:[7,8],custom_cmap:[7,8],cutpoint:7,cvxbook:11,cvxopt:[3,6],cyber:18,cycl:[0,2,10,16],d985fb40c43d:4,d_f:11,dagger:[3,14],dai:[2,7,13],dalen:17,darget:7,darkr:16,dat:1,dat_id:[1,4,5,7],data1:0,data2:0,data3:0,data4:0,data:[0,3,6,8,10,11,14,18],data_id:[1,4,5,7],data_indic:2,data_panda:[],data_path:[1,4,5,7],databas:2,datafil:[1,4,5,7],datafram:[1,3,5,7,9],datapoint:[2,3,4,5,9,11],dataset:[0,1,4,5,6,7,8,9,11],date:1,daughter:8,david:18,dbh:2,dbo:2,dcomposit:14,dcost:3,dead:2,deal:[0,1,2,3,4,6,9,11,14,16],debt:5,debug:[3,4],decad:1,decai:[1,11,16],decent:8,decid:[1,3,4,7],decim:1,decis:[1,2,6,9,13,15,18],decision_funct:6,decision_tre:7,decisiontreeclassifi:[7,8],decisiontreeregressor:[1,7,8],declar:[1,14],decompos:[3,14],decomposit:[1,4,10,15],decompost:3,decorrel:[8,11],decreas:[2,3,4,8,9,11],deduc:1,deep:[5,10,11,13,15,18],deep_tree_clf1:7,deep_tree_clf2:7,deep_tree_clf:[7,8],deepen:[3,13],deeper:[0,1],deeplearningbook:18,def:[0,1,2,3,4,5,6,7,8,9,11,16],def_covari:16,defect:3,defici:3,defin:[0,1,3,4,5,6,7,8,9,10,11,14,16],definit:[0,2,3,4,6,8,9,10,11,14],defint:16,degre:[3,4,6,7,8,9,16],del:2,delet:[4,16],deliv:15,delta:[0,1,4,6,10,11,16],delta_:[2,14],delta_h:[1,2],delta_j:10,delta_k:10,delta_l:2,delta_n:1,delug:13,delv:1,demand:11,demonstr:[1,3,4,5,9,10,13],denomin:[2,3],denot:[2,4,5,11,16],dens:[0,2],densiti:[0,1,4,16],depart:17,depend:[0,1,2,3,4,5,6,9,10,11,13,16],depict:16,deploy:[1,13],deprec:1,depth:[1,7,8,14],deriv:[1,2,4,5,6,8,9,11,13],descend:[3,7,9],descent:[1,2,5,6,10],descr:1,describ:[0,1,3,4,6,8,9,10,11,14],descript:[0,1,6,7],design:[1,2,3,4,5,8,9,10,11],designmatrix:1,desir:[0,1,3,11],despit:[2,10],destroi:14,det:[3,14],detail:[0,1,4,9,11,14],detect:[6,10],determin:[1,3,6,7,8,9,10,11,14,16],determinist:[5,11,16],dev:[2,16],develop:[0,1,3,6,8,9,10,13,14],deviat:[1,2,3,4],devis:10,df1:[],diag:[3,6],diagnost:[2,8],diagon:[1,3,5,11,14,16],diagonaliz:3,diagram:8,dice:4,dict:6,dict_kei:1,dictionari:1,did:[0,1,2,3,5,8,9],die:2,diffeent:6,differ:[0,1,2,3,4,7,8,9,10,11,13,14,16,18],differenti:[13,14],differential_oper:11,difficult:[0,1,2,4,8,11,16],difficulti:[1,2,11],digit:[1,2,4,15,17],dilemma:11,dilut:2,dim:[0,9],dimens:[0,1,2,3,6,9,14],dimension:[0,1,3,4,7,9,11,13,14],dimensionless:1,diment:14,dimes:0,direct:[0,1,2,9,10,11],directli:[0,2,3,16],directori:[],disadvantag:1,disappear:4,discard:[4,9],disciplin:[1,10],disclaim:16,discourag:11,discov:1,discover:3,discret:[2,3,5,11],discrimin:[5,8,9],discuss:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,15,16,18],diseas:5,disk:[],disord:[2,5],displai:[0,1,2,3,4,5,6,7,8,9,10,16],displaystyl:[1,3],displot:1,disregard:1,dissimilar:[0,9],dist:0,distanc:[0,1,6,7,9,16],distance_list:7,distinct:[0,5,6,7,8],distinctli:6,distinguish:[1,5,6,16],distplot:1,distribut:[0,1,2,4,5,8,9,11,13,14],distrubut:[1,13],div:3,dive:[1,6],diverg:[2,11],divid:[1,2,3,4,6,7,9,10,16],divis:[4,6,7,11,14,16],dna:5,dnn:[1,2,10],dnn_kera:2,dnn_model:2,dnn_numpi:2,dnn_scikit:[1,2],doamin:[],doc:[4,13,15,18],doconc:[],document:[5,9,11],doe:[0,1,2,3,4,6,8,9,10,11,14,16],doesn:[7,10],dog:2,doi:0,doing:[1,3,4,9],domain:[3,6,11],domin:1,don:[0,1,2,3,4,6,9,11,13,16],done:[0,1,3,4,7,8,9,11,14,16],dot:[1,3,4,5,6,7,8,9,10,11,14,16],doubl:[14,16],doubli:2,down:[1,7,9,10,11],download:[1,2,3,4,14,18],dozen:2,drag:11,dramat:9,draw:[4,8,11],drawback:[1,2,11],drawn:[2,4,5,9,16],dre:3,drop:[1,2,3,4,9,11,16],dropna:[1,4],dtype:[0,1,2,14],dub:1,due:[0,2,3,4,6,8,10,11],dummi:1,dure:[1,2,6,7,9,13],dwell:1,dwh:2,dwo:2,dx_1:16,dx_1p:4,dx_2p:4,dx_mp:4,dx_n:16,dxp:4,dying:2,each:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,15,16,17],eapprox:1,earli:[2,11],earlier:[1,3,5,6,7,9,10,11],earthexplor:4,eas:[0,4,7],easi:[1,3,4,5,6,7,8,9,10,11,13,14],easier:[3,4,6,7,11,16],easiest:11,easili:[1,2,3,4,5,6,7,8,9,10,11,14],eastern:17,ebind:1,eblock:7,econometr:[],economi:3,ecosystem:13,ect:15,edgecolor:4,edit:[],edu:11,educ:1,eface79dac2c:8,eff:16,effect:[2,8,11,16],effic:2,effici:[1,8,11,13,14,16],efron:[4,16],egrad:11,eig:[3,9,11,14,16],eigen:16,eigenpair:[3,9],eigenvalu:[1,3,6,9,11,14],eigenvector:[3,9,11],eight:14,eigval:[14,16],eigvalu:[9,11],eigvec:[14,16],eigvector:[9,11],eispack:14,either:[1,2,3,4,5,6,7,8,9,11,16],ekstrom:17,elabor:16,electr:[1,10],electur:18,eleg:9,element:[2,3,4,5,6,9,10,11,13,14,15,18],elementari:[8,11,14],elementwis:11,elementwise_grad:11,elessar:[],elif:0,elim:14,elimin:[3,6],els:[2,5,7,10,11,16],elu:2,elus:1,email:[15,17],embed:[1,9],embodi:4,emit:16,emner:[15,18],emphas:[1,8,13],emphasi:[1,13,18],empir:[2,9,16],emploi:[1,2,3,4,9,11,16],employ:1,empti:[4,8],emul:10,enabl:9,enbodi:4,encapsul:0,encod:[0,1,3,7,9],encompass:[1,16],encount:[1,2,3,4,5,11,16],end:[0,1,2,3,4,5,6,7,8,9,10,11,14,16],end_box:11,end_nod:11,end_valu:11,endl:16,endpoint:16,energi:[1,4],enforc:10,eng:18,engin:[1,2,13,16],english:18,enough:[1,4,11],ensembl:[2,7,15,16],ensur:[1,2,3,4,9,11,16],enter:[3,16],enthought:[1,13],entir:[2,5,7,13,16],entiti:[7,10,14],entri:[1,3,6,9,10,14],entropi:[2,5,8,11],enumer:[1,2,6],env:[3,16],environ:[13,18],eol:1,eosfit:1,epoch:[1,2,10,11],epsilon:[1,3,4,5,11],epsilon_0:1,epsilon_1:1,epsilon_2:1,epsilon_:1,epsilon_i:1,eqnarrai:[3,4],equal:[0,1,2,3,4,6,7,9,10,11,14,16],equat:[0,2,3,4,5,6,7,8,9,11,14,16],equilibrium:10,equiv:[11,14,16],equival:[1,2,3,6,9,11,13,14],erf:16,eriador:[],eridg:[],err:[1,8],err_:4,errat:11,errno:[],error:[2,3,4,5,7,9,10,11,13,16],error_estimate_corr_tim:16,error_hidden:2,error_output:2,escap:11,esl:0,esol:[],especi:[2,7,10,11],essenti:[0,1,3,4,7,8,10,16],establish:[1,4,8,9],estim:[1,2,3,4,5,8,9,11,13,16],estimated_mse_fold:4,estimated_mse_kfold:4,estimated_mse_sklearn:4,esubex:[],eta0:[6,11],eta:[1,2,6,10,11],eta_:11,eta_t:11,eta_v:[1,2],etc:[0,1,2,3,5,6,7,9,10,11,13,14,16],ethic:13,etsim:4,euclidean:[0,1],evalu:[1,3,4,7,11,16],evalut:11,even:[0,1,2,3,4,6,7,8,9,10,11,13,14,16],event:[3,5,8],eventu:[3,4,9,10,11,17],everi:[0,1,2,3,4,7,8,9,10,11,13,16],everyth:10,everywher:11,evolv:1,exact:[1,3,9,10,11,14,16],exactli:[1,4,10,13],examin:4,exampl:[3,4,9,10,11,13,14,15,18],exce:[2,10,11],excel:[0,1,2,3,8,18],except:[3,4,6,7,16],excess:1,excit:1,exclud:[2,4,10],exclus:[1,2,4,16],execut:[3,11],exemplifi:11,exercis:[3,13,15],exhaust:4,exhibit:[1,3,4,6],exist:[0,1,2,3,4,5,6,7,11,14,18],exit:[3,14,16],exp:[1,2,3,4,5,6,8,9,10,11,16],exp_term:2,expand:[3,5,9,11],expans:[1,3,6,8,10,11],expect:[1,2,3,4,5,9,10,11,13],expectation_value_of_h_wrt_p:16,expens:[4,8,11,16],experi:[1,2,4,6,11,13],experiment:[1,4,7,16],expert:[2,7],explain:[0,1,4,7,8,9,11,16],explained_variance_ratio_:9,explanatori:1,explicit:[1,4,11,14],explicitli:[0,1],explod:2,exploit:[1,10,11],explor:[2,4,6,11,13],expon:2,exponenti:[1,2,3,4,8,11],export_graphviz:7,export_text:7,exporttext:7,expos:13,express:[1,3,4,5,8,10,11,14,16],exptmean:16,exptvari:16,extend:[3,5,9,11,13],extens:[1,10,13],extent:[1,2,4,18],extern:7,extra:[2,3],extract:[1,3,5,6,9,11,14],extrapol:1,extrem:[0,1,2,3,5,6,7,11,14],extremum:11,extrins:9,eye:[0,1,3,11,14],f11:1,f12:1,f13:1,f1_grad:11,f1d:11,f2_grad_x1:11,f2_grad_x1_analyt:11,f2_grad_x2:11,f2_grad_x2_analyt:11,f3_grad:11,f3_grad_analyt:11,f4_grad:11,f4_grad_analyt:11,f5_grad:11,f6_grad_analyt:11,f6d7a289d493:14,f7_grad:11,f7_grad_analyt:11,f8_grad:11,f9_altern:11,f9_alternative_grad:11,f9_grad:11,f_0:8,f_1:[8,11],f_2:[10,11],f_3:10,f_d:16,f_grad:11,f_grad_analyt:11,f_i:[4,10],f_m:8,face:11,facecolor:[4,6,16],facil:[1,13],facilit:10,fact:[1,2,3,7,9,10,11],factor:[1,2,3,7,8,9,11,14,16],factori:11,fafab0:[7,8],fail:[1,4,5,6,9,11,17],failur:5,fairli:[0,2,16],fall:[6,7,15],fals:[0,1,2,3,4,5,7,8],famili:[1,5,6,16],familiar:[1,3,4,6,13,14,16],famou:[4,10,14],far:[0,1,3,6,9,10,11,16],fashion:[1,7,8],fast:[2,4,8,10,11,13,16],faster:[2,9],fastest:11,favor:5,favorit:16,featur:[1,2,3,4,5,6,8,9,10,11,13,16],feature_nam:[1,2,5,7],feautur:7,fed:2,feed:[1,9,13,15],feed_forward:2,feed_forward_out:2,feed_forward_train:2,feedforward:[2,10],feel:[0,1,3,4,9,11,13,17],feet:1,fetch:4,few:[0,2,3,7,12,16],fewer:[1,7,9],ffnn:[2,10],field:[1,10,13],fifth:[1,4],fig:[0,1,2,4,5,10,11],fig_id:[1,4,5,7],figaxi:16,figsiz:[1,2,4,5,6,7,8],figur:[0,1,2,3,4,5,6,7,8,10,11,13],figure_id:[1,4,5,7],figurefil:[1,4,5,7],file:[1,2,3,4,5,6,7,14,16],filenam:[1,16],filenotfounderror:[],fileout:16,fill:[3,7],financ:1,find:[0,1,2,3,4,5,6,7,8,9,10,11,13,16],fine:[0,1],finit:[3,4,10,11,16],first:[0,1,2,3,4,5,6,7,8,9,11,14,15,16,18],firsteigvector:9,fit:[2,3,4,5,6,7,9,10,11,16],fit_intercept:[1,3,4],fit_mod:7,fit_transform:[1,4,6,7,9],fiti:1,five:[1,7],fix:[1,4,8,9,10,11],fkkt:3,flag:0,flat:[10,11],flatten:[2,3],flexibl:[1,2,4,6,8,10],float32:7,float64:[1,14],flop:[3,14],flow:[2,10],fluctuat:3,fly:9,flyvbjerg:16,fmesh:11,focu:[1,3,4,13,18],focus:[2,5,14],fold:[4,7],folder:[1,4],follow:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,15,16,17,18],font:[1,5,16],fontdict:16,fontsiz:[2,6,7,8,16],fontweight:2,foral:6,forc:[1,3,8,9],forecast:10,forelesningsvideo:15,forest:[1,2,7,13,15],forget:9,form:[1,3,4,5,6,7,9,10,11,13,14,16],formal:[0,16],format:[1,2,4,5,6,7,8,9,13,16,18],formatstrformatt:[4,11],formul:[0,9],formula:[11,16],forth:10,fortran2003:13,fortran90:16,fortran:[1,13,14],fortun:[1,9],forward:[1,4,13,14,15],found:[2,3,4,10,11],foundat:13,four:[3,4,6,10,14,15],fourier:1,fourth:10,frac:[0,1,2,3,4,5,6,7,8,9,10,11,14,16],fraction:7,frame:5,framework:[2,6,8,16],frank:[3,9],frankefunct:[3,4,9],free:[1,4,9,11,13,14,16,17,18],freecodecamp:13,freedom:3,freeli:1,frequenc:[4,5,16],frequent:[1,6,7,11],frequentist:13,fresh:8,fret:0,fridai:15,friedman:[4,15,18],frodo:[],from:[0,1,2,4,5,6,7,9,11,13,14,15,16,17,18],from_cod:7,front:[1,3],fruit:0,fstream:16,fulfil:[3,10],full:[1,2,3,5,7,8,11,16],full_matric:3,fulli:[4,10,15,16],fun:[11,13],func:[],functionali:9,fundament:[1,4,13],further:7,furthermor:[1,3,4,5,9,10,11,13],futur:[1,6,7],futurewarn:1,fys:[15,17],g_1:8,g_2:8,g_m:8,gain:[0,2,3,7,8,11],galleri:1,gamge:[],gamma1:6,gamma2:6,gamma:[1,6,7,8,9,11],gamma_0:8,gamma_1:8,gamma_1x:8,gamma_:1,gamma_i:[1,6,16],gamma_j:11,gamma_k:11,gamma_m:8,gamma_x:1,gap:[3,6],gate:10,gather:[1,2,10],gaug:10,gaussbacksub:14,gaussian:[0,3,4,6],gaussian_point:0,gaussian_rbf:6,gave:11,gbc:15,gca:[4,6,11],gd_clf:8,gdclassiffiercgain:8,gdclassiffierconfus:8,gdclassiffierroc:8,gdm:11,gdregress:8,gemv:3,gen:16,gender:1,gener:[0,1,2,3,4,6,8,9,10,11,14,18],generallay:10,generate_simple_clustering_dataset:0,genom:13,geodes:9,geometr:[1,11],geometri:3,georg:18,geotif:4,geq:[3,6,7,11],geron:[1,15,18],get:[0,1,2,3,4,5,7,8,9,11,13,14,16],get_distances_to_clust:0,get_dummi:7,get_split:7,get_yaxi:6,getattr:[],getsolutionslic:3,gibb:13,gini:8,gini_index:7,git:[1,13],github:[1,4,13,15,18],gitlab:[1,13],give:[0,1,2,3,4,5,6,7,8,10,11,13,15,16,18],given:[0,1,2,3,4,5,6,7,8,9,10,11,14,16],glare:0,global:[4,5,11,16],glorot:2,gmail:17,goal:[1,5,7],goe:[0,1,2,3,4,11,14],going:[1,2,3,4,6,7,9,10,11],golden:11,gone:3,gong:2,good:[0,2,3,7,8,9,11,13,15,16,18],goodfellow:[15,18],googl:[0,2,13],got:[2,4],gov:4,gpu:2,grad:11,grad_analyt:11,grade:15,gradient:[1,5,6,7,10,13,15],gradientboostingclassifi:8,gradientboostingregressor:8,gradual:[0,2],grai:4,graph:[2,7,9,10,11],graph_from_dot_data:7,graphic:[1,2,7],grasp:1,gray_r:2,great:[3,11],greater:[2,5,16],greatli:11,greedi:7,green:[1,7,16],grid:[2,4,5,6,10,16],grossli:11,ground:1,group:[0,1,4,5,7,13,15],groupbi:1,grow:[2,7,8],growth:1,guarante:[1,11,16],guess:[0,2,8,11],guestrin:8,guid:2,h21:15,h_1:11,h_2:11,h_m:8,habit:1,had:[1,2,4,5,11],hadamard:[2,10],half:[2,6,7],halv:8,hand:[1,2,3,9,10,11,13,14,15,16,18],handl:[1,2,3,7,9,13],handle_unknown:7,handsid:10,handwrit:10,handwritten:[2,3],happen:[0,2,3,8,11,16],hard:[2,5,6,8,11],hardcopi:13,harder:[1,2],has:[0,1,2,3,4,5,6,7,8,9,10,11,14,16],hasn:[1,2],hassl:[1,13],hast:13,hasti:[0,1,4,15,18],hat:[2,3,4,5,7,8,9,10,11,14,16],have:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,16],haven:2,hdf5:[],head:[1,8,16],header:1,heads_proba:8,health:1,hear:1,heart:[1,5],heatmap:[1,2,5],heavili:1,heavisid:2,height:2,held:11,help:[0,1,2,10,11],helper:0,henc:[1,3,4,6,7,8,10,11],her:5,here:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,15,16,18],hereaft:[1,6,10],hermitian:14,hessenberg:14,hessian:[1,3,11],heterogen:[7,8],hidden:[2,10],hidden_bia:2,hidden_bias_gradi:2,hidden_layer_s:[1,2],hidden_weight:2,hidden_weights_gradi:2,hierarch:[0,3],high:[0,1,2,3,4,7,8,9,11,13,14],higher:[1,2,3,4,6,11],highest:2,highli:[1,8,13,14,16,18],highwai:1,hing:6,hint:11,hip:13,hire:1,his:5,hist:[4,5,16],histogram:[1,4,5,16],histor:[5,9],histori:10,histplot:1,histtyp:[],hitherto:3,hjorth:17,hobbi:16,hoc:3,hoff:18,hold:[0,2,4,11,16],holder:1,home:1,homework:[4,11],homogen:[2,7,8,11],hopefulli:[1,9,16],horizont:9,hors:5,hot:[2,7],hour:[2,13,15,16,17],how:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,18],howev:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,16],hspace:[1,6,8,16],hstack:2,htf:15,html:[5,9,13,15,18],http:[4,5,9,11,13,14,15,18],huang:1,huber:1,huge:[2,13],human:[1,2,7,10],humid:7,hundr:2,hungri:2,hybrid:15,hydrogen:1,hyperbol:[2,10],hyperparam:6,hyperparamet:[0,3,7],hyperplan:9,i_1:[3,4],i_2:[3,4],ian:18,idea:[1,2,4,7,8,10,11,14,16],ideal:[0,1,4,6,11,16],idem:4,ident:[3,4,10,11,14],identical:3,identifi:[0,1,2,5,6,7,9,10,11],idum:16,ieor:16,ifi:18,ifs:13,ignor:[1,2,7],iii:14,ijca2016907841:0,illustr:[0,3,5,8,10,11,13],imag:[2,7,9,10,18],image_path:[1,4,5,7],imageio:4,imagin:2,immedi:[1,13],implement:[0,1,3,4,6,7,8,9,10,11],impli:[3,4,5,11,14],implicitli:[9,16],impos:[1,9,10],imposs:[1,3],impress:[1,10],improv:[0,1,3,7,8,9,11],impur:7,imread:4,imshow:[2,4],in3050:18,in4080:18,in4300:18,in5400:18,inaccur:11,inact:10,inadequ:1,includ:[1,2,3,4,5,9,10,11,13,16,17,18],include_bia:[4,7],incom:10,inconsist:[],incorrect:2,incoveni:6,increas:[1,2,3,4,5,6,7,9,10,11,16],increasingli:16,ind:4,inde:[1,3],indent:16,indentationerror:16,independ:[1,3,4,5,6,10,11,16],index:[0,1,2,8,13,16,18],index_col:1,indic:[1,2,3,4,7,8,9,11],indispens:4,individu:[2,4,5,8,10,16],indu:1,indx:14,ineffici:[0,11],inequ:6,inequaltii:11,inertia:11,inf1000:13,inf1100:13,inf1100l:13,inf1110:13,inf3000:18,inf4490:18,inf5860:18,inf:1,infeas:7,infer:[1,2,4,18],inferenc:2,infil:[1,4,5,7],infin:[3,4,5,9],infinitesim:16,influenc:[4,8],influenti:2,info:[],inform:[0,1,2,4,7,9,10,11,14,18],infti:[4,11,16],ingeni:11,ingredi:[1,7],inher:4,inherit:14,initi:[0,1,2,4,8,11,14,16],initialis:16,inject:0,inlin:[0,1,2,3,4,5,6,7,8,9,10,11,14,16],inner:11,innov:18,inplac:11,input:[0,1,2,3,4,5,6,7,8,10,11,14,16],input_dim:2,inputs:2,inputs_shuffl:[1,2],insert:[3,4,6,8,16],insid:[1,5],insight:[1,2,3,13,18],insist:11,inspir:[1,2,10,18],instal:[1,2,3,4,7],instanc:[1,2,4,7,9,11],instanti:8,instead:[0,1,2,3,4,6,7,9,11,14,16],institut:2,instruct:[1,2],int32:8,int64:1,int_0:16,int_:[4,16],int_a:16,intak:1,integ:[0,2,11,14,16],integer_vector:2,integr:[4,16],intellig:[0,1,18],intend:8,intens:2,intention:0,interact:[1,7,10,13],intercept:[1,6,9,11],intercept_:[1,6,7,11],interchang:[3,10,14],interconnect:2,interest:[1,2,3,4,5,6,7,10,13,15,16],interfac:[1,2,14],interior:[1,7],intermedi:14,intern:[2,8,10],interpol:[2,4,10],interpr:3,interpret:[1,2,4,7,8,10,11,14,16],interv:[1,3,4,5,11,16],intial:11,intimid:[],intract:1,intrins:[9,14,16],intro:[13,18],introduc:[1,2,3,4,6,8,10,11,14,16],introduct:[2,11,15,18],introductori:[1,14,18],intuit:[1,3,4,6,10,11],inv:[1,3,11],invalid:[2,6,14],invalu:[1,11,13],invari:2,invd:3,inver:6,invers:[1,4,11],invers_period:16,inverse_transform:6,invert:[1,3,5,8],invok:[1,6],involv:[1,4,5,9,10],iomanip:16,ios:16,iostream:16,ipca:9,ipynb:13,ipython:[0,1,2,3,4,5,6,7,8,9,11,13,14,16],irani:0,iri:[6,7],irreduc:4,irrelev:3,irrespect:1,isbox:11,isinst:11,isn:3,isnul:1,isomap:9,issu:[2,7,14],it_arrai:11,item:[1,11],items:14,iter:[0,1,2,4,5,6,9,11,16],itr:3,its:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,18],itself:[3,4,10,16],jackknavg:16,jackknif:[4,13],jackknstd:16,jackknvar:16,jackknvec:16,jacobian:11,jargon:16,jensen:17,jerom:18,job:[6,8],join:[1,4,5,7],joint:3,journal:16,judg:11,judgement:4,julia:[13,14],jump:[0,16],jupyt:[0,1,13,18],just:[0,1,2,3,4,5,6,7,8,9,10,11,16],justif:1,justifi:8,k_mean:0,kaggl:4,kappa_d:16,karim:17,karlsen:17,karush:6,keep:[0,1,2,3,4,9,11,14],keepdim:[2,4,8],kei:[1,2,10,18],kept:0,kera:[1,13,15],kernel:[1,2,13],kernel_regular:2,kernelpca:9,kev:1,kevin:18,keyword:14,kfold:4,kick:[2,11],kind:[0,1,6,10,11],kjm:13,kkt:[3,6],kktsolver:3,kmeanspoint:0,kn_k:0,know:[0,1,2,3,4,6,11,13,16],knowledg:[1,13],known:[2,3,4,5,6,7,10,14,16,18],kondev:1,kpca:9,kroneck:0,kuhn:6,kwarg:11,kwown:1,l1_l2:2,l1regl:3,l1regls_mosek2:3,l1regls_mosek:3,l_1:5,l_2:[5,11],l_j:10,la_i:10,la_k:10,lab:[13,15],label:[0,1,2,3,4,5,6,7,8,10,11,13,14,16],labelencod:[5,8],labels:[6,7],labels_shuffl:[1,2],labor:0,laboratori:15,lack:[0,1],lagrang:[6,9],lambda:[1,2,3,4,5,6,8,10,11,16],lambda_0:9,lambda_1:[3,6,9],lambda_2:[6,9],lambda_:9,lambda_i:[6,9],lambda_iy_i:6,lambda_jy_iy_j:6,lambda_k:6,lambda_n:[3,6],lamda:2,lamdbda:3,land:[1,6],landmark:6,landscap:11,langl:[1,4,9,16],languag:[1,2,6,13,14,18],lapack:[3,14],laplac:3,laptop:13,larg:[1,2,3,4,6,7,8,9,11,13,14,16,18],larger:[1,3,4,6,8,9,11,16],largest:[6,9],lasso:[1,5,13,15],last:[0,1,2,3,4,5,6,7,8,10,11,14,15,16],later:[0,1,2,5,6,10,11,13,16],latex:[],latter:[1,3,4,5,6,9,11,14,15,16],lattic:10,law:1,layer:[1,11],lbfg:[5,7,8,9],lbl:[],lcc:[3,4],lda:9,ldot:[1,4,9,16],lead:[1,2,3,4,5,6,7,8,9,10,11,14,16],leaf:7,leaki:2,lear:11,learn:[3,4,5,6,7,8,10,14,15,18],learner:8,learning_r:[6,8],learning_rate_init:[1,2],learning_schedul:11,least:[0,1,5,6,8,9,13,14,15,16],leav:[1,2,3,4,7,9],lectur:[1,2,3,8,9,10,11,13,14,15,18],lecturenot:[13,18],lectureseptember10:15,lectureseptember16firstpart:15,lectureseptember16secondpart:15,lectureseptember17:15,lectureseptember2:15,lectureseptember3:15,lectureseptember9:15,lecturethursdayaugust26:15,lecturethursdayaugust27:15,left:[1,2,3,4,5,6,7,8,9,10,11,14,16],leftarrow:[6,10],legend:[1,3,4,5,6,7,8,11],len:[0,1,2,3,4,6,7,8,9,10,14,16],length:[1,2,6,7,11,13,16],leq:[0,1,3,5,6,11,16],less:[1,2,3,4,6,7,16],lessen:2,let:[0,1,2,3,4,5,6,7,8,9,10,11,14,16],letter:[1,14,16],level:[1,2,3,4,7,13,14,15],lib:[1,2,5,6,9,11],liblinear:[6,8],librari:[1,2,3,4,7,8,9,14,16,18],licens:[1,2,13],lie:[1,4,9,16],lies:[6,9],life:[1,2,6,10],lifetim:11,lift:0,light:[],like:[0,1,2,3,4,5,7,8,9,10,11,13,14,16],likelihood:[1,2,3,7],lim_:16,limit:[1,3,4,5,6,9,10,14],lin_clf:6,lin_model:1,lin_reg:7,linalg:[1,3,6,9,11,14,16],line1:6,line2:6,line2d:11,line3:6,line:[1,2,4,6,9,11,14,16],linear:[2,3,4,5,7,8,9,10,13,15,16],linear_model:[1,3,4,5,6,7,8,9,11],linear_regress:4,linearli:3,linearloc:[4,11],linearregress:[1,4,5,7],linearsvc:6,liner:2,linerar:8,linewidth:[1,4,6,7,8],link:[1,7,10,13],linlag:3,linpack:14,linreg:1,linspac:[1,4,6,7,8,11,14,16],linu:17,linuek:17,linux:[1,2,13],liquid:1,list:[0,1,2,3,7,13],listedcolormap:[7,8],literatur:[0,2,5,18],littl:[2,7,10],live:6,lle:1,lloyd:0,lmb:[3,4],lmbd:[1,2],lmbd_val:[1,2],lmbda:11,load:[1,2,4,5,7,8],load_boston:1,load_breast_canc:[2,5,7,8,9],load_digit:2,load_iri:[6,7],loc:[1,4,5,6,7,8],local:[1,2,5,10,11],locat:6,log10:[3,4],log:[1,2,3,4,5,7,8,9,11,14],log_:1,log_clf:8,logarithm:[1,3,5,14],logic:[1,2,7],logist:[1,2,6,7,8,9,10,11,13,15],logisticregress:[5,7,8,9],logit:5,logreg:[5,7,8,9],logspac:[1,2,3,4],longer:[0,6,8,14,16],longest:0,loocv:4,look:[0,1,2,3,4,5,6,7,8,9,11,14,16],loop:[0,2,4,8,10,13,14,16],lose:2,loss:[1,2,3,4,5,6,8,9,11,14],lot:[0,1,2,4],low:[1,4,7,8,9,16],lower:[1,2,7,8,14],lowercas:14,lowest:[7,11,16],lstat:1,lstsq:1,lubksb:14,ludcmp:14,lux:14,lvert:2,m_1:0,m_h:1,m_k:0,m_l:10,m_n:1,m_p:1,m_t:11,machin:[2,3,4,5,7,8,9,10,14,15,18],machinelearn:[4,13,15,18],mackai:18,made:[1,2,3,4,5,7,9,10],mae:1,magic:0,magnitud:[2,5,11],mai:[1,2,3,4,5,6,7,9,10,11,13,14,16],mail:15,main:[1,2,3,4,5,7,14,18],mainli:[1,3,4,5,7],maintain:4,major:[2,4,7,8,11,14],make:[0,2,3,4,5,6,9,10,11,13,14,16,18],make_moon:[6,7,8],make_pipelin:[1,4,8],make_vjp:11,makedir:[1,4,5,7],makeplot:1,malcondit:14,malign:[2,5,7],mammographi:3,manag:[1,13],manhattan:0,mani:[0,1,2,3,4,5,6,7,9,11,12,13,14,16,18],manifold:9,manual:0,map:[0,1,2,4,5,6,9,10,16],margin:[1,3,6],marit:1,mark:[],marker:[1,5,14],markov:13,marsaglia:16,mask:16,mass:[1,2,3,11],massag:1,masses2016:1,masses2016ol:1,masses2016tre:1,masseval2016:1,master:[4,15],mat1100:13,mat1110:13,mat1120:13,mat3155:15,mat4155:15,mat:13,match:[0,2,3,11],materi:[3,5,14],math:[0,5,10,11,14,16,18],mathbb:[0,1,3,4,5,6,9,10,11,14,16],mathbf:[1,3,4,5,6,11,14,16],mathcal:[2,3,4,5,11],mathemat:[0,1,9,10,11,13,14,16,18],mathemati:[],mathemt:[],mathrm:[0,1,2,3,4,5,6,7,8,9,10,11,16],matmul:[2,3],matnat:[15,17,18],matplotlib:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,16],matric:[1,2,5,6,9,11,13,14],matrix:[1,4,5,6,8,11],matshow:2,matter:11,max:[1,2,7,8,10,11],max_depth:[1,7,8],max_it:[1,2,5,6,9,11],max_iter:0,max_leaf_nod:8,max_sampl:8,maxdegre:[1,4,8],maxdepth:8,maxim:[2,3,5,6,9],maximum:[0,1,2,3,5,6,7,8,11],maxpolydegre:[3,4],mbox:[3,4],mcculloch:10,mcint:16,mcintsqr2:16,mean:[2,3,4,5,7,8,9,10,11,13,14,15],mean_absolute_error:1,mean_divisor:0,mean_i:16,mean_matrix:0,mean_squared_error:[1,4,5,8],mean_squared_log_error:1,mean_vector:0,mean_x:16,meaning:[1,5],meansquarederror:1,meant:[5,8,11],meantempvec:16,meanvec:16,measur:[0,1,2,3,4,7,9,10,16],mechan:[1,16],median:1,medicin:10,medium:[6,11],medv:1,meet:[1,17],mehta:1,memori:[9,10,11,14],mention:[0,1,10,11,16],mere:1,mersienn:16,meshgrid:[3,4,6,7,8,9],messag:[3,11],met:[1,6],meteorolog:7,method:[0,1,2,3,5,6,9,10,13,14,15,18],metion:4,metric:[0,1,2,4,5,7,8],metropoli:13,mev:[1,16],mglearn:13,mgrid:11,mhjensen:[1,2,5,6,9],microsoft:18,mid:2,midpoint:7,might:[1,2,7,11],mild:7,miller:16,million:1,mimic:10,min:[1,3,6,7],min_:[0,1,3],min_samples_leaf:7,mind:[0,1,4,11],mine:13,mini:[2,9,10,11],minibatch:[2,9,11],minibathc:11,minim:[0,1,2,3,4,5,6,7,8,9,10,11,16],minima:[1,2,5,11],minimum:[1,2,4,6,7,9,11],minkowski:0,minmaxscal:1,minor:16,minst:2,minu:5,mirror:7,misc:4,misclassif:[6,7,8],misclassifi:[6,8],miser:1,mismatch:2,miss:[1,8],mit:18,mix:2,mixtur:11,mkdir:[1,4,5,7],mlab:16,mle:[3,5],mlp:2,mlpclassifi:2,mlpregressor:1,mnist:[2,9],mod:16,mode:[15,16],model:[0,3,4,5,6,7,8,9,11,13,16,18],model_select:[1,2,3,4,5,7,8,9],moder:8,modern:[1,4,5,13],modif:[10,11],modifi:[1,2,3,5,6,8,10,11],modul:[1,4,5,7,8,9,11,14],modular:16,modulenotfounderror:7,modulo:16,moe:[3,9],moment:[3,4,11],monitor:11,monoton:[3,10,16],mont:[1,4,13,16,18],montecarlocycl:16,moor:3,more:[1,2,3,5,6,7,8,9,10,11,13,15,16],moreov:1,morten:17,mosek:3,most:[0,1,2,3,4,5,6,7,8,9,10,11,13,15,16],mostli:[2,9],motion:[1,11],motiv:2,move:[0,1,3,4,5,7,10,11,16],mp4:15,mpl:[1,5],mpl_toolkit:[4,11],mplot3d:[4,11],mplregressor:2,mse:[1,3,4,7,8],mse_simpletre:8,mselassopredict:3,mselassotrain:3,msepredict:3,mseridgepredict:3,msetrain:3,msg:1,msle:1,mt19937_64:16,mu0:16,mu1:16,mu2:16,mu_:16,mu_n:9,mu_x:16,much:[1,2,3,4,6,7,8,9,10,11,14,16],mul:3,multi:[1,2,5,13],multiclass:[2,5],multidimension:[9,10],multilay:2,multinomi:5,multipl:[3,4,5,10,11,16],multipli:[3,9,11,14,16],multiplum:6,multitud:[],multivari:[1,8,9,13,16],multivariate_norm:[0,9],murphi:[9,18],must:[0,2,3,4,6,8,10,11,16],mutat:5,mutual:[2,4,11],mx_:16,myriad:[1,13],mz1:16,mz2:16,n_0:[10,16],n_b:16,n_boostrap:[4,8],n_bootstrap:4,n_categori:2,n_cluster:0,n_compon:9,n_epoch:11,n_estim:8,n_featur:2,n_hidden_neuron:[1,2],n_i:16,n_input:[1,2],n_instanc:7,n_iter_i:[5,9],n_job:8,n_k:0,n_l:[10,16],n_layer:2,n_m:7,n_neuron:2,n_neurons_layer1:2,n_neurons_layer2:2,n_point:0,n_sampl:[0,4,6,7,8],n_split:4,nabla:[2,11],nabla_:11,nabla_w:11,nag:11,naimi:1,naiv:[0,5],nall:1,name:[0,1,2,3,4,5,6,7,8,10,11,13,14,17],nameerror:[4,8],namespac:16,narrow:11,nary_f:11,nary_op_arg:11,nary_op_kwarg:11,nary_oper:11,nation:[2,3],nativ:13,natur:[1,2,6,7,10,11,16,18],navier:10,nb_:14,nbconvert:[],nboot:16,nearest:[2,9],nearli:11,neat:[],neccesari:4,necessari:[0,1,2,6],necessarili:[1,9,16],necesserali:3,neck:5,need:[0,1,2,3,4,6,7,8,9,10,11,14,16],neg:[1,2,3,4,5,8,11,16],neg_mean_squared_error:4,neglect:16,neglig:16,neighbor:9,neither:11,neq:[0,11,16],nervou:10,nest:[7,10],nesterov:11,net:10,netlib:14,network:[1,7,11,13,15,18],neural:[1,5,11,13,15,18],neural_network:[1,2],neuralnetwork:2,neuron:[2,10],neutral:1,neutron:1,never:[2,4,7,16],new_box:11,new_hobbit:[],new_root:11,new_sig:[],new_trac:11,newaxi:[1,4,7],newli:1,newton:[2,5,6,11,16],next:[0,1,2,3,6,7,11,16],next_guess:11,nian:17,nice:[0,1,2,3,9],nichola:17,nicholaskarlsen1102:17,niter:11,nitric:1,nlambda:[3,4],nm_n:1,nmse:4,nn_model:2,node:[2,7,8,10],nois:[1,3,4,6,7,8,11],noisi:[2,4],non:[0,1,2,3,4,5,7,8,9,10,11,14,16],none:[0,1,2,3,7,8,11,16],nonetheless:0,nonlinear:[4,6,7,9,10],nonneg:[4,7,11],nonparametr:4,nonsens:16,nonsingular:14,nonumb:[5,6,11,14],nor:[2,11],norm:[1,2,3,4,6,9,11],normal:[3,4,5,6,7,8,9,10,11,13,14],normali:14,normpdf:[],norwai:4,notat:[0,1,3,4,11,16],note:[0,1,2,3,4,5,6,9,10,11,13,14,15,16,18],notebook:[0,1,2,7,13],noth:[0,2,3,6,10,16],notic:[3,10,11,14,16],novel:[4,8],novemb:2,now:[0,1,3,4,5,6,8,9,10,11,14,16],nowadai:[1,2,7,13],nox:1,np_assign_points_to_clust:0,np_get_distances_to_clust:0,np_k_mean:0,nsampl:4,nspin:16,nthi:1,nuclear:3,nuclei:[1,16],nucleon:1,nucleu:1,num_tre:8,number:[0,2,3,4,5,6,7,8,9,10,11,14,15,17],numberid:5,numer:[1,3,4,7,8,9,10,11,13,14,18],numpi:[0,1,2,3,4,5,6,7,8,9,10,11,13,16],nunmpi:3,obei:[9,11],object:[1,2,3,6,8,11,14],objsens:3,obliqu:3,observ:[0,2,3,4,5,6,7,8,9,10,11],obtain:[0,1,2,3,4,5,6,7,8,10,11,14,16],obviou:[3,9,16],obviouli:1,obvious:[1,3,4,14],occupi:1,occur:[1,6,7,16],odd:[1,5],oen:1,off:[2,3,7,11,16],offend:[],offer:[4,9,13,14,15],offic:17,offici:15,ofil:16,ofstream:16,often:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,16],ofter:14,old:[2,3,8,11],olsbeta:3,omit:[1,3],onc:[0,2,4,7,9,11,16],one:[0,1,2,3,4,5,6,7,8,9,11,13,14,16],onehot:2,onehot_vector:2,onehotencod:7,ones:[1,3,4,6,7,8,9,11,14],onli:[0,1,2,3,4,5,6,7,8,9,10,11,14,16],onlin:[9,15],onto:[3,9],open:[1,2,4,5,7,13,15,16],oper:[1,2,3,4,8,9,10,11,13,14,16],operation:16,opinion:0,oplu:16,opmiz:11,opportun:1,oppos:11,opposit:[2,3,6],opt:[1,2,3,5,6,9,11],optim:[0,1,3,4,5,7,8,9,15],optimis:2,option:[1,2,3,4,5,6,9],optmiz:[2,6],orang:1,order:[1,2,3,4,5,6,7,8,9,10,11,14,16],ordinari:[1,5,9,11,13,15],oreilli:18,org:[5,9,13,14,18],organ:[0,4,5,8,14],orient:[2,3,16],origin:[1,3,4,6,9,10,11,14,16],orthogn:3,orthogon:[1,3,6,9,11,14],orthonorm:3,oscar:2,oscil:11,oslo:[1,15,17],osx:[1,13],other:[0,1,2,3,4,5,6,8,11,13,14,15,18],otherwis:[1,2,5,11],ouput:[3,5,10],our:[2,4,5,6,7,8,10,13,14,15],ourmodel:1,ourselv:[0,1,3,4,6,9,11],out:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,16],out_fil:7,outcom:[1,5,7,8,10,16],outdoor:7,outer:10,outfilenam:16,outlier:[1,6],outlin:[4,8,9],outlook:7,outperform:8,output:[1,2,3,5,6,7,8,10,11,14],output_bia:2,output_bias_gradi:2,output_weight:2,output_weights_gradi:2,outputlayer1:10,outputlayer2:10,over1:11,over:[0,1,2,3,4,7,8,10,11,16],overal:[2,8],overcast:7,overcom:[10,11],overdetermin:1,overfit:[1,2,4,7,8,11],overflow:[2,3],overhead:10,overlap:[5,6,7],overlin:[0,1,3,4,7,8,9,14],overst:1,overview:[0,18],own:[3,4,6,10,11,13,14],owner:1,oxid:1,oyvinssc:17,p_i:[3,16],p_j:16,p_n:16,p_x:16,pack:1,packag:[1,2,3,5,6,9,11,13,16],page:[1,13],pai:[1,2,7,11],painless:[],pair:[1,7,13,16],panda:[1,3,4,5,7,9,13],panel:[],paper:2,paradigm:1,parallel:[8,14],paramet:[1,2,3,4,5,6,7,8,10,11,16],parameter:[1,4,8],parametr:[1,4],paramt:3,park:16,part:[0,1,2,3,4,8,14,15,16,18],partial:[1,2,3,5,6,8,9,10,11,16],particip:[13,15],particl:[1,11,16],particular:[1,2,3,4,7,8,9,10,11,16,18],particularli:[3,4,6,9,11,16],partit:[2,7],pass:[0,10,16],past:[8,16],patch:[4,16],path:[1,4,5,7,13],patient:5,pattern:[1,10,15,18],pauli:1,pca:[1,5,13,15],pcost:3,pdf:[1,3,4,7,18],pedagog:1,penalti:[4,11],penros:3,pentagon:11,peopl:[1,2,7,13],per:[1,2,4,15],percentag:[1,8,9],perceptron:[1,2,5],peregrin:[],perfect:[1,2],perfectli:4,perform:[0,1,3,4,6,8,9,10,11,13,14,16],perhap:[1,3,11],perimet:2,period:2,permut:9,persist:11,person:[3,5,15,17],perspect:18,pertin:10,petal:[6,7],peter:18,petersen:16,phantom:16,phase:10,phatak:0,phenomena:16,phi:6,phi_k:6,philip:17,philosophi:11,phone:17,phrase:1,physic:[1,2,5,10,11,16,17,18],pick:[0,2,7,8,9,11,16],pickl:2,pictur:1,pie:13,piec:[0,9],pillow:[1,13],pinv:3,pip3:[1,2],pip:[1,2,13],pipelin:[1,4,6,8],pippin:[],pise:0,pitt:10,pixel:2,pixel_height:2,pixel_width:2,place:[1,4,6,11,14],plai:[1,3,4,6,9,13],plain:[6,8,10,11],plan:[4,7,17,18],plane:[6,7],plateau:[3,16],platform:13,plausibl:10,pleas:[1,5,9,11],plenti:2,plethora:10,plot:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,16],plot_confusion_matrix:[5,8],plot_cumulative_gain:[5,8],plot_data:2,plot_dataset:6,plot_decision_boundari:[7,8],plot_import:8,plot_predict:6,plot_regression_predict:7,plot_roc:[5,8],plot_surfac:[4,11],plot_train:7,plot_tre:[7,8],plt:[0,1,2,3,4,5,6,7,8,9,10,11,14,16],plu:[1,3,5],png:[1,4,5,7],point:[0,1,2,3,4,5,6,7,8,9,11,14,16,17],points_in_clust:0,poisson:13,poli:[4,6],poly100_kernel_svm_clf:6,poly3:1,poly3_plot:1,poly3dcollect:11,poly_featur:[6,7],poly_features10:7,poly_fit10:7,poly_fit:7,poly_kernel_svm_clf:6,polydegre:[1,3,4,8],polygon:11,polym:10,polynomi:[1,3,4,5,6,7,8,9],polynomial_featur:4,polynomial_svm_clf:6,polynomialfeatur:[1,4,6,7],polytrop:[1,4],poor:[2,11],poorli:1,popul:[1,3],popular:[1,2,4,5,6,7,9,10,13,14,16],popularli:1,portabl:8,portion:[9,11],pose:[1,3,4,9,16],posit:[0,1,2,3,5,6,8,9,11,14,16],possibl:[1,2,3,4,5,6,7,8,9,10,11,13,14,16,17],posterior:3,postpon:1,postul:3,potenti:[1,3,10,11],potr:3,potrf:3,pott:10,power:[1,2,3,4,6,7,10],practic:[1,3,4,5,6,15,16],practition:[1,2],pre:3,preced:[2,9,10,16],preceq:6,precis:[1,3,9,11,14,16],pred:4,predicit:1,predict:[1,2,3,4,5,6,7,8,13,18],predict_prob:2,predict_proba:[5,8],predictor:[1,3,5,7,8,9],prefer:[1,2,4,6,7,9,13],prepar:[1,4],preprocess:[1,4,5,6,7,8,9],prerequisit:1,presenc:11,present:[1,3,4,7,10,11,15,16],preserv:9,press:[11,18],pretrain:2,pretti:[1,6,7,13],prev_centroid:0,prevent:[11,16],previou:[1,2,3,4,6,8,9,10,11,14,16],previous:[0,7,8,16],price:[1,7,11],primal:6,primari:[1,5],primarili:0,prime:16,princip:[1,3,5,13,15],principl:[0,1,4,5,6],print:[0,1,2,3,4,5,6,7,8,9,11,14,16],print_funct:[6,7],printout:1,prior:[1,3,4],privat:1,prob:[2,16],probabilist:[1,18],probabl:[1,2,4,5,8,11,13,15],problem:[1,3,4,5,6,7,8,9,10,13,14,15,16],proce:[1,3,4,6,7,8,9,11,14],procedur:[3,4,6,8,9,11],proceed:14,process:[0,1,4,7,8,10,11,13,14,16,18],prod:18,prod_:[2,3,5],produc:[0,1,3,4,7,8,9,10,11,13,14,16],product:[1,2,3,4,5,6,10,11,13,14],profess:1,profil:0,program:[0,1,2,3,4,6,10,13,14,15,16],programm:14,progress:[0,2],progression_plot:0,prohibit:4,project1:4,project:[1,2,3,9,11,13,15,16,17],project_root_dir:[1,4,5,7],promin:10,promis:6,prone:7,pronounc:[11,13],proof:[1,9,10,11],prop:[],proper:[1,4],properli:[0,2,4,6,8,11],properti:[1,2,10,11,14],proport:[1,2,3,7,9,11,16],propos:[2,4,8],propto:[3,11],proton:1,prove:11,provid:[1,2,3,4,6,7,8,10,11,13,14,16,18],proxi:[2,11],prun:0,prune:7,pseudoinv:3,pseudoinvers:3,pseudorandom:[4,16],psycholog:1,ptratio:1,punish:[1,2],pure:[7,16],purest:7,puriti:7,purpos:[0,1,8,10],put:2,putarow:3,putboundslic:3,putclist:3,putobjsens:3,putqobj:3,pycod:[],pydata:13,pydot:7,pyhton2:[],pylab:[1,5],pypi:13,pyplot:[0,1,2,3,4,5,6,7,8,9,10,11,14,16],pythagora:[0,3],python2:1,python3:[1,2,5,6,9,11,13],python:[2,3,4,6,9,10,11,15],pytorch:[1,13],qquad:[9,11,14],quad:[2,11,14],quadrat:[1,3,6,7,11],qualit:[7,16],qualiti:[1,7,13],quantifi:2,quantil:8,quantit:[1,4,7],quantiti:[0,1,3,4,5,7,8,9,10,14,16],quantum:10,quartil:1,quench:3,queri:7,question:[1,3,4,7,9,10,11],quick:16,quickli:[2,7,9,11],quirk:0,quit:[2,3,4,7,8,10],quot:16,r2_score:1,r2score:1,r_1:7,r_2:7,r_j:7,r_m:7,rad:1,radial:[1,6,10],radioact:16,radiu:[1,2],rain:7,rais:11,ramp:2,ran1:16,ran2:16,ran3:16,rand:[1,3,4,7,8,11,14,16],rand_max:16,randint:[4,7,11],randn:[1,2,3,4,7,9,11],random:[0,1,2,3,4,6,7,11,13,14,15],random_devic:16,random_forest_model:8,random_index:11,random_indic:2,random_st:[1,5,6,7,8,9],randomforestclassifi:8,randomli:[0,2,4,7,11,16],randomnumbergener:16,rang:[0,1,2,3,4,5,7,8,9,10,11,14,16],rangl:[1,4,9,16],rangle_x:16,rank:3,raphson:[2,6,11],rapidli:1,rare:2,rate:[1,2,6,7,8,10,11],rather:[1,2,3,4,5,6,7,8,9,10,11,14,16],ratio:[5,7,8,9],rational:1,ravel:[3,4,5,6,7,8,9,11],raw:16,rbf:[6,9,10],rbf_kernel_svm_clf:6,rbf_pca:9,rcond:1,rcparam:[1,2,5,6,7,8,16],reach:[0,1,2,3,4,5,7,8,9,10,11,16],read:[0,1,3,4,5,6,9,10,14,15,16,18],read_csv:[1,4,5,7],read_fwf:1,readabl:0,reader:[1,14,16],readi:[0,1,2,3,4,6,8,9,10,14],readili:2,real:[1,2,5,8,9,10,11,14],realist:6,realiti:16,realiz:[2,10],realli:[1,2],rearrang:11,reason:[0,1,2,8,11,18],reassign:2,recal:[3,4,7,8,9,10,14,16],recalcul:16,receiv:[2,8,10,16],recent:[1,4,7,8,11],recept:10,recip:[1,4,5,14],reciproc:3,recogn:[1,3,8],recognit:[1,2,10,15,18],recommend:[1,3,4,6,11,13,14,15,16,18],reconsid:7,reconstruct:9,record:[8,15],recreat:16,rectangl:[7,11],rectangular:3,rectifi:[2,10],recur:[1,13],recurr:[1,2,13,15],recurs:[7,13,14],recycl:16,red:[1,4,6,7],redefin:[1,8],reduc:[2,3,7,8,9,11],reduct:[1,8,9,13,16],refer:[0,1,2,3,4,5,9,10,11,14,18],refin:10,refit:4,reflect:[1,2,3,16],refresh:[13,15],reg:[8,9],regard:[2,7,11],regardless:10,region:[4,7,10],regist:[4,16],reglasso:3,regr_1:[1,7],regr_2:[1,7],regr_3:[1,7],regress:[2,6,9,10,13,15],regressor:[1,5,8],regridg:3,regular:[1,3,5,7,11],reilli:[1,18],reinforc:[1,6,13],reiter:2,rel:[1,4,5,7,10,11,16],relat:[0,1,2,3,9,11,14,16],relationship:[1,7],relativeerror:1,releas:[2,13],relev:[1,2,3,5,9,13,15,16],reli:[1,6],reliabl:[5,16],remain:[2,4,10,14,16],remaind:16,remark:2,rememb:[1,6,11,14],remind:[1,3,9,11,14,16],remov:[1,3],render:1,reorder:[3,5],reorgan:1,repeat:[0,1,2,3,4,7,8,9,11,14,16],repeated:1,repeatedli:[4,8,11,16],repetit:[4,15],rephras:11,replac:[0,1,2,3,4,8,10,11],replica:4,repositori:1,repres:[1,2,3,4,5,6,7,8,10,11,16],represent:[1,2,4,16],reproduc:[1,3,4,7,10,13,16],repuls:1,request:1,requir:[1,2,3,4,6,7,9,10,11,14],resaml:4,resampl:[1,5,8,13,15,16],rescal:[1,9,10],rescu:3,reseach:4,research:[1,13,18],resembl:[4,16],reserv:[2,3,4,16],reset:16,reshap:[0,1,2,4,6,7,8],residenti:1,residu:[1,3,11],resiz:3,respect:[0,1,2,3,4,5,6,8,9,10,11,16],respond:10,respons:[1,5,7,10],rest:[1,3],restat:[1,10],restrict:[1,7,10],result:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,16],ret:[],retail:1,retain:[3,4],return_data:0,return_x_i:7,reus:[2,4],reveal:[1,10],revers:2,review:[13,14,15],revisit:0,reward:1,rewrit:[1,3,4,5,6,8,9,10,11,14,16],rewritten:[4,6,8,16],rewrot:11,rgoj5yh7evk:13,rho:[1,8],rho_1:8,rho_2:8,rho_m:8,rhs:[3,4],rich:1,rid:0,ride:7,rideclass:7,ridedata:7,ridg:[1,5,9,11,13,15],ridgebeta:3,right:[1,2,3,4,5,6,7,8,10,11,14,16],rightarrow:[1,2,3,4,6,9,10,11,16],rigor:1,rise:1,risk:[1,11],river:1,rmse:1,rmsporp:11,rmsprop:[2,11],rnd_clf:8,rnn:[10,15],rntrick1:16,rntrick2:16,rntrick3:16,rntrick4:16,robert:18,robust:1,robustscal:1,roc:8,role:[1,3,4,6,13],room:[1,17],root:[1,3,7,11,16],rot:[],rotat:[2,6,7,8],rotation_matrix:7,roughli:2,round:[1,5,7,11],routin:[11,14],row:[1,2,3,4,5,7,9,14],rrr:3,rthe:3,rug:11,rule:[1,2,3,4,11],run:[0,1,2,3,4,6,7,9,11,13],runtim:[0,2,4],runtimewarn:[2,4],rust:[1,13,14],rvert:2,rvert_2:2,rwidth:[],s_i:5,saddl:11,safe:16,sai:[0,1,2,3,4,5,6,7,8,9,10,14,16],said:[4,7,11],sake:[1,3,5,9],sale:1,sam:[],same:[0,1,2,3,4,6,7,9,10,11,14,16],samm:8,sampl:[0,1,2,3,4,5,6,7,8,11,13,14],sample_vari:0,sampleexptvari:16,samwis:[],sanitize_sequ:[],sastri:9,satisfactori:1,satisfi:[2,4,6,11,14,16],satur:[2,4],save:[1,4,5,7],save_fig:[1,4,5,7,8],savefig:[1,4,5,7,16],saw:3,scalabl:8,scalar:[3,4,8,11],scale:[1,2,3,4,5,6,7,8,9,10,11,13,17],scaler:[1,5,6,7,8,9],scan:[3,5],scari:3,scatter:[0,1,2,4,5,6,7],scenario:11,schedul:11,scheme:[2,11],schrage:16,scienc:[1,2,8,10,11,13,15,16,18],scientif:[1,13],scientist:[0,1],scikit:[3,4,5,6,7,8,11,13,14,15,18],scikitlearn:[],scikitplot:[5,8],scipi:[1,3,4,11,13,14],score:[1,2,4,5,7,8,9,17],scores_kfold:4,scratch:2,sdg:11,seaborn:[1,2,5],seamless:[1,13],search:[1,2,3,7,11],sec:4,second:[0,1,3,4,5,6,7,9,10,11,13,14,15,16],secondeigvector:9,secondli:10,section:[0,9,12,14,15,16],sector:1,see:[0,1,2,3,4,5,6,8,9,10,11,13,14,15,16],seed:[0,1,2,3,4,6,7,9,11,16],seek:[2,6],seem:2,seemingli:1,seen:[1,2,3,8,10,16],segment:11,seldomli:1,select:[2,3,4,6,7,8,9,15,18],self:[2,3,16,18],semest:[5,15],semi:[6,11],send:[3,10,11,17],senior:15,sens:[1,4,6],sensit:[1,3,4,7,11],sentenc:10,separ:[0,1,2,4,6,7,10,13,16],sequenc:[0,5,7,8,10,11,13,14,16],sequenti:[2,8,10,16],seri:[1,2,3,4,8,9,10,11,14,15],serif:[1,5,16],serv:[1,2,3,5,11,18],session:[2,15],set:[0,2,3,4,5,6,8,9,11,13,14,16],set_:[],set_label:[],set_major_formatt:4,set_major_loc:4,set_stream:3,set_tick:[2,6],set_ticklabel:2,set_titl:[0,1,2,5,10],set_xlabel:[1,2,5,10],set_xlim:[5,10],set_xticklabel:2,set_ylabel:[1,2,5],set_ylim:[5,10],set_ytick:5,set_yticklabel:2,set_zlim:4,setiosflag:16,setminu:4,setosa:[6,7],setosa_or_versicolor:6,setp:4,setprecis:16,setse:3,setup:[2,3,6,13],setw:16,sever:[1,3,4,5,6,7,9,10,11,13,14,15,16],sgd:[2,11],sgd_clf:6,sgdclassifi:6,sgdreg:11,sgdregressor:11,sgn:3,shallow:11,shape:[0,1,2,3,4,5,6,7,8,9,11,14],share:2,she:5,shift:[2,10,16],shire:[],shortcom:11,shorter:16,shorthand:[],shortli:14,should:[0,1,3,4,6,7,9,10,11,14],show:[0,1,2,3,4,5,6,7,8,9,10,11,14,16],shown:[1,3,5,6,9,10,11,16],showpoint:16,shrink:[3,4,6,9],shrinkag:3,shrunk:9,shuffl:[1,2,4,11],side:[1,3,6,10,11,14],sigh:13,sigma0:16,sigma1:16,sigma2:16,sigma:[1,2,3,4,5,8,9,10,11,14,16],sigma_0:3,sigma_1:3,sigma_2:3,sigma_:[3,14,16],sigma_fn:[5,10],sigma_i:[1,3],sigma_j:3,sigma_m:[4,16],sigma_n:[9,16],sigma_t:11,sigma_x:16,sigmoid:[2,5,6,8,10],sigmundson:17,sign:[2,5,6,8,16],signal:[2,8,10],signific:2,significantli:[2,11,16],sim:[3,4,11,16],similar:[0,1,2,3,4,5,6,7,8,9,11,13,14],similarli:[1,2,3,6,8,16],simpl:[0,2,3,4,5,6,8,9,10,13,14],simplepredict:8,simpler:[0,1,2,3,4,11,13],simplest:[0,1,2,7,8,10],simpletre:8,simpli:[1,2,3,4,6,7,8,9,10,13,14,16],simplic:[0,3,5,6,7,8,9,10],simplicti:3,simplifi:[1,4,7,13],simplist:[4,16],simul:[4,16],simultan:4,sin:[1,2,7,10,11,14],sinc:[1,2,3,4,5,6,7,8,9,11,14,16,18],sine:10,singl:[1,2,3,5,6,7,10,11,14,16],singular:[1,4,11,14,15],site:[1,2,5,6,9,11,15],situat:[1,3,5,11],six:16,size:[1,2,3,4,6,7,8,9,11,14,16],sketch:8,ski:7,skill:1,skip:9,skl:1,sklearn:[1,2,3,4,5,6,7,8,9,11],skplt:[5,8],slack:6,slice:14,slide:[1,16],slight:[4,11],slightli:[2,3,4,5,8,16],slope:[6,9,10],slow:[1,6,11],slower:[3,14],slowli:10,slp:2,small:[0,1,2,3,4,6,7,8,9,10,11,13,14,16],smaller:[1,2,3,4,6,7,9,11,16],smallest:[0,1],smallest_row_index:0,smart:[],smooth:[1,4,11],sne:9,sneak:[],sns:[1,2,5],soar:4,social:1,soft:[2,5,8,10],soften:6,softmax:5,softwar:[1,6,13,14,15],sol:6,sole:1,solid:[1,5],solitem:3,soltyp:3,solut:[1,2,3,4,6,8,9,11,14,16],solutionsummari:3,solv:[1,2,3,6,8,9,10,11,14],solver:[3,5,6,7,8,9,14],some:[0,1,2,3,4,5,6,7,8,9,10,14,15,16],someth:[1,2,5,7,9,16],sometim:[0,1,2,9,10,11],soon:14,sophist:1,sopt:11,sort:[3,4,7,9,16],sound:3,sourc:[0,1,2,4,13,14,16],space:[0,1,2,3,6,7,9,10,11,16],span:[1,3,7,9,14],spare:2,spars:[3,14],sparse_mtx:14,sparsiti:8,spatial:[2,10],spdiag:3,speak:16,special:[4,5,8,10,11,14,16],specif:[1,2,3,4,5,6,7,9,10,13,14,16],specifi:[0,1,3,4,5,7,9,11,16],specifici:[1,8],spectral:2,speech:[1,2,10],speed:[2,11],spend:16,sphere:1,spite:1,spline:6,split:[0,2,3,4,6,7,8,9,16],splite:1,splitter:[2,8],spmatrix:3,spontan:16,spread:[1,9,16],springer:18,spuriou:11,sqquar:3,sqrt:[1,3,4,6,8,9,11,16],squar:[0,2,5,6,7,9,11,13,14,15,16],squarederror:8,squaredeuclidean:0,squash:10,srand:16,srtm:4,srtm_data_norway_1:4,stabil:3,stabl:[1,3,5,7,9,13],stack:[],stage:[3,11],stai:[1,3,9],stand:[1,3,7,10],standard:[1,2,3,4,5,6,8,10,14],standardscal:[1,5,6,7,8,9],stanford:11,start:[0,1,2,3,4,6,7,8,9,10,11,14,15,16],start_box:11,start_nod:11,start_tim:0,startpoint:16,stat:4,state:[0,2,3,4,5,6,8,9,10,11,13,16],statement:[1,5,14],statis:[],statist:[0,1,2,5,7,8,9,10,11,14,15,18],statu:[1,5,9],stavang:4,std:[1,4,16],stdev:16,stdout:3,steep:11,step:[0,1,2,4,5,7,8,9,10,11,14,16],step_fn:[5,10],step_length:11,steps_list:7,stian:17,still:[3,4,9,11,16],stimuli:10,stk2100:18,stk3155:15,stk4021:18,stk4051:18,stk4155:15,stk5000:18,stk:18,stochast:[1,2,3,4,6,9,10],stoke:10,stone:[1,5],stop:[0,2,5,7,9,11,16],storag:3,store:[1,2,4,9,11,16],str:2,straight:[1,4,6,11],straightforward:[1,3,4,6,7,8,11,14],strategi:[1,2,7],stratifi:4,streamtyp:3,strength:[0,1,3],stretch:9,strict:[6,11],strictli:[6,11],string:[2,16],stroke:5,strong:[4,7,8,10,16],strongli:[1,6,13,14],stronli:1,structur:[0,1,2,4,7,8,10,13],stuck:[2,11],student:[1,15,17,18],studi:[0,1,3,4,5,6,9,10,11,13,18],studier:[15,18],style:[1,5,7],sub:[7,10],subarg:11,subdivid:[1,14],subfield:1,subject:[3,6,16],subplot:[0,1,2,4,5,6,7,8],subplots_adjust:[6,16],subprogram:14,subract:1,subroutin:1,subscript:2,subsequ:[2,3,4,10,14,16],subset:[2,4,7,10,11,13],subspac:[1,6,9],substanti:[7,8],substep:9,substitut:[4,10,14],subsubset:7,subtask:4,subtl:2,subtract:[1,3,4,9,11,14,16],subtre:7,subval:11,succeed:1,success:[5,7,11,16],successfulli:7,sucess:16,sudo:[1,13],suffer:[1,2,3,8],suffici:[2,4,6,9,11],suggest:[2,11,18],suit:[6,10],suitabl:[1,16],sum:[0,1,2,3,4,5,6,7,8,9,10,11,16],sum_:[0,1,2,3,4,5,6,7,8,9,10,11,14,16],sum_i:[3,4,6,11],sum_k:[6,10,14],summar:[0,3,4,7],summari:[0,2,8,15],summat:[],sunni:7,superscript:[2,10],supervis:[1,3,4,5,7,10,13],supplement:5,support:[1,2,7,8,9,11,13,15],suppos:[1,3,4,5,6,8,9,10,11,14],suppress:[3,11],sure:[2,4],surf:4,surfac:[1,4],surpris:1,surround:13,survei:[1,3],svc:[6,7,8],svd:[1,4,9,15],svdinv:3,svm:[6,7,8,9],svm_clf:[6,8],swath:3,symbol:[2,3,9,11,13,16],symmeteri:2,symmetr:[1,3,6,9,10,11,14],sympi:[1,13],synonim:16,syntax:[2,11,14],syntaxerror:[2,6,14],syrk:3,sys:[3,11],system:[1,2,3,5,7,8,10,11,13,14,18],systemat:[4,16],t_0:[7,11],t_1:11,t_b:8,t_i:[2,10],t_j:[3,10],t_k:7,tabl:[7,16,17],tabul:1,tabular:[],tackl:0,tag:[0,3,5,10,11,14,16],taht:1,tail:16,tailor:[6,9],taiwan:1,take:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,16],taken:[1,2,4,8,11,14],tangent:[2,10,11],tanh:[2,5,6,10],target:[1,2,3,5,6,7,8,9,10],target_nam:7,task:[0,1,2,3,4,7,9,10],tau:[3,16],tax:1,taylor:11,taylornr:11,team:2,teaser:1,technic:[0,1,3],techniqu:[1,2,6,8,11,13,15,16,18],technolog:[1,2],tek5040:18,tell:[1,4,8,9,11,16],temp1:2,temp2:2,temp:2,temperatur:[1,7],temporarili:2,ten:[],tend:[0,3,4,6,7,8,10,11],tendenc:1,tension:4,tensorflow:[0,1,6,13,14,15,18],term1:[3,4,9],term2:[3,4,9],term3:[3,4,9],term4:[3,4,9],term:[0,1,2,3,4,5,6,7,8,9,10,11,16],termin:[1,3,7,8,11],terrain1:4,terrain:4,test:[3,4,5,6,7,8,11,16],test_accuraci:2,test_data:0,test_ind:4,test_pr:2,test_predict:2,test_scor:[5,8],test_siz:[1,2,3,4,8],test_split:7,tester:[],testerror:[1,4],text:[1,2,3,6,7,9,11,14,16,18],textual:7,textur:2,than:[1,2,3,4,5,7,8,9,10,11,13,16],thats:0,theano:[2,13],thei:[0,1,2,3,4,5,6,7,9,10,11,14,16],them:[1,2,4,6,7,8,9,10,11,14],theme:1,themselv:[1,16],thenc:4,theorem:[4,5],theoret:[1,8],theori:[1,2,6,7,10,11,13,15,18],thereaft:[1,3,4,9,10,14],therebi:[1,3,5,9,16],therefor:[1,2,4,5,6,9,11,16],therein:9,thereof:[1,4,11],theta:[2,11,16],theta_:[2,11],theta_i:2,theta_k:16,theta_linreg:11,theta_t:11,thi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18],thing:[0,1,2,3,5,7,16],think:[0,1,2,4,7,10,11,16],third:[1,11],thirti:5,thorough:0,those:[0,3,4,6,7,8,9,14,15],though:[2,14,16],thought:[0,4,16],thousand:[1,2],three:[1,2,3,4,6,7,10,14,15,17],threshold:[2,7,8,9,10,11],through:[0,1,2,3,4,6,9,10,11,13,14,16],throughout:[0,1,3,13,14,16],thu:[1,2,3,4,5,6,8,9,10,11,16,17],thumb:[1,4],thursdai:15,tibshirani:[4,15,18],ticker:[4,11,16],tif:4,tight_layout:[2,5],tightli:9,tild:[1,3,4,9,16],till:[1,5,6,7,8,10,14],time:[0,1,2,3,4,5,6,7,8,9,10,11,14,15,16],timefunct:16,tini:2,tip:12,titl:[1,2,4,5,6,7,8,11,16],tmp:11,to_categor:2,to_categorical_numpi:2,to_numer:[1,4],to_str:16,togeth:[1,4,6,9],toi:0,told:11,toler:0,tomographi:10,too:[1,3,4,7,9,11,16,18],took:6,tool:[0,1,2,4,11,13,16],toolbox:6,top:[1,3,4,7,8,13],topic:[0,1,3,5,6,13,15,18],topolog:[2,10],toss:8,total:[0,1,2,4,5,6,8,9,10,11,16,17],totalclustervari:0,totalscatt:0,totalvari:16,toward:[2,5,10,11],town:1,tpng:7,trace:11,trace_stack:11,traceback:[4,7,8,11],tracer:11,track:[0,11,14],tract:1,tractabl:1,trade:[3,7],tradeoff:[1,3,15],tradit:[1,2,4],train:[3,4,6,7,8,9,10,11],train_accuraci:[1,2],train_end:[1,2],train_ind:4,train_pr:2,train_siz:[1,2],train_test_split:[1,2,3,4,5,7,8,9],train_test_split_numpi:[1,2],trainerror:1,trainingerror:4,trait:1,tran:3,transfer:7,transform:[1,3,4,5,6,7,8,9,10,11,13,14],transit:10,translat:[2,8],transpos:[2,3,9],travers:[1,3],treat:[1,2,4,10,11,16],tree:[1,2,4,13,15],tree_clf:[7,8],tree_clf_:7,tree_clf_sr:7,tree_reg1:7,tree_reg2:7,tree_reg:7,trend:16,trevor:18,tri:[7,11],triain:1,trial:[1,4,11,16],triangl:11,triangular:14,trick:[6,9,11,16],trickier:16,tridiagon:14,trillion:13,trivial:[1,2,3,9,16],troubl:[1,6,10],true_divid:2,true_fun:4,tucker:6,tumor:[5,7],tumour:5,tunabl:2,tune:[7,11,14],tupl:11,turn:[1,2,3,4,5,6,7,8,9,10,11,14,16],tutori:2,tweak:[2,8,16],twice:11,twist:9,twister:16,two:[0,1,2,3,4,5,7,8,9,10,11,14,15,16,18],tx_1:11,type:[1,2,4,6,8,11,14,16],typeerror:11,typic:[1,2,3,5,7,8,10,11,16],u_i:10,u_m:8,ubuntu:[1,13],uci:1,uio:[15,17,18],unari:14,unary_f:11,unary_oper:11,unbalanc:[4,7],unbias:[1,3,4,16],uncertainti:[1,3],uncertitud:16,unchang:2,uncorrel:8,undefin:3,under:[1,2,3,4,8,11,13],underdetermin:1,underfit:[2,4],underflowproblem:3,undergo:3,undergradu:15,underli:[1,2,7,11,16],underset:0,understand:[0,1,2,3,4,8,11,13],understood:[0,6,11],undesir:6,undetermin:[3,6],unexpect:[4,16],unexpected:16,unfortun:[2,6,7,8],unicode_liter:[6,7],uniform:[1,2,3,4,9,11],uniform_real_distribut:16,uniformli:[11,16],unifrompdf:16,unimport:11,union:[3,4],uniqu:[0,1,4,11,14],unique_cluster_label:0,unit:[1,2,3,8,10,16],unitari:[3,14],unitarili:14,uniti:16,univari:16,univers:[1,2,11,15,17],unix:2,unknow:[1,14],unknown:[1,2,3,4,6,8,14],unknowwn:10,unlabel:2,unless:[1,4,9,11],unlik:[2,6,11,16],unnecessarili:7,unravel:2,unrol:9,unseen:[1,5,7],unstabl:2,unsupervis:[1,2,10,13,15],unsymmetr:14,until:[0,2,7,10,11,16],untouch:1,unusu:10,updat:[0,2,8,10,11],upload:[13,18],upon:[2,4,9,14],upper:[1,6,7,14],uppercas:[14,16],ups:[],usag:[1,6,13,16],usd10000:1,usd:1,use:[0,1,3,4,5,6,7,8,9,10,11,13,14,15],usecol:1,used:[0,1,2,3,4,6,7,8,9,10,11,13,14,16,18],useful:[1,2,3,4,5,7,9,10,11,13,14,16,18],useless:2,user:[1,2,4,5,6,9,13,14],uses:[1,2,3,4,7,9,10,14,16],usetex:16,usg:4,using:[0,2,3,4,5,6,7,8,9,10,11,14],usr:16,usual:[0,1,5,10,11],util:[0,2,4,5,8],v_0:9,valid:[1,2,5,7,8,11,13,15,16],valu:[0,1,2,4,5,6,7,8,10,11,13,14,15],valuat:7,valueerror:[],van:1,vandenbergh:[6,11],vandermond:1,vanilla:[1,9],vanish:[2,11,16],var_x:16,varabl:6,varepsilon:[3,4],varepsilon_:[3,4],varepsilon_i:[3,4],vari:[1,2,3,4,8],variabl:[0,1,2,3,4,5,6,8,9,10,11,14],varianc:[0,1,2,3,5,7,8,9,11,13,14,15],variance_i:[3,9],variance_x:[3,9],variant:[1,2,4,6,10,11],variat:9,varieti:[1,10,13],variou:[2,3,4,5,6,7,9,10,11,13,14,16],vartempvec:16,varvec:16,vaue:2,vault:1,vdot:11,vec:[4,16],vector:[0,1,2,3,4,5,7,8,9,11,13,15],vector_mean:0,ventur:[1,6,13],verbos:2,veri:[0,1,2,3,4,5,6,7,8,9,10,11,16,18],verifi:[9,14],versatil:6,versicolor:[6,7],version:[0,1,8,11,13,14,16],versu:2,vert:[1,2,3,5,6,7,9,11],vert_1:3,vert_2:[3,9],vertic:[],via:[1,3,4,5,6,7,8,9,10,13,14,15,16],vidal:9,video:[1,2,10,13,15],view:[2,3,4,10,11,15,16,18],violat:6,virginica:7,viridi:[1,2],virtual:2,viscos:11,viscou:11,vision:1,visual:[1,9,10,13],visualis:2,viz:[6,16],vjp:11,vjpnode:11,vmax:2,vmc:16,vmin:2,volum:1,vote:8,voting_clf:8,votingclassifi:8,votingsimpl:8,vrtx:15,vspace:11,vstack:[3,9,14,16],w_1:[6,14],w_1x_1:6,w_1x_:6,w_2:[6,14],w_2x_2:6,w_2x_:6,w_3:14,w_4:14,w_i:[2,8],w_ix_i:10,w_j:14,w_m:14,w_px_:6,w_px_p:6,wai:[0,1,2,3,4,5,6,8,9,10,11,12,14,16],walk:7,walker:16,wang:1,want:[0,1,2,3,4,6,7,8,9,10,11,13,16],warn:[1,2,6],warrant:4,watch:13,wavelet:6,weak:[0,7,8],weather:[2,10],web:[13,15],webpag:15,websit:[4,14,15],wedg:[6,16],wednesdai:15,wee:9,week:[3,4,5],weekli:[13,18],weight:[1,2,4,5,7,8,10,11,16],welcom:[6,13],well:[1,2,3,4,5,6,7,8,10,11,13,14,15,16,18],went:6,were:[0,1,2,3,4,5,6,8,9,10,16],wessel:1,what:[0,2,3,4,5,6,7,8,9,10,11,13,14,15],when:[0,1,2,3,4,5,6,7,8,9,10,11,14,16],whenev:[11,16],where:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,16,17],wherea:[4,16],wherein:[2,10],whether:[1,3,5,7,16],which:[0,1,3,4,5,6,7,8,9,10,11,13,14,15,17],whichev:2,white:7,who:[1,15],whole:[0,2,3,7,9],whose:[1,4,8,16],whow:[3,9],why:[1,2,4,11],wide:[1,2,4,5,10,13,14],widehat:4,width:[1,6,7],wieringen:1,win:8,wind:7,wing:17,wiscons:5,wisconsin:8,wise:[1,2,3,10,11],wish:[0,1,3,5,6,9,11,14],with_std:1,within:[0,1,5,7,10,11,16,18],withinclust:0,without:[1,2,3,6,7,9,10,11],won:1,wonder:6,word:[0,1,2,3,16],work:[0,1,2,4,5,6,7,11,13,15,16],world:[1,6],worldwid:1,wors:[1,2,4],worth:7,would:[1,2,3,4,5,6,7,8,9,10,11,14,16],wrap:[14,15],wrap_util:11,write:[1,2,3,4,5,6,10,11,12,14,15,16],written:[1,3,9,10,11,13,14,16],wrong:[2,6],wrongli:[8,16],wrote:[3,9],wrt:8,wth:8,www:[13,14,15,18],wx_1:6,x0s:6,x1_exampl:6,x1d:6,x1s:[6,7,8],x2d:[6,9],x2d_train:9,x2dsl:9,x2s:[6,7,8],x3s:6,x_0:[1,3,9,14],x_1:[1,3,4,5,6,7,8,9,11,14,16],x_2:[1,3,4,5,6,7,8,9,11,14,16],x_3:[6,14,16],x_4:14,x_center:9,x_data:2,x_data_ful:2,x_i:[0,1,2,3,4,5,6,7,8,9,10,11,14,16],x_ix_:1,x_iy_i:6,x_j:[1,6,7,10,16],x_jy_j:6,x_k:[0,10,14,16],x_l:16,x_m:[4,10,14,16],x_n:[1,4,6,9,10,11,14,16],x_new:[7,8],x_p:[5,7],x_poli:7,x_poly10:7,x_reduc:9,x_scale:6,x_test:[1,2,3,4,5,7,8,9],x_test_scal:[1,5,7,8,9],x_train:[1,2,3,4,5,7,8,9],x_train_scal:[1,5,7,8,9],x_val:2,xarrai:13,xavier:2,xbnew:11,xcode:[1,13],xdclassiffierconfus:8,xdclassiffierroc:8,xg_clf:8,xgb:8,xgbclassifi:8,xgboost:7,xgboot:8,xgbregressor:8,xgparam:8,xgtree:8,xi_1:6,xi_:6,xi_i:6,xlabel:[1,2,3,4,5,6,7,8,11,16],xlim:[4,8],xmesh:11,xnew:[1,11],xpanda:1,xpd:[3,9],xplot:1,xscale:1,xsr:7,xt_x:11,xtest:4,xtick:[4,6,7],xtrain:4,xytext:6,y_0:[1,3,9,14],y_1:[1,3,6,7,9,11,14],y_1y_1:6,y_1y_1k:6,y_1y_2:6,y_1y_2k:6,y_1y_n:6,y_1y_nk:6,y_2:[1,3,6,7,9,14],y_2y_1:6,y_2y_1k:6,y_2y_2:6,y_2y_2k:6,y_3:[1,7,14],y_4:14,y_data:[1,2,3],y_data_ful:2,y_decis:6,y_fit:1,y_i:[1,2,3,4,5,6,7,8,9,10,11,14],y_if_:8,y_ix_:1,y_ix_i:[5,6,11],y_iy_jk:6,y_j:[4,6,10],y_k:10,y_m:14,y_model:[1,3],y_n:[6,11],y_ny_1:6,y_ny_1k:6,y_ny_2:6,y_ny_2k:6,y_ny_n:6,y_ny_nk:6,y_plot:7,y_pred1:7,y_pred2:7,y_pred:[1,2,4,5,6,7,8],y_pred_rf:8,y_pred_tre:8,y_proba:[5,8],y_test:[1,2,3,4,5,7,8,9],y_test_onehot:2,y_test_predict:1,y_train:[1,2,3,4,5,7,8,9],y_train_onehot:2,y_train_predict:1,y_val:2,year:[1,13],yes:[4,5],yet:[1,2,4,6,9,11],yield:[0,1,3,4,6,8,10,11,14,16],ylabel:[1,2,3,4,5,6,7,8,11,16],ylim:4,ymesh:11,yoshua:[2,18],you:[0,1,2,3,4,6,7,8,9,11,13,14,16,18],young:1,your:[0,2,3,4,6,9,11,13,14,16],yourself:[9,11],youtub:13,ypred:4,ypredict2:11,ypredict:[1,11],ypredictlasso:3,ypredictol:3,ypredictridg:3,yridg:[],ytest:4,ytick:[4,6,7],ytild:[1,4],ytildelasso:3,ytildenp:1,ytildeol:3,ytilderidg:3,ytrain:4,z_0:14,z_1:14,z_2:14,z_c:2,z_h:2,z_i:[2,10],z_j:[2,10],z_k:10,z_m:2,z_mod:7,z_o:2,zaman:16,zaxi:4,zero:[0,1,2,3,4,5,6,7,8,9,10,11,14,16],zip:11,zm_h:1,zone:1},titles:["12. Clustering Analysis","3. Linear Regression","14. Building a Feed Forward Neural Network","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","Content in Jupyter Book","Applied Data Analysis and Machine Learning, FYS-STK3155/4155 at the University of Oslo, Norway","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:{"2021":17,"4155":13,"case":[6,8,16],"final":10,"function":[1,2,4,5,6,8,9,10,11,16],"import":[3,14,16],And:[],Eye:8,FYS:13,OLS:[3,4],RMS:11,The:[0,1,2,3,4,5,6,7,9,10,13,16],Useful:13,Using:11,activ:[2,10],actual:16,adaboost:8,adam:11,adapt:8,adding:4,adjust:2,again:7,aim:[6,7],algebra:14,algorithm:[0,7,8,9,10],algortithm:11,all:6,analys:3,analysi:[0,1,3,4,9,13,16],ani:11,anoth:7,appli:13,approach:[1,6],approxim:10,architectur:2,arrai:14,assist:17,august:15,autocorrel:16,automat:11,back:[2,9,10],background:13,bag:8,base:11,basic:[0,1,3,5,7,8,9,14],batch:2,bay:3,befor:9,better:[6,16],bia:4,binari:2,binomi:16,bird:8,block:16,book:12,boost:8,bootstrap:[4,8,16],boston:1,breast:2,brief:[],bring:10,build:[2,7],calcul:16,cancer:[2,5,7,9],cart:7,central:[11,13,16],chain:10,chang:8,chi:1,choos:2,classic:9,classif:[2,7,8],classifi:6,clip:2,cluster:0,code:[0,1,2,3,7,9,10,16],collect:2,compar:8,complex:[1,4],compon:9,comput:[7,16],con:7,concept:16,condit:[],conjug:11,content:12,continu:16,convex:[6,11],convolut:10,correl:[9,16],correspond:[],cost:[2,8],cours:[13,18],covari:[3,9,16],cross:4,cumul:16,cython:[],data:[1,2,4,5,7,9,13,16],dataset:2,decemb:15,decis:[7,8],decomposit:[3,9,14],deep:2,defin:2,definit:16,degre:1,demonstr:16,dens:1,deriv:[3,10],descent:[8,11],develop:2,deviat:16,diagon:9,dice:16,differ:6,differenti:11,dimension:6,disadvantag:7,discret:16,disguis:16,distribut:[3,16],doing:2,domain:16,down:2,dropout:2,economi:[],element:[1,16],elimin:14,ensembl:8,entropi:7,environ:1,equat:[1,10],error:[1,8],etc:[],evalu:2,event:16,exampl:[1,2,5,6,7,8,16],exercis:[1,4],expect:16,experi:16,explor:1,exponenti:16,express:[],extend:[],extrem:8,fall:17,famili:2,famou:16,fantast:[],featur:[7,14],feed:[2,10],fine:2,first:10,fit:[1,8],forest:8,forward:[2,10],frank:4,freedom:1,frequentist:1,fridai:[],from:[3,8,10],further:3,gaussian:[14,16],gener:[7,16],geometr:9,gini:7,good:1,grade:17,gradient:[2,8,11],handl:14,has:13,hessian:[],homework:[],hous:1,how:16,hyperparamet:2,hyperplan:6,id3:7,idea:[0,9],ideal:[],implement:[2,16],implic:3,improv:2,increment:9,index:7,inform:17,instal:13,instructor:17,interpret:[3,9],introduc:9,introduct:[1,4,13,14],invers:[3,14],iter:8,its:16,jackknif:16,julia:[],jungl:8,jupyt:12,kera:2,kernel:[6,9],lagrangian:6,lasso:[3,4],later:3,layer:[2,10],learn:[1,2,9,11,13],least:[3,4],level:8,librari:13,likelihood:5,limit:[2,11,16],linear:[1,6,11,14],link:[3,9,15,18],logist:5,loss:[],machin:[1,6,11,13],main:16,make:[1,7,8],mani:[8,10],materi:15,math:3,mathemat:[3,6],matric:3,matrix:[2,3,9,10,14,16],matter:1,mean:[0,1,16],meet:[3,8,16],mercer:6,mersenn:16,method:[4,7,8,11,16],mlp:10,model:[1,2,10],moment:16,momentum:11,moon:[6,7],more:[0,4,14],multilay:10,multipl:2,multipli:6,name:16,need:[],network:[2,5,10],neural:[2,10],newton:[],non:6,normal:[1,2,16],norwai:13,notat:10,novemb:15,now:[2,7],nuclear:1,nueral:5,numba:[],number:[1,16],numer:16,numpi:14,numpython:0,observ:16,obtain:9,octob:15,off:4,one:10,optim:[2,6,11,13],ordinari:[3,4],organ:1,oslo:[13,18],other:[7,9,10,16],our:[0,1,3,9,11,16],outcom:13,output:16,overarch:[1,6,7],overview:8,own:[0,1,8,9],packag:14,panda:[],part:[11,13],pass:2,pca:9,pdf:16,perceptron:10,perform:[2,7],period:16,perspect:2,poisson:16,practic:11,pre:2,preprocess:[],prerequisit:13,princip:9,pro:7,probabl:[3,16],problem:[2,11],procedur:7,process:2,program:11,project:4,prop:11,propag:[2,10],properti:[3,16],pseudo:16,python:[0,1,7,13,14,16],quick:6,ran0:16,random:[8,9,16],raphson:[],read:7,real:4,recip:16,recurr:10,reduc:1,regress:[1,3,4,5,7,8,11],regular:2,relev:18,relu:2,remind:[4,6],requir:13,resampl:4,revisit:11,ridg:[3,4],rng:16,rule:10,sampl:[9,16],schedul:15,schemat:7,scikit:[1,2,9],select:16,semest:17,sensit:[],septemb:15,set:[1,7,10],sgd:[],should:[2,16],simpl:[1,7,11,16],singl:8,singular:[3,9],situat:16,size:[],slightli:[],soft:6,softmax:2,softwar:[],solv:[],solver:11,some:11,split:1,squar:[1,3,4,8],standard:[11,16],state:1,statist:[3,4,13,16],steepest:[8,11],step:[],stk3155:13,stochast:[11,16],stop:[],supervis:2,support:6,svd:3,teach:[15,17],teacher:17,techniqu:[4,9],technolog:13,tensorflow:2,test:[1,2],textbook:18,than:[],theorem:[3,6,9,10,16],theori:16,three:16,tip:11,togeth:10,top:2,toss:16,toward:[0,9],trade:4,tradeoff:4,train:[1,2],tree:[7,8],tune:2,two:[6,13],type:10,uncorrel:16,understand:[],uniform:16,univers:[10,13,18],use:[2,16],used:5,using:[1,16],valid:4,valu:[3,9,16],variabl:16,varianc:[4,16],variou:1,vector:[6,10,14],view:[1,8],visual:[2,7],wai:7,week:15,weekli:15,what:[1,16],when:[],which:[2,16],why:16,wisconsin:5,write:[0,9],xgboost:8,your:[1,8]}}) \ No newline at end of file +Search.setIndex({docnames:["Clustering","chapter1","chapter10","chapter2","chapter3","chapter4","chapter5","chapter6","chapter7","chapter8","chapter9","chapteroptimization","content","intro","linalg","schedule","statistics","teachers","textbooks"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":3,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":2,"sphinx.domains.rst":2,"sphinx.domains.std":1,"sphinx.ext.intersphinx":1,sphinx:56},filenames:["Clustering.ipynb","chapter1.ipynb","chapter10.ipynb","chapter2.ipynb","chapter3.ipynb","chapter4.ipynb","chapter5.ipynb","chapter6.ipynb","chapter7.ipynb","chapter8.ipynb","chapter9.ipynb","chapteroptimization.ipynb","content.md","intro.md","linalg.ipynb","schedule.md","statistics.ipynb","teachers.md","textbooks.md"],objects:{},objnames:{},objtypes:{},terms:{"000":2,"000000":[1,3,9],"00000000e":3,"0001":2,"00015921913736794912":7,"00019998":3,"00024087":3,"00029012":3,"00031535148309579146":4,"00031535148309581185":4,"0003451":3,"00034944":3,"00042089":3,"00050694":3,"00058016":4,"00060728":4,"00061058":3,"00062588":4,"00066668":4,"00068734":4,"00068970":4,"00073541":3,"00076495":4,"00076916":4,"000769847326055633":4,"0007698473260556339":4,"00078806":4,"00079968":3,"00084589":4,"00085887":4,"00087697":4,"00088573":3,"00092354":4,"00096314":3,"001":[2,6,11],"00100519":4,"0010479246398391328":4,"00105081":4,"00106677":3,"00107405":4,"00109273":[],"00111756":4,"0011526":4,"00115999":3,"00118170":4,"00128479":3,"001323":4,"00137982":4,"00139705":3,"00149311":4,"00149956":4,"0015":[],"00152117":4,"00154733":3,"00156372":4,"00168251":3,"00174276":4,"00175331":4,"00186347":3,"001880":3,"00200":6,"00202624":3,"00202756":4,"00217499":4,"00224413":3,"00228740":4,"0023548":4,"002381316302584886":4,"0023813163025848865":4,"00242998":4,"00243186":4,"0024401":3,"00247083e":1,"00249435":4,"00270244":3,"00274989":4,"00289724":4,"00293838":3,"00312361":4,"00315593":4,"0032153180657605086":4,"00323332":4,"0032542":3,"0032873138755776365":16,"003301":4,"0033955154592040936":4,"00353823":3,"0036237":4,"0036367":4,"00369758":4,"003704":1,"003717":1,"003759":1,"003774":1,"003788":1,"0038335":4,"00384936":[],"003909404072811237":4,"00391839":3,"0039987":4,"004":3,"004091940707753964":4,"00410387":4,"00410478":4,"0041136346174431284":4,"004113634617443135":4,"004113634617443136":4,"004113634617443137":4,"004155986345861379":4,"00424967":4,"00426027":3,"00433417":9,"00440346":4,"00443743":4,"004456043243408203":0,"00445655":9,"004579219539673833":4,"00458878":4,"004610275230656537":4,"00462287":4,"00471782":3,"00472199":4,"00472512":4,"0049544":4,"0049999999999999845":[],"004999999999999996":[],"004999999999999997":[],"0050000000000000044":[],"005000000000000007":1,"00512927":3,"00517114":4,"00526348":4,"0053018":4,"00554552":4,"00556826":4,"0056799":3,"00579953":4,"00588657":4,"00607783":4,"006162":4,"00617499":3,"00630331":4,"00642221":4,"006530396683779109":1,"00660427":4,"00672607":4,"00673407":4,"00676387":4,"0068011":4,"00683748":3,"00683964":4,"006968283076248407":[],"007024126888936384":4,"00717152":11,"00719176":4,"00727646693":1,"00728323e":[],"007315":1,"0074331":3,"00759119":4,"007789":[],"007824":1,"00784393":4,"007931713723267314":[],"00803064":4,"00813803":4,"008171076530362356":1,"00817631":4,"00823002":3,"00827728":4,"00831018":4,"00834567":4,"00848904":4,"0086649156":1,"008675369724976777":3,"008885578722629236":[],"00890601":[],"00894639":3,"00905423":4,"009154":1,"009163470508352228":3,"009164545680330616":4,"00917248":4,"00934499":4,"0096208":4,"009735":9,"00973536":9,"009790":1,"009883615646716182":[],"009883615646716184":[],"009883615646716186":[],"009883615646716188":1,"00990475":3,"009911":1,"00992331":4,"00996754":4,"010018312644140933":4,"0100706":4,"010331721306655588":4,"010516485576652981":4,"01057384067458835":[],"01066519":4,"010679893512872646":[],"01076611":3,"0110":16,"011076219011390184":4,"0113104":4,"011347":1,"01179792":4,"01191824":3,"012073649480472317":4,"01210814993019007":[],"01219292":4,"01223198":4,"01231917":4,"01290947":4,"01295356":3,"01312157412031145":4,"01318643":4,"01347916":4,"01348565":4,"01367553":4,"01397146":4,"01405935":4,"0140617":[],"01416528":4,"01433809":3,"01443680008897583":4,"01449782":4,"01458337":4,"0146081":4,"01463049":4,"01503674":[],"015037":[],"015072388895177083":4,"01507238889517716":4,"01514394":[],"015144":[],"01531845":4,"01549377":4,"01558197":3,"01628578269590588":4,"01633913":4,"01640891":4,"01655318":4,"016587414993048166":4,"01691985":4,"0169643":3,"0170259":[],"01708781":4,"01708852":4,"01713366":4,"01724499":3,"017355848195591973":4,"017665":3,"018232":1,"01825571":[],"01831152e":4,"01831250e":4,"01866537":4,"01867234e":16,"01873344":9,"01873869":3,"01887348":[],"01898855":4,"019":[],"01905883":4,"01908936":4,"01963611":4,"01969145":4,"01975416527163567":4,"01975848":4,"02024962":4,"02054837e":4,"02068067":4,"02073509":3,"02096350e":1,"02098261":4,"02123176":4,"021544346900318832":[],"021592704588043153":4,"021592704588043167":4,"02161783e":16,"021901":9,"02190139":9,"02198702e":4,"02208512":4,"02228115":4,"02229529":4,"02252765":3,"02299949826036597":4,"02348765":4,"02365049":4,"0245528":4,"02492265":3,"02493044e":[],"02498832":4,"02503753":4,"02511518":4,"02522069":4,"02568378":[],"025709":[1,9],"02586427":4,"026":4,"0260906":4,"02625193":6,"026605727637189085":4,"0266057276371891":4,"02707227":3,"02723445":4,"02730126581656065":16,"027609773491022498":4,"027609773491022505":4,"028":4,"02881304":[],"029":[],"029483":3,"029688":[],"02968834":[],"029733":1,"02976145":4,"02994311":3,"02f":4,"03019554":[],"030196":[],"03032441e":4,"030670":[],"03067028":[],"03099776":3,"031":3,"03193199":[],"03196357":4,"03251863":3,"03256632e":2,"03267527":4,"03279636":4,"0330308045181225":4,"033030804518383":4,"03303359":[],"033037772005753835":[],"03308408":3,"03365768507152761":4,"034342":[],"0344707":[],"03447512":4,"0354":[],"03562355":4,"03568439":4,"0359565":3,"03607832":[],"03630548":4,"03652792":[],"036528":[],"03697069":[],"03707133":9,"03750367":14,"03781367141738898":4,"03781367141738899":4,"03787596148305236":1,"03791824e":16,"03814292":4,"03815288":4,"038300":[1,9],"03871832":[],"039039":3,"03929932":[],"039967668952797":4,"0399676689527975":4,"03it":4,"040102":3,"04010697":4,"04063602":4,"0411487294305266":4,"0411487294305548":4,"04205220e":16,"04220758":4,"04260073e":[],"04315108":3,"04330858":[],"04346721":3,"04355837":4,"04389027":4,"04421672e":[],"04423486":4,"044334":1,"044402":1,"04455272":[],"044553":[],"044613":4,"04529095":[],"04537385":4,"04543942":4,"04566964":4,"0458":7,"04648335":3,"04683565":3,"04757618e":[],"04784395":4,"048187277304303125":4,"04829457939163212":16,"04892055":4,"04909093":4,"04912436":4,"0495569966278269":4,"0495569966278282":4,"05009826":4,"05100875":4,"051115":[],"051418":3,"051649":[1,9],"0517473":3,"05227921801205707":4,"05227921801205709":4,"052645":[],"05295709":4,"053053":[],"0530533":[],"05318162":[],"053182":[],"05364854":6,"05383795":4,"053849":3,"05396545e":[],"054187":[],"054276":[],"05447415":4,"0545103":[],"054674":[],"055":[],"055085":[],"05531364":[],"055314":[],"055529303095955385":3,"055676":1,"055744":[],"055774":[],"055831":[],"055887":[],"055916":[],"05614483":3,"056326":[],"056329":9,"056484":[],"05651951":4,"057035":[],"057088709963637":1,"0571636815533073":4,"057320":[],"057332":[],"05755374":[],"057571":[],"057654":[],"05785343":4,"05789007":4,"057919":[],"05796251":4,"05802766":[],"05807125":4,"058178":[],"058247":[],"058282":[],"058719":[],"058805":[],"058856":3,"058892":[],"059225":[],"059245":[],"059344":9,"059406":[],"059455":[],"059531":[],"059571":[],"059680303635344434":[],"059765":[],"059806":[],"059865":[],"059908":[],"059994":[],"060064":9,"060070":9,"06020587":4,"060308":[],"060335":[],"06041458e":[],"06043581":4,"060520":[],"060748":3,"060919":[],"061164":[],"061176":[],"061255":[],"06126507e":16,"061330":[],"061601":9,"061652":[],"061774":[],"061783":3,"061842":[],"061855":[],"061896":[],"06200174":3,"062082386342319454":4,"06209126":[],"062188":[],"062327":[],"062376":[],"062639":[],"062659":[],"062660":9,"062731":[],"062822":[],"062829":[],"062879":[],"062885":[],"062923":9,"062979":[],"063055":[],"063097":[],"063114":3,"063122":[],"063178":9,"063190":[],"063324":9,"063395":[],"063415":[],"063523":[],"063526":[],"063615":[],"063670":[],"063727":[],"063759":[],"063763":[],"063880":[],"063882":[],"063925":[],"063982":[],"064000":[],"064013":[],"064075":[],"064078":[],"064101":[],"06412177e":16,"064156":[],"064257":[],"064273":[],"064304":[],"064354":[],"064357":[],"064393":[],"064410":[],"064449":[],"064472":[],"06453579006728317":4,"064591":[],"064647":[],"064648":9,"064686":[],"064689":[],"064783":9,"064795":[],"06491736":4,"06492086e":[],"064929":[],"064958":[],"064964":[],"064982":[],"065":[],"065003":[],"065016":3,"065086":[],"065110":9,"065144":[],"065151":[],"065188":[],"065200":[],"065202":[],"065204":[],"065334":[],"065355":[],"065408":[],"06540809":[],"06547790180152352":4,"06547790180152355":4,"065545":3,"065591":[],"065618":[],"065660":[],"065680":[],"065762":[],"065860":9,"065994":[],"066002":9,"06600226":9,"066030":9,"066047":[],"066074":9,"066092":[],"066098":3,"066116":[],"06619182206626131":[],"066249":[],"066272":[],"066294":[],"066312":9,"066389":[],"066403":9,"066487":[],"066629":[],"066683":9,"066705":[],"066761":[],"066788":[],"066835":[],"066837":[1,9],"066949":3,"066951":9,"066963":[],"067043":[],"067061":[],"067123":[],"067132":9,"067175":9,"067202":[],"06724062":3,"067326":[],"067355":[],"067440":9,"067504":[],"067531":[],"067577":[],"067601":[],"067610":[],"067667":9,"067685":9,"067711":[],"067718":[],"067769":[],"067777":[],"067793":3,"067794":[],"067811":3,"067844":[],"067865":[],"067889":[],"067892":[],"067985":[],"067990":[],"068056":[],"068073":[],"068165":[],"068185":[],"068213":[],"068244":[],"068276":[],"068293":[],"06834":[],"068351":9,"068385":[],"068427":[],"06844519414009441":4,"06844519414009442":4,"068460":[],"068491":[],"068514":[],"068515":3,"068593":[],"068633":3,"068640":[],"068654":[],"068667":[],"068673":[],"068686":[],"068697":9,"068717":[],"068818":9,"068821":[],"068828":[],"068838":9,"068840":[],"068873":[],"068896":[],"068920":[],"068928":[],"068945":[],"069005":[],"069028":[],"069071":[],"069081":[],"069098":[],"069195":9,"069243":9,"069282":[],"069369":[],"069371":[],"069413":9,"069496":[],"069503":[],"069510":[],"069516":[],"069519":3,"069528":[],"069542":[],"069584":1,"069635":[],"069641":9,"069775":9,"069814":[],"069848":[],"069853":[],"069859":[],"069872":[],"069890":[],"069902":[],"069956":3,"069988":9,"06it":4,"070043":1,"070103":[],"070129":[],"070131":[],"070138":[],"070166":[],"070182":[],"070188":[],"070212":3,"070254":[],"070337":9,"070456":[],"070473":[],"070517":[],"070548":9,"07062318":4,"070653":[],"070762":9,"070764":[],"070769":3,"07076926":3,"070791":9,"070812":[],"070815":[],"070866":3,"070867":9,"070889":[1,9],"070949":[],"070955":3,"070967":[],"071016":[],"071049":9,"07106781e":[],"071096":[],"07110274":14,"071156":[],"071248":[],"071268":[],"0713":1,"071313":[],"071325":[],"071359":[],"071435":9,"071447584032141":1,"07145103":9,"071453":[],"071481":[],"071502":[],"071547":9,"071549":[],"07155335":[],"071576":[],"071579":[],"07159175":[],"07160048164228312":4,"07160048164228314":4,"07160764":[],"071660":9,"071667":[],"071681":[],"071684":[],"071714":[],"071761":[],"071841":3,"071855":[],"071887":[],"071917":[],"072012":[],"072046":3,"072094":[],"072197":3,"072198":[],"072246":[],"072279":[],"072296":3,"072424":[],"072468":[],"072471":[],"072555":9,"072557":3,"072589":[],"072598":[],"072620":[],"072654":9,"072661":[],"072710":9,"072826":[],"072862":[],"072879":9,"072910":[],"072995":3,"073":[],"073020":[],"073035":[],"073052":3,"073096":9,"073162":3,"073310":9,"073333":[],"073352":[],"073371":9,"073372":[],"073483":[],"073546":[],"073567":[],"073591":[],"073598":[1,9],"073602":[],"073607":[],"073656":9,"073681":[],"073695":[],"073765":9,"073827":3,"073851":[],"073902":[],"073915":1,"073926":[],"073966":[],"074":[],"074027":[],"074036":[],"074037":[],"074044":[],"074067":[1,9],"074077":[],"074096":[],"074099":[],"074130":3,"074134":[],"074154":3,"074170":[],"074191":[],"074201":9,"074207":[],"07421084":3,"074230":[],"07423848370736122":[],"074248":[],"074285":[],"074286":[],"074331":9,"074432":[],"074434":[],"074453":[],"074488":[],"074557":3,"07456491":3,"074568":[],"074618":9,"074665":[],"074693":[],"074696":[],"074848":[],"07490892":4,"074979":9,"074996":[],"075084":[],"075119":[],"075151":3,"075163":[],"075194":9,"075212":[],"07521771":[],"075218":[],"075261":[],"075266":[],"075289":[],"075296":9,"075309":[],"075526":9,"075542":[],"075545":9,"0755452":9,"075562":[],"075567":[],"075615":9,"075754":[],"075772":[],"07581375":[],"075814":[],"075818":[],"075821":[],"075865":[],"075869":3,"075975":[],"075993":9,"076026":[],"076062":[],"076068":3,"076121":3,"076166":[],"076169":[],"076189":[],"076213":[],"076251":[],"076283":[],"076320":[],"076367":9,"076377":3,"076398":[],"076408":[],"076410":9,"076466":9,"076469":[],"0764924":4,"07670437":[],"076730":[],"076774":3,"076810":3,"076822":[],"076938":[1,9],"076954":3,"077005":[],"077010":9,"077021":3,"077026":3,"077046":9,"077115":[],"077143":9,"077160":[],"077163":[],"077212":[],"07729012413236423":9,"077303":[],"077305":9,"077338":[],"077339":[],"077386":[],"077407":[],"077416":[],"07744472306026946":7,"077469":[],"077533":[],"077623":[],"077645":3,"077771":9,"07777777777777778":2,"077891":[],"077927":9,"077968":3,"078049":[],"078076":[],"078099":9,"078103":9,"078197":[],"078244":9,"078279":[],"078311":[],"078342":[],"078388":[],"078390":[],"078399":[],"07839924":[],"078451":[],"078474":[],"078529":3,"078646":[],"078649":[],"078674":[],"078693":9,"078710":9,"078717":3,"078720":3,"078746":9,"078750":[],"078892":[],"078927":[],"078930":[],"078937":[],"078966":[],"079001":[],"079029":[],"079037":[],"079137":[],"079139":[],"079333":[],"079337":[],"079351":3,"079365":[],"07944154":14,"079597":[],"079598":3,"079624":[],"079643":[],"07968918676726028":4,"07972177":[],"079785":9,"079801":3,"079848":9,"079956":[],"07it":4,"080024":9,"080084":1,"080101":[],"080115":[],"080173":3,"080182":[],"080223":[],"080249":[],"080264":9,"080265":3,"080325":9,"080336":[],"080341":[],"080381":[],"080387":[],"080398":[],"08043851":3,"080565":3,"080570":9,"080612":3,"080626":9,"080633":[],"080675":9,"080678":3,"080738":[],"080806":[],"080845":[],"080846":3,"080871":[],"081024":[],"081077":9,"081092":[],"081102":[],"081103":[],"081129":9,"081210":9,"081227":[],"081260":[],"081270":3,"081309":[],"08131003":4,"081402":[],"081414":3,"081425":[],"081435":[],"081474":[],"081480":[],"081489":9,"081514":[],"08156108":4,"081632":[],"08170444":[],"081732":3,"081744":[],"081778":[],"081816":[],"081886":[],"082032":[],"082091":[],"082211":9,"082225":9,"082239":[],"082247":9,"082272":[],"082303":3,"082382":3,"08248290e":[],"08251519":4,"08251898":16,"082549":[],"082616":[],"082666":3,"082687":[],"08271336":[],"082866":[],"08292574":3,"082926":3,"082990":[],"08299273e":4,"083015":[],"083128":[],"083138":[],"083177":[],"08318298e":2,"0832":[],"083221":[],"083228":3,"083246":[],"083295":9,"083337":3,"083376":[],"083384":[],"083495":[],"083527":1,"083577":[],"083618":[],"08362077210702115":[],"083622":[],"083657":[],"083658":9,"083659":3,"083672":3,"083682":3,"083728":[],"08376632":4,"0837663229239025":4,"083766322923905":4,"083775":[],"083797":3,"083808":[],"08380813":[],"083855":[],"083905":[],"084":[],"084092":[],"084103":[],"08415761":[],"084167":[],"084181":[],"084221":[],"084249":9,"084251":[],"08426840630693411":4,"08429424":11,"084461":[],"084604":9,"084813":9,"084826":[],"084864":[],"084873":[],"084916":[],"084931":[],"08501147":[],"085041":3,"085121":9,"085253":[],"085259":[],"085285":[],"085289":[],"085484":3,"085510":[],"08551306":4,"085544":[],"085597":[],"085598":[],"085610":[],"085627":3,"085646":9,"085676":[],"085748":[],"085763":[],"08576932":4,"085811":[],"085928":[],"08593216":4,"085951":[],"086006":3,"086052":[],"086076":3,"08611111111111111":2,"086116":[],"086325":[],"086430":[],"086465":[],"086561":[],"086592":[],"08665060086846632":[],"086652":9,"086757":[],"086920":3,"086974":9,"086985":[],"087032":3,"087096":3,"087148":3,"087202":9,"087205":3,"087242":[],"087334":[],"087482":[],"087526":[],"087544":[],"087563":9,"088085":3,"088137":[],"0881981":3,"088209":[],"088258":[],"088260":3,"08839750e":[],"088414":[],"088484":[],"088556":[],"088660":[],"08871404":3,"088871":[],"08888888888888889":2,"088983":3,"089039":[],"089250":3,"089300":[],"089326":[],"089352":[],"089425":9,"089437":[],"089504":[],"089540":[],"089693":[],"089881":[],"089916":[],"089928":3,"089931":[],"090099":3,"090107":3,"090274":9,"090355":[],"090817":[],"09103481e":16,"091159":[],"091253":3,"091318":[],"09145189":4,"091535":[],"091542":3,"091566":3,"091578":[],"091659":[],"09166666666666666":2,"0917":7,"091756":3,"091855":3,"091979":[],"092276":3,"092288":[],"092375":[],"092378":3,"092659":[],"092932":[],"092936":3,"093236":[],"093248":[],"093328":[],"093573":[],"093725":3,"093755":9,"093928":[],"094":[],"094082198961287e":4,"0940821989631478e":4,"094513":[],"09456011349477329":[],"094708":3,"094774":[],"09487315108590391":9,"095173":[],"095180":3,"095275":3,"095472":[],"095786152583691":3,"095941":[],"09609807":3,"096406":[],"096639":[],"096726":[],"09672604":[],"096763":[],"09678277e":16,"096802":[],"097150":3,"097346":[],"09741585e":[],"097452":[],"098028":3,"098187":3,"09903804":6,"099079":3,"09919198949386163":4,"099504":3,"099609":3,"099763":[],"09976319":[],"0x7f8830b3a340":11,"0x7f88524ba760":11,"0x7fda9123e220":[],"0x7fdab4f97430":[],"0x7febdb109490":[],"0x7febdb6780d0":[],"100":[0,1,2,3,4,5,6,7,8,9,11,14,16,17],"1000":[0,1,2,3,6,9,11,13,16],"10000":[0,3,4,8,9,16],"100000":6,"10001":8,"1001":16,"1002":16,"1003":16,"1005":16,"1007125":[],"10077114273548986":4,"1009":16,"10094646e":[],"1011":16,"1013":16,"10131725":[],"1013904243":16,"10141413e":4,"10141414e":4,"1015":16,"101781":3,"102":1,"1022964509394572":2,"1023":16,"1026":16,"1027":16,"103":2,"1030":16,"10307631":[],"10327559":14,"1037":16,"10378326e":2,"1038":16,"10391807":4,"10398646080125035":4,"10398646080125036":4,"1040":16,"10405456":9,"104411":1,"1047":16,"104887":3,"105137868830763":16,"105387":3,"10555555555555556":2,"10589577":3,"106095":[1,9],"106946":3,"108":[1,4],"10806972":[],"108070":[],"10896672e":16,"10898112e":[],"10913":4,"10931453":4,"109794":3,"10979444":3,"10it":4,"10th":7,"10x":1,"110":1,"1100":16,"1101":16,"11022302e":3,"111":[2,5,10],"1111111111111111":2,"112283":1,"112383":[1,9],"11304709e":16,"11388888888888889":2,"11456076e":[],"11462415":3,"11482289e":4,"11507992e":2,"1154777721897675":4,"11547777218976751":4,"115822":4,"11666666666666667":2,"117":6,"11744554e":4,"118318":1,"11892185":[],"11944444444444445":2,"12002944":[],"1203284":6,"121":[6,7,8],"12182967":4,"122":[6,7,8],"12222222222222222":2,"12283463":[],"12318726e":4,"123190":1,"12333649":4,"123459876":16,"12366979e":16,"123711":4,"124":1,"12497018e":[],"12552073e":4,"12618549":3,"1271":4,"127773":16,"12777777777777777":2,"12908963":1,"1298":7,"12adb44b1c20":[],"13003291":4,"13055555555555556":2,"13060772":[],"131343":4,"13140162":[],"13162821e":[],"13209041":[],"13220608e":4,"13220609e":4,"13266452e":[],"133":5,"13328820e":[],"134102":[],"13410232":[],"13457922":[],"13519106":1,"13535942":4,"13579199e":[],"1361111111111111":2,"13646574":3,"13661243e":4,"136687":[],"13679863":4,"137268":[],"137400784702912":1,"1375":[],"137546":[],"137652":[1,9],"138":[],"13803928":[],"138472":[],"13859":[],"13865173":3,"138775":[1,9],"1388":4,"13891144e":[],"139255958275475e":4,"139255958572018e":4,"139462":[],"139475":[],"139992":4,"14021063":4,"1404":1,"1416398":4,"141725":[],"14174745":4,"141955":3,"14195542":3,"143":5,"14309733":[],"1437":2,"14370264":4,"1440501043841336":2,"1445":[],"14459063":[],"1446":[],"1447":[],"1448":[],"1449":[],"14662074":[],"14722222222222223":2,"147400":[1,9],"147420":[1,9],"147722":[],"148":[],"14812206":4,"148127":[],"148225":4,"148517":4,"149076":[],"1492":[],"149233":[],"149328":[],"149366":[],"149667":[],"149739":[],"149832":[],"149894":[],"149903":[],"14g":4,"150":6,"15005476":3,"15024669":[],"150306":[],"150581":[],"15061":4,"15098090e":4,"151":[],"15130074e":4,"152636":[],"1527777777777778":2,"153036":1,"153106":1,"15324631":[],"15332528e":[],"154720":1,"15475232":[],"154911":1,"155491":1,"155687":1,"155883":1,"156":1,"156956":3,"157":1,"15751596":[],"158":1,"159":1,"15979239e":16,"15g":4,"160":1,"16111111111111112":2,"16211139":3,"162246":3,"16342407":3,"16343471":4,"16496581e":[],"16553696":[],"16637855e":16,"16666666666666666":2,"167787":3,"16796929":4,"16805821e":4,"16807":16,"16831012":[],"16861772":[],"168618":[],"1695":4,"16b8e3cda33a":2,"17117385":[],"17174962e":2,"17234827e":[],"17248441e":[],"172737":3,"17273709":3,"17385778e":[],"17446471":4,"174497":[],"17449733":[],"175300":1,"1758506":[],"1761":4,"17641709":4,"17654307":[],"17666625":11,"17707436":[],"17709":4,"17777777777777778":2,"17801022":3,"17861098":4,"17917768":3,"17949575":3,"17953942":9,"1797":2,"17it":4,"180092462880674":[],"18029127":3,"18063928":[],"18123182":11,"18220995":[],"18224665":[],"1831277634928002":[],"18333333333333332":2,"18404906e":[],"184519":1,"1856411":[],"18611111111111112":2,"18613217e":4,"18620601e":[],"18673098":9,"189496":1,"18954529":[],"189622":1,"18968431e":16,"1914224774238273":[],"19207979":3,"1940":1,"194042826640948e":4,"194042826840599e":4,"1943":10,"19569961":4,"197":[],"1970":14,"1973":7,"197370":[1,9],"19742904e":[],"1979":4,"1989":16,"19937":16,"19955871":[],"199559":[],"19972087e":16,"1_1":10,"1_2":10,"1_3":10,"1cm":[1,6,8,16],"1e10":0,"1e4":4,"1ec254875e1a":11,"200":[1,6,7,8,16],"2000":1,"200000":1,"20015436":4,"2004":11,"2006":18,"2010":2,"2011":2,"2015":2,"2016":1,"2018":[1,4],"201841":[],"20184113":[],"2021":[0,4,15],"20277777777777778":2,"203757":[],"20375701":[],"205466494327873":[],"20632410e":[],"20738183":[],"207545":[1,9],"20772452":[],"20819609e":[],"20833333333333334":2,"20843563e":[],"20867052175003387":4,"20906175e":16,"210340":[1,9],"21058097":3,"21169159e":4,"212":[],"21208310e":[],"212327334149492":[],"21244261":3,"212443":3,"2125":[],"2126":[],"2127":[],"2128":[],"2129":[],"213":[],"213103":[1,9],"21347282":[],"213743":[1,9],"214":[],"2147483647":16,"215":[],"21596432":4,"216":[],"21623344":[],"216290":[1,9],"216683":[1,9],"21698969":11,"22044605e":3,"22076362":[],"221":6,"221180":1,"221921":3,"22209371e":[],"222400":1,"22443803":[],"22527008e":16,"22690428":3,"22717936e":16,"22842468702166951":4,"22842468702166954":4,"22847924":3,"22999784":[],"229998":[],"23002365e":4,"23117916e":16,"23167717":3,"232435":1,"23333333333333334":2,"2335879":[],"23382086e":[],"234":4,"23438810e":[],"236913":3,"23691315":3,"23744178":[],"240792":3,"2407922":3,"241262":[],"24126232":[],"24175744e":4,"2433e":3,"24340751":[],"243484":3,"24348403":3,"24444444444444444":2,"246138":[],"24613822":[],"24829908":3,"24906604e":4,"250":[5,7],"25000":1,"250000":1,"250154":1,"251559":[],"2515593":[],"251879":1,"25190225e":[],"25226753e":16,"25240108":[],"252436":1,"252639":[],"25263916":[],"253":[],"25303483":[],"253775":1,"254":[],"254509":[],"25450941":[],"25457052":[],"255":[],"255001":1,"2551":1,"256":[],"25617658e":4,"25617662e":4,"256962":1,"257":[],"2571699":[],"25726439e":[],"2572e3a4b38d":2,"25803281":[],"25845e8df859":4,"259107":[],"25910749":[],"259125":3,"25912505":3,"259153":[1,9],"259815":[],"25981533":[],"260227742627244":[],"2627588":14,"26301436":3,"26381865":[],"263819":[],"264":1,"2640931530791003":4,"26409315307910036":4,"26412372":[],"265":1,"2653678":[],"266":1,"26666667":11,"267":1,"26710969":3,"26780278":3,"2683":[],"2684":[],"2685":[],"2686":[],"2687":[],"26890510e":[],"269":1,"26974938e":[],"270":1,"27262964":[],"27296891e":[],"276263":[1,9],"27753165e":16,"27852549":[],"27924636":3,"27n_":16,"280573":3,"280647":[1,9],"28166741":[],"282":[],"282727":[1,9],"28310983":[],"283110":[],"28336218e":4,"2836":16,"28475098":6,"2861":16,"28712116":[],"2873":7,"2882":16,"2886":16,"2890":1,"2892":16,"28971976":9,"289720":9,"290":[],"291":[],"2915":16,"291614":[],"29167186":3,"292":[],"293":[],"2931":[],"294":[],"29424824":[],"295656121491569":[],"296247":1,"2968":[],"297219777724628":9,"297260":1,"29737229":11,"29748212":11,"2975":4,"2980":[],"29822833":4,"298273":1,"2983233":14,"298375":1,"2988":4,"2990":[],"299444":9,"29944428":9,"299748":1,"2_1":10,"2_2":10,"2_3":10,"2_i":10,"2_m":[4,16],"2_t":11,"2_x":16,"2cm":6,"2ff97f4bf03b":16,"2nd":7,"2x_ix_jy_iy_j":6,"2x_j":6,"2y_i":8,"2y_j":6,"30000":1,"300162456113691":[],"30119421":6,"303":4,"3041320306136366":[],"3043053":11,"30466214e":4,"30626706":[],"30655001":4,"306854":[],"30685416":[],"30787294":4,"30879705":[],"30968181":[],"310811":[],"31081134":[],"31109204e":[],"3123314713548606":4,"31276579e":4,"31318084":3,"31457796":3,"315":4,"315208":3,"31520842":3,"3155":[3,4],"3156929654100207":7,"31603087":4,"31608475e":[],"31718909":9,"31730641":[],"317367":9,"31853484":[],"31896852":6,"3200":2,"32047562":1,"3214960170351912":4,"32149601703519126":4,"323291478597321":16,"3250":2,"32521615e":16,"326238":1,"327631":1,"32938847":14,"32945844e":16,"3304":1,"33066907e":3,"3310":1,"3317":1,"331939":1,"333":5,"333333":1,"33333333":11,"3338":1,"3344":1,"33443859e":[],"33544681":[],"33569998e":[],"33861512":[],"338869":[],"33886902":[],"339535706819584":16,"33953571":16,"340782":[1,9],"34108726":[],"34114547":3,"34114641e":[],"34172919":[],"342680":1,"3436":1,"3437":1,"344172":1,"34569596":3,"346433":9,"34643337":9,"34902789e":16,"3498837":11,"350387":[],"35038714":[],"351636":[1,9],"35176067":[],"35182854":3,"35216172e":[],"35367281e":[],"35386868":11,"35533773":4,"356399":1,"357508":1,"358869339268145":16,"35886934":16,"359":3,"359640894899012":[],"360":2,"360688":1,"361556":1,"3621311":3,"363295916523824e":4,"3632959273186007e":4,"36436520e":[],"36468301":[],"3655222":3,"369139":[1,9],"36941772":[],"369418":[],"37186301":[],"372889":[],"3728892":[],"37396662":4,"37416969":9,"374170":9,"37732":11,"37738324":[],"37900111":4,"38135733e":4,"38207279e":[],"38216436":[],"3848":4,"38561052":3,"385611":3,"38629436":14,"38777878e":3,"38892672":[],"388927":[],"38903780":4,"38916861e":4,"3893239":[],"389324":[],"38937995e":16,"38962192e":4,"38986237":[],"39579407":3,"396740":9,"39674043":9,"39706038":3,"39716546":4,"397700":[1,9],"39792608e":[],"399836":1,"39it":4,"3cd19a0768e1":[],"4000":18,"401842":[1,9],"40212127":[],"404":1,"40425078e":16,"405890":[1,9],"40702":[],"40708470e":[],"40859":[],"4087793":3,"40902095":[],"40927184e":4,"40968888":[],"409689":[],"41078073":4,"412374":[],"41237437":[],"4140e":3,"41433969":3,"41511965e":2,"415634483874318":[],"416694683938511":9,"4171578884124756":0,"41754964":[],"41770932":[],"418506":[1,9],"41876428e":[],"41882037e":4,"4200e":3,"4201e":3,"4203e":3,"42208194":4,"423756":3,"42375621":3,"42441033":3,"426":[4,5],"42847770e":16,"42937310e":16,"43054282":3,"4332e":3,"43330971e":4,"43341615":4,"435163":1,"435490":[],"43549028":[],"43579948e":4,"43766686":9,"438136":1,"439230":4,"44089210e":3,"442600":[1,9],"443217":1,"44395541":[],"44625466e":16,"44655382":3,"446554":3,"44970586e":2,"45013332e":[],"45019484":[],"450257":[1,9],"4557763":9,"455947":1,"458027":1,"458078":[1,9],"45937170e":[],"45960079":3,"46016532e":[],"461":16,"461838":[],"46183815":[],"462":5,"46323168e":16,"4632e":3,"46383924e":4,"46383925e":4,"46415888336127775":[],"46423858e":[],"465564":[],"46556436":[],"466":16,"46675058":[],"46914544e":[],"46929603e":[],"469730":[],"46973015":[],"46984697e":4,"47042744":3,"470714":1,"47075725":4,"47079457e":16,"47116868e":4,"47125748":3,"47132891":3,"472652":[],"47265243":[],"47441766":[],"47566390e":16,"47610036":4,"47654764e":[],"47815203":9,"47862383":[],"478624":[],"480170":3,"48017006":3,"48019541":[],"48154187202453613":0,"481979":4,"48257387":17,"48471852e":[],"48476997":9,"48608063e":[],"48994188":3,"491837":[],"4918372":[],"493230":[],"49323032":[],"4940954":1,"4959161509366834e":4,"4959161509370406e":4,"497221":[],"49722108":[],"49841285":[],"498413":[],"49865673":[],"4990":16,"4992":16,"4997":16,"49b0ef2e51e2":4,"4c4c7f":[7,8],"4y_i":8,"500":[2,4,7,8,11,16],"500000":1,"50000455":3,"50000553":3,"50000718":3,"50000855":3,"50000969":3,"50001063":3,"50001142":3,"50001207":3,"50001261":3,"50001306":3,"50001343":3,"50001374":3,"500014":3,"50001414":3,"50001422":3,"50001439":3,"50001454":3,"50001466":3,"50001476":3,"50001485":3,"50001492":3,"50001498":3,"50001502":3,"50001506":3,"5000151":3,"50001512":3,"50001515":3,"50001517":3,"50001518":3,"50001519":3,"50001521":3,"50001522":3,"50001523":3,"50001524":3,"50001525":3,"5018":16,"50227564e":4,"50321091":3,"50394742":[],"506":1,"507d50":[7,8],"50846112e":4,"5098779":[],"509878":[],"50j":11,"50x10":2,"510":2,"511888":3,"5120":0,"512132":1,"51257863e":[],"51345668e":[],"51363731e":[],"514219":1,"51523276e":[],"515768":[],"51576807":[],"51707172":[],"517072":[],"51893804e":[],"51943726":9,"519842":1,"51it":4,"52158335":[],"5222222222222223":2,"52570079":[],"525701":[],"526744":[1,9],"52687171":[],"526872":[],"52722156":[],"52874252":3,"529":4,"52d2c51caad1":[],"5303329":9,"5305555555555556":2,"531280":1,"535457":[],"53545715":[],"53703498":4,"5378811":9,"539261":[1,9],"54039921":3,"54096582":[],"540966":[],"54121682":[],"541217":[],"54152940e":[],"541605":1,"54237024":16,"543169":[],"54316925":[],"544439":1,"546972":[],"54697204":[],"54702088e":[],"54710530e":1,"5483":4,"55111512e":3,"55138385":9,"551384":9,"55280484":[],"5555555555555556":2,"55707065":[],"557071":[],"557795":[1,9],"55795935":[],"55854694":9,"56033697":3,"56198284":3,"56216797e":[],"564374":[1,9],"56536":1,"56636616e":4,"56831157":3,"568312":3,"569":2,"56912044e":4,"56939714":3,"57051369":[],"571":3,"571105947979326e":4,"57110594797945e":4,"57143061":4,"57201944e":4,"574465":[1,9],"5755035":[],"57781668":[],"57871326":[],"579842":3,"57984245":3,"581766":9,"58176612":9,"582":[1,2],"58228342e":16,"58239999":[],"582400":[],"583595":1,"584804":1,"58521266":9,"585213":9,"58596975":[],"585970":[],"5864689451163851":3,"587401":1,"58836420e":16,"5888888888888889":2,"59007674e":16,"59304755e":[],"5944444444444444":2,"59480085":[],"59it":4,"5cm":16,"5dd54edf2138":4,"60122668e":16,"60293962":3,"60394236e":[],"60420593":3,"60673226":9,"606760":3,"60949193":[],"609492":[],"60999846":[],"61069091e":16,"6111111111111112":2,"61124978":[],"61234223":[],"612939":1,"613579":1,"614808":[1,9],"61505887e":[],"61745046e":[],"618":1,"61825186":11,"6183694":[],"61869821":[],"618982":1,"622539":9,"62253933":9,"622625":[],"62262506":[],"6226921":[],"62316154e":16,"62359224e":16,"62373464":9,"625":5,"62783293":[],"62856593":[],"62894215":3,"629961":1,"6300745149331701":1,"63025821e":4,"63249532e":4,"63315151":[],"63339159":[],"63374631":[],"63437572":[],"63442451e":[],"63488525":4,"63498144":3,"636323":9,"63632311":9,"63680118":[],"637129335071195":1,"63993205e":[],"64001211":4,"64012627":3,"640782":[],"64078247":[],"64166831e":[],"64447921":[],"64522721":4,"64580686":[],"646283":[1,9],"64669382":[],"646694":[],"64742912e":4,"647473":[1,9],"64857826e":[],"649382":[1,9],"64x50":2,"650024":[],"65002433":[],"6510573774179256":16,"65105738":16,"65238878":14,"65245958":[],"653095390463358":[],"653702":14,"653725417896576":1,"6544e":3,"65482578":[],"65572035":[],"65599927":[],"65766387":[],"65885453":3,"65933852":[],"65939208e":[],"6600855222624895":[],"66020213e":[],"6614":[],"66152576":3,"661526":3,"66183486":9,"661835":9,"66204648":4,"6628996975186952":1,"66302359":[],"66383151":[],"66677842":[],"66800261":[],"668172":1,"66880047":[],"67006792":[],"67047975e":4,"67060602":[],"671089":1,"6713619":3,"6714":[],"67171347e":16,"672721":1,"67279536":[],"67298546":11,"67303655":9,"673037":9,"67407338e":16,"67450955":[],"67708423":[],"677149":[],"67714918":[],"6796265324852733":[],"68002363":[],"680024":[],"68034946e":[],"6813":[],"6814":[],"6815":[],"6816":[],"6817":[],"6818813252071303":16,"68188133":16,"68192193":3,"68316185":[],"68342382":[],"68386076":11,"68534263e":4,"68542204":3,"68616263":14,"68729414":[],"68887763":11,"68929213e":4,"68937695":[],"689519":[1,9],"690617":1,"69069n_":16,"693361":1,"69347005":[],"6936767":3,"693677":3,"693850":9,"69385025":9,"69504801":4,"69519693":[],"695197":[],"69573183":[],"69634577e":4,"69695259":3,"69843037":[],"6996584":[],"69981195e":16,"6999536":9,"6ea927cc6e88":2,"6f7a6bd7d79f":4,"6n_":16,"701370":3,"70183798":[],"7022283":[],"70234019":[],"70415861":[],"70523024e":[],"70589906":[],"7070e":3,"70710678":3,"70790937":[],"70832814":3,"70885528e":[],"70886748":[],"70900891":[],"70946493e":[],"712018":[1,9],"712199063818309":[],"71281409":[],"71351486":[],"71442781":14,"71606852":[],"7162":[],"71669651":[],"7172":[],"718165":3,"72108703":[],"72174172":9,"72218808":[],"72271878e":4,"72312577":[],"7236674":3,"7240496":[],"725394195434945":[],"72780613e":16,"72859758":3,"72879865e":[],"72981762":6,"73091052e":[],"731000":1,"73153522":11,"733096":1,"73453972":[],"7371165871823337":[],"737349":[],"73734906":[],"73921714":[],"74081822":6,"74107697":9,"74143127e":[],"7432283":[],"74382593":[],"7442":[],"74495014":[],"745136489050356":[],"7465":[],"74840212":3,"74845978":[],"74921867":[],"749765":1,"750445":1,"751699":[1,9],"75170092":3,"75195757":[],"7522047280566193":[],"75322913":11,"75382481":[],"75524378":[],"75629493":[],"756352":1,"75841112":[],"75932862":[],"75it":4,"76172241e":[],"762":[5,9],"7621419":[],"76290332":[],"763880":[],"76388013":[],"76497666":[],"765":5,"76504618":[],"76570177":[],"76648901e":[],"76936315":3,"7693978131030923":9,"7701384":[],"77152076":3,"77156117e":3,"7718":7,"772b904ae9cb":[],"77317984":[],"7733":[],"77350269e":[],"774300":1,"776223":[],"77622336":[],"77636e":11,"77661393e":16,"77714169":6,"78080633":[],"78082":[],"78184120e":4,"78195":[],"78857629":[],"78941903":3,"78944806":[],"7899453":[],"79111643":3,"7925146":[],"792515":[],"79295029e":16,"793167":1,"79326583e":16,"79328828":[],"793701":1,"794282":[1,9],"79459035":[],"79648291":[],"796796":4,"79902342":[],"7c394b1e8b71":7,"7d7d58":[7,8],"800":5,"80004454e":[],"80021057":3,"800266":[],"80026635":[],"80121":[],"80354994":4,"80469739":3,"8055555555555556":2,"80609614e":4,"80609615e":4,"80847477e":4,"81048318e":4,"81160425":3,"81333793":4,"81441779":[],"81620806":[],"81633628":9,"816454":1,"816847":1,"81712976":[],"817130":[],"81781888":9,"819202":[],"81920231":[],"82198978":3,"8265786":3,"827265":1,"82889306e":16,"8305555555555556":2,"83425361":9,"834254":9,"83512277":3,"83614019":[],"8388888888888889":2,"839313":[],"8393131":[],"83935285":[],"83it":4,"84008474":[],"840085":[],"84087101":[],"842":[],"842436":1,"84251485":[],"842515":[],"8429949116841184":[],"84355903e":2,"84372853":[],"84443254e":2,"84658093e":16,"84780262":4,"8479552268981934":0,"84860939":[],"84923989e":4,"849766":[],"84976606":[],"84994524":3,"850164":3,"85058354":[],"850584":[],"8520127":[],"85218118":[],"85263220":4,"85278450e":[],"85396354":[],"85450859":9,"85463934e":[],"85497163e":[],"85546305e":[],"85601992":3,"860114":3,"86011441":3,"861":1,"86117291":3,"86134827":3,"86145244":9,"8638888888888889":2,"86436607":[],"86574276":[],"8666666666666667":2,"86692943":[],"87030083":[],"870301":[],"8718475896381779":16,"87184759":16,"8722222222222222":2,"87381451":3,"875":2,"8759":11,"87761937":[],"8777777777777778":2,"878843":[],"8788431":[],"87972591":[],"8802":[],"88046261":3,"88046462":[],"8805555555555555":2,"881323":[],"88168312e":4,"88297395":[],"88336879":3,"88529063e":4,"88559559":[],"8867467323038865":[],"88693966e":16,"88712946":[],"88730288":[],"8888888888888888":2,"890":4,"8901":[],"8914984":[],"89156955":[],"8921171964770647":9,"8923":[],"89288636":9,"8931":[],"89383322":[],"8941":4,"89410423":3,"8944444444444445":2,"8954":[],"89704131":[],"89742056":[],"897421":[],"898500":9,"89850037":9,"89928965":[],"89942598":[],"89975818":[],"89992521":1,"8dc29df57a8c":4,"8x8":2,"90075537":3,"9011":4,"90220243":3,"90233874":[],"90266948":3,"9031":[],"90316476":[],"9040":7,"9042":4,"90475506e":4,"9054":[],"9055555555555556":2,"90618734e":16,"906747":3,"907307":9,"90730735":9,"90825063":[],"9096":[],"91012519e":[],"9111111111111111":2,"91128596":3,"91145266e":16,"91417278":[],"9142":4,"91492986e":4,"9154537458386387":3,"91549644":1,"9166666666666666":2,"916978":[],"91697817":[],"9171356":[],"91760278":3,"91812702":3,"918992":1,"9196":[],"91960881":11,"9222222222222223":2,"922312":[],"92231203":[],"92280994":[],"924018":1,"924197515789051":4,"925":2,"92507116e":2,"92578916":3,"92605247":[],"92645039":9,"92646965":9,"926470":9,"92732185e":[],"9277777777777778":2,"9279671770201344":16,"92814088":[],"928141":[],"92857143":5,"92919670e":16,"9305555555555556":2,"931":1,"93100040e":16,"931066":3,"93155188":3,"93158979":3,"932734":[],"93273404":[],"933":3,"93492130e":4,"9354":[],"9361111111111111":2,"93679587":[],"936796":[],"937":16,"937082":1,"93799826":3,"938":16,"9388888888888889":2,"939":[1,16],"94019247e":[],"94034531":[],"94226022e":4,"94240779":[],"942726":[],"94284104":3,"94320205":3,"94327895":3,"9444444444444444":2,"94536341":16,"94591015":14,"94639099":9,"946893955211749":[],"946957":3,"947543":9,"9482527":3,"948729":[],"94it":4,"95008046":4,"95014575":[],"95231424":3,"9527777777777777":2,"95284275":3,"95351665":3,"954":16,"95443703e":[],"9547578478889096":1,"95517094":[],"955171":[],"9555555555555556":2,"95628168":[],"956282":[],"956563":[1,9],"95684892":3,"958228616652075":3,"9583333333333334":2,"959247":[],"960":16,"9601304850085328e":4,"9601304850163794e":4,"96024953":3,"96084663":3,"961":16,"96104648":[],"9611111111111111":2,"962":16,"963499":9,"96349948":9,"9637117593816477":4,"9640435":3,"965548":1,"965885569080809":[],"96688672":3,"9674916":3,"967809":[1,9],"96793117e":[],"97005689":3,"97101567e":16,"97108e":11,"9722222222222222":2,"97243128":3,"97300836":3,"97497404e":4,"975":2,"97507735":3,"9756404":[],"976":6,"97622676":[],"976227":[],"9765":[],"9769":[],"97705827":3,"97723801":[],"97758848":3,"9777777777777777":2,"9780387310732":18,"9780387848570":18,"9781492032632":18,"978553":3,"97898392":4,"97900797":11,"97926491":3,"9804422":[],"98046438":[],"9805555555555555":2,"98091621":3,"981321":1,"98139097":3,"98275501":3,"98314755":[],"983148":[],"983310":1,"98413059":3,"98452685":[],"98454786":3,"985":16,"98526763":[],"98528992":[],"98531221":[],"98566191":3,"986":16,"9860803":[],"98609175":16,"986091753050161":16,"9861111111111112":2,"98661465":[],"986699":3,"98680716":3,"98716878":3,"9877742":[],"987902":[],"98808176":3,"98822371":4,"988663":[],"9888888888888889":2,"98892195e":16,"98893512":[],"989":16,"9890348":3,"98927731":[],"9893447":3,"9898ff":[7,8],"99009525":3,"99009739":[],"9901168":[],"99013921":[],"99016161":[],"99018401":[],"99043999":[],"99088801":3,"9909252":[],"991":16,"991072":9,"99107239":9,"99115119":3,"99126104":[],"99133007":[],"99160404":[],"99176998":3,"99190487":[],"99194716":[],"992":16,"99218987":[],"99219378":[],"99242605":[],"99242921":3,"99248001":[],"99265097":3,"99273355":[],"99276945":[],"993":16,"99305549":[],"99305802":[],"99311297":[],"99316252":3,"9933":[],"99346398":[],"99363129":[],"99363383":[],"99371056":3,"99389612":3,"99393624":[],"994":[],"99400444":[],"9941":[],"99418903":9,"99420743":[],"99420997":[],"99428016":[],"9943201":3,"9945452":[],"99462421":[],"99473581":[],"9947756":3,"99478645":[],"99478898":[],"99492986":3,"99498985":[],"995":[],"99501236":[],"99503487":[],"99505739":[],"9950799":[],"99527696":[],"99528218":3,"9953048353087299":[],"99536326":[],"9953658":[],"99539415":3,"99544872":[],"9954538761021741":[],"99566069":3,"995774":[],"9957744":[],"99578809":3,"99579317":[],"99581841":[],"99594294":[],"996":3,"99600927":[],"99608161":3,"99620088364924":1,"99636015":[],"9963961":3,"99650061":3,"99652042":[],"99652296":[],"99655111":[],"9966744029509663":[],"9967292151090247":[],"9967458":3,"9968966158779216":1,"9969":[],"99696351":[],"997":[],"99700706":3,"99709215":3,"99709325":[],"99710078":[],"99723611":[],"99728435":[],"99729756":3,"99730848":[],"99751458":3,"99758326":3,"99763569":[],"99767893":[],"99775587":3,"99782689":[],"99793613":3,"99799099":3,"998":[],"99813653":3,"99817842":[],"99825997":[],"99828624":3,"9983295":3,"99836973":[],"99845267":3,"9984806":[],"998577":3,"99861053":3,"99871521":3,"99881845":3,"99883879":[],"99884384":3,"99891285":[],"99893323":3,"999":[7,16],"99901896":3,"99903755":3,"99911427":3,"99918546":3,"99919837":3,"99926459":3,"9993237":3,"99933188":3,"99938942":3,"9994385":3,"99944272":3,"99945628":[],"99949306":3,"99953381":3,"99953475":3,"99957911":3,"99961294":3,"99965056":3,"99967865":3,"99970988":3,"9997332":3,"99975913":3,"99977849":3,"99980002":3,"9998161":3,"99984732":3,"99987324":3,"99988687":[],"99989476":3,"9999095":[],"99991263":3,"99992746":3,"99993212":[],"99993978":3,"99995":3,"99995475":[],"999955585168597":4,"99995818594196":[],"999974281880048":[],"99997737":[],"9999787681537219":[],"9999794306626945":[],"9999822527140678":[],"9999850282256434":1,"9999864543345858":[],"9999868619217517":[],"9999869956119286":[],"9999878260589065":[],"9999887274726137":1,"9999910208315801":[],"9b9cf4fa1a95":[],"\u00f8yvind":[4,17],"abstract":2,"break":[0,1,4,9],"byte":14,"case":[1,2,3,4,5,9,10,11,13,14,15],"catch":1,"char":16,"class":[1,2,4,5,6,7,9,10,11,16],"const":16,"default":[1,2,4,5,14],"ekstr\u00f8m":17,"export":7,"f\u00f8470":17,"final":[0,1,2,3,4,5,6,7,8,9,11,15,16,17],"float":[0,1,3,7,9,11,14,16],"function":[0,3,7,13,14],"import":[0,1,2,4,5,6,7,8,9,10,11],"int":[0,1,2,3,4,9,11,14,16],"long":[1,2,10,11,16],"m\u00f8svatn":4,"new":[0,1,2,3,4,5,6,7,8,9,11,14,16],"null":16,"public":[1,13],"return":[0,1,2,3,4,5,6,7,9,11,14,16],"s\u00f8rli":17,"sch\u00f8yen":[4,17],"short":[0,3,12],"steinsv\u00e5g":17,"super":3,"switch":[0,1],"throw":[4,16],"true":[0,1,2,3,4,5,6,7,8,10,11,16],"try":[0,1,2,3,4,5,6,7,8,9,11,13,14,16],"var":[3,4,8,9,16],"while":[0,1,2,3,4,5,6,7,9,10,11,16],AGE:1,Adding:2,Age:5,And:[0,1,3,4,7,11,13,16],Are:9,Being:11,But:[0,1,2,3,4,7,8,16],CAS:[],DIS:1,Doing:[3,4,8,11],EoS:[1,4],FYS:15,For:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,15,16,18],Going:2,Ising:[3,10],Its:[2,9],MDS:9,NNs:10,N_s:6,Not:[1,2,3,4,15],OLS:1,One:[1,2,3,4,5,6,9,10,11,16],PCs:[9,13],RMS:16,Such:[4,10,16],That:[0,1,3,5,8,9,10,16],The:[8,11,14,15,17,18],Then:[0,1,2,3,4,6,7,8,9,10,11,14,16],There:[0,1,3,4,6,7,9,10,12,14,15,16,17],These:[0,1,3,6,7,8,9,10,11,14,16],Use:[1,4,7],Useful:[3,4,14],Using:[1,3,4,6,8,10,14],With:[1,3,4,6,7,8,9,10,14,16],__class__:8,__doc__:4,__future__:[6,7],__getattr__:[],__init__:2,__mosek:3,__name__:8,_auto10:[4,10],_auto12:4,_auto1:[3,4,5,10,11,14,16],_auto2:[3,4,10,11,14,16],_auto3:[3,4,10,11,14],_auto4:[4,10,11,14],_auto5:[4,10,11,14],_auto6:[4,10,14],_auto7:[4,10,14],_auto8:[4,10],_auto9:[4,10],_ax:[],_base:6,_build:[13,18],_check_optimize_result:[5,9],_compon:9,_coordinate_desc:4,_datafram:[],_depth:7,_fraction:7,_lambda:4,_leaf:7,_logist:[5,9],_make_index:[],_make_vjp:11,_multilayer_perceptron:[1,2],_node:[7,11],_num_sampl:[],_ratio:9,_sampl:7,_split:[4,7],_test:4,_trace:11,_valu:11,_varianc:9,_weight:7,a0faa0:[7,8],a77d5ac269b2:[],a_0:1,a_1a:1,a_2a:1,a_3:1,a_3a:1,a_4:1,a_4a:1,a_h:2,a_i:[1,2,10],a_j:[2,10],a_k:[2,10],aaron:18,ab_channel:13,abandon:2,abbrevi:15,abid:16,abil:[1,8],abl:[2,3,4,5,8,10,11,16],abort:16,about:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,18],abov:[0,1,2,3,4,5,6,7,8,9,10,11,14,16],abovement:4,abs:[0,1,3,11],abscissa:11,absolut:[1,3,4,11],acccess:[],acceler:11,accept:[1,4,7],access:[1,9,16],accid:4,accmod:3,accompani:1,accomplish:[6,7,11],accord:[0,1,2,3,4,7,10,11,16],accordingli:9,account:[1,3,11,16],accumul:[10,16],accur:[1,4,8,11,16],accuraci:[1,2,3,4,5,7,8,9,10],accuracy_scor:[1,2,8],accuracy_score_numpi:2,achiev:[1,2,3,4,6,10,14],aco:16,acquaint:13,acquir:[2,13],acr:1,across:[2,4,7,13],act:[2,14],action:16,activ:[0,1,7,15],actual:[1,2,3,4,6,9,14],ada_clf:8,adaboostclassifi:8,adadelta:11,adagrad:11,adam:2,adapt:[1,4,11,18],add:[1,2,3,4,6,8,9,10,16],add_subplot:[0,2,5,10],added:[1,2,3,4,6,11,14],addendum:3,adding:[0,2,14],addit:[0,1,3,4,5,6,7,8,10,11,13,14,16,17,18],addition:[10,11],address:[2,7,9,11,18],adjac:10,adjoint:3,adjust:[1,3,10,11],admir:1,advanc:[4,10,18],advantag:[2,3,4,8,11,14],afecionado:[],affect:[],affin:[1,6,9],aficionado:[],aforement:0,african:1,after:[0,1,2,3,4,7,9,10,11,13,14,16],afterward:1,again:[0,1,2,3,4,5,6,8,9,10,11,16],against:[2,5,8],age:[1,5],agegroup:5,agegroupmean:5,aggreg:[7,8],agorithm:8,agre:[3,4,16],ahead:7,aid:9,aim:[0,1,2,4,5,9,13,14],ainv:3,aka:3,alarm:3,albeit:0,algebra:[1,3,11,13,15],algo:16,algorithm:[1,2,3,4,5,6,11,13,14,15,16,18],align:[1,3,4,5,6,11,16],all:[0,1,2,3,4,5,7,8,9,10,11,13,14,15,16,17,18],allevi:[2,11],alloc:14,allow:[1,2,3,4,6,8,11,13,14],almost:[1,2,4,6,9,11,16],alon:7,along:[0,3,4,7,8,9,13,14],alpha:[0,1,2,3,4,5,6,7,8,11,16],alpha_:8,alpha_i:11,alpha_k:11,alpha_m:8,alpha_opt:11,alreadi:[3,4,8,10,13,14,16],also:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,15,16,18],alter:[2,16],altern:[1,2,3,4,5,6,7,9,11,14],although:[2,3,4,6,8,11],alwai:[0,1,3,4,10,11,16],ame2016:1,american:1,among:[1,3,7,8,10],amongst:3,amount:[0,1,2,4,6,8,13],an_:16,anaconda3:[1,2,4,5,6,9,11],anaconda:[1,2,13],analog:11,analys:[4,16],analysi:[2,5,14,15,18],analyt:[1,3,4,5,10,11,13],analyz:[1,2,3,4,16],andrew:2,angl:[1,7,16],ani:[0,1,2,3,4,5,6,7,8,10,16],anim:10,ann:10,annot:[1,2,5,6],anoth:[1,2,3,4,5,6,8,9,10,11,14,16],ans:[11,16],ansatz:1,answer:[1,2,3,4,14],antialias:4,anymor:[2,6],anyon:6,anyth:[2,16],anytim:17,apach:2,apart:[9,11],api:[2,13],appear:[1,2,11,14,16],append:[2,6,7,11,16],appendcon:3,appendvar:3,appli:[1,2,4,5,6,7,8,9,10,11,16,18],applic:[1,2,3,4,5,7,10,11,15,16,18],approach:[2,3,4,7,8,9,10,11,13,16,18],appropri:[4,7,10,11,13,16],approx:[1,4,8,9,11,16],approxim:[1,2,3,4,5,8,9,11,16],apt:[1,13],aptli:0,aragorn:[],arang:[2,4,5,7,8,10],arbitrari:[2,4,6,10,11,16],arbitrarili:[1,2,9],arc:4,architectur:[10,18],area:[1,4,18],arg:11,argc:16,argmax:[2,9],argmin:[0,8],argnum:11,argsort:9,argu:[2,11],arguabl:0,argument:[1,3,9,10,11,16],argv:16,aris:[1,4,10,11,16],arithmet:[1,11,14],arm:4,arma:16,armadillo:[14,16],around:[1,2,3,4,9,16],arrai:[0,1,2,3,4,5,6,7,9,10,11,13,16],arraybox:11,arriv:[1,4,7,9,14,16],arrow:10,arrowprop:6,art3d:11,art:[1,2,13],articl:[0,1,4,8,16],artifici:[1,5,10,18],artificialneuron:10,artist:[],arug:11,asarrai:[1,4,7],asc:3,ascii:16,ask:[3,4,9,10],aspect:[1,4,13],assembl:1,assess:[1,4],assign:[0,1,5,6,7,10,11,15,18],assign_points_to_clust:0,associ:[0,1,4,7,10,16],assum:[0,1,2,3,4,5,6,7,8,9,10,11,14,16],assumpt:[1,3,4,7,9,16],ast:[1,3,4],astyp:[7,8],asymmetri:1,asymptot:4,atoi:16,atom:1,attempt:[1,4,5,6,8],attend:15,attent:[1,14],attr:[],attract:[1,8],attribut:[1,7,11],attributeerror:11,audi:1,aurelien:[1,15,18],austfjel:4,author:[1,2,8,16],authour:1,auto:[7,8,16],autocor:16,autocorrelation_tim:16,autocorrelform:16,autocovari:16,autoencod:13,autoencond:13,autograd:[11,13],autom:[1,13],automac:14,automag:[],automat:[1,2,9,13,14],autonom:18,avail:[1,2,4,8,9,13,14,15,18],averag:[0,1,2,4,7,8,11,16,17],avg:16,avoid:[0,1,3,4,7,9,11,14],awai:[4,16],awar:8,award:17,axes3d:[4,11],axes:[1,5,6,7,8,9],axes_grid1:4,axessubplot:1,axhlin:6,axi:[0,1,2,4,5,6,7,8,9,10,11,16],axiom:3,axlabel:1,axvlin:6,b_1:[10,11],b_2:11,b_5:11,b_group:7,b_i:[1,2,10],b_ia_:1,b_index:7,b_j:[2,10],b_k:[2,10,11],b_m:10,b_score:7,b_valu:7,bachelor:15,back:[1,3,4,6,7,8,14,15,16],backbon:14,backend:2,background:[15,18],backpropag:2,backtrack:7,backup:14,backward:[2,10,14],bad:[4,16],badli:16,bag:[7,13,15],bag_clf:8,baggin:[],baggingboot:8,baggingclassifi:8,baggingtre:8,balanc:4,band:14,bandwidth:14,bar:[1,4,9],barber:18,bare:8,barebon:0,base:[0,1,2,3,5,6,7,8,13,16,17,18],basi:[3,5,6,8,9,10,11,14],basic:[4,6,10,11,13,15,16],batch:[9,10,11],batch_siz:2,bay:5,bayesian:[3,13,18],be0d226abb41:[],becaus:[0,1,2,3,4,6,7,10,11],becom:[0,1,2,3,4,5,7,10,11,16],been:[1,2,3,4,9,10,11,13,14],befor:[0,1,2,3,4,5,6,10,11,14,16],beforehand:[0,1,16],begin:[0,1,2,3,4,5,6,7,9,10,11,14,16],behav:[2,4,11],behavior:[1,2,11],behaviour:10,behind:[1,2,4,6,11],being:[0,1,2,3,5,6,8,9,10,11,16],believ:[7,14],belong:[0,3,5,6,7,11],below:[1,2,3,4,5,6,7,8,9,10,11,14,16],benchmark:8,bendik:17,benefici:[2,11],benefit:[1,2,9,11,13],bengio:[2,15,18],benign:[2,5],besid:3,bessel:3,best:[0,1,2,3,4,5,6,7,8,10,11,16,17],beta:[1,2,3,4,5,8,9,11],beta_0:[1,2,3,4,5,11],beta_0x_:1,beta_1:[1,2,3,4,5,8,11],beta_1x_0:1,beta_1x_1:[1,5],beta_1x_2:1,beta_1x_:1,beta_1x_i:[5,11],beta_2:[1,11],beta_2x_0:1,beta_2x_1:1,beta_2x_2:[1,5],beta_2x_:1,beta_:[1,4,5,11],beta_i:[1,3],beta_j:[1,3,4,11],beta_k:11,beta_linreg:11,beta_m:8,beta_mg_m:8,beta_p:5,beta_px_p:5,betavalu:3,better:[0,1,2,4,7,8,9,10,11],between:[0,1,2,3,4,5,6,7,9,10,11,16],beyond:[1,2,3,4,6,11],bia:[1,2,3,6,7,8,10,11,15,16],bias:[2,3,4,7,10],big:[0,1,2,3,4],bigger:[2,4],bigr:10,bike:7,bilbo:[],bilek:17,billion:[10,13],bin:[1,5,16],binari:[1,3,5,7,8,10,15,16],bind:1,binomi:13,binsboot:4,bioinformat:1,biolog:[2,10,18],bios1100:13,bird:1,birth:[],bishop:[15,18],bit:[0,2,14,16],bitwis:16,bla:[3,14],black:[0,6,7],block:[0,4,8,13,14],blockingavg:16,blockingstd:16,blockingvar:16,blocksiz:16,blocksizemax:16,blocksizemin:16,blue:1,bmatrix:[1,2,3,5,6,9,11,14],bmi:2,bodi:[1,2,10],bold:2,boldfac:[1,3],boldsymbol:[0,1,2,3,4,5,6,8,9,11],boltzmann:[10,13],book:18,bool:0,boost:[2,7,13,15],boostrap:8,bootavg:16,bootstd:16,bootstrap:[2,13,15],bootvar:16,bootvec:16,borrow:[],boston_dataset:1,bot:6,both:[0,1,2,3,4,6,7,8,11,13,14,16,17],bottl:5,bottom:[],bound:[1,3,6,10],boundari:[6,9,10],boundkei:3,box:7,boyd:[6,11],bracket:16,brain:[2,5,10],branch:7,breast:[3,5,9],breviti:11,brew:[1,13],brg:6,briefli:1,bring:[1,3,4,8],broad:1,broadcast:0,browser:[],brute:[3,9],bsol:[],bsubex:[],build:[1,3,4,8,14,16],built:[1,2,4],bunch:9,busi:1,bzl:3,c46dd114b2af:6,c_0:16,c_1:10,c_2:10,c_3:10,c_4:10,c_i:[10,11],c_k:16,cabc613b8702:[],cach:8,cal:[1,6,8,10,11],calcul:[0,1,2,3,4,6,7,8,9,10,11,14],call:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,16,18],callabl:[],calor:1,cambridg:[11,18],came:0,can:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,16,18],cancel:[1,11],cancer:[3,8],cancerpd:5,candid:[6,7,8],cannot:[1,2,3,4,5,6,7,15,16],canopi:[1,13],cap:3,capabl:[1,2,6,11,13],capita:1,captur:[9,10],card:[1,5],cardin:2,care:[0,9],carefulli:11,carlo:[1,4,13,16,18],carri:[4,5],cart:8,casella:18,cast:2,categor:[1,2,7,9],categori:[0,1,2,5,8,10,15],categorical_crossentropi:2,caus:[1,3,4,16],causal:1,causat:1,cax:2,cbar:2,ccc:[3,10],cd_fast:4,cdf:16,cdot:[0,1,4,10,11,14,16],celebr:11,center:[0,1,2,4,5,6,7,9,16],centr:18,central:[1,3,4,6,14],centroid:[0,16],centroid_differ:0,centroid_list:0,certain:[0,1,4,5,7,16],cha:1,chain:[2,11,13,16],challeng:0,chanc:[2,3,11,16],chang:[0,1,2,3,4,6,7,9,10,11,14,16],chapter:[0,1,4,8,9,14,15,18],charact:[1,3,6,16],character:[6,7,8,10,16],characterist:[1,2,8,11],charg:1,charl:1,chd:5,chddata:5,cheap:3,cheaper:[2,11],chebychev:0,check:[1,2,3,9,11,14],check_consistent_length:[],chemic:16,chen:8,choic:[0,1,2,4,7,10,11,14,16],choleski:[3,14],choos:[0,4,7,8,9,11,16],chosen:[1,2,4,6,7,8,11,16],chosen_datapoint:2,christian:18,christoph:[15,18],cin:16,circ:[2,10],circl:[1,6,10],circumfer:7,circumv:[2,3,11],clariti:[0,16],class_nam:7,class_val:7,class_valu:7,classic:[5,7,11],classif:[1,3,4,5,6,9,10,13,15,18],classifi:[1,2,5,7,8,9],classificaton:2,classifii:8,clean:2,clear:[2,3,8,10,11],clearer:0,clearli:[1,3,4,5,6,16],clever:[0,2,8],clf3:1,clf:[1,4,6,7,8],clf_lasso:4,clf_ridg:4,clip:16,close:[0,1,2,4,6,7,9,10,11,16,18],closer:[3,11],closest:[0,6,9,11],closur:13,cloud:13,clust:0,cluster:[1,2,4,9,13,15],cluster_label:0,cmap:[1,2,4,6,7,8],cmap_arg:4,cmath:16,cmb:15,cmd:7,cn_:16,cnn:[10,15],cntk:13,code:[4,5,6,11,13,14,15,18],coef0:6,coef:1,coef_:[1,3,4,6,7,11],coeff:3,coeffici:[1,3,4,5,6,7,11,14],coerc:[1,4],coin:[8,16],coin_toss:8,col:[1,9],colab:13,cold:7,colinear:1,collaps:6,collect:[1,4,8,9,13,16,18],collinear:3,color:[1,4,6,7,8,16],color_cod:4,colorbar:[2,4],colsample_bytre:8,colsaobject:8,column:[1,2,3,4,5,6,7,9,10,14],columntransform:7,com:[4,13,17,18],combin:[2,3,4,5,8,16],come:[0,1,2,3,10,11,15],comma:[],command:[1,2,16],comment:[1,3,4],commerci:[1,13],commod:1,common:[0,1,2,3,4,5,7,9,16],commonli:[0,1,2,4,5,7,11],commun:[1,10],compact:[0,1,2,3,4,5,7,9,10,11],compar:[0,1,3,4,9,11,14],comparison:11,compat:5,compet:1,competit:8,compil:[1,2,13,14,16],complet:[1,7,10],completenn:10,complex:[2,3,6,7,9,10,11],complic:[0,1,2,7,11],compon:[0,1,2,3,4,5,7,13,15],components_:9,compos:[0,7,10],compphys:[4,13,15,18],compress:1,compris:4,compromis:3,compulsori:13,comput:[0,1,2,3,4,5,6,8,9,10,11,13,14,15,18],computation:[1,4,7,11,16],con:3,concaten:[0,4],concav:[2,11],concentr:[1,8],concept:[0,1,13],conceptu:[10,11],concern:[0,1,2,5],concic:[],conclud:[1,3],conclus:2,conda:[1,2,13],condit:[1,3,4,6,7,9,11,16],conduct:13,coneqp:3,confid:[1,3,4,5,6],confirm:[3,10],confus:[3,4,8,14],confusion_matrix:7,congruenti:16,conjug:6,conjugaci:11,connect:[1,2,7,9,10,11,14],consequ:[3,4,6,8,10,11],conserv:[0,3],consid:[0,1,2,3,4,5,6,7,8,10,11,14,16],consider:[1,2,3,11],consist:[1,2,4,10,11,16],constant:[1,3,4,6,10,11,16],constitu:1,constitut:4,constrain:[2,3,5,9],constraint:[3,4,6,11],construct:[1,2,3,4,5,6,7,8,9,14,16,18],contact:1,contain:[0,1,3,4,5,6,7,9,10,11,14,16,18],contemporari:18,content:[2,13,14],context:[4,8,11],continu:[1,2,3,4,5,6,7,8,10,11,14],contour:[7,8,11],contourf:[6,7,8],contrast:[2,7,8,10],contribut:[1,3,16],contributor:1,control:[1,2,7,11,13],conveni:[1,3,4,10,11,14],convent:10,converg:[0,1,2,3,4,5,6,9,11],convergencewarn:[1,2,4,5,6,9],convert:[1,2,3,7,9,11,14],convex:[3,5],convinc:11,convolut:[2,13,15],cool:7,coolwarm:4,coordin:[0,3,10],coorel:1,copi:[0,1,2],core:[8,11],corel:1,coronari:5,corr:[1,3,5,9],correalt:[9,13],correct:[0,1,2,3,11,14,16],correctli:[2,4,8],correl:[1,2,3,4,5,8,10,11,13],correlation_matrix:[1,3,5,9],correspond:[0,1,3,4,6,7,9,10,13,14,16],cortex:10,cos:[1,4,7,11],cosin:[0,4],cost:[1,3,4,5,6,7,10,11,16],could:[1,2,3,4,5,6,7,8,9,10,11,14,16],coulomb:1,count:[1,7,15,16,17],countor:11,coupl:[3,4],cours:[1,2,3,9,15,16],courvil:[15,18],cout:16,cov:[3,4,9,14,16],cov_xi:[3,9],cov_xx:[3,9],cov_yi:[3,9],covari:[1,5,13,14],covariance_matrix:[0,3,9],cover:[1,3,12,13,15,18],covert:1,covxi:16,covxx:16,covxz:16,covyi:16,covyz:16,covzz:16,cpu:2,creat:[2,3,7,8,9,10,13],create_biases_and_weight:2,create_neural_network_kera:2,create_x:[3,9],credit:[1,5],crim:1,crime:1,criteria:[0,1,7,8,16],criterion:[7,8,11],critic:4,cross:[1,2,5,7,8,11,13,15,16],cross_val_scor:4,cross_valid:[5,8],crossvalid:4,crucial:[2,16],csr_matrix:14,cstdlib:16,csv:[1,4,5,7],ctnk:2,cubic:1,cumbersom:3,cumsum:[8,9],cumul:8,cumulative_heads_ratio:8,cup:3,current:[0,2,11],curs:1,curv:[4,5,8,10],curvatur:11,custom:[0,3,4],custom_cmap2:[7,8],custom_cmap:[7,8],cutpoint:7,cvxbook:11,cvxopt:[3,6],cyber:18,cycl:[0,2,10,16],d985fb40c43d:4,d_f:11,dagger:[3,14],dai:[2,7,13],dalen:17,darget:7,darkr:16,dat:1,dat_id:[1,4,5,7],data1:0,data2:0,data3:0,data4:0,data:[0,3,6,8,10,11,14,18],data_id:[1,4,5,7],data_indic:2,data_panda:[],data_path:[1,4,5,7],databas:2,datafil:[1,4,5,7],datafram:[1,3,5,7,9],datapoint:[2,3,4,5,9,11],dataset:[0,1,4,5,6,7,8,9,11],date:1,daughter:8,david:18,dbh:2,dbo:2,dcomposit:14,dcost:3,dead:2,deal:[0,1,2,3,4,6,9,11,14,16],debt:5,debug:[3,4],decad:1,decai:[1,11,16],decent:8,decid:[1,3,4,7],decim:1,decis:[1,2,6,9,13,15,18],decision_funct:6,decision_tre:7,decisiontreeclassifi:[7,8],decisiontreeregressor:[1,7,8],declar:[1,14],decompos:[3,4,14],decomposit:[1,4,10,15],decompost:3,decorrel:[8,11],decreas:[2,3,4,8,9,11],deduc:1,deep:[5,10,11,13,15,18],deep_tree_clf1:7,deep_tree_clf2:7,deep_tree_clf:[7,8],deepen:[3,13],deeper:[0,1],deeplearningbook:18,def:[0,1,2,3,4,5,6,7,8,9,11,16],def_covari:16,defect:3,defici:3,defin:[0,1,3,4,5,6,7,8,9,10,11,14,16],definit:[0,2,3,4,6,8,9,10,11,14],defint:16,degre:[3,4,6,7,8,9,16],del:2,delet:[4,16],deliv:15,delta:[0,1,4,6,10,11,16],delta_:[2,14],delta_h:[1,2],delta_j:10,delta_k:10,delta_l:2,delta_n:1,delug:13,delv:1,demand:11,demonstr:[1,3,4,5,9,10,13],denomin:[2,3],denot:[2,4,5,11,16],dens:[0,2],densiti:[0,1,4,16],depart:17,depend:[0,1,2,3,4,5,6,9,10,11,13,16],depict:16,deploy:[1,13],deprec:1,depth:[1,7,8,14],deriv:[1,2,4,5,6,8,9,11,13],descend:[3,7,9],descent:[1,2,5,6,10],descr:1,describ:[0,1,3,4,6,8,9,10,11,14],descript:[0,1,6,7],design:[1,2,3,4,5,8,9,10,11],designmatrix:1,desir:[0,1,3,11],despit:[2,10],destroi:14,det:[3,14],detail:[0,1,4,9,11,14],detect:[6,10],determin:[1,3,4,6,7,8,9,10,11,14,16],determinist:[5,11,16],dev:[2,16],develop:[0,1,3,6,8,9,10,13,14],deviat:[1,2,3,4],devis:10,df1:[],diag:[3,6],diagnost:[2,8],diagon:[1,3,5,11,14,16],diagonaliz:3,diagram:8,diagsvd:4,dice:4,dict:[4,6],dict_kei:1,dictionari:1,did:[0,1,2,3,4,5,8,9],die:2,diffeent:6,differ:[0,1,2,3,4,7,8,9,10,11,13,14,16,18],differenti:[13,14],differential_oper:11,difficult:[0,1,2,4,8,11,16],difficulti:[1,2,11],digit:[1,2,4,15,17],dilemma:11,dilut:2,dim:[0,9],dimens:[0,1,2,3,6,9,14],dimension:[0,1,3,4,7,9,11,13,14],dimensionless:1,diment:14,dimes:0,direct:[0,1,2,9,10,11],directli:[0,2,3,4,16],directori:[],disadvantag:1,disappear:4,discard:[4,9],disciplin:[1,10],disclaim:16,discourag:11,discov:1,discover:3,discret:[2,3,5,11],discrimin:[5,8,9],discuss:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,15,16,18],diseas:5,disguis:4,disk:[],disord:[2,5],displai:[0,1,2,3,4,5,6,7,8,9,10,16],displaystyl:[1,3],displot:1,disregard:1,dissimilar:[0,9],dist:0,distanc:[0,1,6,7,9,16],distance_list:7,distinct:[0,5,6,7,8],distinctli:6,distinguish:[1,5,6,16],distplot:1,distribut:[0,1,2,4,5,8,9,11,13,14],distrubut:[1,13],div:3,dive:[1,6],diverg:[2,11],divid:[1,2,3,4,6,7,9,10,16],divis:[4,6,7,11,14,16],dna:5,dnn:[1,2,10],dnn_kera:2,dnn_model:2,dnn_numpi:2,dnn_scikit:[1,2],doamin:[],doc:[4,13,15,18],doconc:[],document:[5,9,11],doe:[0,1,2,3,4,6,8,9,10,11,14,16],doesn:[7,10],dog:2,doi:0,doing:[1,3,4,9],domain:[3,6,11],domin:1,don:[0,1,2,3,4,6,9,11,13,16],done:[0,1,3,4,7,8,9,11,14,16],dot:[1,3,4,5,6,7,8,9,10,11,14,16],doubl:[14,16],doubli:2,down:[1,4,7,9,10,11],download:[1,2,3,4,14,18],dozen:2,drag:11,dramat:9,draw:[4,8,11],drawback:[1,2,11],drawn:[2,4,5,9,16],dre:3,drop:[1,2,3,4,9,11,16],dropna:[1,4],dtype:[0,1,2,14],dualiti:4,dub:1,due:[0,2,3,4,6,8,10,11],dummi:1,dure:[1,2,6,7,9,13],dwell:1,dwh:2,dwo:2,dx_1:16,dx_1p:4,dx_2p:4,dx_mp:4,dx_n:16,dxp:4,dying:2,each:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,15,16,17],eapprox:1,earli:[2,11],earlier:[1,3,5,6,7,9,10,11],earthexplor:4,eas:[0,4,7],easi:[1,3,4,5,6,7,8,9,10,11,13,14],easier:[3,4,6,7,11,16],easiest:11,easili:[1,2,3,4,5,6,7,8,9,10,11,14],eastern:17,ebind:1,eblock:7,econometr:[],economi:3,ecosystem:13,ect:15,edgecolor:4,edit:[],edu:11,educ:1,eface79dac2c:8,eff:16,effect:[2,8,11,16],effic:2,effici:[1,8,11,13,14,16],efron:[4,16],egrad:11,eig:[3,9,11,14,16],eigen:16,eigenpair:[3,9],eigenvalu:[1,3,6,9,11,14],eigenvector:[3,9,11],eight:14,eigval:[14,16],eigvalu:[9,11],eigvec:[14,16],eigvector:[9,11],eispack:14,either:[1,2,3,4,5,6,7,8,9,11,16],ekstrom:17,elabor:16,electr:[1,10],electur:18,eleg:9,element:[2,3,4,5,6,9,10,11,13,14,15,18],elementari:[8,11,14],elementwis:11,elementwise_grad:11,elessar:[],elif:0,elim:14,elimin:[3,6],els:[2,5,7,10,11,16],elu:2,elus:1,email:[15,17],embed:[1,9],embodi:4,emit:16,emner:[15,18],emphas:[1,8,13],emphasi:[1,13,18],empir:[2,9,16],emploi:[1,2,3,4,9,11,16],employ:1,empti:[4,8],emul:10,enabl:9,enbodi:4,encapsul:0,encod:[0,1,3,7,9],encompass:[1,16],encount:[1,2,3,4,5,11,16],end:[0,1,2,3,4,5,6,7,8,9,10,11,14,16],end_box:11,end_nod:11,end_valu:11,endl:16,endpoint:[4,16],energi:[1,4],enet_coordinate_desc:4,enforc:10,eng:18,engin:[1,2,13,16],english:18,enough:[1,4,11],ensembl:[2,7,15,16],ensur:[1,2,3,4,9,11,16],enter:[3,4,16],enthought:[1,13],entir:[2,5,7,13,16],entiti:[7,10,14],entri:[1,3,6,9,10,14],entropi:[2,5,8,11],enumer:[1,2,4,6],env:[3,16],environ:[13,18],eol:1,eosfit:1,epoch:[1,2,10,11],epsilon:[1,3,4,5,11],epsilon_0:1,epsilon_1:1,epsilon_2:1,epsilon_:1,epsilon_i:1,eqnarrai:[3,4],equal:[0,1,2,3,4,6,7,9,10,11,14,16],equat:[0,2,3,4,5,6,7,8,9,11,14,16],equilibrium:10,equiv:[11,14,16],equival:[1,2,3,6,9,11,13,14],erf:16,eriador:[],eridg:[],err:[1,8],err_:4,errat:11,errno:[],error:[2,3,4,5,7,9,10,11,13,16],error_estimate_corr_tim:16,error_hidden:2,error_output:2,escap:11,esl:0,esol:[],especi:[2,7,10,11],essenti:[0,1,3,4,7,8,10,16],establish:[1,4,8,9],estim:[1,2,3,4,5,8,9,11,13,16],estimated_mse_fold:4,estimated_mse_kfold:4,estimated_mse_sklearn:4,esubex:[],eta0:[6,11],eta:[1,2,6,10,11],eta_:11,eta_t:11,eta_v:[1,2],etc:[0,1,2,3,5,6,7,9,10,11,13,14,16],ethic:13,etsim:4,euclidean:[0,1],evalu:[1,3,4,7,11,16],evalut:11,even:[0,1,2,3,4,6,7,8,9,10,11,13,14,16],event:[3,5,8],eventu:[3,4,9,10,11,17],everi:[0,1,2,3,4,7,8,9,10,11,13,16],everyth:10,everywher:11,evolv:1,exact:[1,3,9,10,11,14,16],exactli:[1,4,10,13],examin:4,exampl:[3,9,10,11,13,14,15,18],exce:[2,10,11],excel:[0,1,2,3,8,18],except:[3,4,6,7,16],excess:1,excit:1,exclud:[2,4,10],exclus:[1,2,4,16],execut:[3,11],exemplifi:11,exercis:[3,13,15],exhaust:4,exhibit:[1,3,4,6],exist:[0,1,2,3,4,5,6,7,11,14,18],exit:[3,14,16],exp:[1,2,3,4,5,6,8,9,10,11,16],exp_term:2,expand:[3,5,9,11],expans:[1,3,6,8,10,11],expect:[1,2,3,4,5,9,10,11,13],expectation_value_of_h_wrt_p:16,expens:[4,8,11,16],experi:[1,2,4,6,11,13],experiment:[1,4,7,16],expert:[2,7],explain:[0,1,4,7,8,9,11,16],explained_variance_ratio_:9,explanatori:1,explicit:[1,4,11,14],explicitli:[0,1],explod:2,exploit:[1,10,11],explor:[2,4,6,11,13],expon:2,exponenti:[1,2,3,4,8,11],export_graphviz:7,export_text:7,exporttext:7,expos:13,express:[1,3,4,5,8,10,11,14,16],exptmean:16,exptvari:16,extend:[3,5,9,11,13],extens:[1,10,13],extent:[1,2,4,18],extern:[4,7],extra:[2,3],extract:[1,3,4,5,6,9,11,14],extrapol:1,extrem:[0,1,2,3,4,5,6,7,11,14],extremum:11,extrins:9,eye:[0,1,3,4,11,14],f11:1,f12:1,f13:1,f1_grad:11,f1d:11,f2_grad_x1:11,f2_grad_x1_analyt:11,f2_grad_x2:11,f2_grad_x2_analyt:11,f3_grad:11,f3_grad_analyt:11,f4_grad:11,f4_grad_analyt:11,f5_grad:11,f6_grad_analyt:11,f6d7a289d493:14,f7_grad:11,f7_grad_analyt:11,f8_grad:11,f9_altern:11,f9_alternative_grad:11,f9_grad:11,f_0:8,f_1:[8,11],f_2:[10,11],f_3:10,f_d:16,f_grad:11,f_grad_analyt:11,f_i:[4,10],f_m:8,face:11,facecolor:[4,6,16],facil:[1,13],facilit:10,fact:[1,2,3,7,9,10,11],factor:[1,2,3,4,7,8,9,11,14,16],factori:11,fade:4,fafab0:[7,8],fail:[1,4,5,6,9,11,17],failur:5,fairli:[0,2,16],fall:[6,7,15],fals:[0,1,2,3,4,5,7,8],famili:[1,5,6,16],familiar:[1,3,4,6,13,14,16],famou:[4,10,14],far:[0,1,3,4,6,9,10,11,16],fashion:[1,7,8],fast:[2,4,8,10,11,13,16],faster:[2,9],fastest:11,favor:5,favorit:16,fe5b9d300cc0:4,featur:[1,2,3,4,5,6,8,9,10,11,13,16],feature_nam:[1,2,5,7],feautur:7,fed:2,feed:[1,9,13,15],feed_forward:2,feed_forward_out:2,feed_forward_train:2,feedforward:[2,10],feel:[0,1,3,4,9,11,13,17],feet:1,fetch:4,few:[0,2,3,7,12,16],fewer:[1,7,9],ffnn:[2,10],field:[1,4,10,13],fifth:[1,4],fig:[0,1,2,4,5,10,11],fig_id:[1,4,5,7],figaxi:16,figsiz:[1,2,4,5,6,7,8],figur:[0,1,2,3,4,5,6,7,8,10,11,13],figure_id:[1,4,5,7],figurefil:[1,4,5,7],file:[1,2,3,4,5,6,7,14,16],filenam:[1,16],filenotfounderror:[],fileout:16,fill:[3,7],financ:1,find:[0,1,2,3,4,5,6,7,8,9,10,11,13,16],fine:[0,1],finit:[3,4,10,11,16],first:[0,1,2,3,4,5,6,7,8,9,11,14,15,16,18],firsteigvector:9,fit:[2,3,4,5,6,7,9,10,11,16],fit_beta:4,fit_intercept:[1,3,4],fit_mod:7,fit_transform:[1,4,6,7,9],fiti:1,five:[1,7],fix:[1,4,8,9,10,11],fixedformatt:4,fixedloc:4,fkkt:3,flag:0,flat:[10,11],flatten:[2,3],flexibl:[1,2,4,6,8,10],float32:7,float64:[1,14],flop:[3,14],flow:[2,10],fluctuat:3,fly:9,flyvbjerg:16,fmesh:11,focu:[1,3,4,13,18],focus:[2,4,5,14],fold:[4,7],folder:[1,4],follow:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,15,16,17,18],font:[1,5,16],fontdict:16,fontsiz:[2,4,6,7,8,16],fontweight:2,foral:6,forc:[1,3,4,8,9],forecast:10,forelesningsvideo:15,forest:[1,2,7,13,15],forget:9,form:[1,3,4,5,6,7,9,10,11,13,14,16],formal:[0,16],format:[1,2,4,5,6,7,8,9,13,16,18],formatstrformatt:[4,11],formul:[0,4,9],formula:[11,16],forth:10,fortran2003:13,fortran90:16,fortran:[1,13,14],fortun:[1,9],forward:[1,4,13,14,15],found:[2,3,4,10,11],foundat:13,four:[3,4,6,10,14,15],fourier:1,fourth:10,frac:[0,1,2,3,4,5,6,7,8,9,10,11,14,16],fraction:7,frame:5,framework:[2,6,8,16],frank:[3,9],frankefunct:[3,4,9],free:[1,4,9,11,13,14,16,17,18],freecodecamp:13,freedom:3,freeli:1,frequenc:[4,5,16],frequent:[1,6,7,11],frequentist:13,fresh:8,fret:0,fridai:15,friedman:[4,15,18],frodo:[],from:[0,1,2,4,5,6,7,9,11,13,14,15,16,17,18],from_cod:7,front:[1,3],fruit:0,fstream:16,fulfil:[3,10],full:[1,2,3,5,7,8,11,16],full_matric:3,fulli:[4,10,15,16],fun:[11,13],func:[],functionali:9,fundament:[1,4,13],further:7,furthermor:[1,3,4,5,9,10,11,13],futur:[1,6,7],futurewarn:1,fys:[15,17],g_1:8,g_2:8,g_m:8,gain:[0,2,3,7,8,11],galleri:1,gamge:[],gamma1:6,gamma2:6,gamma:[1,6,7,8,9,11],gamma_0:8,gamma_1:8,gamma_1x:8,gamma_:1,gamma_i:[1,6,16],gamma_j:11,gamma_k:11,gamma_m:8,gamma_x:1,gap:[3,4,6],gate:10,gather:[1,2,10],gaug:10,gaussbacksub:14,gaussian:[0,3,4,6],gaussian_point:0,gaussian_rbf:6,gave:11,gbc:15,gca:[4,6,11],gd_clf:8,gdclassiffiercgain:8,gdclassiffierconfus:8,gdclassiffierroc:8,gdm:11,gdregress:8,gemv:3,gen:16,gender:1,gener:[0,1,2,3,4,6,8,9,10,11,14,18],generallay:10,generate_simple_clustering_dataset:0,genom:13,geodes:9,geometr:[1,11],geometri:3,georg:18,geotif:4,geq:[3,6,7,11],geron:[1,15,18],get:[0,1,2,3,4,5,7,8,9,11,13,14,16],get_distances_to_clust:0,get_dummi:7,get_split:7,get_yaxi:6,get_yticklabel:4,getattr:[],getsolutionslic:3,gibb:13,gini:8,gini_index:7,git:[1,13],github:[1,4,13,15,18],gitlab:[1,13],give:[0,1,2,3,4,5,6,7,8,10,11,13,15,16,18],given:[0,1,2,3,4,5,6,7,8,9,10,11,14,16],glare:0,global:[4,5,11,16],glorot:2,gmail:17,goal:[1,5,7],goe:[0,1,2,3,4,11,14],going:[1,2,3,4,6,7,9,10,11],golden:11,gone:3,gong:2,good:[0,2,3,4,7,8,9,11,13,15,16,18],goodfellow:[15,18],googl:[0,2,13],got:[2,4],gov:4,gpu:2,grad:11,grad_analyt:11,grade:15,gradient:[1,5,6,7,10,13,15],gradientboostingclassifi:8,gradientboostingregressor:8,gradual:[0,2],grai:4,graph:[2,7,9,10,11],graph_from_dot_data:7,graphic:[1,2,7],grasp:1,gray_r:2,great:[3,11],greater:[2,5,16],greatli:11,greedi:7,green:[1,7,16],grid:[2,4,5,6,10,16],grossli:11,ground:1,group:[0,1,4,5,7,13,15],groupbi:1,grow:[2,7,8],growth:1,guarante:[1,11,16],guess:[0,2,8,11],guestrin:8,guid:2,h21:15,h_1:11,h_2:11,h_m:8,habit:1,had:[1,2,4,5,11],hadamard:[2,10],half:[2,6,7],halv:8,hand:[1,2,3,9,10,11,13,14,15,16,18],handl:[1,2,3,7,9,13],handle_unknown:7,handsid:10,handwrit:10,handwritten:[2,3],happen:[0,2,3,4,8,11,16],hard:[2,5,6,8,11],hardcopi:13,harder:[1,2],has:[0,1,2,3,4,5,6,7,8,9,10,11,14,16],hasn:[1,2],hassl:[1,13],hast:13,hasti:[0,1,4,15,18],hat:[2,3,4,5,7,8,9,10,11,14,16],have:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,16],haven:2,hdf5:[],head:[1,8,16],header:1,heads_proba:8,health:1,hear:1,heart:[1,5],heatmap:[1,2,5],heavili:1,heavisid:2,height:[2,4],held:11,help:[0,1,2,10,11],helper:0,henc:[1,3,4,6,7,8,10,11],her:5,here:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,15,16,18],hereaft:[1,6,10],hermitian:14,hessenberg:14,hessian:[1,3,11],heterogen:[7,8],hidden:[2,10],hidden_bia:2,hidden_bias_gradi:2,hidden_layer_s:[1,2],hidden_weight:2,hidden_weights_gradi:2,hierarch:[0,3],high:[0,1,2,3,4,7,8,9,11,13,14],higher:[1,2,3,4,6,11],highest:2,highli:[1,8,13,14,16,18],highwai:1,hing:6,hint:11,hip:13,hire:1,his:5,hist:[4,5,16],histogram:[1,4,5,16],histor:[5,9],histori:10,histplot:1,histtyp:[],hitherto:3,hjorth:17,hobbi:16,hoc:3,hoff:18,hold:[0,2,4,11,16],holder:1,home:1,homework:[4,11],homogen:[2,7,8,11],hopefulli:[1,9,16],horizont:9,hors:5,hot:[2,7],hour:[2,13,15,16,17],how:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,18],howev:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,16],hspace:[1,6,8,16],hstack:2,htf:15,html:[5,9,13,15,18],http:[4,5,9,11,13,14,15,18],huang:1,huber:1,huge:[2,13],human:[1,2,4,7,10],humid:7,hundr:2,hungri:2,hybrid:15,hydrogen:1,hyperbol:[2,10],hyperparam:6,hyperparamet:[0,3,4,7],hyperplan:9,i_1:[3,4],i_2:[3,4],ian:18,idea:[1,2,4,7,8,10,11,14,16],ideal:[0,1,4,6,11,16],idem:4,ident:[3,4,10,11,14],identical:3,identifi:[0,1,2,5,6,7,9,10,11],idum:16,ieor:16,ifi:18,ifs:13,ignor:[1,2,7],iii:14,ijca2016907841:0,illustr:[0,3,5,8,10,11,13],imag:[2,4,7,9,10,18],image_path:[1,4,5,7],imageio:4,imagin:2,immedi:[1,4,13],implement:[0,1,3,4,6,7,8,9,10,11],impli:[3,4,5,11,14],implicitli:[9,16],impos:[1,4,9,10],imposs:[1,3],impress:[1,10],improv:[0,1,3,7,8,9,11],impur:7,imread:4,imshow:[2,4],in3050:18,in4080:18,in4300:18,in5400:18,inaccur:11,inact:10,inadequ:1,inch:4,includ:[1,2,3,4,5,9,10,11,13,16,17,18],include_bia:[4,7],incom:10,inconsist:[],incorrect:2,incoveni:6,increas:[1,2,3,4,5,6,7,9,10,11,16],increasingli:16,ind:4,inde:[1,3,4],indent:16,indentationerror:16,independ:[1,3,4,5,6,10,11,16],index:[0,1,2,8,13,16,18],index_col:1,indic:[1,2,3,4,7,8,9,11],indispens:4,individu:[2,4,5,8,10,16],indu:1,indx:14,ineffici:[0,11],inequ:6,inequaltii:11,inertia:11,inf1000:13,inf1100:13,inf1100l:13,inf1110:13,inf3000:18,inf4490:18,inf5860:18,inf:1,infeas:7,infer:[1,2,4,18],inferenc:2,infil:[1,4,5,7],infin:[3,4,5,9],infinitesim:16,influenc:[4,8],influenti:2,info:[],inform:[0,1,2,4,7,9,10,11,14,18],infti:[4,11,16],ingeni:11,ingredi:[1,7],inher:4,inherit:14,initi:[0,1,2,4,8,11,14,16],initialis:16,inject:0,inlin:[0,1,2,3,4,5,6,7,8,9,10,11,14,16],inner:11,innov:18,inplac:11,input:[0,1,2,3,4,5,6,7,8,10,11,14,16],input_dim:2,inputs:2,inputs_shuffl:[1,2],insert:[3,4,6,8,16],insid:[1,5],insight:[1,2,3,13,18],insist:[4,11],inspir:[1,2,10,18],instal:[1,2,3,4,7],instanc:[1,2,4,7,9,11],instanti:8,instead:[0,1,2,3,4,6,7,9,11,14,16],institut:2,instruct:[1,2],int32:8,int64:1,int_0:16,int_:[4,16],int_a:16,intak:1,integ:[0,2,11,14,16],integer_vector:2,integr:[4,16],intellig:[0,1,18],intend:8,intens:2,intention:0,interact:[1,4,7,10,13],intercept:[1,4,6,9,11],intercept_:[1,4,6,7,11],interchang:[3,10,14],interconnect:2,interest:[1,2,3,4,5,6,7,10,13,15,16],interfac:[1,2,14],interior:[1,7],intermedi:14,intern:[2,8,10],interpol:[2,4,10],interpr:3,interpret:[1,2,4,7,8,10,11,14,16],interv:[1,3,4,5,11,16],intial:11,intimid:[],intract:1,intrins:[9,14,16],intro:[13,18],introduc:[1,2,3,4,6,8,10,11,14,16],introduct:[2,11,15,18],introductori:[1,14,18],intuit:[1,3,4,6,10,11],inv:[1,3,11],invalid:[2,6,14],invalu:[1,11,13],invari:2,invd:3,inver:6,invers:[1,4,11],invers_period:16,inverse_transform:6,invert:[1,3,5,8],invok:[1,6],involv:[1,4,5,9,10],iomanip:16,ios:16,iostream:16,ipca:9,ipynb:13,ipython:[0,1,2,3,4,5,6,7,8,9,11,13,14,16],irani:0,iri:[6,7],irreduc:4,irrelev:3,irrespect:1,isbox:11,isinst:11,isn:3,isnul:1,isomap:9,issu:[2,7,14],it_arrai:11,item:[1,11],items:14,iter:[0,1,2,4,5,6,9,11,16],itr:3,its:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,18],itself:[3,4,10,16],j_lasso_sk:4,j_ridge_sk:4,j_sk:4,jackknavg:16,jackknif:[4,13],jackknstd:16,jackknvar:16,jackknvec:16,jacobian:11,jargon:16,jensen:17,jerom:18,job:[6,8],join:[1,4,5,7],joint:3,journal:16,judg:11,judgement:4,julia:[13,14],jump:[0,16],jupyt:[0,1,13,18],just:[0,1,2,3,4,5,6,7,8,9,10,11,16],justif:1,justifi:8,k_mean:0,kaggl:4,kappa_d:16,karim:17,karlsen:17,karush:6,keep:[0,1,2,3,4,9,11,14],keepdim:[2,4,8],kei:[1,2,4,10,18],kept:0,kera:[1,13,15],kernel:[1,2,13],kernel_regular:2,kernelpca:9,kev:1,kevin:18,keyword:14,kfold:4,kick:[2,11],kilomet:4,kind:[0,1,6,10,11],kjm:13,kkt:[3,6],kktsolver:3,kmeanspoint:0,kn_k:0,know:[0,1,2,3,4,6,11,13,16],knowledg:[1,13],known:[2,3,4,5,6,7,10,14,16,18],kondev:1,kpca:9,kroneck:0,kuhn:6,kwarg:11,kwown:1,l1_l2:2,l1regl:3,l1regls_mosek2:3,l1regls_mosek:3,l_1:5,l_2:[5,11],l_j:10,la_i:10,la_k:10,lab:[13,15],label:[0,1,2,3,4,5,6,7,8,10,11,13,14,16],labelencod:[5,8],labels:[4,6,7],labels_shuffl:[1,2],labor:0,laboratori:15,lack:[0,1],lagrang:[6,9],lambda:[1,2,3,4,5,6,8,10,11,16],lambda_0:9,lambda_1:[3,6,9],lambda_2:[6,9],lambda_:9,lambda_i:[6,9],lambda_iy_i:6,lambda_jy_iy_j:6,lambda_k:6,lambda_n:[3,6],lamda:2,lamdbda:3,land:[1,6],landmark:6,landscap:11,langl:[1,4,9,16],languag:[1,2,6,13,14,18],lapack:[3,14],laplac:3,laptop:13,larg:[1,2,3,4,6,7,8,9,11,13,14,16,18],larger:[1,3,4,6,8,9,11,16],largest:[6,9],lasso:[1,5,13,15],lasso_sk:4,last:[0,1,2,3,4,5,6,7,8,10,11,14,15,16],later:[0,1,2,5,6,10,11,13,16],latex:[],latter:[1,3,4,5,6,9,11,14,15,16],lattic:10,law:1,layer:[1,11],lbfg:[5,7,8,9],lbl:[],lcc:[3,4],lda:9,ldot:[1,4,9,16],lead:[1,2,3,4,5,6,7,8,9,10,11,14,16],leaf:7,leaki:2,lear:11,learn:[3,4,5,6,7,8,10,14,15,18],learner:8,learning_r:[6,8],learning_rate_init:[1,2],learning_schedul:11,least:[0,1,5,6,8,9,13,14,15,16],leav:[1,2,3,4,7,9],lectur:[1,2,3,8,9,10,11,13,14,15,18],lecturenot:[13,18],lectureseptember10:15,lectureseptember16firstpart:15,lectureseptember16secondpart:15,lectureseptember17:15,lectureseptember23:15,lectureseptember2:15,lectureseptember3:15,lectureseptember9:15,lecturethursdayaugust26:15,lecturethursdayaugust27:15,left:[1,2,3,4,5,6,7,8,9,10,11,14,16],leftarrow:[6,10],legend:[1,3,4,5,6,7,8,11],len:[0,1,2,3,4,6,7,8,9,10,14,16],length:[1,2,6,7,11,13,16],leq:[0,1,3,5,6,11,16],less:[1,2,3,4,6,7,16],lessen:2,let:[0,1,2,3,4,5,6,7,8,9,10,11,14,16],letter:[1,14,16],level:[1,2,3,4,7,13,14,15],lib:[1,2,4,5,6,9,11],liblinear:[6,8],librari:[1,2,3,4,7,8,9,14,16,18],licens:[1,2,13],lie:[1,4,9,16],lies:[6,9],life:[1,2,6,10],lifetim:11,lift:0,light:[],like:[0,1,2,3,4,5,7,8,9,10,11,13,14,16],likelihood:[1,2,3,7],lim_:16,limit:[1,3,4,5,6,9,10,14],lin_clf:6,lin_model:1,lin_reg:7,linalg:[1,3,4,6,9,11,14,16],line1:6,line2:6,line2d:11,line3:6,line:[1,2,4,6,9,11,14,16],linear:[2,3,4,5,7,8,9,10,13,15,16],linear_model:[1,3,4,5,6,7,8,9,11],linear_regress:4,linearli:3,linearloc:[4,11],linearregress:[1,4,5,7],linearsvc:6,liner:2,linerar:8,linewidth:[1,4,6,7,8],link:[1,7,10,13],linlag:3,linpack:14,linreg:1,linspac:[1,4,6,7,8,11,14,16],linu:17,linuek:17,linux:[1,2,13],liquid:1,list:[0,1,2,3,7,13],listedcolormap:[7,8],literatur:[0,2,5,18],littl:[2,7,10],live:6,lle:1,lloyd:0,lmb:[3,4],lmbd:[1,2],lmbd_val:[1,2],lmbda:11,load:[1,2,4,5,7,8],load_boston:1,load_breast_canc:[2,5,7,8,9],load_digit:2,load_iri:[6,7],loc:[1,4,5,6,7,8],local:[1,2,5,10,11],locat:6,log10:[3,4],log:[1,2,3,4,5,7,8,9,11,14],log_:1,log_clf:8,logarithm:[1,3,5,14],logic:[1,2,7],logist:[1,2,6,7,8,9,10,11,13,15],logisticregress:[5,7,8,9],logit:5,logreg:[5,7,8,9],logspac:[1,2,3,4],longer:[0,6,8,14,16],longest:0,loocv:4,look:[0,1,2,3,4,5,6,7,8,9,11,14,16],loop:[0,2,4,8,10,13,14,16],lose:2,loss:[1,2,3,4,5,6,8,9,11,14],lot:[0,1,2,4],low:[1,4,7,8,9,16],lower:[1,2,4,7,8,14],lowercas:14,lowest:[7,11,16],lstat:1,lstsq:1,lubksb:14,ludcmp:14,lux:14,lvert:2,m_1:0,m_h:1,m_k:0,m_l:10,m_n:1,m_p:1,m_t:11,machin:[2,3,4,5,7,8,9,10,14,15,18],machinelearn:[4,13,15,18],mackai:18,made:[1,2,3,4,5,7,9,10],mae:1,magic:0,magnitud:[2,4,5,11],mai:[1,2,3,4,5,6,7,9,10,11,13,14,16],mail:15,main:[1,2,3,4,5,7,14,18],mainli:[1,3,4,5,7],maintain:4,major:[2,4,7,8,11,14],make:[0,2,3,4,5,6,9,10,11,13,14,16,18],make_axes_locat:4,make_moon:[6,7,8],make_pipelin:[1,4,8],make_vjp:11,makedir:[1,4,5,7],makeplot:1,malcondit:14,malign:[2,5,7],mammographi:3,manag:[1,13],manhattan:0,mani:[0,1,2,3,4,5,6,7,9,11,12,13,14,16,18],manifold:9,manual:[0,4],map:[0,1,2,4,5,6,9,10,16],margin:[1,3,6],marit:1,mark:[],marker:[1,5,14],markov:13,marsaglia:16,mask:16,mass:[1,2,3,11],massag:1,masses2016:1,masses2016ol:1,masses2016tre:1,masseval2016:1,master:[4,15],mat1100:13,mat1110:13,mat1120:13,mat3155:15,mat4155:15,mat:13,match:[0,2,3,11],materi:[3,5,14],math:[0,5,10,11,14,16,18],mathbb:[0,1,3,4,5,6,9,10,11,14,16],mathbf:[1,3,4,5,6,11,14,16],mathcal:[2,3,4,5,11],mathemat:[0,1,4,9,10,11,13,14,16,18],mathemati:[],mathemt:[],mathrm:[0,1,2,3,4,5,6,7,8,9,10,11,16],matmul:[2,3],matnat:[15,17,18],matplotlib:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,16],matric:[1,2,4,5,6,9,11,13,14],matrix:[1,4,5,6,8,11],matshow:2,matter:11,max:[1,2,7,8,10,11],max_depth:[1,7,8],max_it:[1,2,5,6,9,11],max_iter:0,max_leaf_nod:8,max_sampl:8,maxdegre:[1,4,8],maxdepth:8,maxim:[2,3,5,6,9],maximum:[0,1,2,3,5,6,7,8,11],maxpolydegre:[3,4],mbox:[3,4],mcculloch:10,mcint:16,mcintsqr2:16,mean:[2,3,4,5,7,8,9,10,11,13,14,15],mean_absolute_error:1,mean_divisor:0,mean_i:16,mean_matrix:0,mean_squared_error:[1,4,5,8],mean_squared_log_error:1,mean_vector:0,mean_x:16,meaning:[1,5],meansquarederror:1,meant:[5,8,11],meantempvec:16,meanvec:16,measur:[0,1,2,3,4,7,9,10,16],mechan:[1,16],median:1,medicin:10,medium:[6,11],medv:1,meet:[1,17],mehta:1,memori:[9,10,11,14],mention:[0,1,10,11,16],mere:1,mersienn:16,meshgrid:[3,4,6,7,8,9],messag:[3,11],met:[1,6],meteorolog:7,meter:4,method:[0,1,2,3,5,6,9,10,13,14,15,18],metion:4,metric:[0,1,2,4,5,7,8],metropoli:13,mev:[1,16],mglearn:13,mgrid:11,mhjensen:[1,2,4,5,6,9],microsoft:18,mid:2,midpoint:7,might:[1,2,4,7,11],mild:7,miller:16,millimet:4,million:1,mimic:10,min:[1,3,6,7],min_:[0,1,3],min_samples_leaf:7,mind:[0,1,4,11],mine:13,mini:[2,9,10,11],minibatch:[2,9,11],minibathc:11,minim:[0,1,2,3,4,5,6,7,8,9,10,11,16],minima:[1,2,5,11],minimum:[1,2,4,6,7,9,11],minkowski:0,minmaxscal:1,minor:16,minst:2,minu:5,mirror:7,misc:4,misclassif:[6,7,8],misclassifi:[6,8],miser:1,mismatch:2,miss:[1,8],mit:18,mix:2,mixtur:11,mkdir:[1,4,5,7],mlab:16,mle:[3,5],mlp:2,mlpclassifi:2,mlpregressor:1,mnist:[2,9],mod:16,mode:[15,16],model:[0,3,5,6,7,8,9,11,13,16,18],model_select:[1,2,3,4,5,7,8,9],moder:8,modern:[1,4,5,13],modif:[10,11],modifi:[1,2,3,5,6,8,10,11],modul:[1,4,5,7,8,9,11,14],modular:16,modulenotfounderror:7,modulo:16,moe:[3,9],moment:[3,4,11],monitor:11,monoton:[3,10,16],mont:[1,4,13,16,18],montecarlocycl:16,moor:[3,4],more:[1,2,3,5,6,7,8,9,10,11,13,15,16],moreov:1,morten:17,mosek:3,most:[0,1,2,3,4,5,6,7,8,9,10,11,13,15,16],mostli:[2,9],motion:[1,11],motiv:2,move:[0,1,3,4,5,7,10,11,16],mp4:15,mpl:[1,5],mpl_toolkit:[4,11],mplot3d:[4,11],mplregressor:2,mse:[1,3,4,7,8],mse_simpletre:8,mselassopredict:3,mselassotrain:3,mseownridgepredict:4,msepredict:3,mseridgepredict:[3,4],msetrain:3,msg:1,msle:1,mt19937_64:16,mu0:16,mu1:16,mu2:16,mu_1:4,mu_:[4,16],mu_i:4,mu_j:4,mu_n:9,mu_x:16,much:[1,2,3,4,6,7,8,9,10,11,14,16],mul:3,multi:[1,2,5,13],multiclass:[2,5],multidimension:[9,10],multilay:2,multinomi:5,multipl:[3,4,5,10,11,16],multipli:[3,4,9,11,14,16],multiplum:6,multitud:[],multivari:[1,8,9,13,16],multivariate_norm:[0,9],murphi:[9,18],must:[0,2,3,4,6,8,10,11,16],mutat:5,mutual:[2,4,11],mx_:16,myriad:[1,13],mz1:16,mz2:16,n_0:[10,16],n_b:16,n_boostrap:[4,8],n_bootstrap:4,n_categori:2,n_cluster:0,n_compon:9,n_epoch:11,n_estim:8,n_featur:2,n_hidden_neuron:[1,2],n_i:16,n_input:[1,2],n_instanc:7,n_iter_i:[5,9],n_job:8,n_k:0,n_l:[10,16],n_layer:2,n_m:7,n_neuron:2,n_neurons_layer1:2,n_neurons_layer2:2,n_point:0,n_sampl:[0,4,6,7,8],n_split:4,nabla:[2,11],nabla_:11,nabla_w:11,nag:11,naimi:1,naiv:[0,5],nall:1,name:[0,1,2,3,4,5,6,7,8,10,11,13,14,17],nameerror:[4,8],namespac:16,narrow:11,nary_f:11,nary_op_arg:11,nary_op_kwarg:11,nary_oper:11,nation:[2,3],nativ:13,natur:[1,2,6,7,10,11,16,18],navier:10,nb_:14,nbconvert:[],nboot:16,ndarrai:4,nearest:[2,4,9],nearli:11,neat:[],neccesari:4,necessari:[0,1,2,6],necessarili:[1,9,16],necesserali:3,neck:5,need:[0,1,2,3,4,6,7,8,9,10,11,14,16],neg:[1,2,3,4,5,8,11,16],neg_mean_squared_error:4,neglect:16,neglig:16,neighbor:[4,9],neither:11,neq:[0,11,16],nervou:10,nest:[7,10],nesterov:11,net:10,netlib:14,network:[1,7,11,13,15,18],neural:[1,5,11,13,15,18],neural_network:[1,2],neuralnetwork:2,neuron:[2,10],neutral:1,neutron:1,never:[2,4,7,16],new_box:11,new_hobbit:[],new_root:11,new_sig:[],new_trac:11,newaxi:[1,4,7],newli:1,newton:[2,5,6,11,16],next:[0,1,2,3,4,6,7,11,16],next_guess:11,nian:17,nice:[0,1,2,3,9],nichola:17,nicholaskarlsen1102:17,niter:11,nitric:1,nlambda:[3,4],nm_n:1,nmse:4,nn_model:2,node:[2,7,8,10],nois:[1,3,4,6,7,8,11],noisi:[2,4],non:[0,1,2,3,4,5,7,8,9,10,11,14,16],none:[0,1,2,3,7,8,11,16],nonetheless:0,nonlinear:[4,6,7,9,10],nonneg:[4,7,11],nonparametr:4,nonsens:16,nonsingular:14,nonumb:[5,6,11,14],nor:[2,11],norm:[1,2,3,4,6,9,11],normal:[3,4,5,6,7,8,9,10,11,13,14],normali:14,normpdf:[],norwai:4,notat:[0,1,3,4,11,16],note:[0,1,2,3,4,5,6,9,10,11,13,14,15,16,18],notebook:[0,1,2,7,13],noth:[0,2,3,6,10,16],notic:[3,10,11,14,16],novel:[4,8],novemb:2,now:[0,1,3,4,5,6,8,9,10,11,14,16],nowadai:[1,2,7,13],nox:1,np_assign_points_to_clust:0,np_get_distances_to_clust:0,np_k_mean:0,nsampl:4,nspin:16,nthi:1,ntrained_model:4,nuclear:3,nuclei:[1,16],nucleon:1,nucleu:1,num_tre:8,number:[0,2,3,4,5,6,7,8,9,10,11,14,15,17],numberid:5,numer:[1,3,4,7,8,9,10,11,13,14,18],numpi:[0,1,2,3,4,5,6,7,8,9,10,11,13,16],nunmpi:3,nx_test:4,nx_train:4,nx_train_mean:4,ny_pr:4,ny_train:4,ny_train_mean:4,obei:[4,9,11],object:[1,2,3,4,6,8,11,14],objsens:3,obliqu:3,observ:[0,2,3,4,5,6,7,8,9,10,11],obtain:[0,1,2,3,4,5,6,7,8,10,11,14,16],obviou:[3,4,9,16],obviouli:1,obvious:[1,3,4,14],occupi:1,occur:[1,4,6,7,16],odd:[1,5],oen:1,off:[2,3,7,11,16],offend:[],offer:[4,9,13,14,15],offic:17,offici:15,ofil:16,ofstream:16,often:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,16],ofter:14,old:[2,3,8,11],ols_sk:4,ols_svd:4,olsbeta:3,omega:4,omit:[1,3],onc:[0,2,4,7,9,11,16],one:[0,1,2,3,4,5,6,7,8,9,11,13,14,16],onehot:2,onehot_vector:2,onehotencod:7,ones:[1,3,4,6,7,8,9,11,14],onli:[0,1,2,3,4,5,6,7,8,9,10,11,14,16],onlin:[9,15],onto:[3,9],open:[1,2,4,5,7,13,15,16],oper:[1,2,3,4,8,9,10,11,13,14,16],operation:16,opinion:0,oplu:16,opmiz:11,opportun:1,oppos:[4,11],opposit:[2,3,6],opt:[1,2,3,4,5,6,9,11],optim:[0,1,3,4,5,7,8,9,15],optimis:2,option:[1,2,3,4,5,6,9],optmiz:[2,6],orang:1,order:[1,2,3,4,5,6,7,8,9,10,11,14,16],ordinari:[1,5,9,11,13,15],oreilli:18,org:[5,9,13,14,18],organ:[0,4,5,8,14],orient:[2,3,16],origin:[1,3,4,6,9,10,11,14,16],orthogn:3,orthogon:[1,3,4,6,9,11,14],orthonorm:3,oscar:2,oscil:11,oslo:[1,15,17],osx:[1,13],other:[0,1,2,3,4,5,6,8,11,13,14,15,18],otherwis:[1,2,5,11],ouput:[3,5,10],our:[2,4,5,6,7,8,10,13,14,15],ourmodel:1,ourselv:[0,1,3,4,6,9,11],out:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,16],out_fil:7,outcom:[1,5,7,8,10,16],outdoor:7,outer:[4,10],outfilenam:16,outlier:[1,6],outlin:[4,8,9],outlook:7,outperform:8,output:[1,2,3,4,5,6,7,8,10,11,14],output_bia:2,output_bias_gradi:2,output_weight:2,output_weights_gradi:2,outputlayer1:10,outputlayer2:10,over1:11,over:[0,1,2,3,4,7,8,10,11,16],overal:[2,8],overcast:7,overcom:[10,11],overdetermin:1,overfit:[1,2,4,7,8,11],overflow:[2,3],overhead:10,overlap:[5,6,7],overlin:[0,1,3,4,7,8,9,14],overst:1,overview:[0,18],own:[3,4,6,10,11,13,14],owner:1,ownridgebeta:4,oxid:1,oyvinssc:17,p_i:[3,16],p_j:16,p_n:16,p_x:16,pack:1,packag:[1,2,3,4,5,6,9,11,13,16],page:[1,13],pai:[1,2,7,11],painless:[],pair:[1,7,13,16],panda:[1,3,4,5,7,9,13],panel:[],paper:2,paradigm:1,parallel:[8,14],paramet:[1,2,3,4,5,6,7,8,10,11,16],parameter:[1,4,8],parametr:[1,4],paramt:3,park:16,part:[0,1,2,3,4,8,14,15,16,18],partial:[1,2,3,4,5,6,8,9,10,11,16],particip:[13,15],particl:[1,11,16],particular:[1,2,3,4,7,8,9,10,11,16,18],particularli:[3,4,6,9,11,16],partit:[2,7],partli:4,pass:[0,10,16],past:[8,16],patch:[4,16],path:[1,4,5,7,13],patient:5,pattern:[1,10,15,18],pauli:1,pca:[1,5,13,15],pcost:3,pdf:[1,3,4,7,18],pedagog:1,penal:4,penalti:[4,11],penros:[3,4],pentagon:11,peopl:[1,2,7,13],per:[1,2,4,15],percentag:[1,8,9],perceptron:[1,2,5],peregrin:[],perfect:[1,2],perfectli:4,perform:[0,1,3,4,6,8,9,10,11,13,14,16],perhap:[1,3,11],perimet:2,period:2,permut:9,persist:11,person:[3,4,5,15,17],perspect:18,pertin:10,petal:[6,7],peter:18,petersen:16,phantom:16,phase:[4,10],phatak:0,phenomena:16,phi:6,phi_k:6,philip:17,philosophi:11,phone:17,phrase:1,physic:[1,2,5,10,11,16,17,18],pick:[0,2,7,8,9,11,16],pickl:2,pictur:1,pie:13,piec:[0,9],pillow:[1,13],pinv:[3,4],pip3:[1,2],pip:[1,2,13],pipelin:[1,4,6,8],pippin:[],pise:0,pitfal:4,pitt:10,pixel:2,pixel_height:2,pixel_width:2,place:[1,4,6,11,14],plai:[1,3,4,6,9,13],plain:[6,8,10,11],plan:[4,7,17,18],plane:[6,7],plateau:[3,16],platform:13,plausibl:10,pleas:[1,5,9,11],plenti:2,plethora:10,plot:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,16],plot_confusion_matrix:[5,8],plot_count:4,plot_cumulative_gain:[5,8],plot_data:2,plot_dataset:6,plot_decision_boundari:[7,8],plot_import:8,plot_predict:6,plot_regression_predict:7,plot_roc:[5,8],plot_surfac:[4,11],plot_train:7,plot_tre:[7,8],plt:[0,1,2,3,4,5,6,7,8,9,10,11,14,16],plu:[1,3,5],png:[1,4,5,7],point:[0,1,2,3,4,5,6,7,8,9,11,14,16,17],points_in_clust:0,poisson:13,poli:[4,6],poly100_kernel_svm_clf:6,poly3:1,poly3_plot:1,poly3dcollect:11,poly_featur:[6,7],poly_features10:7,poly_fit10:7,poly_fit:7,poly_kernel_svm_clf:6,polydegre:[1,3,4,8],polygon:11,polym:10,polynomi:[1,3,4,5,6,7,8,9],polynomial_featur:4,polynomial_svm_clf:6,polynomialfeatur:[1,4,6,7],polytrop:[1,4],poor:[2,11],poorli:1,popul:[1,3],popular:[1,2,4,5,6,7,9,10,13,14,16],popularli:1,portabl:8,portion:[9,11],pose:[1,3,4,9,16],posit:[0,1,2,3,5,6,8,9,11,14,16],possibl:[1,2,3,4,5,6,7,8,9,10,11,13,14,16,17],posterior:3,postpon:1,postul:3,potenti:[1,3,4,10,11],potr:3,potrf:3,pott:10,power:[1,2,3,4,6,7,10],practic:[1,3,4,5,6,15,16],practition:[1,2],pre:3,preced:[2,9,10,16],preceq:6,precis:[1,3,9,11,14,16],pred:4,predicit:1,predict:[1,2,3,4,5,6,7,8,13,18],predict_prob:2,predict_proba:[5,8],predictor:[1,3,4,5,7,8,9],prefer:[1,2,4,6,7,9,13],prepar:[1,4],preprocess:[1,4,5,6,7,8,9],prerequisit:1,presenc:11,present:[1,3,4,7,10,11,15,16],preserv:9,press:[11,18],pretrain:2,pretti:[1,6,7,13],prev_centroid:0,prevent:[11,16],previou:[1,2,3,4,6,8,9,10,11,14,16],previous:[0,7,8,16],price:[1,7,11],primal:6,primari:[1,5],primarili:0,prime:16,princip:[1,3,5,13,15],principl:[0,1,4,5,6],print:[0,1,2,3,4,5,6,7,8,9,11,14,16],print_funct:[6,7],printout:1,prior:[1,3,4],privat:1,prob:[2,16],probabilist:[1,18],probabl:[1,2,4,5,8,11,13,15],problem:[1,3,4,5,6,7,8,9,10,13,14,15,16],proce:[1,3,4,6,7,8,9,11,14],procedur:[3,4,6,8,9,11],proceed:14,process:[0,1,4,7,8,10,11,13,14,16,18],prod:18,prod_:[2,3,5],produc:[0,1,3,4,7,8,9,10,11,13,14,16],product:[1,2,3,4,5,6,10,11,13,14],profess:1,profil:0,program:[0,1,2,3,4,6,10,13,14,15,16],programm:14,progress:[0,2],progression_plot:0,prohibit:4,project1:4,project:[1,2,3,9,11,13,15,16,17],project_root_dir:[1,4,5,7],promin:10,promis:6,prone:7,pronounc:[11,13],proof:[1,9,10,11],prop:[],proper:[1,4],properli:[0,2,4,6,8,11],properti:[1,2,10,11,14],proport:[1,2,3,7,9,11,16],propos:[2,4,8],propto:[3,11],proton:1,prove:11,provid:[1,2,3,4,6,7,8,10,11,13,14,16,18],proxi:[2,11],prun:0,prune:7,pseudoinv:3,pseudoinvers:[3,4],pseudorandom:[4,16],psycholog:1,ptratio:1,punish:[1,2],pure:[7,16],purest:7,puriti:7,purpos:[0,1,8,10],put:2,putarow:3,putboundslic:3,putclist:3,putobjsens:3,putqobj:3,pycod:[],pydata:13,pydot:7,pyhton2:[],pylab:[1,5],pypi:13,pyplot:[0,1,2,3,4,5,6,7,8,9,10,11,14,16],pythagora:[0,3],python2:1,python3:[1,2,4,5,6,9,11,13],python:[2,3,4,6,9,10,11,15],pytorch:[1,13],qquad:[9,11,14],quad:[2,11,14],quadrat:[1,3,6,7,11],qualit:[7,16],qualiti:[1,7,13],quantifi:2,quantil:8,quantit:[1,4,7],quantiti:[0,1,3,4,5,7,8,9,10,14,16],quantum:10,quartil:1,quench:3,queri:7,question:[1,3,4,7,9,10,11],quick:16,quickli:[2,7,9,11],quirk:0,quit:[2,3,4,7,8,10],quot:16,r2_score:1,r2score:1,r_1:7,r_2:7,r_j:7,r_m:7,rad:1,radial:[1,6,10],radioact:16,radiu:[1,2],rain:7,rais:11,ramp:2,ran1:16,ran2:16,ran3:16,rand:[1,3,4,7,8,11,14,16],rand_max:16,randint:[4,7,11],randn:[1,2,3,4,7,9,11],random:[0,1,2,3,4,6,7,11,13,14,15],random_devic:16,random_forest_model:8,random_index:11,random_indic:2,random_st:[1,5,6,7,8,9],randomforestclassifi:8,randomli:[0,2,4,7,11,16],randomnumbergener:16,rang:[0,1,2,3,4,5,7,8,9,10,11,14,16],rangl:[1,4,9,16],rangle_x:16,rank:3,raphson:[2,6,11],rapidli:1,rare:2,rate:[1,2,6,7,8,10,11],rather:[1,2,3,4,5,6,7,8,9,10,11,14,16],ratio:[5,7,8,9],rational:1,ravel:[3,4,5,6,7,8,9,11],raw:16,rbf:[6,9,10],rbf_kernel_svm_clf:6,rbf_pca:9,rcond:1,rcparam:[1,2,5,6,7,8,16],reach:[0,1,2,3,4,5,7,8,9,10,11,16],read:[0,1,3,4,5,6,9,10,14,15,16,18],read_csv:[1,4,5,7],read_fwf:1,readabl:0,reader:[1,4,14,16],readi:[0,1,2,3,4,6,8,9,10,14],readili:2,real:[1,2,5,8,9,10,11,14],realist:6,realiti:16,realiz:[2,10],realli:[1,2],rearrang:11,reason:[0,1,2,8,11,18],reassign:2,recal:[3,4,7,8,9,10,14,16],recalcul:16,receiv:[2,8,10,16],recent:[1,4,7,8,11],recept:10,recip:[1,4,5,14],reciproc:3,recogn:[1,3,8],recognit:[1,2,10,15,18],recommend:[1,3,4,6,11,13,14,15,16,18],reconsid:7,reconstruct:9,record:[8,15],recreat:16,rectangl:[7,11],rectangular:3,rectifi:[2,10],recur:[1,13],recurr:[1,2,13,15],recurs:[7,13,14],recycl:16,red:[1,4,6,7],redefin:[1,8],reduc:[2,3,4,7,8,9,11],reduct:[1,8,9,13,16],refer:[0,1,2,3,4,5,9,10,11,14,18],refin:10,refit:4,reflect:[1,2,3,16],refresh:[13,15],reg:[8,9],regard:[2,7,11],regardless:10,region:[4,7,10],regist:[4,16],reglasso:3,regr_1:[1,7],regr_2:[1,7],regr_3:[1,7],regress:[2,6,9,10,13,15],regressor:[1,5,8],regridg:[3,4],regular:[1,3,4,5,7,11],reilli:[1,18],reinforc:[1,6,13],reiter:2,rel:[1,4,5,7,10,11,16],relat:[0,1,2,3,9,11,14,16],relationship:[1,7],relativeerror:1,releas:[2,13],relev:[1,2,3,5,9,13,15,16],reli:[1,4,6],reliabl:[5,16],remain:[2,4,10,14,16],remaind:16,remark:2,rememb:[1,6,11,14],remind:[1,3,9,11,14,16],remov:[1,3,4],render:1,reorder:[3,5],reorgan:1,repeat:[0,1,2,3,4,7,8,9,11,14,16],repeated:1,repeatedli:[4,8,11,16],repetit:[4,15],rephras:11,replac:[0,1,2,3,4,8,10,11],replica:4,repositori:1,repres:[1,2,3,4,5,6,7,8,10,11,16],represent:[1,2,4,16],reproduc:[1,3,4,7,10,13,16],repuls:1,request:1,requir:[1,2,3,4,6,7,9,10,11,14],resaml:4,resampl:[1,5,8,13,15,16],rescal:[1,9,10],rescu:3,reseach:4,research:[1,13,18],resembl:[4,16],reserv:[2,3,4,16],reset:16,reshap:[0,1,2,4,6,7,8],residenti:1,residu:[1,3,11],resiz:3,respect:[0,1,2,3,4,5,6,8,9,10,11,16],respond:10,respons:[1,5,7,10],rest:[1,3],restat:[1,10],restrict:[1,7,10],result:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,16],ret:[],retail:1,retain:[3,4],return_data:0,return_x_i:7,reus:[2,4],reveal:[1,10],revers:2,review:[13,14,15],revisit:0,reward:1,rewrit:[1,3,4,5,6,8,9,10,11,14,16],rewritten:[4,6,8,16],rewrot:11,rgoj5yh7evk:13,rho:[1,8],rho_1:8,rho_2:8,rho_m:8,rhs:[3,4],rich:1,rid:0,ride:7,rideclass:7,ridedata:7,ridg:[1,5,9,11,13,15],ridge_sk:4,ridgebeta:3,right:[1,2,3,4,5,6,7,8,10,11,14,16],rightarrow:[1,2,3,4,6,9,10,11,16],rigor:1,ring:4,rise:1,risk:[1,11],river:1,rmse:1,rmsporp:11,rmsprop:[2,11],rnd_clf:8,rnn:[10,15],rntrick1:16,rntrick2:16,rntrick3:16,rntrick4:16,robert:18,robust:1,robustscal:1,roc:8,role:[1,3,4,6,13],roll:4,room:[1,17],root:[1,3,7,11,16],rot:[],rotat:[2,6,7,8],rotation_matrix:7,roughli:2,round:[1,5,7,11],routin:[11,14],row:[1,2,3,4,5,7,9,14],rrr:3,rthe:3,rug:11,rule:[1,2,3,4,11],run:[0,1,2,3,4,6,7,9,11,13],runtim:[0,2,4],runtimewarn:[2,4],rust:[1,13,14],rvert:2,rvert_2:2,rwidth:[],s_1:4,s_i:[4,5],s_j:4,s_k:4,saddl:11,safe:16,sai:[0,1,2,3,4,5,6,7,8,9,10,14,16],said:[4,7,11],sake:[1,3,5,9],sale:1,sam:[],same:[0,1,2,3,4,6,7,9,10,11,14,16],samm:8,sampl:[0,1,2,3,4,5,6,7,8,11,13,14],sample_vari:0,sampleexptvari:16,samwis:[],sanitize_sequ:[],sastri:9,satisfactori:1,satisfi:[2,4,6,11,14,16],satur:[2,4],save:[1,4,5,7],save_fig:[1,4,5,7,8],savefig:[1,4,5,7,16],saw:3,scalabl:8,scalar:[3,4,8,11],scale:[1,2,3,4,5,6,7,8,9,10,11,13,17],scaler:[1,5,6,7,8,9],scan:[3,5],scari:3,scatter:[0,1,2,4,5,6,7],scenario:[4,11],schedul:11,scheme:[2,11],schrage:16,scienc:[1,2,8,10,11,13,15,16,18],scientif:[1,13],scientist:[0,1],scikit:[3,4,5,6,7,8,11,13,14,15,18],scikitlearn:[],scikitplot:[5,8],scipi:[1,3,4,11,13,14],scl:4,score:[1,2,4,5,7,8,9,17],scores_kfold:4,scratch:2,sdg:11,seaborn:[1,2,4,5],seamless:[1,13],search:[1,2,3,7,11],sec:4,second:[0,1,3,4,5,6,7,9,10,11,13,14,15,16],secondeigvector:9,secondli:10,section:[0,9,12,14,15,16],sector:1,see:[0,1,2,3,4,5,6,8,9,10,11,13,14,15,16],seed:[0,1,2,3,4,6,7,9,11,16],seek:[2,6],seem:2,seemingli:1,seen:[1,2,3,8,10,16],segment:11,seismic:4,seldomli:1,select:[2,3,4,6,7,8,9,15,18],self:[2,3,16,18],semest:[5,15],semi:[6,11],semilogx:4,send:[3,10,11,17],senior:15,sens:[1,4,6],sensit:[1,3,4,7,11],sentenc:10,separ:[0,1,2,4,6,7,10,13,16],sequenc:[0,5,7,8,10,11,13,14,16],sequenti:[2,8,10,16],seri:[1,2,3,4,8,9,10,11,14,15],serif:[1,5,16],serv:[1,2,3,5,11,18],session:[2,15],set:[0,2,3,4,5,6,8,9,11,13,14,16],set_:[],set_label:[],set_major_formatt:4,set_major_loc:4,set_stream:3,set_tick:[2,6],set_ticklabel:2,set_titl:[0,1,2,5,10],set_xlabel:[1,2,5,10],set_xlim:[5,10],set_xticklabel:2,set_ylabel:[1,2,5],set_ylim:[5,10],set_ytick:5,set_yticklabel:[2,4],set_zlim:4,setiosflag:16,setminu:4,setosa:[6,7],setosa_or_versicolor:6,setp:4,setprecis:16,setse:3,setup:[2,3,4,6,13],setw:16,sever:[1,3,4,5,6,7,9,10,11,13,14,15,16],sgd:[2,11],sgd_clf:6,sgdclassifi:6,sgdreg:11,sgdregressor:11,sgn:3,shallow:11,shape:[0,1,2,3,4,5,6,7,8,9,11,14],share:2,she:5,shift:[2,4,10,16],shire:[],shortcom:11,shorter:16,shorthand:[],shortli:14,should:[0,1,3,4,6,7,9,10,11,14],show:[0,1,2,3,4,5,6,7,8,9,10,11,14,16],shown:[1,3,5,6,9,10,11,16],showpoint:16,shrink:[3,4,6,9],shrinkag:[3,4],shrunk:9,shuffl:[1,2,4,11],side:[1,3,6,10,11,14],sigh:13,sigma0:16,sigma1:16,sigma2:16,sigma:[1,2,3,4,5,8,9,10,11,14,16],sigma_0:3,sigma_1:3,sigma_2:3,sigma_:[3,14,16],sigma_fn:[5,10],sigma_i:[1,3],sigma_j:3,sigma_m:[4,16],sigma_n:[9,16],sigma_t:11,sigma_x:16,sigmoid:[2,5,6,8,10],sigmundson:[4,17],sign:[2,5,6,8,16],signal:[2,8,10],signific:2,significantli:[2,11,16],sim:[3,4,11,16],similar:[0,1,2,3,4,5,6,7,8,9,11,13,14],similarli:[1,2,3,6,8,16],simpl:[0,2,3,4,5,6,8,9,10,13,14],simplepredict:8,simpler:[0,1,2,3,4,11,13],simplest:[0,1,2,7,8,10],simpletre:8,simpli:[1,2,3,4,6,7,8,9,10,13,14,16],simplic:[0,3,4,5,6,7,8,9,10],simplicti:3,simplifi:[1,4,7,13],simplist:[4,16],simul:[4,16],simultan:4,sin:[1,2,7,10,11,14],sinc:[1,2,3,4,5,6,7,8,9,11,14,16,18],sine:10,singl:[1,2,3,4,5,6,7,10,11,14,16],singular:[1,4,11,14,15],site:[1,2,4,5,6,9,11,15],situat:[1,3,5,11],six:16,size:[1,2,3,4,6,7,8,9,11,14,16],sketch:8,ski:7,skill:1,skip:9,skl:[1,4],sklearn:[1,2,3,4,5,6,7,8,9,11],skplt:[5,8],slack:6,slice:14,slide:[1,16],slight:[4,11],slightli:[2,3,4,5,8,16],slope:[6,9,10],slow:[1,6,11],slower:[3,14],slowli:10,slp:2,small:[0,1,2,3,4,6,7,8,9,10,11,13,14,16],smaller:[1,2,3,4,6,7,9,11,16],smallest:[0,1],smallest_row_index:0,smart:[],smooth:[1,4,11],sne:9,sneak:[],sns:[1,2,4,5],soar:4,social:1,soft:[2,5,8,10],soften:6,softmax:5,softwar:[1,6,13,14,15],sol:6,sole:[1,4],solid:[1,5],solitem:3,soltyp:3,solut:[1,2,3,4,6,8,9,11,14,16],solutionsummari:3,solv:[1,2,3,4,6,8,9,10,11,14],solver:[3,5,6,7,8,9,14],some:[0,1,2,3,4,5,6,7,8,9,10,14,15,16],some_model:4,someth:[1,2,5,7,9,16],sometim:[0,1,2,9,10,11],soon:14,sophist:1,sopt:11,sort:[3,4,7,9,16],sound:3,sourc:[0,1,2,4,13,14,16],space:[0,1,2,3,6,7,9,10,11,16],span:[1,3,7,9,14],spare:2,spars:[3,4,14],sparse_mtx:14,sparsiti:8,spatial:[2,10],spdiag:3,speak:16,special:[4,5,8,10,11,14,16],specif:[1,2,3,4,5,6,7,9,10,13,14,16],specifi:[0,1,3,4,5,7,9,11,16],specifici:[1,8],spectral:2,speech:[1,2,10],speed:[2,11],spend:16,sphere:1,spin:4,spite:1,spline:6,split:[0,2,3,4,6,7,8,9,16],splite:1,splitter:[2,8],spmatrix:3,spontan:16,spread:[1,9,16],springer:18,spuriou:11,sqquar:3,sqrt:[1,3,4,6,8,9,11,16],squar:[0,2,5,6,7,9,11,13,14,15,16],squarederror:8,squaredeuclidean:0,squash:10,srand:16,srtm:4,srtm_data_norway_1:4,stabil:3,stabl:[1,3,4,5,7,9,13],stack:[],stage:[3,11],stai:[1,3,9],stand:[1,3,7,10],standadscal:4,standard:[1,2,3,4,5,6,8,10,14],standardscal:[1,4,5,6,7,8,9],stanford:11,start:[0,1,2,3,4,6,7,8,9,10,11,14,15,16],start_box:11,start_nod:11,start_tim:0,startpoint:16,stat:4,state:[0,2,3,4,5,6,8,9,10,11,13,16],statement:[1,5,14],statis:[],statist:[0,1,2,5,7,8,9,10,11,14,15,18],statu:[1,5,9],stavang:4,std:[1,4,16],stdev:16,stdout:3,steep:11,step:[0,1,2,4,5,7,8,9,10,11,14,16],step_fn:[5,10],step_length:11,steps_list:7,stian:17,still:[3,4,9,11,16],stimuli:10,stk2100:18,stk3155:15,stk4021:18,stk4051:18,stk4155:15,stk5000:18,stk:18,stochast:[1,2,3,4,6,9,10],stoke:10,stone:[1,5],stop:[0,2,5,7,9,11,16],storag:3,store:[1,2,4,9,11,16],str:2,straight:[1,4,6,11],straightforward:[1,3,4,6,7,8,11,14],strategi:[1,2,7],stratifi:4,streamtyp:3,strength:[0,1,3],stretch:9,strict:[6,11],strictli:[6,11],strike:4,string:[2,16],stroke:5,strong:[4,7,8,10,16],strongli:[1,6,13,14],stronli:1,structur:[0,1,2,4,7,8,10,13],stuck:[2,11],student:[1,15,17,18],studi:[0,1,3,4,5,6,9,10,11,13,18],studier:[15,18],style:[1,5,7],sub:[7,10],subarg:11,subdivid:[1,14],subfield:1,subject:[3,4,6,16],subplot:[0,1,2,4,5,6,7,8],subplots_adjust:[6,16],subprogram:14,subract:1,subroutin:1,subscript:2,subsequ:[2,3,4,10,14,16],subset:[2,4,7,10,11,13],subspac:[1,6,9],substanti:[7,8],substep:9,substitut:[4,10,14],subsubset:7,subtask:4,subtl:2,subtract:[1,3,4,9,11,14,16],subtre:7,subval:11,succeed:1,success:[5,7,11,16],successfulli:7,sucess:16,sudo:[1,13],suffer:[1,2,3,8],suffici:[2,4,6,9,11],suggest:[2,11,18],suit:[6,10],suitabl:[1,16],sum:[0,1,2,3,4,5,6,7,8,9,10,11,16],sum_:[0,1,2,3,4,5,6,7,8,9,10,11,14,16],sum_i:[3,4,6,11],sum_j:4,sum_k:[4,6,10,14],summar:[0,3,4,7],summari:[0,2,8,15],summat:[],sunni:7,superscript:[2,10],supervis:[1,3,4,5,7,10,13],supplement:5,support:[1,2,7,8,9,11,13,15],suppos:[1,3,4,5,6,8,9,10,11,14],suppress:[3,11],sure:[2,4],surf:4,surfac:[1,4],surpass:4,surpris:1,surround:13,survei:[1,3,4],svc:[6,7,8],svd:[1,4,9,15],svdinv:3,svm:[6,7,8,9],svm_clf:[6,8],swath:3,symbol:[2,3,9,11,13,16],symmeteri:2,symmetr:[1,3,6,9,10,11,14],symmetri:4,sympi:[1,13],synonim:16,syntax:[2,11,14],syntaxerror:[2,6,14],syrk:3,sys:[3,11],system:[1,2,3,4,5,7,8,10,11,13,14,18],systemat:[4,16],t_0:[7,11],t_1:11,t_b:8,t_i:[2,10],t_j:[3,10],t_k:7,tabl:[7,16,17],tabul:1,tabular:[],tackl:0,tag:[0,3,4,5,10,11,14,16],taht:1,tail:16,tailor:[6,9],taiwan:1,take:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,16],taken:[1,2,4,8,11,14],tangent:[2,10,11],tanh:[2,5,6,10],target:[1,2,3,4,5,6,7,8,9,10],target_nam:7,task:[0,1,2,3,4,7,9,10],tau:[3,16],tax:1,taylor:11,taylornr:11,team:2,teaser:1,technic:[0,1,3,4],techniqu:[1,2,6,8,11,13,15,16,18],technolog:[1,2],tek5040:18,tell:[1,4,8,9,11,16],temp1:2,temp2:2,temp:2,temperatur:[1,7],temporarili:2,ten:[],tend:[0,3,4,6,7,8,10,11],tendenc:1,tension:4,tensorflow:[0,1,6,13,14,15,18],term1:[3,4,9],term2:[3,4,9],term3:[3,4,9],term4:[3,4,9],term:[0,1,2,3,4,5,6,7,8,9,10,11,16],termin:[1,3,7,8,11],terrain1:4,terrain:4,test:[3,4,5,6,7,8,11,16],test_accuraci:2,test_data:0,test_error:4,test_ind:4,test_pr:2,test_predict:2,test_scor:[5,8],test_siz:[1,2,3,4,8],test_split:7,tester:[],testerror:[1,4],text:[1,2,3,6,7,9,11,14,16,18],textual:7,textur:2,than:[1,2,3,4,5,7,8,9,10,11,13,16],thank:4,thats:0,theano:[2,13],thei:[0,1,2,3,4,5,6,7,9,10,11,14,16],them:[1,2,4,6,7,8,9,10,11,14],theme:1,themselv:[1,16],thenc:4,theorem:[4,5],theoret:[1,8],theori:[1,2,6,7,10,11,13,15,18],thereaft:[1,3,4,9,10,14],therebi:[1,3,5,9,16],therefor:[1,2,4,5,6,9,11,16],therein:9,thereof:[1,4,11],theta:[2,11,16],theta_:[2,11],theta_i:2,theta_k:16,theta_linreg:11,theta_t:11,thi:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18],thing:[0,1,2,3,5,7,16],think:[0,1,2,4,7,10,11,16],third:[1,4,11],thirti:5,thorough:0,those:[0,3,4,6,7,8,9,14,15],though:[2,14,16],thought:[0,4,16],thousand:[1,2],three:[1,2,3,4,6,7,10,14,15,17],threshold:[2,7,8,9,10,11],through:[0,1,2,3,4,6,9,10,11,13,14,16],throughout:[0,1,3,13,14,16],thu:[1,2,3,4,5,6,8,9,10,11,16,17],thumb:[1,4],thursdai:15,tibshirani:[4,15,18],tick_param:4,ticker:[4,11,16],tif:4,tight_layout:[2,5],tightli:9,tild:[1,3,4,9,16],till:[1,5,6,7,8,10,14],time:[0,1,2,3,4,5,6,7,8,9,10,11,14,15,16],timefunct:16,tini:2,tip:12,titl:[1,2,4,5,6,7,8,11,16],tmp:11,to_categor:2,to_categorical_numpi:2,to_numer:[1,4],to_str:16,togeth:[1,4,6,9],toi:0,told:11,toler:[0,4],tomographi:10,too:[1,3,4,7,9,11,16,18],took:6,tool:[0,1,2,4,11,13,16],toolbox:6,top:[1,3,4,7,8,13],topic:[0,1,3,4,5,6,13,15,18],topolog:[2,10],toss:8,total:[0,1,2,4,5,6,8,9,10,11,16,17],totalclustervari:0,totalscatt:0,totalvari:16,toward:[2,5,10,11],town:1,tpng:7,tqdm:4,trace:11,trace_stack:11,traceback:[4,7,8,11],tracer:11,track:[0,11,14],tract:1,tractabl:1,trade:[3,7],tradeoff:[1,3,15],tradit:[1,2,4],train:[3,4,6,7,8,9,10,11],train_accuraci:[1,2],train_end:[1,2],train_error:4,train_ind:4,train_pr:2,train_siz:[1,2],train_test_split:[1,2,3,4,5,7,8,9],train_test_split_numpi:[1,2],trained_model:4,trainerror:1,trainingerror:4,trait:1,tran:3,transfer:7,transform:[1,3,4,5,6,7,8,9,10,11,13,14],transit:[4,10],translat:[2,4,8],transpos:[2,3,9],travers:[1,3],treat:[1,2,4,10,11,16],tree:[1,2,4,13,15],tree_clf:[7,8],tree_clf_:7,tree_clf_sr:7,tree_reg1:7,tree_reg2:7,tree_reg:7,trend:16,trevor:18,tri:[7,11],triain:1,trial:[1,4,11,16],triangl:11,triangular:14,trick:[6,9,11,16],trickier:16,tridiagon:14,trillion:13,trivial:[1,2,3,9,16],troubl:[1,6,10],true_beta:4,true_divid:2,true_fun:4,tucker:6,tumor:[5,7],tumour:5,tunabl:2,tune:[7,11,14],tupl:11,turn:[1,2,3,4,5,6,7,8,9,10,11,14,16],tutori:2,tweak:[2,8,16],twice:11,twist:9,twister:16,two:[0,1,2,3,4,5,7,8,9,10,11,14,15,16,18],tx_1:11,type:[1,2,4,6,8,11,14,16],typeerror:11,typic:[1,2,3,5,7,8,10,11,16],u_i:10,u_m:8,ubuntu:[1,13],uci:1,uio:[15,17,18],unari:14,unary_f:11,unary_oper:11,unbalanc:[4,7],unbias:[1,3,4,16],uncent:4,uncertainti:[1,3],uncertitud:16,unchang:2,uncorrel:8,undefin:3,under:[1,2,3,4,8,11,13],underdetermin:1,underfit:[2,4],underflowproblem:3,undergo:3,undergradu:15,underli:[1,2,7,11,16],underset:0,understand:[0,1,2,3,4,8,11,13],understood:[0,6,11],undesir:6,undetermin:[3,6],unexpect:[4,16],unexpected:16,unfair:4,unfortun:[2,6,7,8],unicode_liter:[6,7],uniform:[1,2,3,4,9,11],uniform_real_distribut:16,uniformli:[11,16],unifrompdf:16,unimport:11,union:[3,4],uniqu:[0,1,4,11,14],unique_cluster_label:0,unit:[1,2,3,8,10,16],unitari:[3,4,14],unitarili:14,uniti:16,univari:16,univers:[1,2,11,15,17],unix:2,unknow:[1,14],unknown:[1,2,3,4,6,8,14],unknowwn:10,unlabel:2,unless:[1,4,9,11],unlik:[2,6,11,16],unnecessarili:7,unravel:2,unrol:9,unseen:[1,5,7],unstabl:2,unsupervis:[1,2,10,13,15],unsymmetr:14,until:[0,2,7,10,11,16],untouch:1,unusu:10,updat:[0,2,8,10,11],upload:[13,18],upon:[2,4,9,14],upper:[1,6,7,14],uppercas:[14,16],ups:[],usag:[1,6,13,16],usd10000:1,usd:1,use:[0,1,3,4,5,6,7,8,9,10,11,13,14,15],usecol:1,used:[0,1,2,3,4,6,7,8,9,10,11,13,14,16,18],useful:[1,2,3,4,5,7,9,10,11,13,14,16,18],useless:2,user:[1,2,4,5,6,9,13,14],userwarn:4,uses:[1,2,3,4,7,9,10,14,16],usetex:16,usg:4,using:[0,2,3,4,5,6,7,8,9,10,11,14],usr:16,usual:[0,1,5,10,11],util:[0,2,4,5,8],v_0:9,valid:[1,2,5,7,8,11,13,15,16],valu:[0,1,2,4,5,6,7,8,10,11,13,14,15],valuat:7,valueerror:[],van:1,vandenbergh:[6,11],vandermond:1,vanilla:[1,4,9],vanish:[2,11,16],var_x:16,varabl:6,varepsilon:[3,4],varepsilon_:[3,4],varepsilon_i:[3,4],vari:[1,2,3,4,8],variabl:[0,1,2,3,4,5,6,8,9,10,11,14],varianc:[0,1,2,3,5,7,8,9,11,13,14,15],variance_i:[3,9],variance_x:[3,9],variant:[1,2,4,6,10,11],variat:9,varieti:[1,10,13],variou:[2,3,4,5,6,7,9,10,11,13,14,16],vartempvec:16,varvec:16,vaue:2,vault:1,vdot:11,vec:[4,16],vector:[0,1,2,3,4,5,7,8,9,11,13,15],vector_mean:0,ventur:[1,6,13],verbos:2,veri:[0,1,2,3,4,5,6,7,8,9,10,11,16,18],verifi:[9,14],versatil:6,versicolor:[6,7],version:[0,1,8,11,13,14,16],versu:2,vert:[1,2,3,4,5,6,7,9,11],vert_1:[3,4],vert_2:[3,4,9],vertic:[],via:[1,3,4,5,6,7,8,9,10,13,14,15,16],vidal:9,video:[1,2,10,13,15],view:[2,3,4,10,11,15,16,18],violat:6,virginica:7,viridi:[1,2],virtual:2,viscos:11,viscou:11,vision:1,visual:[1,9,10,13],visualis:2,viz:[4,6,16],vjp:11,vjpnode:11,vmax:[2,4],vmc:16,vmin:[2,4],volum:1,vote:8,voting_clf:8,votingclassifi:8,votingsimpl:8,vrtx:15,vspace:11,vstack:[3,9,14,16],w_1:[6,14],w_1x_1:6,w_1x_:6,w_2:[6,14],w_2x_2:6,w_2x_:6,w_3:14,w_4:14,w_i:[2,8],w_ix_i:10,w_j:14,w_m:14,w_px_:6,w_px_p:6,wai:[0,1,2,3,4,5,6,8,9,10,11,12,14,16],walk:7,walker:16,wang:1,want:[0,1,2,3,4,6,7,8,9,10,11,13,16],warn:[1,2,6],warrant:4,watch:13,wavelet:6,weak:[0,7,8],weather:[2,10],web:[13,15],webpag:15,websit:[4,14,15],wedg:[6,16],wednesdai:15,wee:9,week:[3,4,5],weekli:[13,18],weight:[1,2,4,5,7,8,10,11,16],welcom:[6,13],well:[1,2,3,4,5,6,7,8,10,11,13,14,15,16,18],went:6,were:[0,1,2,3,4,5,6,8,9,10,16],wessel:1,what:[0,2,3,4,5,6,7,8,9,10,11,13,14,15],when:[0,1,2,3,4,5,6,7,8,9,10,11,14,16],whenev:[11,16],where:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,16,17],wherea:[4,16],wherein:[2,10],whether:[1,3,5,7,16],which:[0,1,3,4,5,6,7,8,9,10,11,13,14,15,17],whichev:2,white:7,who:[1,15],whole:[0,2,3,7,9],whose:[1,4,8,16],whow:[3,9],why:[1,2,4,11],wide:[1,2,4,5,10,13,14],widehat:4,width:[1,6,7],wieringen:1,win:8,wind:7,wing:17,wiothout:4,wiscons:5,wisconsin:8,wisdom:4,wise:[1,2,3,10,11],wish:[0,1,3,5,6,9,11,14],with_std:1,wither:4,within:[0,1,5,7,10,11,16,18],withinclust:0,without:[1,2,3,4,6,7,9,10,11],won:1,wonder:6,word:[0,1,2,3,4,16],work:[0,1,2,4,5,6,7,11,13,15,16],world:[1,6],worldwid:1,wors:[1,2,4],worth:7,would:[1,2,3,4,5,6,7,8,9,10,11,14,16],wrap:[4,14,15],wrap_util:11,write:[1,2,3,4,5,6,10,11,12,14,15,16],written:[1,3,9,10,11,13,14,16],wrong:[2,6],wrongli:[8,16],wrote:[3,9],wrt:8,wth:8,www:[13,14,15,18],wx_1:6,x0s:6,x1_exampl:6,x1d:6,x1s:[6,7,8],x2d:[6,9],x2d_train:9,x2dsl:9,x2s:[6,7,8],x3s:6,x_0:[1,3,9,14],x_1:[1,3,4,5,6,7,8,9,11,14,16],x_2:[1,3,4,5,6,7,8,9,11,14,16],x_3:[6,14,16],x_4:14,x_center:9,x_data:2,x_data_ful:2,x_i:[0,1,2,3,4,5,6,7,8,9,10,11,14,16],x_ix_:1,x_iy_i:6,x_j:[1,6,7,10,16],x_jy_j:6,x_k:[0,10,14,16],x_l:16,x_m:[4,10,14,16],x_n:[1,4,6,9,10,11,14,16],x_new:[7,8],x_offset:4,x_p:[5,7],x_poli:7,x_poly10:7,x_reduc:9,x_scale:6,x_test:[1,2,3,4,5,7,8,9],x_test_own:4,x_test_scal:[1,4,5,7,8,9],x_train:[1,2,3,4,5,7,8,9],x_train_mean:4,x_train_own:4,x_train_scal:[1,4,5,7,8,9],x_val:2,xarrai:13,xavier:2,xbnew:11,xcode:[1,13],xdclassiffierconfus:8,xdclassiffierroc:8,xg_clf:8,xgb:8,xgbclassifi:8,xgboost:7,xgboot:8,xgbregressor:8,xgparam:8,xgtree:8,xi_1:6,xi_:6,xi_i:6,xlabel:[1,2,3,4,5,6,7,8,11,16],xlim:[4,8],xmesh:11,xnew:[1,11],xpanda:1,xpd:[3,9],xplot:1,xscale:1,xsr:7,xt_x:11,xtest:4,xtick:[4,6,7],xtrain:4,xytext:6,y_0:[1,3,9,14],y_1:[1,3,6,7,9,11,14],y_1y_1:6,y_1y_1k:6,y_1y_2:6,y_1y_2k:6,y_1y_n:6,y_1y_nk:6,y_2:[1,3,6,7,9,14],y_2y_1:6,y_2y_1k:6,y_2y_2:6,y_2y_2k:6,y_3:[1,7,14],y_4:14,y_data:[1,2,3,4],y_data_ful:2,y_decis:6,y_fit:1,y_i:[1,2,3,4,5,6,7,8,9,10,11,14],y_if_:8,y_ix_:1,y_ix_i:[5,6,11],y_iy_jk:6,y_j:[4,6,10],y_k:10,y_m:14,y_model:[1,3,4],y_n:[6,11],y_ny_1:6,y_ny_1k:6,y_ny_2:6,y_ny_2k:6,y_ny_n:6,y_ny_nk:6,y_offset:4,y_plot:7,y_pred1:7,y_pred2:7,y_pred:[1,2,4,5,6,7,8],y_pred_rf:8,y_pred_tre:8,y_proba:[5,8],y_scaler:4,y_test:[1,2,3,4,5,7,8,9],y_test_onehot:2,y_test_predict:1,y_train:[1,2,3,4,5,7,8,9],y_train_mean:4,y_train_onehot:2,y_train_predict:1,y_train_scal:4,y_val:2,year:[1,13],yes:[4,5],yet:[1,2,4,6,9,11],yield:[0,1,3,4,6,8,10,11,14,16],ylabel:[1,2,3,4,5,6,7,8,11,16],ylim:4,ymesh:11,yoshua:[2,18],you:[0,1,2,3,4,6,7,8,9,11,13,14,16,18],young:1,your:[0,2,3,4,6,9,11,13,14,16],yourself:[9,11],youtub:13,ypred:4,ypredict2:11,ypredict:[1,11],ypredictlasso:3,ypredictol:3,ypredictown:4,ypredictownridg:4,ypredictridg:[3,4],ypredictskl:4,yridg:[],ytest:4,ytick:[4,6,7],ytild:[1,4],ytildelasso:3,ytildenp:1,ytildeol:3,ytildeownridg:4,ytilderidg:[3,4],ytrain:4,z_0:14,z_1:14,z_2:14,z_c:2,z_h:2,z_i:[2,10],z_j:[2,10],z_k:10,z_m:2,z_mod:7,z_o:2,zaman:16,zaxi:4,zero:[0,1,2,3,4,5,6,7,8,9,10,11,14,16],zip:[4,11],zm_h:1,zone:1},titles:["12. Clustering Analysis","3. Linear Regression","14. Building a Feed Forward Neural Network","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","Content in Jupyter Book","Applied Data Analysis and Machine Learning, FYS-STK3155/4155 at the University of Oslo, Norway","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:{"2021":17,"4155":13,"case":[6,8,16],"final":10,"function":[1,2,4,5,6,8,9,10,11,16],"import":[3,14,16],And:[],Eye:8,FYS:13,Ising:4,OLS:[3,4],RMS:11,The:[0,1,2,3,4,5,6,7,9,10,13,16],Useful:13,Using:11,activ:[2,10],actual:16,adaboost:8,adam:11,adapt:8,adding:4,adjust:2,again:7,aim:[6,7],algebra:14,algorithm:[0,7,8,9,10],algortithm:11,all:6,analys:3,analysi:[0,1,3,4,9,13,16],ani:11,anoth:7,appli:13,approach:[1,6],approxim:10,architectur:2,arrai:14,assist:17,august:15,autocorrel:16,automat:11,back:[2,9,10],background:13,bag:8,base:11,basic:[0,1,3,5,7,8,9,14],batch:2,bay:3,befor:9,better:[6,16],bia:4,binari:2,binomi:16,bird:8,block:16,book:12,boost:8,bootstrap:[4,8,16],boston:1,breast:2,brief:[],bring:10,build:[2,7],calcul:16,cancer:[2,5,7,9],cart:7,central:[11,13,16],chain:10,chang:8,chi:1,choos:2,classic:9,classif:[2,7,8],classifi:6,clip:2,cluster:0,code:[0,1,2,3,7,9,10,16],collect:2,compar:8,complex:[1,4],complic:4,compon:9,comput:[7,16],con:7,concept:16,condit:[],conjug:11,content:12,continu:16,convex:[6,11],convolut:10,correl:[9,16],correspond:[],cost:[2,8],cours:[13,18],covari:[3,9,16],cross:4,cumul:16,cython:[],data:[1,2,4,5,7,9,13,16],dataset:2,decemb:15,decis:[7,8],decomposit:[3,9,14],deep:2,defin:2,definit:16,degre:1,demonstr:16,dens:1,deriv:[3,10],descent:[8,11],develop:2,deviat:16,diagon:9,dice:16,differ:6,differenti:11,dimension:6,disadvantag:7,discret:16,disguis:16,distribut:[3,16],doing:2,domain:16,down:2,dropout:2,economi:[],element:[1,16],elimin:14,ensembl:8,entropi:7,environ:1,equat:[1,10],error:[1,8],etc:[],evalu:2,event:16,exampl:[1,2,4,5,6,7,8,16],exercis:[1,4],expect:16,experi:16,explor:1,exponenti:16,express:[],extend:[],extrem:8,fall:17,famili:2,famou:16,fantast:[],featur:[7,14],feed:[2,10],fine:2,first:10,fit:[1,8],forest:8,forward:[2,10],frank:4,freedom:1,frequentist:1,fridai:[],from:[3,8,10],further:3,gaussian:[14,16],gener:[7,16],geometr:9,gini:7,good:1,grade:17,gradient:[2,8,11],handl:14,has:13,hessian:[],homework:[],hous:1,how:16,hyperparamet:2,hyperplan:6,id3:7,idea:[0,9],ideal:[],implement:[2,16],implic:3,improv:2,increment:9,index:7,inform:17,instal:13,instructor:17,interpret:[3,9],introduc:9,introduct:[1,4,13,14],invers:[3,14],iter:8,its:16,jackknif:16,julia:[],jungl:8,jupyt:12,kera:2,kernel:[6,9],lagrangian:6,lasso:[3,4],later:3,layer:[2,10],learn:[1,2,9,11,13],least:[3,4],level:8,librari:13,likelihood:5,limit:[2,11,16],linear:[1,6,11,14],link:[3,9,15,18],logist:5,loss:[],machin:[1,6,11,13],main:16,make:[1,7,8],mani:[8,10],materi:15,math:3,mathemat:[3,6],matric:3,matrix:[2,3,9,10,14,16],matter:1,mean:[0,1,16],meet:[3,8,16],mercer:6,mersenn:16,method:[4,7,8,11,16],mlp:10,model:[1,2,4,10],moment:16,momentum:11,moon:[6,7],more:[0,4,14],multilay:10,multipl:2,multipli:6,name:16,need:[],network:[2,5,10],neural:[2,10],newton:[],non:6,normal:[1,2,16],norwai:13,notat:10,novemb:15,now:[2,7],nuclear:1,nueral:5,numba:[],number:[1,16],numer:16,numpi:14,numpython:0,observ:16,obtain:9,octob:15,off:4,one:10,optim:[2,6,11,13],ordinari:[3,4],organ:1,oslo:[13,18],other:[7,9,10,16],our:[0,1,3,9,11,16],outcom:13,output:16,overarch:[1,6,7],overview:8,own:[0,1,8,9],packag:14,panda:[],part:[11,13],pass:2,pca:9,pdf:16,perceptron:10,perform:[2,7],period:16,perspect:2,poisson:16,practic:11,pre:2,preprocess:[],prerequisit:13,princip:9,pro:7,probabl:[3,16],problem:[2,11],procedur:7,process:2,program:11,project:4,prop:11,propag:[2,10],properti:[3,16],pseudo:16,python:[0,1,7,13,14,16],quick:6,ran0:16,random:[8,9,16],raphson:[],read:7,real:4,recip:16,recurr:10,reduc:1,regress:[1,3,4,5,7,8,11],regular:2,relev:18,relu:2,remind:[4,6],requir:13,resampl:4,rescal:4,revisit:11,ridg:[3,4],rng:16,rule:10,sampl:[9,16],schedul:15,schemat:7,scikit:[1,2,9],select:16,semest:17,sensit:[],septemb:15,set:[1,7,10],sgd:[],should:[2,16],simpl:[1,7,11,16],singl:8,singular:[3,9],situat:16,size:[],slightli:[],soft:6,softmax:2,softwar:[],solv:[],solver:11,some:11,split:1,squar:[1,3,4,8],standard:[11,16],state:1,statist:[3,4,13,16],steepest:[8,11],step:[],stk3155:13,stochast:[11,16],stop:[],supervis:2,support:6,svd:3,teach:[15,17],teacher:17,techniqu:[4,9],technolog:13,tensorflow:2,test:[1,2],textbook:18,than:[],theorem:[3,6,9,10,16],theori:16,three:16,tip:11,togeth:10,top:2,toss:16,toward:[0,9],trade:4,tradeoff:4,train:[1,2],tree:[7,8],tune:2,two:[6,13],type:10,uncorrel:16,understand:[],uniform:16,univers:[10,13,18],use:[2,16],used:5,using:[1,16],valid:4,valu:[3,9,16],variabl:16,varianc:[4,16],variou:1,vector:[6,10,14],view:[1,8],visual:[2,7],wai:7,week:15,weekli:15,what:[1,16],when:[],which:[2,16],why:16,wisconsin:5,write:[0,9],xgboost:8,your:[1,8]}}) \ No newline at end of file diff --git a/doc/LectureNotes/_build/jupyter_execute/chapter3.ipynb b/doc/LectureNotes/_build/jupyter_execute/chapter3.ipynb index f83b4276c..a5fdd1e14 100644 --- a/doc/LectureNotes/_build/jupyter_execute/chapter3.ipynb +++ b/doc/LectureNotes/_build/jupyter_execute/chapter3.ipynb @@ -397,10 +397,10 @@ "name": "stdout", "output_type": "stream", "text": [ - "Runtime: 0.13859 sec\n", + "Runtime: 0.139992 sec\n", "Jackknife Statistics :\n", "original bias std. error\n", - " 99.9054 99.8954 0.149328\n" + " 99.9142 99.9042 0.148517\n" ] } ], @@ -774,7 +774,7 @@ "text": [ "Bootstrap Statistics :\n", "original bias std. error\n", - " 99.7442 15.0015 99.7465 0.148127\n" + " 100.028 14.8941 100.026 0.148225\n" ] } ], @@ -828,7 +828,7 @@ "outputs": [ { "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEICAYAAABS0fM3AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Il7ecAAAACXBIWXMAAAsTAAALEwEAmpwYAAAtgUlEQVR4nO3dd3gU5drH8e+dhFASWiihKt2GBYiKPRELWI8KCiLYELEh9sI5R8VjwYZy9KiIKD0qgqIioBRRXxUJAoJIEVFCR6QECARyv3/MohGT7JLs7OzO3p/rmmtnZ2dnfw9ZcmdmnnlGVBVjjDHxK8HrAMYYY7xlhcAYY+KcFQJjjIlzVgiMMSbOWSEwxpg4Z4XAGGPinGuFQEQqichsEZkvIotE5JFi1qkoIm+JyHIR+UZEmriVxxhjTPGSXNz2buBMVc0TkQrAFyLysap+XWSd64HfVbWFiHQFBgJXlLbR2rVra5MmTYJ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ou2wP5gp1hpW8sxfqpP9nLjgU9V9RG/QlahPrn7AVmBn9NFwPEikutr2h/UJ/dOvDOYqYH7/yKEP6dWCCoRkaMCX9sT6FCqsC8O+CPwVOXnqeofVLWtqnbEu0L6PVUN21+n9ci9FfhKRLoEdp3Fj6cK992RZsdrEuobGMEieNnXhSf19ypOk3IN8FaF/VcHRoT0xWu22lLxiYH7e0WkbyD/1RWeHw5HnB1ARB7A62P6nzBkrag+3/MnVbVN4Of0NLw/OrLDE7teuRV4GyjPGtqfU786SqJ1wxv9sBb4CDgrsG8sUBDYxvFDJ2YbYFYVr5FNGDuL65sbOBnIAz4GpgGpUZT9PuATvL6Gl4HGPuaciNcXUYJ3JvVrIB2vbfxTvBFPaYFjBW9hpo3AKiCrwuusrHA7K5B9I/AYPnXahzo73l+tild4Vwa26yM9d6XX7oh/o4b8+Kx0ABYGfk7nA+1DldemmDDGmBhnTUPGGBPjrBAYY0yMs0JgjDExzgqBMcbEOCsExhgT46wQGGNMjLNCYIwxMc4KgTH1JCK9A/PIJ4lIcmB+/u6ucxkTLLugzJgQCEy3kAQ0wZu76c+OIxkTNCsExoSAiCTiLaZzAOivqqWOIxkTNGsaMiY00vEWPGmGd2ZgTNSwMwJjQkBEpuNNP94Jb3Wp0Y4jGRO0Rq4DGBPtRORqoERVXxOReOADERmoqu+5zmZMMOyMwBhjYpz1ERhjTIyzQmCMMTHOCoExxsQ4KwTGGBPjrBAYY0yMs0JgjDExzgqBMcbEuP8PZeN2FLzTAvAAAAAASUVORK5CYII=\n", "text/plain": [ "
        " ] @@ -1088,18 +1088,17 @@ "Bias^2: 0.3123314713548606\n", "Var: 0.009164545680330616\n", "0.32149601703519126 >= 0.3123314713548606 + 0.009164545680330616 = 0.3214960170351912\n", - "Polynomial degree:" + "Polynomial degree: 1\n", + "Error: 0.08426840630693411\n", + "Bias^2: 0.07968918676726028\n", + "Var: 0.004579219539673833\n", + "0.08426840630693411 >= 0.07968918676726028 + 0.004579219539673833 = 0.08426840630693411\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - " 1\n", - "Error: 0.08426840630693411\n", - "Bias^2: 0.07968918676726028\n", - "Var: 0.004579219539673833\n", - "0.08426840630693411 >= 0.07968918676726028 + 0.004579219539673833 = 0.08426840630693411\n", "Polynomial degree: 2\n", "Error: 0.10398646080125035\n", "Bias^2: 0.10077114273548986\n", @@ -1130,18 +1129,18 @@ "Error: 0.03781367141738898\n", "Bias^2: 0.03365768507152761\n", "Var: 0.004155986345861379\n", - "0.03781367141738898 >= 0.03365768507152761 + 0.004155986345861379 = 0.03781367141738899\n", - "Polynomial degree: 7\n", - "Error: 0.027609773491022498\n", - "Bias^2: 0.02299949826036597\n", - "Var: 0.004610275230656537\n", - "0.027609773491022498 >= 0.02299949826036597 + 0.004610275230656537 = 0.027609773491022505\n" + "0.03781367141738898 >= 0.03365768507152761 + 0.004155986345861379 = 0.03781367141738899\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ + "Polynomial degree: 7\n", + "Error: 0.027609773491022498\n", + "Bias^2: 0.02299949826036597\n", + "Var: 0.004610275230656537\n", + "0.027609773491022498 >= 0.02299949826036597 + 0.004610275230656537 = 0.027609773491022505\n", "Polynomial degree: 8\n", "Error: 0.017355848195591973\n", "Bias^2: 0.010331721306655588\n", @@ -1173,14 +1172,7 @@ "Bias^2: 0.01628578269590588\n", "Var: 0.09919198949386163\n", "0.1154777721897675 >= 0.01628578269590588 + 0.09919198949386163 = 0.11547777218976751\n", - "Polynomial degree:" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - " 13\n", + "Polynomial degree: 13\n", "Error: 0.22842468702166951\n", "Bias^2: 0.01975416527163567\n", "Var: 0.20867052175003387\n", @@ -1196,7 +1188,7 @@ }, "metadata": { "filenames": { - "image/png": "/Users/mhjensen/Teaching/MachineLearning/doc/LectureNotes/_build/jupyter_execute/chapter3_62_6.png" + "image/png": "/Users/mhjensen/Teaching/MachineLearning/doc/LectureNotes/_build/jupyter_execute/chapter3_62_5.png" }, "needs_background": "light" }, @@ -1450,117 +1442,110 @@ "Mean squared error on training data: 3.66204648\n", "Mean squared error on test data: 8.14812206\n", "Degree of polynomial: 7\n", - "Mean squared error on training data: 0.47075725" + "Mean squared error on training data: 0.47075725\n", + "Mean squared error on test data: 2.00607783\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "\n", - "Mean squared error on test data: 2.00607783\n", "Degree of polynomial: 8\n", "Mean squared error on training data: 0.04912436\n", "Mean squared error on test data: 0.21596432\n", "Degree of polynomial: 9\n", "Mean squared error on training data: 0.02522069\n", - "Mean squared error on test data: 0.08576932\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ + "Mean squared error on test data: 0.08576932\n", "Degree of polynomial: 10\n", "Mean squared error on training data: 0.02511518\n", "Mean squared error on test data: 1.20015436\n", "Degree of polynomial: 11\n", "Mean squared error on training data: 0.01640891\n", - "Mean squared error on test data: 1.35533773\n", - "Degree of polynomial: 12\n", - "Mean squared error on training data: 0.00813803\n", - "Mean squared error on test data: 0.17446471\n" + "Mean squared error on test data: 1.35533773\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ + "Degree of polynomial: 12\n", + "Mean squared error on training data: 0.00813803\n", + "Mean squared error on test data: 0.17446471\n", "Degree of polynomial: 13\n", "Mean squared error on training data: 0.00759119\n", "Mean squared error on test data: 1.08131003\n", "Degree of polynomial: 14\n", "Mean squared error on training data: 0.00472199\n", - "Mean squared error on test data: 0.81333793\n", - "Degree of polynomial: 15\n", - "Mean squared error on training data: 0.00410478\n", - "Mean squared error on test data: 92.09145189\n" + "Mean squared error on test data: 0.81333793\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ + "Degree of polynomial: 15\n", + "Mean squared error on training data: 0.00410478\n", + "Mean squared error on test data: 92.09145189\n", "Degree of polynomial: 16\n", "Mean squared error on training data: 0.00315593\n", "Mean squared error on test data: 234.39716546\n", "Degree of polynomial: 17\n", "Mean squared error on training data: 0.00242998\n", - "Mean squared error on test data: 1271.05295709\n", - "Degree of polynomial: 18\n", - "Mean squared error on training data: 0.00228740\n", - "Mean squared error on test data: 108.42208194\n" + "Mean squared error on test data: 1271.05295709\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ + "Degree of polynomial: 18\n", + "Mean squared error on training data: 0.00228740\n", + "Mean squared error on test data: 108.42208194\n", "Degree of polynomial: 19\n", "Mean squared error on training data: 0.00156372\n", "Mean squared error on test data: 1388.41078073\n", "Degree of polynomial: 20\n", "Mean squared error on training data: 0.00137982\n", - "Mean squared error on test data: 1761.43341615\n", - "Degree of polynomial: 21\n", - "Mean squared error on training data: 0.00118170\n", - "Mean squared error on test data: 15061.31603087\n" + "Mean squared error on test data: 1761.43341615\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ + "Degree of polynomial: 21\n", + "Mean squared error on training data: 0.00118170\n", + "Mean squared error on test data: 15061.31603087\n", "Degree of polynomial: 22\n", "Mean squared error on training data: 0.00092354\n", "Mean squared error on test data: 890.63488525\n", "Degree of polynomial: 23\n", "Mean squared error on training data: 0.00085887\n", - "Mean squared error on test data: 5483.16796929\n", - "Degree of polynomial: 24\n", - "Mean squared error on training data: 0.00084589\n", - "Mean squared error on test data: 1695.57143061\n" + "Mean squared error on test data: 5483.16796929\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ + "Degree of polynomial: 24\n", + "Mean squared error on training data: 0.00084589\n", + "Mean squared error on test data: 1695.57143061\n", "Degree of polynomial: 25\n", "Mean squared error on training data: 0.00078806\n", "Mean squared error on test data: 131343.30655001\n", "Degree of polynomial: 26\n", "Mean squared error on training data: 0.00076916\n", - "Mean squared error on test data: 17709.14370264\n", - "Degree of polynomial: 27\n", - "Mean squared error on training data: 0.00068970\n", - "Mean squared error on test data: 2975.38903780\n" + "Mean squared error on test data: 17709.14370264\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ + "Degree of polynomial: 27\n", + "Mean squared error on training data: 0.00068970\n", + "Mean squared error on test data: 2975.38903780\n", "Degree of polynomial: 28\n", "Mean squared error on training data: 0.00062588\n", "Mean squared error on test data: 3848.64522721\n", @@ -1588,7 +1573,7 @@ }, "metadata": { "filenames": { - "image/png": "/Users/mhjensen/Teaching/MachineLearning/doc/LectureNotes/_build/jupyter_execute/chapter3_65_11.png" + "image/png": "/Users/mhjensen/Teaching/MachineLearning/doc/LectureNotes/_build/jupyter_execute/chapter3_65_10.png" }, "needs_background": "light" }, @@ -2057,6 +2042,2121 @@ "cell_type": "markdown", "metadata": {}, "source": [ + "## More on Rescaling data\n", + "\n", + "We end this chapter by adding some words on scaling and how to deal with the intercept for regression cases.\n", + "\n", + "When you are comparing your own code with for example **Scikit-Learn**'s\n", + "library, there are some technicalities to keep in mind. The examples\n", + "here demonstrate some of these aspects with potential pitfalls.\n", + "\n", + "The discussion here focuses on the role of the intercept, how we can\n", + "set up the design matrix, what scaling we should use and other topics\n", + "which tend confuse us.\n", + "\n", + "The intercept can be interpreted as the expected value of our\n", + "target/output variables when all other predictors are set to zero.\n", + "Thus, if we cannot assume that the expected outputs/targets are zero\n", + "when all predictors are zero (the columns in the design matrix), it\n", + "may be a bad idea to implement a model which penalizes the intercept.\n", + "Furthermore, in for example Ridge and Lasso regression, the default solutions\n", + "from the library **Scikit-Learn** (when not shrinking $\\beta_0$) for the unknown parameters\n", + "$\\boldsymbol{\\beta}$, are derived under the assumption that both $\\boldsymbol{y}$ and\n", + "$\\boldsymbol{X}$ are zero centered, that is we subtract the mean values.\n", + "\n", + "\n", + "If our predictors represent different scales, then it is important to\n", + "standardize the design matrix $\\boldsymbol{X}$ by subtracting the mean of each\n", + "column from the corresponding column and dividing the column with its\n", + "standard deviation. Most machine learning libraries do this as a default. This means that if you compare your code with the results from a given library,\n", + "the results may differ. \n", + "\n", + "The\n", + "[Standadscaler](https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.StandardScaler.html)\n", + "function in **Scikit-Learn** does this for us. For the data sets we\n", + "have been studying in our various examples, the data are in many cases\n", + "already scaled and there is no need to scale them. You as a user of different machine learning algorithms, should always perform a\n", + "survey of your data, with a critical assessment of them in case you need to scale the data.\n", + "\n", + "If you need to scale the data, not doing so will give an *unfair*\n", + "penalization of the parameters since their magnitude depends on the\n", + "scale of their corresponding predictor.\n", + "\n", + "Suppose as an example that you \n", + "you have an input variable given by the heights of different persons.\n", + "Human height might be measured in inches or meters or\n", + "kilometers. If measured in kilometers, a standard linear regression\n", + "model with this predictor would probably give a much bigger\n", + "coefficient term, than if measured in millimeters.\n", + "This can clearly lead to problems in evaluating the cost/loss functions.\n", + "\n", + "\n", + "\n", + "Keep in mind that when you transform your data set before training a model, the same transformation needs to be done\n", + "on your eventual new data set before making a prediction. If we translate this into a Python code, it would could be implemented as follows" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [ + { + "data": { + "text/plain": [ + "'\\n#Model training, we compute the mean value of y and X\\ny_train_mean = np.mean(y_train)\\nX_train_mean = np.mean(X_train,axis=0)\\nX_train = X_train - X_train_mean\\ny_train = y_train - y_train_mean\\n\\n# The we fit our model with the training data\\ntrained_model = some_model.fit(X_train,y_train)\\n\\n\\n#Model prediction, we need also to transform our data set used for the prediction.\\nX_test = X_test - X_train_mean #Use mean from training data\\ny_pred = trained_model(X_test)\\ny_pred = y_pred + y_train_mean\\n'" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "\"\"\"\n", + "#Model training, we compute the mean value of y and X\n", + "y_train_mean = np.mean(y_train)\n", + "X_train_mean = np.mean(X_train,axis=0)\n", + "X_train = X_train - X_train_mean\n", + "y_train = y_train - y_train_mean\n", + "\n", + "# The we fit our model with the training data\n", + "trained_model = some_model.fit(X_train,y_train)\n", + "\n", + "\n", + "#Model prediction, we need also to transform our data set used for the prediction.\n", + "X_test = X_test - X_train_mean #Use mean from training data\n", + "y_pred = trained_model(X_test)\n", + "y_pred = y_pred + y_train_mean\n", + "\"\"\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Let us try to understand what this may imply mathematically when we\n", + "subtract the mean values, also known as *zero centering*. For\n", + "simplicity, we will focus on ordinary regression, as done in the above example.\n", + "\n", + "The cost/loss function for regression is" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "C(\\beta_0, \\beta_1, ... , \\beta_{p-1}) = \\frac{1}{n}\\sum_{i=0}^{n} \\left(y_i - \\beta_0 - \\sum_{j=1}^{p-1} X_{ij}\\beta_j\\right)^2,.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Recall also that we use the squared value since this leads to an increase of the penalty for higher differences between predicted and output/target values.\n", + "\n", + "What we have done is to single out the $\\beta_0$ term in the definition of the mean squared error (MSE).\n", + "The design matrix\n", + "$X$ does in this case not contain any intercept column.\n", + "When we take the derivative with respect to $\\beta_0$, we want the derivative to obey" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\frac{\\partial C}{\\partial \\beta_j} = 0,\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "for all $j$. For $\\beta_0$ we have" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\frac{\\partial C}{\\partial \\beta_0} = -\\frac{2}{n}\\sum_{i=0}^{n-1} \\left(y_i - \\beta_0 - \\sum_{j=1}^{p-1} X_{ij} \\beta_j\\right).\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Multiplying away the constant $2/n$, we obtain" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\sum_{i=0}^{n-1} \\beta_0 = \\sum_{i=0}^{n-1}y_i - \\sum_{i=0}^{n-1} \\sum_{j=1}^{p-1} X_{ij} \\beta_j.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We assume \n", + "that every column of $\\boldsymbol{X}$ is centered, which we can do by subtracting the mean," + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "X = X - np.mean(X,axis=0)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This means that we need to rewrite $X_{ij}$ as $\\tilde{X}_{ij}=X_{ij}-\\mu_j$, where" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\mu_j = \\frac{1}{n}\\sum_{i=0}^{n-1}X_{ij}.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Let us special first to the case where we have only two parameters $\\beta_0$ and $\\beta_1$.\n", + "Our result for $\\beta_0$ simplifies then to" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "n\\beta_0 = \\sum_{i=0}^{n-1}y_i - \\sum_{i=0}^{n-1} X_{i1} \\beta_1.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Assuming that the matrix elements $X_{i1}$ are centered, what we have is" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\beta_0 = \\frac{1}{n}\\sum_{i=0}^{n-1}y_i - \\beta_1\\frac{1}{n}\\sum_{i=0}^{n-1} \\left(X_{i1}-\\mu_{1}\\right),\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "where" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\mu_1=\\frac{1}{n}\\sum_{i=0}^{n-1} (X_{i1},\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "and if we define the mean value of the outputs as" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\mu_y=\\frac{1}{n}\\sum_{i=0}^{n-1}y_i,\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "we have" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\beta_0 = \\mu_y - \\beta_1\\frac{1}{n}\\sum_{i=0}^{n-1} (X_{i1}-\\mu_{1}),\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "and it is easy to see that the last sum equals zero! This means that we have" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\beta_0 = \\mu_y,\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "if the columns of the design matrix are centered. It is straight forward to generalize this results to more values of $\\beta$.\n", + "We have thus" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\beta_0 = \\frac{1}{n}\\sum_{i=0}^{n-1} y_i = \\overline{\\boldsymbol{y}},\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "the average value of $\\boldsymbol{y}$.\n", + "\n", + "Replacing $y_i$ with $y_i - \\beta_0 = y_i - \\overline{\\boldsymbol{y}}$ and centering also our design matrix results in a cost function (in vector-matrix disguise)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "C(\\boldsymbol{\\beta}) = (\\boldsymbol{\\tilde{y}} - \\tilde{X}\\boldsymbol{\\beta})^T(\\boldsymbol{\\tilde{y}} - \\tilde{X}\\boldsymbol{\\beta}).\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "If we minimize with respect to $\\boldsymbol{\\beta}$ we have then" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\hat{\\boldsymbol{\\beta}} = (\\tilde{X}^T\\tilde{X})^{-1}\\tilde{X}^T\\boldsymbol{\\tilde{y}},\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "where $\\boldsymbol{\\tilde{y}} = \\boldsymbol{y} - \\overline{\\boldsymbol{y}}$\n", + "and $\\tilde{X}_{ij} = X_{ij} - \\frac{1}{n}\\sum_{k=0}^{n-1}X_{kj}$.\n", + "\n", + "For Ridge regression we need to add $\\lambda \\boldsymbol{\\beta}^T\\boldsymbol{\\beta}$ to the cost function and get then" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\hat{\\boldsymbol{\\beta}} = (\\tilde{X}^T\\tilde{X} + \\lambda I)^{-1}\\tilde{X}^T\\boldsymbol{\\tilde{y}}.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "What does this mean? And why do we insist on all this? Let us look at some examples.\n", + "\n", + "\n", + "This code shows a simple first-order fit to a data set using the above transformed data, where we consider the role of the intercept first, by either excluding it or including it (*code example thanks to Øyvind Sigmundson Schøyen*). Here our scaling of the data is done by subtracting the mean values only.\n", + "Note also that we do not split the data into training and test." + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "True beta: [2, 0.5, 3.7]\n", + "Fitted beta: [2.08376632 0.19569961 3.97898392]\n", + "Sklearn fitted beta: [2.08376632 0.19569961 3.97898392]\n", + "MSE with intercept column\n", + "0.004113634617443137\n", + "MSE with intercept column from SKL\n", + "0.0041136346174431284\n", + "Manual intercept: 2.083766322923905\n", + "Fitted beta (wiothout intercept): [0.19569961 3.97898392]\n", + "Sklearn intercept: 2.0837663229239025\n", + "Sklearn fitted beta (without intercept): [0.19569961 3.97898392]\n", + "MSE with Manual intercept\n", + "0.004113634617443136\n", + "MSE with Sklearn intercept\n", + "0.004113634617443135\n" + ] + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWoAAAD4CAYAAADFAawfAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Il7ecAAAACXBIWXMAAAsTAAALEwEAmpwYAAA7MElEQVR4nO3deVhV1frA8e8GEY+CoqKIQ+KQC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2hadoA4HNN03orpQqMHVhdYawRdQLQ6YbvO15/rtQ2mqY1ovAjU3KtRFf9DOkvmqbdDSwFxiulsmsptppSUZ+tgd5AiKZpcRTO5X1Tx08oGvI+nwO+UUrlKqVOA39SmLjrKkP6/BDwFYBS6hDQhMLiRfWVQf/fb4WxEvXvwO2apnXRNK0xhScLv7mpzTfArOtfTwaC1PWZ+jqowv5qmtYH+JDCJF3X5y2hgj4rpVKVUrZKKQellAOF8/LjlVKhxgm3Whjye72dwtE0mqbZUjgV8lctxljdDOnzWWAogKZpjhQm6qRajbJ2fQM8cP3qDy8gVSmVWKVXNOKZ09EUjiZigaXXn/On8D8rFL6ZXwOngN+ArsY+21vD/d0LXAAirj++MXbMNd3nm9qGUMev+jDwfdYonPKJBqKAacaOuRb67AQcoPCKkAhguLFjrmJ/vwQSgVwKPyE9BMwF5t7wHr93/ecRVR2/13ILuRBCmDi5M1EIIUycJGohhDBxkqiFEMLESaIWQggTJ4laCCFMnCRqIYQwcZKohRDCxP0/5zUzMkNVbe8AAAAASUVORK5CYII=\n", + "text/plain": [ + "
        " + ] + }, + "metadata": { + "filenames": { + "image/png": "/Users/mhjensen/Teaching/MachineLearning/doc/LectureNotes/_build/jupyter_execute/chapter3_110_1.png" + }, + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "\n", + "from sklearn.linear_model import LinearRegression\n", + "\n", + "\n", + "np.random.seed(2021)\n", + "\n", + "def MSE(y_data,y_model):\n", + " n = np.size(y_model)\n", + " return np.sum((y_data-y_model)**2)/n\n", + "\n", + "\n", + "def fit_beta(X, y):\n", + " return np.linalg.pinv(X.T @ X) @ X.T @ y\n", + "\n", + "\n", + "true_beta = [2, 0.5, 3.7]\n", + "\n", + "x = np.linspace(0, 1, 11)\n", + "y = np.sum(\n", + " np.asarray([x ** p * b for p, b in enumerate(true_beta)]), axis=0\n", + ") + 0.1 * np.random.normal(size=len(x))\n", + "\n", + "degree = 3\n", + "X = np.zeros((len(x), degree))\n", + "\n", + "# Include the intercept in the design matrix\n", + "for p in range(degree):\n", + " X[:, p] = x ** p\n", + "\n", + "beta = fit_beta(X, y)\n", + "\n", + "# Intercept is included in the design matrix\n", + "skl = LinearRegression(fit_intercept=False).fit(X, y)\n", + "\n", + "print(f\"True beta: {true_beta}\")\n", + "print(f\"Fitted beta: {beta}\")\n", + "print(f\"Sklearn fitted beta: {skl.coef_}\")\n", + "ypredictOwn = X @ beta\n", + "ypredictSKL = skl.predict(X)\n", + "print(f\"MSE with intercept column\")\n", + "print(MSE(y,ypredictOwn))\n", + "print(f\"MSE with intercept column from SKL\")\n", + "print(MSE(y,ypredictSKL))\n", + "\n", + "\n", + "plt.figure()\n", + "plt.scatter(x, y, label=\"Data\")\n", + "plt.plot(x, X @ beta, label=\"Fit\")\n", + "plt.plot(x, skl.predict(X), label=\"Sklearn (fit_intercept=False)\")\n", + "\n", + "\n", + "# Do not include the intercept in the design matrix\n", + "X = np.zeros((len(x), degree - 1))\n", + "\n", + "for p in range(degree - 1):\n", + " X[:, p] = x ** (p + 1)\n", + "\n", + "# Intercept is not included in the design matrix\n", + "skl = LinearRegression(fit_intercept=True).fit(X, y)\n", + "\n", + "# Use centered values for X and y when computing coefficients\n", + "y_offset = np.average(y, axis=0)\n", + "X_offset = np.average(X, axis=0)\n", + "\n", + "beta = fit_beta(X - X_offset, y - y_offset)\n", + "intercept = np.mean(y_offset - X_offset @ beta)\n", + "\n", + "print(f\"Manual intercept: {intercept}\")\n", + "print(f\"Fitted beta (wiothout intercept): {beta}\")\n", + "print(f\"Sklearn intercept: {skl.intercept_}\")\n", + "print(f\"Sklearn fitted beta (without intercept): {skl.coef_}\")\n", + "ypredictOwn = X @ beta\n", + "ypredictSKL = skl.predict(X)\n", + "print(f\"MSE with Manual intercept\")\n", + "print(MSE(y,ypredictOwn+intercept))\n", + "print(f\"MSE with Sklearn intercept\")\n", + "print(MSE(y,ypredictSKL))\n", + "\n", + "plt.plot(x, X @ beta + intercept, \"--\", label=\"Fit (manual intercept)\")\n", + "plt.plot(x, skl.predict(X), \"--\", label=\"Sklearn (fit_intercept=True)\")\n", + "plt.grid()\n", + "plt.legend()\n", + "\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The intercept is the value of our output/target variable\n", + "when all our features are zero and our function crosses the $y$-axis (for a one-dimensional case). \n", + "\n", + "Printing the MSE, we see first that both methods give the same MSE, as\n", + "they should. However, when we move to for example Ridge regression,\n", + "the way we treat the intercept may give a larger or smaller MSE,\n", + "meaning that the MSE can be penalized by the value of the\n", + "intercept. Not including the intercept in the fit, means that the\n", + "regularization term does not include $\\beta_0$. For different values\n", + "of $\\lambda$, this may lead to differeing MSE values. \n", + "\n", + "To remind the reader, the regularization term, with the intercept in Ridge regression, is given by" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\lambda \\vert\\vert \\boldsymbol{\\beta} \\vert\\vert_2^2 = \\lambda \\sum_{j=0}^{p-1}\\beta_j^2,\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "but when we take out the intercept, this equation becomes" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\lambda \\vert\\vert \\boldsymbol{\\beta} \\vert\\vert_2^2 = \\lambda \\sum_{j=1}^{p-1}\\beta_j^2.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "For Lasso regression we have" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\lambda \\vert\\vert \\boldsymbol{\\beta} \\vert\\vert_1 = \\lambda \\sum_{j=1}^{p-1}\\vert\\beta_j\\vert.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "It means that, when scaling the design matrix and the outputs/targets,\n", + "by subtracting the mean values, we have an optimization problem which\n", + "is not penalized by the intercept. The MSE value can then be smaller\n", + "since it focuses only on the remaining quantities. If we however bring\n", + "back the intercept, we will get a MSE which then contains the\n", + "intercept.\n", + "\n", + "\n", + "Armed with this wisdom, we attempt first to simply set the intercept equal to **False** in our implementation of Ridge regression for our well-known vanilla data set." + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Beta values for own Ridge implementation\n", + "[ 1.03032441e+00 6.28336218e-02 -6.24175744e-01 5.21169159e-02\n", + " 2.80847477e-01 2.12552073e-01 8.13220609e-02 -1.69634577e-02\n", + " -6.50846112e-02 -7.38962192e-02 -5.94226022e-02 -3.50227564e-02\n", + " -9.80609614e-03 1.08299273e-02 2.41882037e-02 2.93492130e-02\n", + " 2.64742912e-02 1.63249532e-02 -5.01831250e-05 -2.15098090e-02]\n", + "Beta values for Scikit-Learn Ridge implementation\n", + "[ 1.03032441e+00 6.28336218e-02 -6.24175744e-01 5.21169159e-02\n", + " 2.80847477e-01 2.12552073e-01 8.13220608e-02 -1.69634577e-02\n", + " -6.50846112e-02 -7.38962192e-02 -5.94226022e-02 -3.50227564e-02\n", + " -9.80609615e-03 1.08299273e-02 2.41882037e-02 2.93492130e-02\n", + " 2.64742912e-02 1.63249532e-02 -5.01831152e-05 -2.15098090e-02]\n", + "MSE values for own Ridge implementation\n", + "4.3632959273186007e-07\n", + "MSE values for Scikit-Learn Ridge implementation\n", + "4.363295916523824e-07\n", + "Beta values for own Ridge implementation\n", + "[ 1.03630548 -0.01963611 -0.37900111 -0.07062318 0.12182967 0.16343471\n", + " 0.13003291 0.07490892 0.02365049 -0.01449782 -0.03814292 -0.04909093\n", + " -0.05009826 -0.04389027 -0.03279636 -0.01866537 -0.00289724 0.01348565\n", + " 0.02976145 0.04543942]\n", + "Beta values for Scikit-Learn Ridge implementation\n", + "[ 1.03630548 -0.01963611 -0.37900111 -0.07062318 0.12182967 0.16343471\n", + " 0.13003291 0.07490892 0.02365049 -0.01449782 -0.03814292 -0.04909093\n", + " -0.05009826 -0.04389027 -0.03279636 -0.01866537 -0.00289724 0.01348565\n", + " 0.02976145 0.04543942]\n", + "MSE values for own Ridge implementation\n", + "5.194042826640948e-06\n", + "MSE values for Scikit-Learn Ridge implementation\n", + "5.194042826840599e-06\n", + "Beta values for own Ridge implementation\n", + "[ 1.04220758 -0.10931453 -0.17641709 -0.06020587 0.02208512 0.05789007\n", + " 0.06491736 0.05785343 0.04537385 0.03196357 0.01969145 0.00934499\n", + " 0.00107405 -0.00526348 -0.00992331 -0.01318643 -0.01531845 -0.01655318\n", + " -0.01708852 -0.01708781]\n", + "Beta values for Scikit-Learn Ridge implementation\n", + "[ 1.04220758 -0.10931453 -0.17641709 -0.06020587 0.02208512 0.05789007\n", + " 0.06491736 0.05785343 0.04537385 0.03196357 0.01969145 0.00934499\n", + " 0.00107405 -0.00526348 -0.00992331 -0.01318643 -0.01531845 -0.01655318\n", + " -0.01708852 -0.01708781]\n", + "MSE values for own Ridge implementation\n", + "2.094082198961287e-05\n", + "MSE values for Scikit-Learn Ridge implementation\n", + "2.0940821989631478e-05\n", + "Beta values for own Ridge implementation\n", + "[ 1.01219292 -0.06043581 -0.10391807 -0.05651951 -0.01898855 0.00312361\n", + " 0.01463049 0.01975848 0.02123176 0.02068067 0.01905883 0.01691985\n", + " 0.01458337 0.01223198 0.00996754 0.00784393 0.00588657 0.00410387\n", + " 0.00249435 0.00105081]\n", + "Beta values for Scikit-Learn Ridge implementation\n", + "[ 1.01219292 -0.06043581 -0.10391807 -0.05651951 -0.01898855 0.00312361\n", + " 0.01463049 0.01975848 0.02123176 0.02068067 0.01905883 0.01691985\n", + " 0.01458337 0.01223198 0.00996754 0.00784393 0.00588657 0.00410387\n", + " 0.00249435 0.00105081]\n", + "MSE values for own Ridge implementation\n", + "0.00031535148309579146\n", + "MSE values for Scikit-Learn Ridge implementation\n", + "0.00031535148309581185\n", + "Beta values for own Ridge implementation\n", + "[ 8.38916861e-01 1.31276579e-01 8.97497404e-03 -1.72271878e-02\n", + " -2.11744554e-02 -1.91492986e-02 -1.57201944e-02 -1.23002365e-02\n", + " -9.30466214e-03 -6.81048318e-03 -4.78184120e-03 -3.15130074e-03\n", + " -1.84923989e-03 -8.13661243e-04 7.46984697e-06 6.56636616e-04\n", + " 1.16805821e-03 1.56912044e-03 1.88168312e-03 2.12318726e-03]\n", + "Beta values for Scikit-Learn Ridge implementation\n", + "[ 8.38916861e-01 1.31276579e-01 8.97497404e-03 -1.72271878e-02\n", + " -2.11744554e-02 -1.91492986e-02 -1.57201944e-02 -1.23002365e-02\n", + " -9.30466214e-03 -6.81048318e-03 -4.78184120e-03 -3.15130074e-03\n", + " -1.84923989e-03 -8.13661243e-04 7.46984697e-06 6.56636616e-04\n", + " 1.16805821e-03 1.56912044e-03 1.88168312e-03 2.12318726e-03]\n", + "MSE values for own Ridge implementation\n", + "0.01507238889517716\n", + "MSE values for Scikit-Learn Ridge implementation\n", + "0.015072388895177083\n", + "Beta values for own Ridge implementation\n", + "[0.37396662 0.14174745 0.0764924 0.04892055 0.03447512 0.02586427\n", + " 0.02024962 0.01633913 0.01347916 0.0113104 0.0096208 0.00827728\n", + " 0.00719176 0.00630331 0.00556826 0.0049544 0.00443743 0.0039987\n", + " 0.0036237 0.003301 ]\n", + "Beta values for Scikit-Learn Ridge implementation\n", + "[0.37396662 0.14174745 0.0764924 0.04892055 0.03447512 0.02586427\n", + " 0.02024962 0.01633913 0.01347916 0.0113104 0.0096208 0.00827728\n", + " 0.00719176 0.00630331 0.00556826 0.0049544 0.00443743 0.0039987\n", + " 0.0036237 0.003301 ]\n", + "MSE values for own Ridge implementation\n", + "0.2640931530791003\n", + "MSE values for Scikit-Learn Ridge implementation\n", + "0.26409315307910036\n" + ] + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEGCAYAAAB/+QKOAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMywgaHR0cHM6Ly9tYXRwb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jz766JDu94EHHqBXr15kZmZy5513ArBz506GDBlCVlYWXbt25aWXXuKRRx7hyy+/5JxzzuGcc845jJ+oSOIoePMRzGHkyENvWR+O+tOCuPFGqO1349nZ8NBD1e42duxY7r77boYOHcrSpUu58sorK38h//rXv2bMmDH8+c9/5rzzzuOKK67gxBNPBEK/RLOzsyvP8+ijj9K/f//K5ZKSEi6//HLeeustOnbsyM9//nMef/xxrrvuusqWx9tvv03Xrl0pLCykrKyMPn36VB5fVlbGwoULmTFjBr///e958803D3gPJSUlLFiwgIcffvgH237/+99z5plncscddzB9+nSefvppAAoLCykoKGDJkiWUlpbSo0cPevbsCcD48eN54okn6NChAwsWLODaa69l9uzZB/05vvHGG6xevZqFCxfi7gwfPpx58+axYcMGTjzxxMoivG3bNpo1a8Yf//jHGrU8RBJF/rZ36V/RjONPObw3loeq/hSIAGVmZrJu3TpeeOGFyj6GfQYNGsTatWuZOXMmr732Gt27d2fZsmVA9Y+YVq1aRfv27enYsSMAl112GY899hg33ngjp556KitXrmThwoXcdNNNzJs3j/Ly8v0KzL5WRs+ePVm3bl3Ua+wrUp9++ilDhgyJ2sKZN28ekyZNAmDIkCEcc8wxALzzzjuMGDGC9PR00tPTGTZsGAA7duxg/vz5XHTRRZXn2LNnz8F+hECoQLzxxht079698jyrV6+mf//+3Hzzzdx6660MHTp0v3sUSVarCl9jWbM9PNx4SMyuUX8KxCG804+l4cOHc8sttzB37lw2bdq037Zjjz2WSy65hEsuuYShQ4cyb968ynfaNTVgwABee+010tLSOO+887j88sspLy/ngQceqNynUaNGQOjxUVlZWdTz7CtSGzdupF+/fkydOpXhw4cfUbaKigqaN29+2P0r7s5tt93G1Vdf/YNt77//PjNmzODf//3fOffcc7njjjuOKKNIvCuY+ScARo+IzeMlUB9Enbnyyiu588476dat237rZ8+eXflJm+3bt/PJJ59w8sknH9I5O3XqxLp161izZg0Azz33HGeddRYA/fv356GHHqJv3760atWKTZs2sWrVKrp27Vqj/C1btmTixIncd999P9g2YMAA/v73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QqeCD8S3000I7Q3AY/I/Tt5upEG9G0dXj4iS3uvifKMR8B/d29O6F5Of4zYlvXcI5ewL3ArvB+7xIaiXefJuG5Pa4FngmvuxP4f+7eBZgMnByx/5Xu3hPIAW4wsxYA7r4FaLRvWaQ6GotJkt2ZwAvuXg58Y2b/JPQL+UzgH+5eAXxtZnOO4BonABsOsK0Z8D9m1oHQvBxpEdvmhMfw325m24Bp4fUfApkR+70AoXkMzOxoC82qN4BQccHdp5vZloj9bzCzUeHXJxF6JLYpvPwtcGLEssgBqQUhcugONKLpbiD9AMfcQ6gQdAWGVdkvssVREbFcwf5v3qqOh3PA8XHM7GxCLaW+7p4FfFDlmunhvCLVUoGQZPc2MMbMUs2sFaF33gsJdUTnhvsijgPOPoRzTQV+Hu7X+Amwzd2/IjQVarsDHNOM74fFvryG97Cv3+TM8DW3EZq29JLw+guAfZ9OakbocdcuMzuN0DSUhPczQnNVrKthDqlnVCAk2U0GlgJLgNnAb8NzfBQQ6kNYAfwv8D6h2fcwsxvCo662AZaGO4EhNK/GWmANoU8sXQvg7juBT8zsx1Gu/wfgPjP7gJo/0i0JH/8EsG/k0d8DA8xsOaFHTfvmUZ8JNDCzlcBEQtO07tMTeC9iCleRg9JorlJvmVmGu+8Id9ouBPrVdIKo8DP/nu7+77UashaZ2cPAVHd/K+gskhjUSS312avhDt+GwD1HMnugu09OgE8HLVNxkMOhFoSIiESlPggREYlKBUJERKJSgRARkahUIEREJCoVCBERier/A5PsezvJwAMMAAAAAElFTkSuQmCC\n", + "text/plain": [ + "
        " + ] + }, + "metadata": { + "filenames": { + "image/png": "/Users/mhjensen/Teaching/MachineLearning/doc/LectureNotes/_build/jupyter_execute/chapter3_118_1.png" + }, + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "import numpy as np\n", + "import pandas as pd\n", + "import matplotlib.pyplot as plt\n", + "from sklearn.model_selection import train_test_split\n", + "from sklearn import linear_model\n", + "\n", + "def MSE(y_data,y_model):\n", + " n = np.size(y_model)\n", + " return np.sum((y_data-y_model)**2)/n\n", + "\n", + "\n", + "# A seed just to ensure that the random numbers are the same for every run.\n", + "# Useful for eventual debugging.\n", + "np.random.seed(3155)\n", + "\n", + "n = 100\n", + "x = np.random.rand(n)\n", + "y = np.exp(-x**2) + 1.5 * np.exp(-(x-2)**2)\n", + "\n", + "Maxpolydegree = 20\n", + "X = np.zeros((n,Maxpolydegree))\n", + "#We include explicitely the intercept column\n", + "for degree in range(Maxpolydegree):\n", + " X[:,degree] = x**degree\n", + "# We split the data in test and training data\n", + "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)\n", + "\n", + "p = Maxpolydegree\n", + "I = np.eye(p,p)\n", + "# Decide which values of lambda to use\n", + "nlambdas = 6\n", + "MSEOwnRidgePredict = np.zeros(nlambdas)\n", + "MSERidgePredict = np.zeros(nlambdas)\n", + "lambdas = np.logspace(-4, 2, nlambdas)\n", + "for i in range(nlambdas):\n", + " lmb = lambdas[i]\n", + " OwnRidgeBeta = np.linalg.pinv(X_train.T @ X_train+lmb*I) @ X_train.T @ y_train\n", + " # Note: we include the intercept column and no scaling\n", + " RegRidge = linear_model.Ridge(lmb,fit_intercept=False)\n", + " RegRidge.fit(X_train,y_train)\n", + " # and then make the prediction\n", + " ytildeOwnRidge = X_train @ OwnRidgeBeta\n", + " ypredictOwnRidge = X_test @ OwnRidgeBeta\n", + " ytildeRidge = RegRidge.predict(X_train)\n", + " ypredictRidge = RegRidge.predict(X_test)\n", + " MSEOwnRidgePredict[i] = MSE(y_test,ypredictOwnRidge)\n", + " MSERidgePredict[i] = MSE(y_test,ypredictRidge)\n", + " print(\"Beta values for own Ridge implementation\")\n", + " print(OwnRidgeBeta)\n", + " print(\"Beta values for Scikit-Learn Ridge implementation\")\n", + " print(RegRidge.coef_)\n", + " print(\"MSE values for own Ridge implementation\")\n", + " print(MSEOwnRidgePredict[i])\n", + " print(\"MSE values for Scikit-Learn Ridge implementation\")\n", + " print(MSERidgePredict[i])\n", + "\n", + "# Now plot the results\n", + "plt.figure()\n", + "plt.plot(np.log10(lambdas), MSEOwnRidgePredict, 'r', label = 'MSE own Ridge Test')\n", + "plt.plot(np.log10(lambdas), MSERidgePredict, 'g', label = 'MSE Ridge Test')\n", + "\n", + "plt.xlabel('log10(lambda)')\n", + "plt.ylabel('MSE')\n", + "plt.legend()\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The results here agree when we force **Scikit-Learn**'s Ridge function to include the first column in our design matrix.\n", + "We see that the results agree very well. Here we have thus explicitely included the intercept column in the design matrix.\n", + "What happens if we do not include the intercept in our fit?\n", + "Let us see how we can change this code by zero centering." + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Beta values for own Ridge implementation\n", + "[ 3.43579948e-02 -5.43330971e-01 -3.10141414e-03 2.47116868e-01\n", + " 2.18613217e-01 1.02054837e-01 -4.25617662e-04 -5.90475506e-02\n", + " -7.68534263e-02 -6.68929213e-02 -4.24906604e-02 -1.40927184e-02\n", + " 1.11482289e-02 2.88529063e-02 3.67047975e-02 3.38135733e-02\n", + " 2.02198702e-02 -3.46383924e-03 -3.63025821e-02]\n", + "Beta values for Scikit-Learn Ridge implementation\n", + "[ 3.43579948e-02 -5.43330971e-01 -3.10141413e-03 2.47116868e-01\n", + " 2.18613217e-01 1.02054837e-01 -4.25617658e-04 -5.90475506e-02\n", + " -7.68534263e-02 -6.68929213e-02 -4.24906604e-02 -1.40927184e-02\n", + " 1.11482289e-02 2.88529063e-02 3.67047975e-02 3.38135733e-02\n", + " 2.02198702e-02 -3.46383925e-03 -3.63025821e-02]\n", + "Intercept from own implementation:\n", + "1.0330308045181225\n", + "Intercept from Scikit-Learn Ridge implementation\n", + "1.033030804518383\n", + "MSE values for own Ridge implementation\n", + "3.139255958275475e-06\n", + "MSE values for Scikit-Learn Ridge implementation\n", + "3.139255958572018e-06\n", + "Beta values for own Ridge implementation\n", + "[-0.05807125 -0.29822833 -0.08551306 0.08156108 0.13679863 0.12333649\n", + " 0.08251519 0.03815288 0.00111756 -0.02498832 -0.04010697 -0.04566964\n", + " -0.04355837 -0.03562355 -0.02348765 -0.00848904 0.00831018 0.0260906\n", + " 0.04423486]\n", + "Beta values for Scikit-Learn Ridge implementation\n", + "[-0.05807125 -0.29822833 -0.08551306 0.08156108 0.13679863 0.12333649\n", + " 0.08251519 0.03815288 0.00111756 -0.02498832 -0.04010697 -0.04566964\n", + " -0.04355837 -0.03562355 -0.02348765 -0.00848904 0.00831018 0.0260906\n", + " 0.04423486]\n", + "Intercept from own implementation:\n", + "1.0411487294305548\n", + "Intercept from Scikit-Learn Ridge implementation\n", + "1.0411487294305266\n", + "MSE values for own Ridge implementation\n", + "1.9601304850163794e-05\n", + "MSE values for Scikit-Learn Ridge implementation\n", + "1.9601304850085328e-05\n", + "Beta values for own Ridge implementation\n", + "[-0.1416398 -0.14021063 -0.05383795 0.01367553 0.04784395 0.05796251\n", + " 0.05447415 0.044613 0.03267527 0.02098261 0.01066519 0.00217499\n", + " -0.00440346 -0.00917248 -0.01231917 -0.01405935 -0.0146081 -0.01416528\n", + " -0.01290947]\n", + "Beta values for Scikit-Learn Ridge implementation\n", + "[-0.1416398 -0.14021063 -0.05383795 0.01367553 0.04784395 0.05796251\n", + " 0.05447415 0.044613 0.03267527 0.02098261 0.01066519 0.00217499\n", + " -0.00440346 -0.00917248 -0.01231917 -0.01405935 -0.0146081 -0.01416528\n", + " -0.01290947]\n", + "Intercept from own implementation:\n", + "1.0495569966278282\n", + "Intercept from Scikit-Learn Ridge implementation\n", + "1.0495569966278269\n", + "MSE values for own Ridge implementation\n", + "5.4959161509370406e-05\n", + "MSE values for Scikit-Learn Ridge implementation\n", + "5.4959161509366834e-05\n", + "Beta values for own Ridge implementation\n", + "[-0.13535942 -0.08593216 -0.03568439 -0.0036367 0.01397146 0.02229529\n", + " 0.02503753 0.0245528 0.02228115 0.01908936 0.01549377 0.01179792\n", + " 0.00817631 0.00472512 0.00149311 -0.00149956 -0.00424967 -0.00676387\n", + " -0.00905423]\n", + "Beta values for Scikit-Learn Ridge implementation\n", + "[-0.13535942 -0.08593216 -0.03568439 -0.0036367 0.01397146 0.02229529\n", + " 0.02503753 0.0245528 0.02228115 0.01908936 0.01549377 0.01179792\n", + " 0.00817631 0.00472512 0.00149311 -0.00149956 -0.00424967 -0.00676387\n", + " -0.00905423]\n", + "Intercept from own implementation:\n", + "1.039967668952797\n", + "Intercept from Scikit-Learn Ridge implementation\n", + "1.0399676689527975\n", + "MSE values for own Ridge implementation\n", + "7.571105947979326e-05\n", + "MSE values for Scikit-Learn Ridge implementation\n", + "7.57110594797945e-05\n", + "Beta values for own Ridge implementation\n", + "[-0.05100875 -0.04063602 -0.02723445 -0.01713366 -0.0100706 -0.00517114\n", + " -0.00174276 0.00068734 0.00243186 0.00369758 0.00462287 0.0053018\n", + " 0.00579953 0.006162 0.00642221 0.00660427 0.00672607 0.0068011\n", + " 0.00683964]\n", + "Beta values for Scikit-Learn Ridge implementation\n", + "[-0.05100875 -0.04063602 -0.02723445 -0.01713366 -0.0100706 -0.00517114\n", + " -0.00174276 0.00068734 0.00243186 0.00369758 0.00462287 0.0053018\n", + " 0.00579953 0.006162 0.00642221 0.00660427 0.00672607 0.0068011\n", + " 0.00683964]\n", + "Intercept from own implementation:\n", + "0.999955585168597\n", + "Intercept from Scikit-Learn Ridge implementation\n", + "0.999955585168597\n", + "MSE values for own Ridge implementation\n", + "0.0007698473260556339\n", + "MSE values for Scikit-Learn Ridge implementation\n", + "0.000769847326055633\n", + "Beta values for own Ridge implementation\n", + "[-0.00834567 -0.00803064 -0.00673407 -0.00554552 -0.00458878 -0.0038335\n", + " -0.00323332 -0.00274989 -0.0023548 -0.00202756 -0.00175331 -0.00152117\n", + " -0.001323 -0.0011526 -0.00100519 -0.00087697 -0.00076495 -0.00066668\n", + " -0.00058016]\n", + "Beta values for Scikit-Learn Ridge implementation\n", + "[-0.00834567 -0.00803064 -0.00673407 -0.00554552 -0.00458878 -0.0038335\n", + " -0.00323332 -0.00274989 -0.0023548 -0.00202756 -0.00175331 -0.00152117\n", + " -0.001323 -0.0011526 -0.00100519 -0.00087697 -0.00076495 -0.00066668\n", + " -0.00058016]\n", + "Intercept from own implementation:\n", + "0.9637117593816477\n", + "Intercept from Scikit-Learn Ridge implementation\n", + "0.9637117593816477\n", + "MSE values for own Ridge implementation\n", + "0.0023813163025848865\n", + "MSE values for Scikit-Learn Ridge implementation\n", + "0.002381316302584886\n" + ] + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZQAAAEKCAYAAAA1qaOTAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Il7ecAAAACXBIWXMAAAsTAAALEwEAmpwYAAA0tUlEQVR4nO3dd3xUVdrA8d+TDoQOIp2ICIYWpIkURUBRIthYiUoRfLHAsor6CjZEdC0oYAHWBjaWIliiUgTFF1dUitKLFFFBpISWEFLnef+YSzaEFAgzuZPk+X4+89m595x77nNGdp6ce+6cK6qKMcYYc66C3A7AGGNMyWAJxRhjjE9YQjHGGOMTllCMMcb4hCUUY4wxPmEJxRhjjE/4NaGISE8R2Soi20VkVC7l4SIy2yn/UUQaZCsb7ezfKiJXO/vqishSEdkkIhtF5B/Z6j8pIntEZI3zutaffTPGGHMq8dfvUEQkGPgF6AHsBlYCcaq6KVude4EWqnq3iPQDblDVW0QkGpgJtANqAUuAi4DzgJqq+pOIlAdWA9er6iYReRJIUtUX/dIhY4wx+fLnCKUdsF1Vd6pqGjAL6JOjTh/gXef9XKCbiIizf5aqpqrqr8B2oJ2q7lXVnwBUNRHYDNT2Yx+MMcacoRA/tl0b+CPb9m6gfV51VDVDRI4CVZ39P+Q49pTE4VweawX8mG33cBEZAKwCHlDVwzmDEpGhwFCAcuXKtW7SpMlZd8wYY0qz1atX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YAAAAASUVORK5CYII=\n", + "text/plain": [ + "
        " + ] + }, + "metadata": { + "filenames": { + "image/png": "/Users/mhjensen/Teaching/MachineLearning/doc/LectureNotes/_build/jupyter_execute/chapter3_120_1.png" + }, + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "import numpy as np\n", + "import pandas as pd\n", + "import matplotlib.pyplot as plt\n", + "from sklearn.model_selection import train_test_split\n", + "from sklearn import linear_model\n", + "from sklearn.preprocessing import StandardScaler\n", + "\n", + "def MSE(y_data,y_model):\n", + " n = np.size(y_model)\n", + " return np.sum((y_data-y_model)**2)/n\n", + "# A seed just to ensure that the random numbers are the same for every run.\n", + "# Useful for eventual debugging.\n", + "np.random.seed(315)\n", + "\n", + "n = 100\n", + "x = np.random.rand(n)\n", + "y = np.exp(-x**2) + 1.5 * np.exp(-(x-2)**2)\n", + "\n", + "Maxpolydegree = 20\n", + "X = np.zeros((n,Maxpolydegree-1))\n", + "\n", + "for degree in range(1,Maxpolydegree): #No intercept column\n", + " X[:,degree-1] = x**(degree)\n", + "\n", + "# We split the data in test and training data\n", + "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)\n", + "\n", + "#For our own implementation, we will need to deal with the intercept by centering the design matrix and the target variable\n", + "X_train_mean = np.mean(X_train,axis=0)\n", + "#Center by removing mean from each feature\n", + "X_train_scaled = X_train - X_train_mean \n", + "X_test_scaled = X_test - X_train_mean\n", + "#The model intercept (called y_scaler) is given by the mean of the target variable (IF X is centered)\n", + "#Remove the intercept from the training data.\n", + "y_scaler = np.mean(y_train) \n", + "y_train_scaled = y_train - y_scaler \n", + "\n", + "p = Maxpolydegree-1\n", + "I = np.eye(p,p)\n", + "# Decide which values of lambda to use\n", + "nlambdas = 6\n", + "MSEOwnRidgePredict = np.zeros(nlambdas)\n", + "MSERidgePredict = np.zeros(nlambdas)\n", + "\n", + "lambdas = np.logspace(-4, 2, nlambdas)\n", + "for i in range(nlambdas):\n", + " lmb = lambdas[i]\n", + " OwnRidgeBeta = np.linalg.pinv(X_train_scaled.T @ X_train_scaled+lmb*I) @ X_train_scaled.T @ (y_train_scaled)\n", + " intercept_ = y_scaler - X_train_mean@OwnRidgeBeta #The intercept can be shifted so the model can predict on uncentered data\n", + " #Add intercept to prediction\n", + " ypredictOwnRidge = X_test @ OwnRidgeBeta + intercept_ \n", + " #Add intercept to prediction\n", + " ypredictOwnRidge = X_test_scaled @ OwnRidgeBeta + y_scaler \n", + " RegRidge = linear_model.Ridge(lmb)\n", + " RegRidge.fit(X_train,y_train)\n", + " ypredictRidge = RegRidge.predict(X_test)\n", + " MSEOwnRidgePredict[i] = MSE(y_test,ypredictOwnRidge)\n", + " MSERidgePredict[i] = MSE(y_test,ypredictRidge)\n", + " print(\"Beta values for own Ridge implementation\")\n", + " print(OwnRidgeBeta) #Intercept is given by mean of target variable\n", + " print(\"Beta values for Scikit-Learn Ridge implementation\")\n", + " print(RegRidge.coef_)\n", + " print('Intercept from own implementation:')\n", + " print(intercept_)\n", + " print('Intercept from Scikit-Learn Ridge implementation')\n", + " print(RegRidge.intercept_)\n", + " print(\"MSE values for own Ridge implementation\")\n", + " print(MSEOwnRidgePredict[i])\n", + " print(\"MSE values for Scikit-Learn Ridge implementation\")\n", + " print(MSERidgePredict[i])\n", + "\n", + "\n", + "# Now plot the results\n", + "plt.figure()\n", + "plt.plot(np.log10(lambdas), MSEOwnRidgePredict, 'b--', label = 'MSE own Ridge Test')\n", + "plt.plot(np.log10(lambdas), MSERidgePredict, 'g--', label = 'MSE SL Ridge Test')\n", + "plt.xlabel('log10(lambda)')\n", + "plt.ylabel('MSE')\n", + "plt.legend()\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We see here, when compared to the code which includes explicitely the\n", + "intercept column, that our MSE value is actually smaller. This is\n", + "because the regularization term does not include the intercept value\n", + "$\\beta_0$ in the fitting. This applies to Lasso regularization as\n", + "well. It means that our optimization is now done only with the\n", + "centered matrix and/or vector that enter the fitting procedure. Note\n", + "also that the problem with the intercept occurs mainly in these type\n", + "of polynomial fitting problem.\n", + "\n", + "The next example is indeed an example where all these discussions about the role of intercept are not present.\n", + "\n", + "## More complicated Example: The Ising model\n", + "\n", + "The one-dimensional Ising model with nearest neighbor interaction, no\n", + "external field and a constant coupling constant $J$ is given by" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
        \n", + "\n", + "$$\n", + "\\begin{equation}\n", + " H = -J \\sum_{k}^L s_k s_{k + 1},\n", + "\\label{_auto1} \\tag{1}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "where $s_i \\in \\{-1, 1\\}$ and $s_{N + 1} = s_1$. The number of spins\n", + "in the system is determined by $L$. For the one-dimensional system\n", + "there is no phase transition.\n", + "\n", + "We will look at a system of $L = 40$ spins with a coupling constant of\n", + "$J = 1$. To get enough training data we will generate 10000 states\n", + "with their respective energies." + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "from mpl_toolkits.axes_grid1 import make_axes_locatable\n", + "import seaborn as sns\n", + "import scipy.linalg as scl\n", + "from sklearn.model_selection import train_test_split\n", + "import tqdm\n", + "sns.set(color_codes=True)\n", + "cmap_args=dict(vmin=-1., vmax=1., cmap='seismic')\n", + "\n", + "L = 40\n", + "n = int(1e4)\n", + "\n", + "spins = np.random.choice([-1, 1], size=(n, L))\n", + "J = 1.0\n", + "\n", + "energies = np.zeros(n)\n", + "\n", + "for i in range(n):\n", + " energies[i] = - J * np.dot(spins[i], np.roll(spins[i], 1))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Here we use ordinary least squares\n", + "regression to predict the energy for the nearest neighbor\n", + "one-dimensional Ising model on a ring, i.e., the endpoints wrap\n", + "around. We will use linear regression to fit a value for\n", + "the coupling constant to achieve this.\n", + "\n", + "A more general form for the one-dimensional Ising model is" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
        \n", + "\n", + "$$\n", + "\\begin{equation}\n", + " H = - \\sum_j^L \\sum_k^L s_j s_k J_{jk}.\n", + "\\label{_auto2} \\tag{2}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Here we allow for interactions beyond the nearest neighbors and a state dependent\n", + "coupling constant. This latter expression can be formulated as\n", + "a matrix-product" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
        \n", + "\n", + "$$\n", + "\\begin{equation}\n", + " \\boldsymbol{H} = \\boldsymbol{X} J,\n", + "\\label{_auto3} \\tag{3}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "where $X_{jk} = s_j s_k$ and $J$ is a matrix which consists of the\n", + "elements $-J_{jk}$. This form of writing the energy fits perfectly\n", + "with the form utilized in linear regression, that is" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
        \n", + "\n", + "$$\n", + "\\begin{equation}\n", + " \\boldsymbol{y} = \\boldsymbol{X}\\boldsymbol{\\beta} + \\boldsymbol{\\epsilon},\n", + "\\label{_auto4} \\tag{4}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We split the data in training and test data as discussed in the previous example" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "X = np.zeros((n, L ** 2))\n", + "for i in range(n):\n", + " X[i] = np.outer(spins[i], spins[i]).ravel()\n", + "y = energies\n", + "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In the ordinary least squares method we choose the cost function" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
        \n", + "\n", + "$$\n", + "\\begin{equation}\n", + " C(\\boldsymbol{X}, \\boldsymbol{\\beta})= \\frac{1}{n}\\left\\{(\\boldsymbol{X}\\boldsymbol{\\beta} - \\boldsymbol{y})^T(\\boldsymbol{X}\\boldsymbol{\\beta} - \\boldsymbol{y})\\right\\}.\n", + "\\label{_auto5} \\tag{5}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We then find the extremal point of $C$ by taking the derivative with respect to $\\boldsymbol{\\beta}$ as discussed above.\n", + "This yields the expression for $\\boldsymbol{\\beta}$ to be" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\boldsymbol{\\beta} = \\frac{\\boldsymbol{X}^T \\boldsymbol{y}}{\\boldsymbol{X}^T \\boldsymbol{X}},\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "which immediately imposes some requirements on $\\boldsymbol{X}$ as there must exist\n", + "an inverse of $\\boldsymbol{X}^T \\boldsymbol{X}$. If the expression we are modeling contains an\n", + "intercept, i.e., a constant term, we must make sure that the\n", + "first column of $\\boldsymbol{X}$ consists of $1$. We do this here" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "X_train_own = np.concatenate(\n", + " (np.ones(len(X_train))[:, np.newaxis], X_train),\n", + " axis=1\n", + ")\n", + "X_test_own = np.concatenate(\n", + " (np.ones(len(X_test))[:, np.newaxis], X_test),\n", + " axis=1\n", + ")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Doing the inversion directly turns out to be a bad idea since the matrix\n", + "$\\boldsymbol{X}^T\\boldsymbol{X}$ is singular. An alternative approach is to use the **singular\n", + "value decomposition**. Using the definition of the Moore-Penrose\n", + "pseudoinverse we can write the equation for $\\boldsymbol{\\beta}$ as" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\boldsymbol{\\beta} = \\boldsymbol{X}^{+}\\boldsymbol{y},\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "where the pseudoinverse of $\\boldsymbol{X}$ is given by" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\boldsymbol{X}^{+} = \\frac{\\boldsymbol{X}^T}{\\boldsymbol{X}^T\\boldsymbol{X}}.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Using singular value decomposition we can decompose the matrix $\\boldsymbol{X} = \\boldsymbol{U}\\boldsymbol{\\Sigma} \\boldsymbol{V}^T$,\n", + "where $\\boldsymbol{U}$ and $\\boldsymbol{V}$ are orthogonal(unitary) matrices and $\\boldsymbol{\\Sigma}$ contains the singular values (more details below).\n", + "where $X^{+} = V\\Sigma^{+} U^T$. This reduces the equation for\n", + "$\\omega$ to" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
        \n", + "\n", + "$$\n", + "\\begin{equation}\n", + " \\boldsymbol{\\beta} = \\boldsymbol{V}\\boldsymbol{\\Sigma}^{+} \\boldsymbol{U}^T \\boldsymbol{y}.\n", + "\\label{_auto6} \\tag{6}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Note that solving this equation by actually doing the pseudoinverse\n", + "(which is what we will do) is not a good idea as this operation scales\n", + "as $\\mathcal{O}(n^3)$, where $n$ is the number of elements in a\n", + "general matrix. Instead, doing $QR$-factorization and solving the\n", + "linear system as an equation would reduce this down to\n", + "$\\mathcal{O}(n^2)$ operations." + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "def ols_svd(x: np.ndarray, y: np.ndarray) -> np.ndarray:\n", + " u, s, v = scl.svd(x)\n", + " return v.T @ scl.pinv(scl.diagsvd(s, u.shape[0], v.shape[0])) @ u.T @ y" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "beta = ols_svd(X_train_own,y_train)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "When extracting the $J$-matrix we need to make sure that we remove the intercept, as is done here" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "J = beta[1:].reshape(L, L)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "A way of looking at the coefficients in $J$ is to plot the matrices as images." + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + ":7: UserWarning: FixedFormatter should only be used together with FixedLocator\n", + " cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)\n" + ] + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAA4IAAAM2CAYAAACjUj0CAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Il7ecAAAACXBIWXMAAAsTAAALEwEAmpwYAABOKUlEQVR4nO3dfYxc1Zkg/Kerev2FcRS/cSxjh0/hmVmjgN8RTYZ9N7DEsYmB2IhvOUPAAbKI+QNQloAWxAyaDAKyY4mQZdGYIYNpIFhLYJFZEiXaSZhgBSVkZwnYDhjDGmO+guOPNth0Vb1/GDfptN19yz5ddarv7ychpKrje5/73HNv1dPn1LldjUajEQAAAJRGpd0BAAAA0FoKQQAAgJJRCAIAAJSMQhAAAKBkFIIAAAAloxAEAAAome52BwBA59u9e3f09vbGqlWr4pVXXomurq44/PDD44wzzogLLrggDj300IG2119/ffzgBz+In/zkJzFr1qxht1uv1+P73/9+/OAHP4iXX3456vV6zJw5M+bNmxeXXXbZoO0CAMUpBAE4KG+99VZcdtll8dJLL8W8efPi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RHbDFyG5pVL/C3gUrhdnmenyKxt0OxfLWn36fMWcr4c+1jKaU8xs4+j519z6/Vqsm2Va0O88v/JhWNq0i7lHE1al3JtpVSqz8/in7e5izXe1hKucaVUrrzOPZzlavNmzdH7Y9Wjsm2EAQAAOgkua4aumTJkti0adOg9xSCAAAAY1hvb68RQQAAgDKZMWPGkNcKF4JPP/103H333fHCCy9EpVKJ448/Pq6++uo44YQTBtqce+658fzzzw/5twsWLIg777zzwKIGAADoAJ20amihQvDZZ5+Nyy+/PI499ti45ppror+/Px588MH4yle+Eg8++GB89rOfjUajEevXr4958+bF/PnzB/37mTNnHtQBAAAAkE6hQvDv/u7vYsaMGfHII4/ExIkTIyJi8eLFsXDhwli2bFncd9998frrr8fOnTvjC1/4QixatGhUgwYAAODAjVgIbt26NdauXRuXXnrpQBEYEfGpT30qTjzxxPj5z38eEREvv/xyREQcc8wxoxQqAABAvnJdNXRfRiwEJ0+eHE899dSgInCvLVu2RLW659lCL730UkR8XAju3LkzJk2adCDxAgAAMIpGfKpjtVqNI488MqZPnz7o9bVr18Zzzz0Xc+fOjYg9heAhhxwSt956a8ydOzfmzp0b8+bNi1WrVo1O5AAAAByQA3p8RF9fX3zzm9+MiIgrrrgiIvZMDe3r64vt27fH7bffHtu2bYv7778/rr322vjwww9j8eLFze2kMmKNWqwNTSma0WKpT3d+ynGmCx5lG/p92j12+Nns4PtOx59HuY+IiEajmnBrxRRJfTviarV29MAO7vYf6dzvAp2f+5Qko6gxt2roH3r//ffjyiuvjLVr18bXv/716OnpiYiI888/P+r1eixZsmSg7RlnnBFnnnlm3HHHHXHWWWcNTCMtpF4f/v1KZeQ2NK1e4EIvmvpKpDs/ReLqdIXy1aZ+nzL/KftFy3X4faejz6PcD6hWh/nBR5NqtZE/l4umPmVcjVpXsm2l1OrPog7v9hHRud8FxkLuU0p2HlXXWWnqbGzbti2WLl0av/jFL+Kcc86Ja665ZuC9iy66aFARGBExYcKEWLRoUbz77rsDi8kAAADQXoVHBH/3u9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2Lq/emOsavaSLatWq2abFuVhN+aiowYVKJYn865f6W8Jlv5XaBo7nPW6fEz+rItBAEAADqJVUMBAADIlkIQAACgZEwNBQAASMCqoQAAAGRLIQgAAFAypoYCAAAkYNVQAAAAsqUQBAAAKBlTQwEAABKwaigAAADZUggCAACUjKmhAAAACVg1FAAAgGwpBAEAAErG1FAAAIAErBoKAABAthSCAAAAJTPmp4bWE9a6lagn21bKuBgbivWvStJ+WFSu11FKRY6xUrBdSrned1odV9Hc55qvMuQ+peGmMjWrO+E3nZTTvarVkQ+y0agWalerVVOExAHK9XMtJd9bi7NqKAAAANlSCAIAAJTMmJ8aCgAA0ApWDQUAACBbCkEAAICSMTUUAAAgAauGAgAAkC2FIAAAQMmYGgoAAJCAVUMBAADIlkIQAACgZEwNBQAASMCqoQAAAGRLIQgAAFAypoYCAAAkYNVQAAAAsqUQBAAAKBlTQwEAABLopFVDFYJNqCccQK1EPdm2UipyjJXC7fI8xpRxpewTKXOfWq7nMqVix1hpeS7acb6LyDWuMsg197neJ/r70+WrWh3mxzZNqtWqydp1J/42V+/P83MypZH7a+vv9xH5ftdMt608+0MZbN68OWp/9INBhSAAAMAYtmTJkti0adOg1xSCAAAACTQa9Wg02h3Fx/bEUone3l4jggAAAGUyY8aMIa8Vnqi7evXquOiii2Lu3Lnx7//9v49vfetb0dfXN6jNxo0b46/+6q+ip6cnenp64rrrrov33nvv4CMHAAAgmUIjgqtXr46lS5fGnDlz4hvf+EZs3rw57r///vjNb34Tvb29UalUYsuWLfHVr341du/eHZdddlnUarW49957Y926dbFy5coYN27caB8LAABAG6VbVCqdfY/9FSoE77jjjpgxY0Y88MADMWHChIjYM7x4yy23xNNPPx2nnHJKfO9734s333wznnjiiTjmmGMiIuL444+PSy+9NB577LE4//zzEx0IAAAAB2PEqaG7du2KT37yk3H++ecPFIERET09PRERsW7duoiIWLVqVfT09AwUgRERJ598chx11FGxatWq1HEDAABkph57RgVz+W//j/4YcURw/Pjxce+99w55fc2aNRERcdhhh8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XwAAACUjBFBAACAJDxQHgAAgEwpBAEAAErG1FAAAIAkTA0FAAAgUwpBAACAkjE1FAAAIIlGDPcQ99Zr7PcdI4IAAAAloxAEAAAoGVNDAQAAkrBqKAAAAJlSCAIAAJSMqaEAAABJmBoKAABAphSCAAAAJWNqKAAAQBL1yGtq6P4fbq8QBAAAGMM2b94ctdrgAjXbQrAyTPW6t8XIbRgrcj3X9YSzq3M9xtRyPc5icRW776TsF7lq9TFW2rLPPPtqSrn2+5S5zzWusmjUupJtq6uabpSlVquO2Ka/v9i2uhN+m64X3GehbWXZ98f+52OulixZEps2bRr0WraFIAAAQGfJc9XQ3t7ezhkRBAAA4ODNmDFjyGvGZwEAAEqm8Ijg6tWr484774y1a9fG5MmT4/TTT4+rr746DjnkkIE25557bjz//PND/u2CBQvizjvvTBMxAABAluox3EqdrXeQq4auXr06li5dGnPmzIlvfOMbsXnz5rj//vvjN7/5TfT29kalUolGoxHr16+PefPmxfz58wf9+5kzZx5c/AAAACRTqBC84447YsaMGfHAAw/EhAkTImLPPNNbbrklnn766TjllFPi9ddfj507d8YXvvCFWLRo0agGDQAAwIEb8TeCu3btik9+8pNx/vnnDxSBERE9PT0REbFu3bqIiHj55ZcjIuKYY44ZjTgBAAAyt/eB8rn8dxBTQ8ePHx/33nvvkNfXrFkTERGHHXZYRES89NJLEfFxIbhz586YNGnSSJsHAACgxZpeNXTTpk3x6KOPxre+9a2YPXt2fPGLX4yIPYXgIYccErfeemvMnTs35s6dG/PmzYtVq1YlDxoAAIAD19RzBH//+9/HaaedFhEREydOjBtvvDHGjx8fEXumhvb19cX27dvj9ttvj23btsX9998f1157bXz44YexePHi5iKrFKhRi7TJVOdGvkex1Hf6UY4s7REW3FqB5KfP/Ng/l4W1Jf9EtOOWn26H+faJXO87uea+DWeyg7/rpNZotHZ/RVNfT7pApL7f+fJ8oPy+dDUaxS+rrVu3xs9//vPYvXt3rFixItasWRPLli2LBQsWxEMPPRT1ej2WLFky0P6DDz6IM888M95///342c9+F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AQMkoBAEAAEpGIQgAAFAyCkEAAICSUQgCAACUjEIQAACgZBSCAAAAJdPd7gCatXHjxrjtttvi2WefjYiIU089Na6//vqYOnVqmyMb+84999x4/vnnh7y+YMGCuPPOO9sQ0dh30003xauvvhorVqwY9LrroDX2l3/XQnpPP/103H333fHCCy9EpVKJ448/Pq6++uo44YQTBtro96OjSO71+dGzevXquPPOO2Pt2rUxefLkOP300+Pqq6+OQw45ZKCNvj86iuRe32cs66hCcMuWLfHVr341du/eHZdddlnUarW49957Y926dbFy5coYN25cu0McsxqNRqxfvz7mzZsX8+fPH/TezJkz2xTV2LZy5cp45JFHoqenZ9DrroPW2F/+XQvpPfvss3H55ZfHscceG9dcc0309/fHgw8+GF/5ylfiwQcfjM9+9rP6/Sgpknt9fvSsXr06li5dGnPmzIlvfOMbsXnz5rj//vvjN7/5TfT29kalUtH3R0mR3Ov7jHmNDvL3f//3jT/7sz9rvPzyywOv/fznP2/Mnj278f3vf7+NkY19//f//t/G7NmzG//9v//3docy5vX39ze+853vNP7kT/6kMXv27MZXvvKVQe+7DkbXSPl3LaS3aNGixqmnntrYuXPnwGvvvPNO48QTT2xccskljUZDvx8tRXKvz4+es88+u/Ef/sN/aLz//vsDrz3wwAON2bNnN/75n/+50Wjo+6OlSO71fca6jvqN4KpVq6KnpyeOOeaYgddOPvnkOOqoo2LVqlVtjGzse/nllyMiBuWe9Hbt2hVnn312fOc734lFixbF9OnTh7RxHYyeIvl3LaS1devWWLt2bZx++ukxceLEgdc/9alPxYknnhi//vWvI0K/Hw1Fc6/Pj45du3bFJz/5yTj//PNjwoQJA6/vnYWwbt26iND3R0PR3Ov7jHUdMzV069atsXHjxliwYMGQ9+bMmRM//elP2xBVebz00ksR8fHNcOfOnTFp0qR2hjQm7dq1K3bs2BHLli2LhQsXxmmnnTbofdfB6Bop/xGuhdQmT54cTz311KBCZK8tW7ZEtVrV70dJkdxH6POjZfz48XHvvfcOeX3NmjUREXHYYYfp+6OkSO4j9H3Gvo4ZEXzrrbciIvb5F/pp06bF9u3bY/v27a0OqzReeumlOOSQQ+LWW2+NuXPnxty5c2PevHn+GpnY5MmT40c/+lEsXLhwn++7DkbXSPmPcC2kVq1W48gjjxzSp9euXRvPPfdczJ07V78fJUVyH6HPt8qmTZvi0UcfjW9961sxe/bs+OIXv6jvt8i+ch+h7zP2dcyIYF9fX0TEPv9yOX78+IjY85eaQw89tKVxlcXLL78cfX19sX379rj99ttj27Ztcf/998e1114bH374YSxevLjdIY4JlUolKpX9/33GdTC6Rsp/hGuhFfr6+uKb3/xmRERcccUV+n0L/XHuI/T5Vvj9738/MANh4sSJceONN8b48eP1/RbYX+4j9H3Gvo4pBBuNxohturq6WhBJOZ1//vlRr9djyZIlA6+dccYZceaZZ8Ydd9wRZ5111sA0IkaP66D9XAuj6/33348rr7wy1q5dG1//+tejp6cnnnvuuRH/nX5/8PaV+wh9vhW6urpi2bJlsXv37lixYkVceumlsWzZspg2bVqhf8uB21/uFyxYoO8z5nXM1NC9c7J37do15L29r02ePLmlMZXJRRddNOhGGBExYcKEWLRoUbz77rsDP6hmdLkO2s+1MHq2bdsWS5cujV/84hdxzjnnxDXXXBMR+n0r7C/3Efp8K3ziE5+IhQsXxuLFi6O3tzcOO+ywuPXWW/X9Fthf7iP0fca+jikE9/5w95133hny3ttvvx1TpkzxA9422Psw2507d7Y5knJwHeTLtXBwfve738XFF18czz33XFxwwQXxrW99a2CkQ78fXcPlfjj6/OiYMGFCnHrqqbF58+b49Kc/HRH6fqv8Ye7fe++9/bbT9xkrOqYQnDJlSsyaNSteeOGFIe+9+OKLcdxxx7UhqnJ466234owzzoi77rpryHsbNmyIiIhZs2a1OqxSch20l2thdOzYsSO+9rWvxZo1a+KSSy6JW265ZVAhot+PnpFyr8+PnvXr18dpp50Wvb29Q97r6+uLrq6uGDdunL4/Cork/v3339f3GfM6phCMiJg/f36sXr061q9fP/DaM888Exs2bBh2lT8OzvTp02Pbtm2xcuXK2LFjx8Drb7zxRjz66KNx0kknFfodA2m4DtrHtTA6brnlllizZk1cfPHFccMNN+yzjX4/OkbKvT4/eo444ojYvn17PPzww7F79+6B1zdt2hQ//OEP48QTT4zJkyfr+6OgSO5nzpyp7zPmdTWKrD6Riffeey/OPPPMqFarsXTp0ti1a1csX748Dj/88Hj44Ydj3Lhx7Q5xzPrxj38cV111VRx77LFx3nnnRV9fX/T29saHH34YDz30kIetjpLTTjstZs6cGStWrBh4zXXQOvvKv2shrfXr18fChQtjypQpccMNN+xz4YVFixbp96OgaO71+dHz+OOPx3XXXRcnnHBCfPnLX44tW7YM5PbBBx+M2bNn6/ujpEju9X3Guo4qBCMiXnnllbj11lvjl7/8ZUyYMCFOOeWUuO666wbmazN6fvzjH8c999wTa9eujQkTJkRPT09ce+21boSjaF+FSITroFX2l3/XQjoPPfRQ/PVf//WwbdatWxcR+n1qzeRenx89Tz75ZCxfvjx++9vfxqRJk+Jzn/tcXHPNNXHUUUcNtNH3R0eR3Ov7jGUdVwgCAABwcDrqN4IAAAAcPIUgAABAySgEAQAASkYhCAAAUDIKQQAAgJJRCAIAAJSMQhAAAKBkFIIAAAAloxAEAAAomf8fcpttBfj//P0AAAAASUVORK5CYII=\n", + "text/plain": [ + "
        " + ] + }, + "metadata": { + "filenames": { + "image/png": "/Users/mhjensen/Teaching/MachineLearning/doc/LectureNotes/_build/jupyter_execute/chapter3_151_1.png" + } + }, + "output_type": "display_data" + } + ], + "source": [ + "fig = plt.figure(figsize=(20, 14))\n", + "im = plt.imshow(J, **cmap_args)\n", + "plt.title(\"OLS\", fontsize=18)\n", + "plt.xticks(fontsize=18)\n", + "plt.yticks(fontsize=18)\n", + "cb = fig.colorbar(im)\n", + "cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "It is interesting to note that OLS\n", + "considers both $J_{j, j + 1} = -0.5$ and $J_{j, j - 1} = -0.5$ as\n", + "valid matrix elements for $J$.\n", + "In our discussion below on hyperparameters and Ridge and Lasso regression we will see that\n", + "this problem can be removed, partly and only with Lasso regression. \n", + "\n", + "In this case our matrix inversion was actually possible. The obvious question now is what is the mathematics behind the SVD?\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "Let us now \n", + "focus on Ridge and Lasso regression as well. We repeat some of the\n", + "basic parts of the Ising model and the setup of the training and test\n", + "data. The one-dimensional Ising model with nearest neighbor\n", + "interaction, no external field and a constant coupling constant $J$ is\n", + "given by" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
        \n", + "\n", + "$$\n", + "\\begin{equation}\n", + " H = -J \\sum_{k}^L s_k s_{k + 1},\n", + "\\label{_auto7} \\tag{7}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "where $s_i \\in \\{-1, 1\\}$ and $s_{N + 1} = s_1$. The number of spins in the system is determined by $L$. For the one-dimensional system there is no phase transition.\n", + "\n", + "We will look at a system of $L = 40$ spins with a coupling constant of $J = 1$. To get enough training data we will generate 10000 states with their respective energies." + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "from mpl_toolkits.axes_grid1 import make_axes_locatable\n", + "import seaborn as sns\n", + "import scipy.linalg as scl\n", + "from sklearn.model_selection import train_test_split\n", + "import sklearn.linear_model as skl\n", + "import tqdm\n", + "sns.set(color_codes=True)\n", + "cmap_args=dict(vmin=-1., vmax=1., cmap='seismic')\n", + "\n", + "L = 40\n", + "n = int(1e4)\n", + "\n", + "spins = np.random.choice([-1, 1], size=(n, L))\n", + "J = 1.0\n", + "\n", + "energies = np.zeros(n)\n", + "\n", + "for i in range(n):\n", + " energies[i] = - J * np.dot(spins[i], np.roll(spins[i], 1))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "A more general form for the one-dimensional Ising model is" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
        \n", + "\n", + "$$\n", + "\\begin{equation}\n", + " H = - \\sum_j^L \\sum_k^L s_j s_k J_{jk}.\n", + "\\label{_auto8} \\tag{8}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Here we allow for interactions beyond the nearest neighbors and a more\n", + "adaptive coupling matrix. This latter expression can be formulated as\n", + "a matrix-product on the form" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
        \n", + "\n", + "$$\n", + "\\begin{equation}\n", + " H = X J,\n", + "\\label{_auto9} \\tag{9}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "where $X_{jk} = s_j s_k$ and $J$ is the matrix consisting of the\n", + "elements $-J_{jk}$. This form of writing the energy fits perfectly\n", + "with the form utilized in linear regression, viz." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
        \n", + "\n", + "$$\n", + "\\begin{equation}\n", + " \\boldsymbol{y} = \\boldsymbol{X}\\boldsymbol{\\beta} + \\boldsymbol{\\epsilon}.\n", + "\\label{_auto10} \\tag{10}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We organize the data as we did above" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "X = np.zeros((n, L ** 2))\n", + "for i in range(n):\n", + " X[i] = np.outer(spins[i], spins[i]).ravel()\n", + "y = energies\n", + "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.96)\n", + "\n", + "X_train_own = np.concatenate(\n", + " (np.ones(len(X_train))[:, np.newaxis], X_train),\n", + " axis=1\n", + ")\n", + "\n", + "X_test_own = np.concatenate(\n", + " (np.ones(len(X_test))[:, np.newaxis], X_test),\n", + " axis=1\n", + ")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We will do all fitting with **Scikit-Learn**," + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "clf = skl.LinearRegression().fit(X_train, y_train)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "When extracting the $J$-matrix we make sure to remove the intercept" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "J_sk = clf.coef_.reshape(L, L)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "And then we plot the results" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + ":7: UserWarning: FixedFormatter should only be used together with FixedLocator\n", + " cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)\n" + ] + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAA4IAAAM2CAYAAACjUj0CAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Il7ecAAAACXBIWXMAAAsTAAALEwEAmpwYAAB7LklEQVR4nO3de3xU1b3//3cmcRjiOMZpICGkIQSMCJTbUbDUqsUICip4FLygqHhpe7CtWEvRH60txwqoRyrar9ripSDeOHKqFr/aWusd4etBi4jhHiGEBGMIQwghJpnfH0Ag5rI3zCfJDvN6Ph48fDj7k898smftPbOy1qyVEI1GowIAAAAAxA1fexcAAAAAAGhbdAQBAAAAIM7QEQQAAACAOENHEAAAAADiDB1BAAAAAIgzdAQBAAAAIM7QEQTQaqZPn65TTjlFhYWFruK8asmSJTrllFMa/evXr5+++93v6uabb9ann37a3mW2ieXLl+uUU07RkiVL2vR5t23bpmuuuUYDBgzQsGHDVFZW1qbP79ann36qn/70p/re976n/v3768wzz9TUqVOPqn0UFhbqlFNO0UMPPVT/2CmnnKLp06e3+HMjRozQNddc0+Cxr776SpWVlY7P6fVrEQBgJ6m9CwCAyy+/XN/97nfbuwxHl19+uf7t3/6t/v+rq6u1du1aPffcc/p//+//6aWXXlJWVlY7Vtj6evXqpXvvvVdDhgxp0+edM2eOPvroI91yyy3q0qWLwuFwmz6/G++8845+9KMfqXfv3po0aZLC4bC2b9+uF198Ua+99poeeugh5eXluc4XDod17733HnHH7M4771Tnzp3r///tt9/W7bffrv/5n/9RcnLyEeUCABy76AgCaHeDBw/W4MGD27sMR4MGDdLYsWMbPT5kyBBNnTpVTzzxhH7zm9+0fWFtKDU1tclz0NrWrl2rU089VVOmTGnz53brd7/7nfr06aPnn39exx13XP3jkyZN0tixYzVz5kydc845Skpy99abnJx8VOf6m53NVatWKRKJHHEeAMCxjamhABCjCy64QJ07d9a//vWv9i7lmPX111/r+OOPb+8ymlVWVqaCggINGzasQSdQklJSUjRu3DiVlpY6TpMGAKCt0BEE0O6++b2k6dOn6/zzz9eqVat09dVXa+DAgRo+fLjuvvtuVVVVNfjZ4uJiTZs2TWeccYa+853vaNy4cXr55ZcbPceyZct04403atiwYerXr5++//3v69e//nWDkZKDz7to0SKdfvrpOv300/XOO+841p+QkKBOnTopGo02eHzDhg2aMmWKTjvtNA0cOFBXXHGF3n333UY//69//UuTJk3S4MGD9f3vf18PPfSQHn744SbPSVO1uTkH0WhUDz/8sEaNGqXvfOc7Gj58uH7xi19o+/btDeKeffZZXXTRRRo4cKCGDRumKVOmaP369fXHm/qOYG1trebPn69Ro0bVfy/urrvuavA9voM/9/777+u3v/2tvvvd72rgwIG69tprlZ+f3+y5Pfhz27Zt04oVK+q/M3fw8f/5n//RRRddpO985zu64447jrieDz74QP/f//f/6fTTT9e//du/6Y477lBlZaXefvttjR07VgMHDtTYsWO1bNmyZmuUpM6dOysxMVH/+Mc/9OWXXzY6/pOf/ESfffaZsrOzG7wmCxYs0IUXXqgBAwZoxIgRuv/++7V3715JTX9H8Js2btyoYcOG6fzzz1dpaamkht8RnD59uh5++GFJ0rnnntvou4NutMU1diTXPADABlNDAXhSWVmZbrjhBl1wwQW6+OKL9c4772jhwoXy+/2aNm2aJKmkpETjx49XNBrVNddcoxNPPFH/+Mc/9Itf/EI7duzQjTfeKEl67733dNNNN2nIkCH66U9/qoSEBL3//vt6/vnntWvXLj344IP1z7t9+3Y98sgjuuWWW7Rjxw4NGjRIb7zxRou1fvrppyovL9eIESPqH1u7dq2uuuoqpaam6oc//KGOO+44/fWvf9XNN9+s//qv/9Lo0aMlSatXr9akSZOUmpqqKVOmaO/evVqwYIF8vsZ/p2uqNrfn4NFHH9Uf/vAHTZw4sX4BnwULFmj16tX661//qsTERL388sv6zW9+o3Hjxumaa65RWVmZ/vznP+uaa67R3//+d51wwglN/v5Tp07V66+/rpEjR2rSpEnavHmznn32WX344YdavHixQqFQfeyMGTPUtWtX/cd//Id27dql+fPn66abbtI///nPJqdMHvxO4qxZs3TSSSfpRz/6kU455RTt2rVLkjRz5kz9+7//u8aPH6+MjIwjrmf69Onq3bu3fv7zn2vFihVasmSJiouLtWbNGl1zzTU64YQT9Mc//lE/+9nP9MYbbzT42cN17txZo0eP1iuvvKK8vDyNGDFCZ555ps444wx17969yd/tt7/9rZ599ln94Ac/0JVXXqnNmzfriSeeUEFBQX3nrSVFRUWaPHmygsGg/vznPys1NbVRzOWXX66Kigr9/e9/1x133KGTTz7ZMe/h2uoae/XVV11d8wAAQ1EAaCW//OUvo7m5udGtW7e6ivvm/y9YsKBB3AUXXBA988wzG8QNHTo0WlJSUv9YXV1d9Lbbbov2798/WlpaGo1Go9Ebbrgh+oMf/CC6b9++BvkmTJgQHTx4cKPnXbp0aYO4F198MZqbmxtduHBh9Kuvvqr/V1RUFP373/8ezcvLiw4YMCC6adOm+p+5+uqro3l5edE9e/bUP/b1119Hr7rqqujw4cPra5k0aVL09NNPj3711Vf1cZ999lm0T58+TZ6Tb9bm9hxccMEF0ZtvvrnBzz777LPRiy++OPrFF19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GHHtJDDz2k3r17a8SIERo/fnyzHZPCwkKFQqEmpyX26tWr0Xcsm3pNJdW/rkfqm/mOtJ5vxiUlJTXKebCj6LbGXr166ZZbbtEtt9yi3bt367XXXtODDz6of/7zn3r99dc1evRobdu2TZIafGdQkkKhULPTTw/6+9//Lp/Pp7q6Oq1evbr+DxBuVVdX10+tPSgQCDSa+tse11hL1zwAwBYdQQCe1dT35A46OLIyatQoXXHFFU3GfPvb35YkPf7447r33nvVs2dPnXbaaRo5cqQGDhyohQsX6pVXXmn0c4ePWB2ud+/eGj58uCTpzDPP1LBhw3TVVVfpmmuu0eLFi+s/xB6sbeLEic3uG9e7d28VFRVJUoNRlIM6derU5M8dXtuRnIM+ffro9ddf17vvvqt//vOfevfddzVv3jw9+eSTev7559WrVy+lp6frpZde0vLly/WPf/xD7777rv74xz/qySef1BNPPKGhQ4c2yh/9xgI5h6urq2u0gmZLr+nR+OZrdaT1NPVaJyQkHHEdb731lt5//3394he/aPB6nnDCCRo/frxyc3M1YcIE/e///q9Gjx5d/9odjRNOOEGPPvqo7rzzTs2ePVtnnXWWTjzxRNc///HHH2vSpEkNHrvkkks0e/bsBo+1xzVm3T4AAM2jIwigQwqHw+rcubNqamrqO2cHFRUVac2aNercubP27dunhx56SMOGDdMTTzzRYNGOwxewOBrf+c539POf/1yzZs3SjBkz9H/+z/+RJHXv3l3S/g+736xtw4YNKiwsVOfOnes/RBcUFDTK/cUXXzg+v9tzUFtbq/z8fAWDQZ177rk699xzJUmvvvqqpk6dqsWLF2v69Olau3atJNVPfZWk//3f/9W1116rhQsXNtkR7N69u9577z2VlpY2Gl3bvHmzunXr5vh7WGqvej777DMtWLBA5513XpPn6eAiLYFAQJLqR5C3bt2qXr161ceVlJRo1qxZuvrqq5Went7kc+Xl5em0007TjBkzdNNNN+m//uu/NHPmTNe19unTR08++WSDx7p27doozgvXGACg9fCnNwAdUlJSks466yy9/fbbjbYfmD17tqZMmaKdO3eqqqpKe/fuVXZ2doMPqJ9//rlWrFghSaqpqTnqOq699loNGTJE//jHP/Tqq69K2v+hun///vqf//mfBtPjvv76a91555366U9/qpqaGn3rW9/S4MGD9de//rXBVL2tW7e62rbC7Tmora3VpEmTdM899zSIGThwoKRDozA/+9nPNG3atAajVX379tVxxx3X7EjNwZVSH3vssQaPv/HGG9q8ebPOOeccx9/DUnvVM2bMGPl8Ps2ZM6fJzdtfeOEFSarvhJ999tmS9m/XcbglS5bo//7f/6tgMOj4nGeddZbOO+88vfDCC1q5cmWzcQdfu4OjpSeeeKKGDx/e4F/v3r0b/ZxXrjEAQOtgRBBAq5s7d26Tm4FfcMEF9SNPR+P222/X8uXLNXHiRE2cOFEZGRl666239M9//lOXX355/SjMwIEDtWTJEgWDQfXs2VPr16/X4sWL6z8g79mz54im1h0uISFBM2fO1CWXXKLf/e53+t73vqcTTzxRM2bM0LXXXqtLL71UV155pVJSUrR06VL961//0s9//nOddNJJkqRf/vKXuuaaa3TZZZfpiiuuUHV1tRYuXOj6e1Fuz8E111yjRx55RFOmTNH3v/99VVVV6fnnn1fnzp116aWXStr/HcgZM2bouuuu0/nnn69oNKqXXnpJ+/bt01VXXdXk85999tk699xztWDBApWUlGjYsGEqKCjQs88+q29/+9uNFm1pbe1VT3Z2tu644w7dc8899dsf5OTkqKqqSu+//77++c9/6pprrtGQIUMk7V8kZ/z48Vq4cKF27Nih7373u9qwYYOee+45jRs3Tn369HG1+fydd96p9957T3fddZeWLFnSaOqrdOh7d/Pnz9dZZ51V3xl1wwvXGACgddARBNDq/vrXvzb5eE5OTkwdwaysLL3wwguaN2+eXnjhBVVWVurb3/627rjjjgarMT744IOaNWuWXnzxRVVXV6t79+66+eab1atXL/3kJz/Rhx9+qFGjRh11HSeffLJuuOEGPfroo5o9e7ZmzZqlwYMH69lnn9VDDz2kJ598UjU1NerZs6dmz56tSy65pP5nBw8erPnz52vu3Ln6/e9/r5SUFF1zzTXauHGjXn/9dbNz8NOf/lQpKSl68cUXNWfOHCUmJmrIkCG677776qcmjh8/Xscd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rscgWDzjGhkBSJOIZVB+zahL+m0ixXye5ks1xpXezei/Thh84xw4dLH3zgGPZm1XCDgg4ZNMguV7jCxZuWS2XBLLNcTk3f75eqq93l8le4+EDqluFnzZJv9TXLZdb2fXEwBuXivarN+Xzavn27amtrGzzcccYuAQAAAMDD6jw44dInaeLEidq2bVuDx+kIAgAAAMAxbNGiRYwIAgAAAEA86datW6PHXHcE3333XT3yyCP67LPP5PP5NHDgQN16660adNhE8q1bt2rOnDlasWKFJOmcc87R9OnTFQ6HY68eAAAAADyspqa9K2jM72/6cVcdwRUrVuimm27SySefrKlTp6qmpkbPPPOMrr76aj3zzDMaMGCAdu7cqWuvvVbV1dW68cYbVVtbq8cff1xr167V4sWL5W+uAgAAAABAm3LVEbznnnvUrVs3vfDCC+rcubMkady4cRo9erTmzp2rJ598Uk899ZSKi4v1yiuvqFevXpKkgQMH6vrrr9df/vIXTZgwofV+CwAAAACAa47L2uzatUv5+fk6//zz6zuBkpSamqrTTz9dH3/8sSRp6dKlGjp0aH0nUJKGDx+unj17aunSpa1QOgAAAAB4R23t/umhXvn3jfVhGnAcEQwGg3rttdcadAIP2rlzpxITE7Vr1y5t3bpVo0aNahTTr18/vf3220d2BgEAAAAArcZxRDAxMVHZ2dlKS0tr8Hh+fr5WrlypwYMHq6SkRJIaxUhSly5dtHv3bu3evduoZAAAAABALBKi0Wj0SH9oz549uuqqq7R27VotWLBAxx13nK644grdfffdGj9+fIPYuXPn6tFHH9U777zTZEcRAAAAAI4Fu3dLR967aj0JCdIJJzR97Ij3Edy7d69+/OMfKz8/Xz/84Q81dOhQrVy50kURCUf0POXlUl1d88fDYamszDlPuKroiJ63RcXFZqm2pA4xy5WebpZKhYXOMTk50qZNznGWdSUHWmgMR6io2HEg3LWKCrNUCgScY7KypC1bnONSU2Ov53DJFTvsklkW99e/2uXq3985xm3jT0mJuZx65eV2uQzP/a/vD5nlmvkbF9e3z9fym8IB98y2u77vvGydWS7Tdl9VZZcrGHSOCYWkSMQxrDpg1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ejYjh07FAqF+AJvOzi4mW1lZWU7VxIfuA68i2shNl999ZUmTZqklStX6vLLL9fvfve7+pEO2n3raunct4Q23zoCgYDOOeccbd++XV27dpVE228rh5/7srKyZuNo+zhWdJiOYCgUUmZmpj777LNGx9asWaP+/fu3Q1XxoaSkRGPGjNHDDz/c6NjmzZslSZmZmW1dVlziOmhfXAuto6KiQjfccIM+//xzXXfddZo5c2aDjgjtvvU4nXvafOvZuHGjRowYoUWLFjU6tmfPHiUkJMjv99P2W4Gbc793717aPo55HaYjKEkjR47UsmXLtHHjxvrHPvjgA23evLnFVf4Qm7S0NEUiES1evFgVFRX1jxcVFWnJkiUaNmyYq+8xwAbXQfvhWmgdM2fO1Oeff65JkybpjjvuaDKGdt86nM49bb719OjRQ7t379Zzzz2n6urq+se3bdum119/XaeffrqCwSBtvxW4Offdu3en7eOYlxB1s/qER5SVlenCCy9UYmKiJk+erH379mn+/PnKysrSc889J7/f394lHrPeeOMNTZkyRSeffLLGjx+vPXv2aNGiRfr666/17LPPstlqKxkxYoS6d++uhQsX1j/GddB2mjr/XAu2Nm7cqNGjRysUCumOO+5ocuGFsWPH0u5bgdtzT5tvPS+99JKmTZumQYMG6eKLL9bOnTvrz+0zzzyj3Nxc2n4rcXPuafs41nWojqAkbdq0SbNmzdJHH32kQCCgs88+W9OmTaufr43W88Ybb+ixxx5Tfn6+AoGAhg4dqttuu40bYStqqiMicR20lebOP9eCnWeffVa/+c1vWoxZu3atJNq9tSM597T51vPqq69q/vz5WrdunZKTk3XGGWdo6tSp6tmzZ30Mbb91uDn3tH0cyzpcRxAAAAAAEJsO9R1BAAAAAEDs6AgCAAAAQJyhIwgAAAAAcYaOIAAAAADEGTqCAAAAABBn6AgCAAAAQJyhIwgAAAAAcYaOIAAAAADEGTqCAAAAABBn/n9J4553XrR7dAAAAABJRU5ErkJggg==\n", + "text/plain": [ + "
        " + ] + }, + "metadata": { + "filenames": { + "image/png": "/Users/mhjensen/Teaching/MachineLearning/doc/LectureNotes/_build/jupyter_execute/chapter3_169_1.png" + } + }, + "output_type": "display_data" + } + ], + "source": [ + "fig = plt.figure(figsize=(20, 14))\n", + "im = plt.imshow(J_sk, **cmap_args)\n", + "plt.title(\"LinearRegression from Scikit-learn\", fontsize=18)\n", + "plt.xticks(fontsize=18)\n", + "plt.yticks(fontsize=18)\n", + "cb = fig.colorbar(im)\n", + "cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The results agree perfectly with our previous discussion where we used our own code.\n", + "\n", + "\n", + "Having explored the ordinary least squares we move on to ridge\n", + "regression. In ridge regression we include a **regularizer**. This\n", + "involves a new cost function which leads to a new estimate for the\n", + "weights $\\boldsymbol{\\beta}$. This results in a penalized regression problem. The\n", + "cost function is given by" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "6\n", + "0\n", + " \n", + "<\n", + "<\n", + "<\n", + "!\n", + "!\n", + "M\n", + "A\n", + "T\n", + "H\n", + "_\n", + "B\n", + "L\n", + "O\n", + "C\n", + "K" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + ":10: UserWarning: FixedFormatter should only be used together with FixedLocator\n", + " cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)\n" + ] + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAA4IAAAM2CAYAAACjUj0CAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Il7ecAAAACXBIWXMAAAsTAAALEwEAmpwYAAB4jElEQVR4nO3dfXxU5Z3//3cmYRiGYYzZQCBkYww0ImAEVyOyLlpMwYIabAVR1Crqun7pb4uuteh6t66KVitdql/rFqpFgrfLqpXeuG7Xm65Yvj4oVbkVMIQQEoghhBBCSGZ+f0AGYm7OwfkkOWFez8eDR+ucTz7zyZnrnJlrrivXlRSNRqMCAAAAACQMX08XAAAAAADoXnQEAQAAACDB0BEEAAAAgARDRxAAAAAAEgwdQQAAAABIMHQEAQAAACDB0BEEgHbMmzdPp512Wpt/Z5xxhr75zW/q7rvvVlVVVaufmThxoq699lrH3G7jrD3//PM6//zzlZ+fryeeeKLbn9+NxsZG/fu//7suu+wyjRkzRmeddZa+853v6N///d918ODB487X8jq2+NnPfqbTTjtNZWVlHf7M8uXLddppp+lPf/pTq8e3b9/u+HxlZWU67bTT9LOf/ey4awUAoDul9HQBAOBld911l04++eTYf9fV1WnlypX6j//4D3322Wd67bXX5Pf7JUl33323+vXr11Oldmrjxo2aP3++xowZox/84AcaMWJET5fURlNTk2688UatWbNG06ZN05VXXqnm5mZ9/PHHevLJJ/WHP/xBS5YsiZ1vN6688kqdd955x1XHOeecox//+McaNmxY7LEbb7xRAwcO1KOPPnpcuQAA8Co6ggDQicLCQmVlZbV6bNasWXrggQf04osv6p133tGUKVNisV61adMmSdItt9yiiRMn9nA17fvtb3+rVatW6Wc/+5kmTZoUe/y6667TokWL9Pjjj+u1117T1Vdf7Trn2LFjNXbs2OOq46//+q/113/9160e++Mf/6jLL7/8uPIAAOBlTA0FgK+hpVPwl7/8pYcrcefQoUOSpP79+/dwJR3785//LEn627/92zbHrr76avXp00dr1qzp5qoAADgx0REEgK+hZQpoNBqNPdbe3/795je/UVFRkfLz83XJJZfov//7v9vN995772n69OkaM2aMLrroIhUXF+uf//mf24zebd68WXPmzNHZZ5+tM888UzNnztQHH3zQaa3XXnut7rrrLkmHR9da/mbu2muv1Y033qgFCxZo7NixOu+887Rx40ZJh6eS/p//83909tlnKz8/XzNmzNA777zTJu8tt9yid955R5dddpnOOOMMTZ06Ve+9957q6up033336ZxzztF5552n++67Tw0NDZ3W2dJJffnll9scCwaDWr16tX784x+3enzLli36wQ9+oHPPPVd/8zd/o2uvvVYff/xx7PhX/0awPQ888IBOO+00Pf/885Ja/41gy9/8SdJ//ud/tvu3g24sX75c06ZN0xlnnKFx48Zp3rx52rVrV6uYuro6/eQnP9HFF1+sM844Q2PHjtWMGTNatZmWep5//nldddVVGj16tK6//vrY46+//roWLFigCRMm6IwzztD06dP10UcfHXe9AIATH1NDAeBraOl8jRw5ssOY5cuX66677tLYsWP1wx/+UNu2bdPcuXOVlJSkoUOHxuL+53/+R3PmzFFeXp5uu+02VVZW6tFHH1UwGGw1grdx40ZdffXVSk9P1y233KI+ffrorbfe0t///d/rJz/5SWyK6lf9wz/8g0499VS9/PLL+od/+Afl5ubGjq1evVrbt2/XD3/4Q5WVlWn48OH65JNPdN111ykUCumGG25Q//799cYbb2jOnDm67777NGvWrNjPr127Vn/+85913XXXacCAAXr22Wc1d+5cnX766erXr59uv/12ffzxx3r55Zc1aNAgff/73+/wfF122WV67rnn9Nhjj2n58uUqLCzUeeedp7Fjx8rv97f528CSkhLNmDFDKSkpuuaaa5SWlqaXXnpJN9xwg4qLi5Wfn9/hc7X46U9/qhdffFG33Xabrr/++jbH09LS9OMf/1h33nmnzj77bM2YMaPV3w668dRTT+lnP/uZJk+erBkzZqiyslJLly7VqlWr9NprryktLU3RaFS33HKL1q1bp2uuuUbZ2dmqqKjQSy+9pO9///t6/fXXW3Vo/+3f/k0TJ07UpZdeqr59+7Z6vF+/fpo9e7YOHTqkX/7yl7rlllv07rvvtvpbVwAAFAUAtPGjH/0ompeXF127dm30yy+/jP3btm1bdOnSpdExY8ZEv/3tb0cbGxtjP/PNb34zes0110Sj0Wi0qakpet5550W/+93vtor5j//4j2heXl4sLhqNRgsLC6OTJk2KHjhwIPbYf/3Xf0Xz8vKi3/zmN2OPXXPNNdHCwsLo/v37Y48dOnQoevXVV0fHjx8fPXjwYIe/T8vzfvTRR63y5eXlRdesWdMqdvr06dExY8ZEd+7cGXusoaEhevnll0fz8/OjX375Zauf/8Mf/hCLW7p0aTQvLy86Y8aM2GORSCQ6YcKE6JVXXtlhfS3+53/+J3reeed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j7dMp23pUAIA0IKOIAB04qyzzoptH9Ey+vTQQw+ppqZG//f//t92R2UkxR5vb4GUYz+UNzU1SVK7e+Md29Fsbm6WdHjrio62qRg+fLibX6mVlo5bi846ay11f7Xz0p6OzktH6uvr9eyzz2rUqFGtto6QpFGjRuknP/mJamtr9f7772vPnj2x83G8z9Pisssu0znnnKN7771Xixcv1j/8wz8c18//f//f/xcbnWzR3kJALefsmWeeaTXi+1XV1dWaPn26du3apb/927/VxIkTNWLECA0dOlTTp09vE//V163FsZ16AAA6Q0cQAI7Dtddeq5UrV+q///u/9atf/ardBUYkxfahaxnxaxGNRrVjxw594xvfaBVXUlKi888/v1VsSUlJ7P+3LC6TnJys8ePHt4rbvHmzysrKTDazb3merVu3tjn2xRdfSFKrKaNW+vbtq8WLF2vs2LFtOoIthg8frg8++ECBQEB9+vRRIBCIjbgda/Hixdq9e7fmzZvX4fP94Ac/0NChQ7V8+XI988wzmjp1apu9Azvzox/9SLW1ta0eGzhwYJspmC3nc8iQITr99NNbHXvvvfcUCoUkScuWLVNZWZmef/55nXfeebGY1atXu64JAIDjwVeHAHCcHnzwQZ100kn66U9/Gpuy+VUjR47U0KFD9eKLL+rAgQOxx1esWKE9e/bE/nv06NEaMmSIXnvtNTU2NsYeX7NmjdatWxf770GDBmn06NH6z//8T1VWVsYeP3TokO6++2794z/+Y2x0MR4DBw7U6NGj9eabb6qioiL2eGNjo5577jn5/f529/mLV3JysqZMmaJVq1bpjTfeaHO8pqZGv//97zV+/Hj169dPKSkp+tu//Vu99957rabE7t27V4sXL+7wdTlWUlKS7rvvPh06dEgPPPBAp7E+n6/VSO7o0aM1fvz4Vv/amyr8zW9+U5L07LPPthptXb9+vW699Vb96le/iv1+UutR3Wg0qqVLl0qSyWsLAMCxGBEEgOOUnp6uO+64Q/fee68eeOABLV68uE1MUlKS7r33Xs2ZM0dXXnmlvvvd76qyslLFxcVKTU2Nxfl8Ps2bN09z587VzJkzVVRUpOrqai1ZsqTNdNF77rlH3/ve9/Td735XV111lVJTU7VixQr95S9/0T/90z+ZbQ/Q8jxXXHGFrrrqKvXv319vvvmm1q5dq3vuuUfhcNjkeb5q3rx5+uSTT3TnnXfqzTff1N/93d8pFAqptLRUy5cv16FDh3TffffF4v/pn/5J06dP1/Tp0zVr1iyFQiG98sorqq+v19y5c10958iRIzVz5kwVFxdrxYoVmjp1artxaWlpWrVqlV555RWdf/75yszMdJU/Ly9P1157rV544QXV1NSosLBQNTU1Wrp0qfr3768f/OAHkqQJEybohRde0C233KIrrrhChw4d0m9/+1t99tln8vl8bRaLAQAgXowIAsDXMH36dP3N3/yN/vjHP+r1119vN+ab3/ymnn32WQUCAT355JN655139PDDD7daDVSSLr74Yi1YsEBNTU16/PHH9dZbb+muu+7S6NGjW3UGx44dqxdffFGjR4/Wc889p8cff1wHDhzQo48+qr//+783+91anmfUqFH65S9/qX/7t39T37599fTTT+vaa681e56vSktL0/Lly/WDH/xANTU1evrpp/XAAw/orbfe0qRJk/TrX/9aOTk5sfhhw4bp5Zdf1hlnnKFFixZp4cKFGjRokJYtWxabeuvG3Llz9Vd/9VeaP39+m+meLe644w41NTXpX//1X9v8baCTf/7nf9b999+v6upqPfbYY1q2bJnOPvtsLVu2LLYAz4QJE/TQQw/FXs9FixYpNTVVL7/8sk4//fSvtYk9AACdSYq6XcYNAGCuublZe/fubXcVyEsvvVThcFjFxcU9UBkAADiRMSIIAD2oublZEyZMaDXlUZI2btyozz//XPn5+T1UGQAAOJHxN4IA0IP8fr8uvvhivfbaa0pKStLo0aO1a9cuvfjiizr55JN1ww039HSJAADgBMTUUADoYQ0NDVq8eLHefPNN7dy5UwMGDNB5552nuXPnxvYwBAAAsERHEAAAAABOULW1te0uhkZHEAAAAADidKC6Wv3aWfytpzU0NGjChAnau3dvq8e92xE8ZuPedvl8zjGS/vVhu/Vw7v1Ro3OQSwea/c5BLlVXm6VSByunt3L66dL69S7ihtmdL0uVe+zOfUbTDrNcam52jsnOlkpLHcO2NmUbFHRUbv9K5yCXavpm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BzWXXfd1e7CC0VFRbT7LuD23NPmu84bb7yhO++8U2PGjNFll12mPXv2xM7tsmXLlJeXR9vvIm7OPW0fJ7pe1RGUpK1bt2r+/Pn6+OOPFQgEdMEFF+jOO++MzddG13nnnXf07LPPasOGDQoEAiooKNDtt9/OjbALtdcRkbgOuktH559rwc6LL76oBx54oNOYjRs3SqLdWzuec0+b7zq/+c1vtGjRIm3atEnBYFDjxo3TbbfdplNPPTUWQ9vvGm7OPW0fJ7Je1xEEAAAAAMSnV/2NIAAAAAAgfnQEAQAAACDB0BEEAAAAgARDRxAAAAAAEgwdQQAAAABIMHQEAQAAACDB0BEEAAAAgARDRxAAAAAAEgwdQQAAAABIMP8/8YfugAZ5AvAAAAAASUVORK5CYII=\n", + "text/plain": [ + "
        " + ] + }, + "metadata": { + "filenames": { + "image/png": "/Users/mhjensen/Teaching/MachineLearning/doc/LectureNotes/_build/jupyter_execute/chapter3_172_1.png" + } + }, + "output_type": "display_data" + } + ], + "source": [ + "_lambda = 0.1\n", + "clf_ridge = skl.Ridge(alpha=_lambda).fit(X_train, y_train)\n", + "J_ridge_sk = clf_ridge.coef_.reshape(L, L)\n", + "fig = plt.figure(figsize=(20, 14))\n", + "im = plt.imshow(J_ridge_sk, **cmap_args)\n", + "plt.title(\"Ridge from Scikit-learn\", fontsize=18)\n", + "plt.xticks(fontsize=18)\n", + "plt.yticks(fontsize=18)\n", + "cb = fig.colorbar(im)\n", + "cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)\n", + "\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In the **Least Absolute Shrinkage and Selection Operator** (LASSO)-method we get a third cost function." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
        \n", + "\n", + "$$\n", + "\\begin{equation}\n", + " C(\\boldsymbol{X}, \\boldsymbol{\\beta}; \\lambda) = (\\boldsymbol{X}\\boldsymbol{\\beta} - \\boldsymbol{y})^T(\\boldsymbol{X}\\boldsymbol{\\beta} - \\boldsymbol{y}) + \\lambda \\sqrt{\\boldsymbol{\\beta}^T\\boldsymbol{\\beta}}.\n", + "\\label{_auto12} \\tag{12}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Finding the extremal point of this cost function is not so straight-forward as in least squares and ridge. We will therefore rely solely on the function ``Lasso`` from **Scikit-Learn**." + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + ":9: UserWarning: FixedFormatter should only be used together with FixedLocator\n", + " cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)\n" + ] + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAA4IAAAM2CAYAAACjUj0CAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Il7ecAAAACXBIWXMAAAsTAAALEwEAmpwYAABNzElEQVR4nO3dfZxWdZkw8GtmCAZELFZCXnxBntAeSJlcsGxTRAQDDEpFDV8ALbfcp8Ra0j6UaSmJGi7qogZZ4PjGI+UWbm9bmquk22O7lQIhoSGSbyAvA4Lcc54/jFvHgZkbODP3mTnf7+czn81zfvfv/Oaac7te9++6r1ORJEkSAAAA5EZluRcAAABA65IIAgAA5IxEEAAAIGckggAAADkjEQQAAMgZiSAAAEDOSAQB3uGyyy6LI444Ip5//vlyLyVVjz32WHzsYx+LQYMGxac+9alyL2e3HnzwwTj33HNjyJAhcdRRR8XIkSPjm9/8Zrz00kt7PNeiRYviiCOOiMcffzwiIh5//PE44ogjYtGiRbt9zfPPPx9HHHFE3HTTTQ2Or169uqRrDh8+PM4999w9XisAtKYO5V4AAC2vvr4+vvjFL0ZVVVVcfvnlcdBBB5V7Sbs0a9asuPXWW2PYsGFx8cUXR3V1daxYsSL+7//9v7F48eK4995745BDDil5viFDhsTMmTOjf//+Jb+me/fuMXPmzDjiiCOKx/71X/81fvCDH8TPf/7zPfp9ACCrJIIAOfDyyy/HunXrYvLkyTFx4sRyL2eX1q5dG9/5znfi3HPPjenTpzc4N3bs2Jg4cWJ8+9vfjhtvvLHkOQ8++OA4+OCD92gdXbp0iXHjxjU4tmTJkigUCns0DwBkmdJQgBx44403IiJiv/32K/NKdu9//ud/olAoxEc+8pFG52pqauKoo46K//7v/279hQFAOyQRBNgH//7v/x7nnHNOHHPMMTFo0KAYPnx4zJw5M7Zv314cs3379rj66qvjpJNOikGDBsUJJ5wQV155ZWzYsKE4JkmSuPnmm2PUqFHxgQ98II477rj453/+51i7dm2D661fvz6+/vWvx0c/+tEYNGhQjBo1Km6//fYmd6tuuummOOmkkyIi4uabby5+Z+6mm26KD3zgA/Hzn/88PvKRj0RNTU0sXLiw5OvcdNNNUVNTE88880xMnjw5Bg8eHB/96EfjO9/5TiRJEvPmzYthw4ZFTU1NXHDBBc1+53JnkvqDH/ygQfx2mj9/fjz00EMNjm3evDmuueaaGDZsWBx99NFx6qmnFn+HiMbfEdyVxYsXx/vf//74/Oc/H4VCodF3BIcPHx5PPPFErFmzZpffHSzF7373u5g8eXLU1NRETU1NTJkyJX7/+983GJMkSdx9991x+umnR01NTXzgAx+IU045JW6//fZIkqQ4bvjw4TF9+vT4yle+EkcddVQcf/zxsW7duhg+fHh87WtfiwceeCDGjBkTH/jAB2LkyJFRW1u7x+sFoP1TGgqwlxYuXBjTp0+P4cOHx5e+9KV444034uc//3nMmzcvIiKmTZsWERFXXXVV/PjHP47zzjsvDj744FixYkXU1tbGc889F9/97ncjIuLWW2+NW265JSZOnFhsVDN//vz44x//GD/+8Y+jqqoqNmzYEGeddVasWbMmzjrrrOjXr188+uijccMNN8TTTz+925LJk08+Ofbff/+YMWNGnHzyyXHyySdH//7944knnogdO3bE1772tZg8eXJs3749jjnmmD26zhtvvBHnn39+jBgxIkaOHBn3339/XH/99fGb3/wm1qxZE5MmTYr169fH3Llz4/LLL48FCxbsNp7HHnts9O3bN37605/G//t//y9GjhwZH/nIR2LIkCFxwAEHRMeOHRuM3759e0ycODFWrFgREyZMiCOPPDIefvjhmD59emzdujXOO++8Zv+Gv/71r+PLX/5yHH/88XHDDTdEVVVVozFf+cpX4oYbboj169fH5Zdf3uC7g6V49NFH46KLLoojjzwyvvCFL8T27dtj0aJFMXHixLjjjjvi7//+7yMi4sYbb4xbb701PvGJT8SECROirq4ufvjDH8YNN9wQ++23X4OS3sWLF8fhhx8eX/nKV+KVV16J7t27R0TEI488Ej/5yU/inHPOiQMPPDDuvffeuOqqq6Jv375xwgkn7NG6AWjnEgAa+PKXv5wMGDAgWb16dZPjTjnllOTMM89M6uvri8feeOON5Pjjj0/Gjh1bPHbUUUclV155ZYPXzpo1K/nkJz+ZbN68OUmSJPnYxz6WfOYzn2kw5u67704+/vGPJ88991ySJEly3XXXJQMGDEh+/vOfNxj39a9/PRkwYEDy0EMP7Xatq1evTgYMGJDMnj27eGz27NnJgAEDkttuu63B2FKvs/P13/rWt4pjVqxYkQwYMCCpqalJXn311eLxL37xi8kRRxyRbNu2bbdrTJIk+fOf/5yMHz8+GTBgQPHn/e9/f3LuuecmjzzySIOxtbW1yYABA5J/+7d/Kx6rr69PPvWpTyUf+chHkkKhkNx///3JgAEDkt/85jdJkiTJb37zm2TAgAHJ/fffnzz55JPJ0UcfnZx//vnJ66+/3mSszjnnnOTEE09scu07nXjiick555yTJEmSFAqF5KSTTkrOOuusZMeOHcUxdXV1ycknn5yMGzcuSZIk2b59e/LBD34wmTp1aoO5Nm3alAwaNCi56KKLGsx/5JFHJn/9618bXfeII45Ili5dWjz20ksvJUcccURy6aWXlrR2APJDaSjAXvq3f/u3uP3226OioqJ47NVXX41u3brFli1biscOOuigePDBB2PRokWxcePGiIi45JJL4v777y+WQx500EHx+OOPx/e///145ZVXIiLirLPOigceeKDYJfOXv/xl9O/fP0aMGNFgHZ/73OciIuI//uM/9ur3GDJkSIN/3tPrvH3cYYcdFhERH/zgB4u7VBERffv2jSRJir/b7vTr1y8WLVoU8+fPj/POOy/69+8fhUIhHn/88bjgggvi9ttvL4596KGHonv37jF27NjisYqKipg5c2bU1tY2+Lu804oVK+Kiiy6Kvn37xpw5c6JTp05NrmtvPf3007F69eoYMWJEbNiwIdatWxfr1q2L119/PU488cRYunRpvPjii/Gud70rHnvssbjqqqsavH79+vXRtWvXBvdTRMQhhxwSPXv2bHS9fv36xZFHHln85x49esSBBx7YbNwByB+loQB76V3velf813/9V/z4xz+OP//5z/GXv/wlXn311YiI6NOnT3Hc17/+9bjkkkvi8ssvj69+9asxePDgOPnkk+O0006L/fffPyLeLCP97Gc/G9dcc03MmDEjBg4cGMOHD48JEyZEjx49IuLN59t99KMfbbSOHj16RLdu3WLNmjV79Xv83d/9XYN/3tPrHHjggcX/3aFDh13OubPksr6+vtn1VFRUxLHHHhvHHntsRES88MILcf/998dtt90W//Iv/xLjxo2Lnj17xpo1a+KQQw5plPC9Pfa7893vfjcqKyvj9ddfj5dffnmPHkkREVFXV9coOdt///2jurq6wbG//OUvERExc+bMmDlz5i7neuGFF6Jnz57xrne9Kx566KH4j//4j1i1alU899xzxe+RJm/7jmBE4/ju9Pbke6eOHTuWFHcA8kUiCLCXvvGNb8Sdd94Z//t//+8YPHhwjBs3LmpqauIb3/hGgyYvH/7wh+NXv/pV8efRRx+NGTNmxPe+971YtGhRdO/ePY488sj46U9/Go888kj86le/ikceeSRmz54dd9xxR9x7773Rv3//RsnA29XX18e73vWuvfo9KisbFofs6XV29b26pnbjdmfBggWxbdu2uPDCCxsc7927d/yf//N/olOnTnHDDTfEf//3f8eoUaOiUCjs1XUiIo444oj42te+FpMmTYorr7yy+L3OUn33u9+Nm2++ucGxGTNmxCc/+ckGx3YmYF/4whdi8ODBu5zr8MMPjyRJ4nOf+1z86le/imOOOSZqamrizDPPjCFDhsT555/f6DW7inlE478lAOyORBBgL6xZsybuvPPOGDduXKOdnreX4W3fvj2WLl0aBx10UIwZMybGjBkT9fX1cccdd8TMmTNj8eLF8alPfSqWLVsWXbt2jZNOOqnY4fPBBx+MqVOnxsKFC+Oyyy6LPn36xKpVqxqt5eWXX47NmzdHr169UvndWus67/SLX/wifv/738enPvWp6NKlS6PzAwYMiIgo7rr17t07li9f3mjcww8/HA8++GD88z//826vNWnSpPj7v//7mDRpUnznO9+JH//4xw1KTJszfvz4OOaYYxoc+1//6381Grdzd7JLly5x3HHHNTj3+9//PjZs2BDV1dXx29/+Nn71q1/F5z73ufjCF75QHLNjx4547bXX9vhZiADQHB8dAuyFnSV77/yP/4cffjieffbZ2LFjR0S8+R2vM888M2677bbimMrKyvjABz5Q/N+FQiHOO++8uOaaaxrMdfTRRxfHRESceOKJsXLlyvjFL37RYNzO780NGzYsld+tta7zTqeeemps2bIlvvWtbzUqZayvr4+FCxdGt27dit9pPP744+OVV16Jn//85w3Gfv/734+HHnoo3vOe9zR7zc997nPRq1evmDFjRvH7m7tSWVnZYE0HH3xwHHfccQ1+3vve9zZ63aBBg6JHjx6xYMGCqKurKx7fvHlzsVy4qqoqXnvttYhofD/dd999sXXr1uL9BABpsSMIsBuzZs3a5QPYP/axj8UxxxwTvXv3jltvvTW2bdsWBx10UPz+97+PH/zgB9GpU6fif/T37NkzTj311Ljrrrti69atUVNTE6+99lrceeedceCBB8bHPvax6NixY5x77rkxZ86cuPjii+OjH/1ovP7663HvvfdG586d47TTTouIiIsuuih+9rOfxSWXXBJnn312HHbYYfGb3/wmfvazn8XIkSNTezxAa13nnT75yU/GI488Evfee2/87ne/i1NOOSUOOuigePXVV+Pf//3fY/ny5XHDDTcUdwvPOuusuP/++2Pq1KkxceLE6NevXzz00EPx6KOPxjXXXLPb8sm369KlS1x22WXxhS98Ia6//vpGzVp26t69e/zXf/1XfPe7341jjjmmmKQ3513veldMnz49pk6dGp/85Cfj9NNPj06dOsXChQvjhRdeiOuvvz46dOgQNTU10bVr15gxY0asWbMmDjjggHj88cfjwQcfbHA/AUBaJIIAu/HjH/94l8cPP/zw+PCHPxy33357fOtb34r58+dHkiRxyCGHxFe+8pXYsWNHXH311fHHP/4xBg0aFN/4xjfi4IMPjsWLF8fixYujc+fO8eEPfzimTp1abO7x+c9/Pt797nfH/fffH9dee21UVVXFBz/4wbjuuuuif//+ERHx7ne/O+6999648cYb48EHH4yNGzfGwQcfHNOmTYtJkyal9nu31nXeqbKyMm688cZ44IEH4oEHHog777wzNm3aFAcccEAcc8wxceWVV8ZRRx1VHF9dXR0LFiyIG2+8MRYvXhybNm2K/v37x4033hgf+9jHSr7uKaecEv/wD/8Q9913X3ziE58oNud5uwsvvDCWL18e3/72t+OTn/xkyYngzvkPOOCAmDNnTvzrv/5rVFZWxvve976YM2dOnHjiiRHxZsOd22+/Pa6//vqYM2dOdOzYMfr16xff/va34/e//33Mnz8/XnnllQaNeQBgX1QkTXUFAAAAoN3xHUEAAICckQgCAADkjEQQAAAgZzSLAQAAaKc2bty4y0ckaRYDAACwj7auWxed/9YNPEtef/31OP7444vPQN4pu4ngOx4m3EhlZfNjIuKww29rdkypnv3zRanN1aaVGHtagNiXl/iXj9iXj9iXj9iXj9g3cNjh39nnOfr27Rr/+Z8TU1hNtn33H/4hNj7/fLmXUdStb9+Y8p//GWvXro1CodDgXLsvDX3uuQ3NDwIAAHbpuecalxWyaxuffz42PPdcuZfRSK9evRod0ywGAAAgZ1JPBFevXh3/9E//FEOHDo2hQ4fGtGnTYt26dWlfBgAAIFMqM/izO6mWhq5fvz7OP//82L59e1x44YVRKBRi3rx5sXz58li4cGF07NgxzcsBAACwF1JNBL/3ve/FX//61/jRj34U/fv3j4iIo48+OiZPnhw//OEPY8KECWleDgAAgL2Qamno4sWLY+jQocUkMCLiuOOOi379+sXixYvTvBQAAECmlLsMdE9KQ1NLBDds2BCrV6+OgQMHNjo3cODAeOqpp9K6FAAAAPsgtUTwxRdfjIiInj17NjrXo0eP2LRpU2zatCmtywEAALCXUvuOYF1dXUREdO7cudG5Tp06RUTEli1bYv/99y9twsoSctQSxi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/Pnz49JLL4033ngjxo8fv2crqywhRy1lDC1D7MtH7MtL/MtH7MtH7MtH7IvSjUR6/52ZJHP2cS20L9l8oPyuVCRJkpQ6zYYNG+LRRx+N7du3x4IFC2Lp0qUxa9asGDVqVNx9991RX18fEydOLI5//fXXY+zYsbF169b49a9/HVVVVaWvub6ZtquVlc2PoWWIffmIfXmJf/mIffmIffmIfQP1KaaClc2199+D2FdUXZzCit6UFG5Jba5MysEHG4cddk8899zmci+j6NBDu8azz561y3N79Nc44IADYvTo0TF+/Piora2N3r17x4wZMyIi4uyzz26QBEZEVFdXx7hx4+KVV14pNpMBAACgvPY6La+uro5hw4bF2rVrY926dbsd171794h4s3kMAABA+1XuLqG7+tm1ZhPBlStXxvDhw6O2trbRubq6uqioqIitW7fGmDFj4uabb240ZtWqVRER0bdv3+YuBQAAQCtoNhE89NBDY9OmTXHPPffE9u3bi8fXrFkTP/3pT2PIkCHRp0+f2LhxYyxcuDA2b36rJvaFF16IRYsWxbHHHhs9evRomd8AAACAPdJs19AOHTrE9OnTY9q0aXHuuefGxz/+8Vi/fn3U1tZGZWVlfPWrX42IiCuuuCIuvvjiOOuss+KMM86Iurq6qK2tjQ4dOsQVV1zR4r8IAABAee18oHxW7L7pUcldQx988MGYO3du/OlPf4ouXbrEhz70oZg6dWr069evOOYXv/hF3HbbbbFs2bKorq6OoUOHxqWXXlp8yPyerVnX0MwS+/IR+/IS//IR+/IR+/IR+wZ0DW0HctE1dEE899ymci+j6NBD949nnz13l+f26PERrUoimF1iXz5iX17iXz5iXz5iXz5i34BEsB2QCLa6phLBPXqgPAAAlEOzydseaC6prCxhzE5pJm8VVdNSmyspzExtLvZEfTRVjtn6dr+W9p+WAwAA0IAdQQAAgFQ0/ey+1rcPzxEEAACgfZEIAgAA5IzSUAAAgFS0necI2hEEAADIGYkgAABAzigNBQAASIWuoQAAAGSURBAAACBnlIYCAACkQtdQAAAAMkoiCAAAkDNKQwEAAFKhaygAAAAZJREEAADIGaWhAAAAqaiPpj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r/99iuOce+3jFJi796nPWtTieD69evj/PPPj+3bt8eFF14YhUIh5s2bF8uXL4+FCxdGx44dy73EditJkli5cmWMGDEiRo4c2eBcnz59yrSq9m3hwoVx3333xdChQxsc9z5oHbuLv/dC+p544on49Kc/He973/ti6tSpsWPHjrjrrrvinHPOibvuuiuOOuoo930LKSX27vmWs2TJkpgyZUoMHDgwvvSlL8XatWtj/vz58cc//jFqa2ujsrLSvd9CSom9e592L2lDvv3tbyfvf//7k2eeeaZ47NFHH00GDBiQ3HvvvWVcWfv3l7/8JRkwYEBy//33l3sp7d6OHTuSm266KTniiCOSAQMGJOecc06D894HLau5+HsvpG/cuHHJsGHDki1bthSPvfzyy8mQIUOSSZMmJUnivm8ppcTePd9yPvGJTyQnnnhisnXr1uKxO++8MxkwYEDy0EMPJUni3m8ppcTevU9716a+I7h48eIYOnRo9O/fv3jsuOOOi379+sXixYvLuLL275lnnomIaBB70rdt27b4xCc+ETfddFOMGzcuevbs2WiM90HLKSX+3gvp2rBhQyxbtixOOeWU6Ny5c/H4gQceGEOGDInf/e53EeG+bwmlxt493zK2bdsW73nPe2LChAlRXV1dPL6zCmH58uUR4d5vCaXG3r1Pe9dmSkM3bNgQq1evjlGjRjU6N3DgwHj44YfLsKr8WLFiRUS89S/DLVu2RJcuXcq5pHZp27ZtsXnz5pg1a1aMHj06hg8f3uC890HLai7+Ed4LaevatWv85Cc/aZCI7LR+/fqoqqpy37eQUmIf4Z5vKZ06dYp58+Y1Or506dKIiOjdu7d7v4WUEvsI9z7tX5vZEXzxxRcjInb5CX2PHj1i06ZNsWnTptZeVm6sWLEi9ttvv5gxY0bU1NRETU1NjBgxwqeRKevatWv87Gc/i9GjR+/yvPdBy2ou/hHeC2mrqqqKww47rNE9vWzZsnjyySejpqbGfd9CSol9hHu+taxZsyYWLVoUV199dQwYMCBOPvlk934r2VXsI9z7tH9tZkewrq4uImKXn1x26tQpIt78pGb//fdv1XXlxTPPPBN1dXWxadOmmDlzZmzcuDHmz58fl156ab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Vy5coYPXp0dOvWLS6//PJdNl4YN26c+74FlBp793zLeeCBB2LatGkxePDg+PjHPx7r168vxvauu+6KAQMGuPdbSCmxd+/T3rWpRDAi4s9//nPMmDEjfvvb30Z1dXWccMIJMW3atGK9Ni3nF7/4Rdx2222xbNmyqK6ujqFDh8all17qX4QtaFeJSIT3QWvZXfy9F9Jz9913x9e//vUmxyxfvjwi3Pdp25PYu+dbzoMPPhhz586NP/3pT9GlS5f40Ic+FFOnTo1+/foVx7j3W0YpsXfv0561uUQQAACAfdOmviMIAADAvpMIAgAA5IxEEAAAIGckggAAADkjEQQAAMgZiSAAAEDOSAQBAAByRiIIAACQMxJBAACAnPn/YovtX1B9RgoAAAAASUVORK5CYII=\n", + "text/plain": [ + "
        " + ] + }, + "metadata": { + "filenames": { + "image/png": "/Users/mhjensen/Teaching/MachineLearning/doc/LectureNotes/_build/jupyter_execute/chapter3_176_1.png" + } + }, + "output_type": "display_data" + } + ], + "source": [ + "clf_lasso = skl.Lasso(alpha=_lambda).fit(X_train, y_train)\n", + "J_lasso_sk = clf_lasso.coef_.reshape(L, L)\n", + "fig = plt.figure(figsize=(20, 14))\n", + "im = plt.imshow(J_lasso_sk, **cmap_args)\n", + "plt.title(\"Lasso from Scikit-learn\", fontsize=18)\n", + "plt.xticks(fontsize=18)\n", + "plt.yticks(fontsize=18)\n", + "cb = fig.colorbar(im)\n", + "cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)\n", + "\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "It is quite striking how LASSO breaks the symmetry of the coupling\n", + "constant as opposed to ridge and OLS. We get a sparse solution with\n", + "$J_{j, j + 1} = -1$.\n", + "\n", + "\n", + "\n", + "\n", + "We see how the different models perform for a different set of values for $\\lambda$." + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 0%| | 0/10 [00:00" + ] + }, + "metadata": { + "filenames": { + "image/png": "/Users/mhjensen/Teaching/MachineLearning/doc/LectureNotes/_build/jupyter_execute/chapter3_178_13.png" + } + }, + "output_type": "display_data" + } + ], + "source": [ + "lambdas = np.logspace(-4, 5, 10)\n", + "\n", + "train_errors = {\n", + " \"ols_sk\": np.zeros(lambdas.size),\n", + " \"ridge_sk\": np.zeros(lambdas.size),\n", + " \"lasso_sk\": np.zeros(lambdas.size)\n", + "}\n", + "\n", + "test_errors = {\n", + " \"ols_sk\": np.zeros(lambdas.size),\n", + " \"ridge_sk\": np.zeros(lambdas.size),\n", + " \"lasso_sk\": np.zeros(lambdas.size)\n", + "}\n", + "\n", + "plot_counter = 1\n", + "\n", + "fig = plt.figure(figsize=(32, 54))\n", + "\n", + "for i, _lambda in enumerate(tqdm.tqdm(lambdas)):\n", + " for key, method in zip(\n", + " [\"ols_sk\", \"ridge_sk\", \"lasso_sk\"],\n", + " [skl.LinearRegression(), skl.Ridge(alpha=_lambda), skl.Lasso(alpha=_lambda)]\n", + " ):\n", + " method = method.fit(X_train, y_train)\n", + "\n", + " train_errors[key][i] = method.score(X_train, y_train)\n", + " test_errors[key][i] = method.score(X_test, y_test)\n", + "\n", + " omega = method.coef_.reshape(L, L)\n", + "\n", + " plt.subplot(10, 5, plot_counter)\n", + " plt.imshow(omega, **cmap_args)\n", + " plt.title(r\"%s, $\\lambda = %.4f$\" % (key, _lambda))\n", + " plot_counter += 1\n", + "\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We see that LASSO reaches a good solution for low\n", + "values of $\\lambda$, but will \"wither\" when we increase $\\lambda$ too\n", + "much. Ridge is more stable over a larger range of values for\n", + "$\\lambda$, but eventually also fades away.\n", + "\n", + "\n", + "To determine which value of $\\lambda$ is best we plot the accuracy of\n", + "the models when predicting the training and the testing set. We expect\n", + "the accuracy of the training set to be quite good, but if the accuracy\n", + "of the testing set is much lower this tells us that we might be\n", + "subject to an overfit model. The ideal scenario is an accuracy on the\n", + "testing set that is close to the accuracy of the training set." + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAABKUAAANBCAYAAAAxzw1RAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Il7ecAAAACXBIWXMAAAsTAAALEwEAmpwYAAEAAElEQVR4nOz9eZxkZ33ffX/PqX3r6nW6p6eXGY1mAQmDBQwgL9iYxWAb2Y4gsQkIYUnJ7fA4eeyXZfvl5blj374dO84rsZwER0hGLHawgYCMBcYLAS/CRBgDRkI9o5np7uqZ6X2rfTvn+aNnqvucqp61u04tn/fr9j1zrlNV/JSaWs63rut3GbZt2wIAAAAAAACayPS6AAAAAAAAAHQfQikAAAAAAAA0HaEUAAAAAAAAmo5QCgAAAAAAAE1HKAUAAAAAAICmI5QCAAAAAABA0xFKAQAAAAAAoOn8XhfQStbWsrIs2+sy0OUGBuJaWcl4XQbQ1XgdAt7iNQh4j9ch4K1OeQ2apqG+vtiu5wmldrAsm1AKLYF/h4D3eB0C3uI1CHiP1yHgrW54DbJ8DwAAAAAAAE1HKAUAAAAAAICmI5QCAAAAAABA0xFKAQAAAAAAoOkIpQAAAAAAANB0hFIAAAAAAABoOkIpAAAAAAAANB2hFAAAAAAAAJqOUAoAAAAAAABNRygFAAAAAACApiOUAgAAAAAAQNMRSgEAAAAAAKDpCKUAAAAAAADQdIRSAAAAAAAAaDpCKQAAAAAAADQdoRQAAAAAAACajlAKAAAAAAAATUcoBQAAAAAAgKYjlAIAAAAAAEDTEUoBAAAAAACg6QilAAAAAAAA0HSEUgAAAAAAAGg6QikAAAAAAAA0HaEUAAAAAAAAmo5QCgAAAAAAAE3XkqHUL//yL+ud73zndd02lUrpve99r06dOqVTp07p4Ycf1urq6j5XCAAAAAAAgFvh97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zHJfzl1QpbXpUDYB2RSgF7OIT5xf0O9+c0f86v6CvLG0oU654XRKADjARbxxKFauWFvKlJlcDAMDN8QViCsbGHGP5TWZLAbgxhFLALmYyBS3kS/rK8qb+1/Silgtlr0sC0AF2myklSdNplvABANpHpOe445i+UgBuFKEU0ECmXNFqcTuEMg1pdJc+MABwIwbDAYV9jT9+6SsFAGgnkaQzlCqkz8uqMusXwPUjlAIaSLm2Zj8YCSm4y0UkANwI0zA0vstsqel0QTZ9pQAAbSIQHpI/2Lc9YFdVSJ/zriAAbadlrrJTqZTe+9736tSpUzp16pQefvhhra6uXvN+3/zmN3X//ffrZS97me666y7963/9r3XuHG+EuDUp19bs47v0gAGAmzG2y3vKZrmi9RL96wAA7cEwjLrZUvmNKY+qAdCO/F4XIElra2u67777VCqV9MADD6harerxxx/X1NSUPvaxjykYDDa837lz5/TOd75TkUhEP/mTPylJ+sAHPqAf//Ef15NPPqnh4eFm/megg8y6Q6mr9IABgBt1tfeU6XRefaFAE6sBAODmRZLHlV76cu04v3lGtm3JMFpm/gOAFtYSodQTTzyh+fl5ffrTn9bRo0clSS996Ut1//3361Of+pTe/va3N7zfBz/4QeVyOf3BH/yBXvziF0uSXv3qV+ttb3ubnnjiCf3cz/1c0/4b0Dks29aca/nebrtlAcDNuFooNZPJ69sHe5pYDQAANy8Un5DhC8muFiVJViWnUvaCQvFxjysD0A5aIr5+6qmndOrUqVogJUl33323jhw5oqeeemrX+83Nzamvr68WSEnSt33bt6m3t1enT7PzA27OYr6kkrXd0yXq96mfWQsA9lAssPv7yrRrpiYAAK3MMHyK9BxzjLGED8D18jyU2tjYUCqV0h133FF37o477tCzzz67630nJye1sbHh6D21vr6udDqtAwcO7Eu96HzupXsTsbAMw/CoGgCdarfZUov5knKVapOrAQDg5kV6XH2lNs94VAmAduN5KLWwsCBJDfs/DQ0NKZ1OK51ON7zvAw88oJGREf30T/+0nn/+eU1NTelnfuZnFAgE9M53vnNf60bncu+8R5NzAPvhxX0xvfpAUm87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AcF6UUgAAAA6qsrJS8+fPV0BAgKZOnVrjOUopAADg7ExGDwAAAIDarVq1SqdPn9aaNWvk6elZ47mOHTvKZDJRSgEAAKflYrPZbEYPAQAAAAAAgMaFy/cAAAAAAABgd5RSAAAAAAAAsDtKKQAAAAAAANgdpRQAAAAAAADsjlIKAAAAAAAAdkcpBQAAAAAAALujlAIAAAAAAIDdUUoBAAAAAADA7iilAAAAAAAAYHeUUgAAAAAAALC7/wfMu5KHomb2kQAAAABJRU5ErkJggg==\n", + "text/plain": [ + "
        " + ] + }, + "metadata": { + "filenames": { + "image/png": "/Users/mhjensen/Teaching/MachineLearning/doc/LectureNotes/_build/jupyter_execute/chapter3_180_0.png" + } + }, + "output_type": "display_data" + } + ], + "source": [ + "fig = plt.figure(figsize=(20, 14))\n", + "\n", + "colors = {\n", + " \"ols_sk\": \"r\",\n", + " \"ridge_sk\": \"y\",\n", + " \"lasso_sk\": \"c\"\n", + "}\n", + "\n", + "for key in train_errors:\n", + " plt.semilogx(\n", + " lambdas,\n", + " train_errors[key],\n", + " colors[key],\n", + " label=\"Train {0}\".format(key),\n", + " linewidth=4.0\n", + " )\n", + "\n", + "for key in test_errors:\n", + " plt.semilogx(\n", + " lambdas,\n", + " test_errors[key],\n", + " colors[key] + \"--\",\n", + " label=\"Test {0}\".format(key),\n", + " linewidth=4.0\n", + " )\n", + "plt.legend(loc=\"best\", fontsize=18)\n", + "plt.xlabel(r\"$\\lambda$\", fontsize=18)\n", + "plt.ylabel(r\"$R^2$\", fontsize=18)\n", + "plt.tick_params(labelsize=18)\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "From the above figure we can see that LASSO with $\\lambda = 10^{-2}$\n", + "achieves a very good accuracy on the test set. This by far surpasses the\n", + "other models for all values of $\\lambda$.\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "## Exercises and Projects\n", "\n", "\n", @@ -2121,7 +4221,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 32, "metadata": { "collapsed": false, "editable": true @@ -2129,16 +4229,15 @@ "outputs": [ { "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAASsAAADsCAYAAAAsPoAMAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Il7ecAAAACXBIWXMAAAsTAAALEwEAmpwYAAB+N0lEQVR4nO19eXgb5bn9+bRZXmXLWxYnTpw4+x47hC4U2l6gLAkUCIHCJWXpRoGuUG5/bSkthVKgvb2UthdayoUWShMKAUooLU3be8uSYOIlTuLd8W7JkiXL2me+3x+jbzwazUgjW3K2Oc/jJ5E0Mxotc/S+73fe8xJKKXTo0KHjZIfhRJ+ADh06dGiBTlY6dOg4JaCTlQ4dOk4J6GSlQ4eOUwI6WenQoeOUgCnF4/pSoQ4d2Qc50SdwKkCPrHTo0HFKQCcrHTp0nBLQyUqHDh2nBHSy0qFDxykBnax06NBxSkAnKx06dJwS0MlKhw4dpwR0stKhQ8cpAZ2sdOjQcUpAJysdOnScEtDJSocOHacEdLLSoUPHKQGdrHTo0HFKQCcrHTp0nBLQyUqHDh2nBHSyOgGglCIajYLneejThXTo0IZU5ns6Mgye5xGJRBAIBAAAhBCYzWaYzWYYjUYQQkCI7sWmQ4ccJMUvu/6znyFQSsFxHCKRCKLRKPr7+5Gfn4+ioqK47QwGAwghyMnJgclkgsGgB79nAPRfJw3QyWoWwNK+aDSKiYkJHD58GGVlZQiFQvB6vTCZTCgpKUFxcTEKCwtx+PBh1NTUIDc3FwaDASaTSYy8dPI6LaGTlQboZJVl8DyPcDgMnufR19eH4eFhrFmzBmazWUz3QqEQ3G433G43JiYmEA6HMWfOHJSXlyM/Pz8uLTQYDDCbzTCZTDp5nT7QyUoDdLLKEqRpXyQSQUtLC/Ly8rB8+XIQQhAOh1VrU42NjSguLsbk5CR8Ph9ycnLEyCs/Pz9uW528TgvoZKUBeoE9C6CUitGU2+3G0a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jIZrxm4+Vr2qEB33UZGctiwYQgjIzmoqoZYLIL+/m709qaRSMQgil6GesGRKbUN1jQNw8NZbNw4gmq1ClEU0NOTRn9/N9LpRC1Nbf3jO5p0kb5emUwOAwNDGB7OQlHI+9ff343+/h6kUgm89tqreP3113ynzfl8HnPnzsUHH3zgeszatWvx+c9/3riezWZx5pln4vDDD8eJJ56IgYGBtp7TRMZmETnR3ThaJwJ05PMl3/enaRwJ6/3Vl2iBnX6ZvGAulGezRWiaClXVoChkSx6o77xJUgSRiARJEse0cOzUlGsuZFOPc3P/XSfqZgSERDTNHr1YrWE0TbNEn17EE2Sq5WYP8/OfP4S1a9ciFothzz33woUXLkFfX5/jOV5//TV8//vX4N1333V9nMHBQVx//fWWv918882YPXs2VqxYgcceewxXX301br755qCe2oTAJh050WiJZYl9bjweQbFY9v1loWkcz3MtkVk8HoEk0X46zfMDz3EskklivJbLuaeLdNetXK4gny8inyd1slQqgUmTetDVlapZsnC+1zoayLKCfL6IoaEMBgaGUCyWwLKsaT3J2vMLfj1upKeqakO0pygqolEa7ZHoU5JE1/elU7uW1Bpm6dKr8cc//hFLllyO7bffESzr/vlYtepRXHbZZZg0aZLrMUuWLMHZZ59t+dvatWtxxBFHAADmzp2L3//+90Y71OaCTTZysregaJpe0y4xvlIic59buVytfYCa35HopIgtit9+OhphtTMBuF44LhruB6IoBlrM9gtSGyKPB9RrQ5IkoqsrCYYx72wFsR7n9hU77H5Rdo2VXffVuV1A08oZBj09PTjwwINwwAGfb3rsRRddiv7+pOvt9913H2bMmIE99tjD8vcNGzagv78fAIm4E4kEhoaGMHny5NE/gQmCTZKc3FpQAIBhdM9IJholjb7m3Tgvm5K6Va9/d8vRGM/Zn4OuW0c42YvZwaiy/YOms+k0MDg4bNrZMheL62TV6nraTRftGiur7ouHpqnQdR2CwHcsVaZv3Wjfgn/9619Ys2YN7rnnHqxbt87z+HZqcBMZmxQ5WVtQyBff3oLS7ANB0zhd133vxpkfy41k7KRGozlVbeYf7s6ExJX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zZg0qRJrrcPDAxYbg+x5SAkp00AkydPxnnnnYeTTz4ZRx11FObOnYvdd98dCxYswN///nek02lce+21OPfcc3HEEUfg4YcfxjXXXDPey3aEF9FOnToVkiThpZdeAgA89thjlttDbDloqnMKEaITWLVqFW6//XbIsox58+ZhwYIFWLBgARYvXoxZs2bhn//8J5YsWYJCoYAZM2bg2muvhSiK473sEGOMkJxChAgxIRGmdSFChJiQCMkpRIgQExIhOYUIEWJCIiSnECFCTEiE5BQiRIgJiZCcQoQIMSERklOIECEmJP4/uij4BsdHgT0AAAAASUVORK5CYII=\n", "text/plain": [ "
        " ] }, "metadata": { "filenames": { - "image/png": "/Users/mhjensen/Teaching/MachineLearning/doc/LectureNotes/_build/jupyter_execute/chapter3_78_0.png" - }, - "needs_background": "light" + "image/png": "/Users/mhjensen/Teaching/MachineLearning/doc/LectureNotes/_build/jupyter_execute/chapter3_184_0.png" + } }, "output_type": "display_data" } @@ -2428,7 +4527,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 33, "metadata": { "collapsed": false, "editable": true @@ -2441,7 +4540,7 @@ "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mNameError\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[0mscipy\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmisc\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mimread\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mscipy\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmisc\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mimread\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", "\u001b[0;31mNameError\u001b[0m: name 'scipy' is not defined" ] } @@ -2467,6 +4566,7 @@ }, "outputs": [], "source": [ + "\"\"\"\n", "import numpy as np\n", "from imageio import imread\n", "import matplotlib.pyplot as plt\n", @@ -2481,7 +4581,8 @@ "plt.imshow(terrain1, cmap='gray')\n", "plt.xlabel('X')\n", "plt.ylabel('Y')\n", - "plt.show()" + "plt.show()\n", + "\"\"\"" ] }, { diff --git a/doc/LectureNotes/_build/jupyter_execute/chapter3.py b/doc/LectureNotes/_build/jupyter_execute/chapter3.py index c827ef0fe..1b4dd4f8f 100644 --- a/doc/LectureNotes/_build/jupyter_execute/chapter3.py +++ b/doc/LectureNotes/_build/jupyter_execute/chapter3.py @@ -1167,6 +1167,969 @@ plt.ylabel('MSE') plt.legend() plt.show() +## More on Rescaling data + +We end this chapter by adding some words on scaling and how to deal with the intercept for regression cases. + +When you are comparing your own code with for example **Scikit-Learn**'s +library, there are some technicalities to keep in mind. The examples +here demonstrate some of these aspects with potential pitfalls. + +The discussion here focuses on the role of the intercept, how we can +set up the design matrix, what scaling we should use and other topics +which tend confuse us. + +The intercept can be interpreted as the expected value of our +target/output variables when all other predictors are set to zero. +Thus, if we cannot assume that the expected outputs/targets are zero +when all predictors are zero (the columns in the design matrix), it +may be a bad idea to implement a model which penalizes the intercept. +Furthermore, in for example Ridge and Lasso regression, the default solutions +from the library **Scikit-Learn** (when not shrinking $\beta_0$) for the unknown parameters +$\boldsymbol{\beta}$, are derived under the assumption that both $\boldsymbol{y}$ and +$\boldsymbol{X}$ are zero centered, that is we subtract the mean values. + + +If our predictors represent different scales, then it is important to +standardize the design matrix $\boldsymbol{X}$ by subtracting the mean of each +column from the corresponding column and dividing the column with its +standard deviation. Most machine learning libraries do this as a default. This means that if you compare your code with the results from a given library, +the results may differ. + +The +[Standadscaler](https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.StandardScaler.html) +function in **Scikit-Learn** does this for us. For the data sets we +have been studying in our various examples, the data are in many cases +already scaled and there is no need to scale them. You as a user of different machine learning algorithms, should always perform a +survey of your data, with a critical assessment of them in case you need to scale the data. + +If you need to scale the data, not doing so will give an *unfair* +penalization of the parameters since their magnitude depends on the +scale of their corresponding predictor. + +Suppose as an example that you +you have an input variable given by the heights of different persons. +Human height might be measured in inches or meters or +kilometers. If measured in kilometers, a standard linear regression +model with this predictor would probably give a much bigger +coefficient term, than if measured in millimeters. +This can clearly lead to problems in evaluating the cost/loss functions. + + + +Keep in mind that when you transform your data set before training a model, the same transformation needs to be done +on your eventual new data set before making a prediction. If we translate this into a Python code, it would could be implemented as follows + +""" +#Model training, we compute the mean value of y and X +y_train_mean = np.mean(y_train) +X_train_mean = np.mean(X_train,axis=0) +X_train = X_train - X_train_mean +y_train = y_train - y_train_mean + +# The we fit our model with the training data +trained_model = some_model.fit(X_train,y_train) + + +#Model prediction, we need also to transform our data set used for the prediction. +X_test = X_test - X_train_mean #Use mean from training data +y_pred = trained_model(X_test) +y_pred = y_pred + y_train_mean +""" + +Let us try to understand what this may imply mathematically when we +subtract the mean values, also known as *zero centering*. For +simplicity, we will focus on ordinary regression, as done in the above example. + +The cost/loss function for regression is + +$$ +C(\beta_0, \beta_1, ... , \beta_{p-1}) = \frac{1}{n}\sum_{i=0}^{n} \left(y_i - \beta_0 - \sum_{j=1}^{p-1} X_{ij}\beta_j\right)^2,. +$$ + +Recall also that we use the squared value since this leads to an increase of the penalty for higher differences between predicted and output/target values. + +What we have done is to single out the $\beta_0$ term in the definition of the mean squared error (MSE). +The design matrix +$X$ does in this case not contain any intercept column. +When we take the derivative with respect to $\beta_0$, we want the derivative to obey + +$$ +\frac{\partial C}{\partial \beta_j} = 0, +$$ + +for all $j$. For $\beta_0$ we have + +$$ +\frac{\partial C}{\partial \beta_0} = -\frac{2}{n}\sum_{i=0}^{n-1} \left(y_i - \beta_0 - \sum_{j=1}^{p-1} X_{ij} \beta_j\right). +$$ + +Multiplying away the constant $2/n$, we obtain + +$$ +\sum_{i=0}^{n-1} \beta_0 = \sum_{i=0}^{n-1}y_i - \sum_{i=0}^{n-1} \sum_{j=1}^{p-1} X_{ij} \beta_j. +$$ + +We assume +that every column of $\boldsymbol{X}$ is centered, which we can do by subtracting the mean, + +X = X - np.mean(X,axis=0) + +This means that we need to rewrite $X_{ij}$ as $\tilde{X}_{ij}=X_{ij}-\mu_j$, where + +$$ +\mu_j = \frac{1}{n}\sum_{i=0}^{n-1}X_{ij}. +$$ + +Let us special first to the case where we have only two parameters $\beta_0$ and $\beta_1$. +Our result for $\beta_0$ simplifies then to + +$$ +n\beta_0 = \sum_{i=0}^{n-1}y_i - \sum_{i=0}^{n-1} X_{i1} \beta_1. +$$ + +Assuming that the matrix elements $X_{i1}$ are centered, what we have is + +$$ +\beta_0 = \frac{1}{n}\sum_{i=0}^{n-1}y_i - \beta_1\frac{1}{n}\sum_{i=0}^{n-1} \left(X_{i1}-\mu_{1}\right), +$$ + +where + +$$ +\mu_1=\frac{1}{n}\sum_{i=0}^{n-1} (X_{i1}, +$$ + +and if we define the mean value of the outputs as + +$$ +\mu_y=\frac{1}{n}\sum_{i=0}^{n-1}y_i, +$$ + +we have + +$$ +\beta_0 = \mu_y - \beta_1\frac{1}{n}\sum_{i=0}^{n-1} (X_{i1}-\mu_{1}), +$$ + +and it is easy to see that the last sum equals zero! This means that we have + +$$ +\beta_0 = \mu_y, +$$ + +if the columns of the design matrix are centered. It is straight forward to generalize this results to more values of $\beta$. +We have thus + +$$ +\beta_0 = \frac{1}{n}\sum_{i=0}^{n-1} y_i = \overline{\boldsymbol{y}}, +$$ + +the average value of $\boldsymbol{y}$. + +Replacing $y_i$ with $y_i - \beta_0 = y_i - \overline{\boldsymbol{y}}$ and centering also our design matrix results in a cost function (in vector-matrix disguise) + +$$ +C(\boldsymbol{\beta}) = (\boldsymbol{\tilde{y}} - \tilde{X}\boldsymbol{\beta})^T(\boldsymbol{\tilde{y}} - \tilde{X}\boldsymbol{\beta}). +$$ + +If we minimize with respect to $\boldsymbol{\beta}$ we have then + +$$ +\hat{\boldsymbol{\beta}} = (\tilde{X}^T\tilde{X})^{-1}\tilde{X}^T\boldsymbol{\tilde{y}}, +$$ + +where $\boldsymbol{\tilde{y}} = \boldsymbol{y} - \overline{\boldsymbol{y}}$ +and $\tilde{X}_{ij} = X_{ij} - \frac{1}{n}\sum_{k=0}^{n-1}X_{kj}$. + +For Ridge regression we need to add $\lambda \boldsymbol{\beta}^T\boldsymbol{\beta}$ to the cost function and get then + +$$ +\hat{\boldsymbol{\beta}} = (\tilde{X}^T\tilde{X} + \lambda I)^{-1}\tilde{X}^T\boldsymbol{\tilde{y}}. +$$ + +What does this mean? And why do we insist on all this? Let us look at some examples. + + +This code shows a simple first-order fit to a data set using the above transformed data, where we consider the role of the intercept first, by either excluding it or including it (*code example thanks to Øyvind Sigmundson Schøyen*). Here our scaling of the data is done by subtracting the mean values only. +Note also that we do not split the data into training and test. + +import numpy as np +import matplotlib.pyplot as plt + +from sklearn.linear_model import LinearRegression + + +np.random.seed(2021) + +def MSE(y_data,y_model): + n = np.size(y_model) + return np.sum((y_data-y_model)**2)/n + + +def fit_beta(X, y): + return np.linalg.pinv(X.T @ X) @ X.T @ y + + +true_beta = [2, 0.5, 3.7] + +x = np.linspace(0, 1, 11) +y = np.sum( + np.asarray([x ** p * b for p, b in enumerate(true_beta)]), axis=0 +) + 0.1 * np.random.normal(size=len(x)) + +degree = 3 +X = np.zeros((len(x), degree)) + +# Include the intercept in the design matrix +for p in range(degree): + X[:, p] = x ** p + +beta = fit_beta(X, y) + +# Intercept is included in the design matrix +skl = LinearRegression(fit_intercept=False).fit(X, y) + +print(f"True beta: {true_beta}") +print(f"Fitted beta: {beta}") +print(f"Sklearn fitted beta: {skl.coef_}") +ypredictOwn = X @ beta +ypredictSKL = skl.predict(X) +print(f"MSE with intercept column") +print(MSE(y,ypredictOwn)) +print(f"MSE with intercept column from SKL") +print(MSE(y,ypredictSKL)) + + +plt.figure() +plt.scatter(x, y, label="Data") +plt.plot(x, X @ beta, label="Fit") +plt.plot(x, skl.predict(X), label="Sklearn (fit_intercept=False)") + + +# Do not include the intercept in the design matrix +X = np.zeros((len(x), degree - 1)) + +for p in range(degree - 1): + X[:, p] = x ** (p + 1) + +# Intercept is not included in the design matrix +skl = LinearRegression(fit_intercept=True).fit(X, y) + +# Use centered values for X and y when computing coefficients +y_offset = np.average(y, axis=0) +X_offset = np.average(X, axis=0) + +beta = fit_beta(X - X_offset, y - y_offset) +intercept = np.mean(y_offset - X_offset @ beta) + +print(f"Manual intercept: {intercept}") +print(f"Fitted beta (wiothout intercept): {beta}") +print(f"Sklearn intercept: {skl.intercept_}") +print(f"Sklearn fitted beta (without intercept): {skl.coef_}") +ypredictOwn = X @ beta +ypredictSKL = skl.predict(X) +print(f"MSE with Manual intercept") +print(MSE(y,ypredictOwn+intercept)) +print(f"MSE with Sklearn intercept") +print(MSE(y,ypredictSKL)) + +plt.plot(x, X @ beta + intercept, "--", label="Fit (manual intercept)") +plt.plot(x, skl.predict(X), "--", label="Sklearn (fit_intercept=True)") +plt.grid() +plt.legend() + +plt.show() + +The intercept is the value of our output/target variable +when all our features are zero and our function crosses the $y$-axis (for a one-dimensional case). + +Printing the MSE, we see first that both methods give the same MSE, as +they should. However, when we move to for example Ridge regression, +the way we treat the intercept may give a larger or smaller MSE, +meaning that the MSE can be penalized by the value of the +intercept. Not including the intercept in the fit, means that the +regularization term does not include $\beta_0$. For different values +of $\lambda$, this may lead to differeing MSE values. + +To remind the reader, the regularization term, with the intercept in Ridge regression, is given by + +$$ +\lambda \vert\vert \boldsymbol{\beta} \vert\vert_2^2 = \lambda \sum_{j=0}^{p-1}\beta_j^2, +$$ + +but when we take out the intercept, this equation becomes + +$$ +\lambda \vert\vert \boldsymbol{\beta} \vert\vert_2^2 = \lambda \sum_{j=1}^{p-1}\beta_j^2. +$$ + +For Lasso regression we have + +$$ +\lambda \vert\vert \boldsymbol{\beta} \vert\vert_1 = \lambda \sum_{j=1}^{p-1}\vert\beta_j\vert. +$$ + +It means that, when scaling the design matrix and the outputs/targets, +by subtracting the mean values, we have an optimization problem which +is not penalized by the intercept. The MSE value can then be smaller +since it focuses only on the remaining quantities. If we however bring +back the intercept, we will get a MSE which then contains the +intercept. + + +Armed with this wisdom, we attempt first to simply set the intercept equal to **False** in our implementation of Ridge regression for our well-known vanilla data set. + +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt +from sklearn.model_selection import train_test_split +from sklearn import linear_model + +def MSE(y_data,y_model): + n = np.size(y_model) + return np.sum((y_data-y_model)**2)/n + + +# A seed just to ensure that the random numbers are the same for every run. +# Useful for eventual debugging. +np.random.seed(3155) + +n = 100 +x = np.random.rand(n) +y = np.exp(-x**2) + 1.5 * np.exp(-(x-2)**2) + +Maxpolydegree = 20 +X = np.zeros((n,Maxpolydegree)) +#We include explicitely the intercept column +for degree in range(Maxpolydegree): + X[:,degree] = x**degree +# We split the data in test and training data +X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2) + +p = Maxpolydegree +I = np.eye(p,p) +# Decide which values of lambda to use +nlambdas = 6 +MSEOwnRidgePredict = np.zeros(nlambdas) +MSERidgePredict = np.zeros(nlambdas) +lambdas = np.logspace(-4, 2, nlambdas) +for i in range(nlambdas): + lmb = lambdas[i] + OwnRidgeBeta = np.linalg.pinv(X_train.T @ X_train+lmb*I) @ X_train.T @ y_train + # Note: we include the intercept column and no scaling + RegRidge = linear_model.Ridge(lmb,fit_intercept=False) + RegRidge.fit(X_train,y_train) + # and then make the prediction + ytildeOwnRidge = X_train @ OwnRidgeBeta + ypredictOwnRidge = X_test @ OwnRidgeBeta + ytildeRidge = RegRidge.predict(X_train) + ypredictRidge = RegRidge.predict(X_test) + MSEOwnRidgePredict[i] = MSE(y_test,ypredictOwnRidge) + MSERidgePredict[i] = MSE(y_test,ypredictRidge) + print("Beta values for own Ridge implementation") + print(OwnRidgeBeta) + print("Beta values for Scikit-Learn Ridge implementation") + print(RegRidge.coef_) + print("MSE values for own Ridge implementation") + print(MSEOwnRidgePredict[i]) + print("MSE values for Scikit-Learn Ridge implementation") + print(MSERidgePredict[i]) + +# Now plot the results +plt.figure() +plt.plot(np.log10(lambdas), MSEOwnRidgePredict, 'r', label = 'MSE own Ridge Test') +plt.plot(np.log10(lambdas), MSERidgePredict, 'g', label = 'MSE Ridge Test') + +plt.xlabel('log10(lambda)') +plt.ylabel('MSE') +plt.legend() +plt.show() + +The results here agree when we force **Scikit-Learn**'s Ridge function to include the first column in our design matrix. +We see that the results agree very well. Here we have thus explicitely included the intercept column in the design matrix. +What happens if we do not include the intercept in our fit? +Let us see how we can change this code by zero centering. + +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt +from sklearn.model_selection import train_test_split +from sklearn import linear_model +from sklearn.preprocessing import StandardScaler + +def MSE(y_data,y_model): + n = np.size(y_model) + return np.sum((y_data-y_model)**2)/n +# A seed just to ensure that the random numbers are the same for every run. +# Useful for eventual debugging. +np.random.seed(315) + +n = 100 +x = np.random.rand(n) +y = np.exp(-x**2) + 1.5 * np.exp(-(x-2)**2) + +Maxpolydegree = 20 +X = np.zeros((n,Maxpolydegree-1)) + +for degree in range(1,Maxpolydegree): #No intercept column + X[:,degree-1] = x**(degree) + +# We split the data in test and training data +X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2) + +#For our own implementation, we will need to deal with the intercept by centering the design matrix and the target variable +X_train_mean = np.mean(X_train,axis=0) +#Center by removing mean from each feature +X_train_scaled = X_train - X_train_mean +X_test_scaled = X_test - X_train_mean +#The model intercept (called y_scaler) is given by the mean of the target variable (IF X is centered) +#Remove the intercept from the training data. +y_scaler = np.mean(y_train) +y_train_scaled = y_train - y_scaler + +p = Maxpolydegree-1 +I = np.eye(p,p) +# Decide which values of lambda to use +nlambdas = 6 +MSEOwnRidgePredict = np.zeros(nlambdas) +MSERidgePredict = np.zeros(nlambdas) + +lambdas = np.logspace(-4, 2, nlambdas) +for i in range(nlambdas): + lmb = lambdas[i] + OwnRidgeBeta = np.linalg.pinv(X_train_scaled.T @ X_train_scaled+lmb*I) @ X_train_scaled.T @ (y_train_scaled) + intercept_ = y_scaler - X_train_mean@OwnRidgeBeta #The intercept can be shifted so the model can predict on uncentered data + #Add intercept to prediction + ypredictOwnRidge = X_test @ OwnRidgeBeta + intercept_ + #Add intercept to prediction + ypredictOwnRidge = X_test_scaled @ OwnRidgeBeta + y_scaler + RegRidge = linear_model.Ridge(lmb) + RegRidge.fit(X_train,y_train) + ypredictRidge = RegRidge.predict(X_test) + MSEOwnRidgePredict[i] = MSE(y_test,ypredictOwnRidge) + MSERidgePredict[i] = MSE(y_test,ypredictRidge) + print("Beta values for own Ridge implementation") + print(OwnRidgeBeta) #Intercept is given by mean of target variable + print("Beta values for Scikit-Learn Ridge implementation") + print(RegRidge.coef_) + print('Intercept from own implementation:') + print(intercept_) + print('Intercept from Scikit-Learn Ridge implementation') + print(RegRidge.intercept_) + print("MSE values for own Ridge implementation") + print(MSEOwnRidgePredict[i]) + print("MSE values for Scikit-Learn Ridge implementation") + print(MSERidgePredict[i]) + + +# Now plot the results +plt.figure() +plt.plot(np.log10(lambdas), MSEOwnRidgePredict, 'b--', label = 'MSE own Ridge Test') +plt.plot(np.log10(lambdas), MSERidgePredict, 'g--', label = 'MSE SL Ridge Test') +plt.xlabel('log10(lambda)') +plt.ylabel('MSE') +plt.legend() +plt.show() + +We see here, when compared to the code which includes explicitely the +intercept column, that our MSE value is actually smaller. This is +because the regularization term does not include the intercept value +$\beta_0$ in the fitting. This applies to Lasso regularization as +well. It means that our optimization is now done only with the +centered matrix and/or vector that enter the fitting procedure. Note +also that the problem with the intercept occurs mainly in these type +of polynomial fitting problem. + +The next example is indeed an example where all these discussions about the role of intercept are not present. + +## More complicated Example: The Ising model + +The one-dimensional Ising model with nearest neighbor interaction, no +external field and a constant coupling constant $J$ is given by + + +
        + +$$ +\begin{equation} + H = -J \sum_{k}^L s_k s_{k + 1}, +\label{_auto1} \tag{1} +\end{equation} +$$ + +where $s_i \in \{-1, 1\}$ and $s_{N + 1} = s_1$. The number of spins +in the system is determined by $L$. For the one-dimensional system +there is no phase transition. + +We will look at a system of $L = 40$ spins with a coupling constant of +$J = 1$. To get enough training data we will generate 10000 states +with their respective energies. + +import numpy as np +import matplotlib.pyplot as plt +from mpl_toolkits.axes_grid1 import make_axes_locatable +import seaborn as sns +import scipy.linalg as scl +from sklearn.model_selection import train_test_split +import tqdm +sns.set(color_codes=True) +cmap_args=dict(vmin=-1., vmax=1., cmap='seismic') + +L = 40 +n = int(1e4) + +spins = np.random.choice([-1, 1], size=(n, L)) +J = 1.0 + +energies = np.zeros(n) + +for i in range(n): + energies[i] = - J * np.dot(spins[i], np.roll(spins[i], 1)) + +Here we use ordinary least squares +regression to predict the energy for the nearest neighbor +one-dimensional Ising model on a ring, i.e., the endpoints wrap +around. We will use linear regression to fit a value for +the coupling constant to achieve this. + +A more general form for the one-dimensional Ising model is + + +
        + +$$ +\begin{equation} + H = - \sum_j^L \sum_k^L s_j s_k J_{jk}. +\label{_auto2} \tag{2} +\end{equation} +$$ + +Here we allow for interactions beyond the nearest neighbors and a state dependent +coupling constant. This latter expression can be formulated as +a matrix-product + + +
        + +$$ +\begin{equation} + \boldsymbol{H} = \boldsymbol{X} J, +\label{_auto3} \tag{3} +\end{equation} +$$ + +where $X_{jk} = s_j s_k$ and $J$ is a matrix which consists of the +elements $-J_{jk}$. This form of writing the energy fits perfectly +with the form utilized in linear regression, that is + + +
        + +$$ +\begin{equation} + \boldsymbol{y} = \boldsymbol{X}\boldsymbol{\beta} + \boldsymbol{\epsilon}, +\label{_auto4} \tag{4} +\end{equation} +$$ + +We split the data in training and test data as discussed in the previous example + +X = np.zeros((n, L ** 2)) +for i in range(n): + X[i] = np.outer(spins[i], spins[i]).ravel() +y = energies +X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2) + +In the ordinary least squares method we choose the cost function + + +
        + +$$ +\begin{equation} + C(\boldsymbol{X}, \boldsymbol{\beta})= \frac{1}{n}\left\{(\boldsymbol{X}\boldsymbol{\beta} - \boldsymbol{y})^T(\boldsymbol{X}\boldsymbol{\beta} - \boldsymbol{y})\right\}. +\label{_auto5} \tag{5} +\end{equation} +$$ + +We then find the extremal point of $C$ by taking the derivative with respect to $\boldsymbol{\beta}$ as discussed above. +This yields the expression for $\boldsymbol{\beta}$ to be + +$$ +\boldsymbol{\beta} = \frac{\boldsymbol{X}^T \boldsymbol{y}}{\boldsymbol{X}^T \boldsymbol{X}}, +$$ + +which immediately imposes some requirements on $\boldsymbol{X}$ as there must exist +an inverse of $\boldsymbol{X}^T \boldsymbol{X}$. If the expression we are modeling contains an +intercept, i.e., a constant term, we must make sure that the +first column of $\boldsymbol{X}$ consists of $1$. We do this here + +X_train_own = np.concatenate( + (np.ones(len(X_train))[:, np.newaxis], X_train), + axis=1 +) +X_test_own = np.concatenate( + (np.ones(len(X_test))[:, np.newaxis], X_test), + axis=1 +) + +Doing the inversion directly turns out to be a bad idea since the matrix +$\boldsymbol{X}^T\boldsymbol{X}$ is singular. An alternative approach is to use the **singular +value decomposition**. Using the definition of the Moore-Penrose +pseudoinverse we can write the equation for $\boldsymbol{\beta}$ as + +$$ +\boldsymbol{\beta} = \boldsymbol{X}^{+}\boldsymbol{y}, +$$ + +where the pseudoinverse of $\boldsymbol{X}$ is given by + +$$ +\boldsymbol{X}^{+} = \frac{\boldsymbol{X}^T}{\boldsymbol{X}^T\boldsymbol{X}}. +$$ + +Using singular value decomposition we can decompose the matrix $\boldsymbol{X} = \boldsymbol{U}\boldsymbol{\Sigma} \boldsymbol{V}^T$, +where $\boldsymbol{U}$ and $\boldsymbol{V}$ are orthogonal(unitary) matrices and $\boldsymbol{\Sigma}$ contains the singular values (more details below). +where $X^{+} = V\Sigma^{+} U^T$. This reduces the equation for +$\omega$ to + + +
        + +$$ +\begin{equation} + \boldsymbol{\beta} = \boldsymbol{V}\boldsymbol{\Sigma}^{+} \boldsymbol{U}^T \boldsymbol{y}. +\label{_auto6} \tag{6} +\end{equation} +$$ + +Note that solving this equation by actually doing the pseudoinverse +(which is what we will do) is not a good idea as this operation scales +as $\mathcal{O}(n^3)$, where $n$ is the number of elements in a +general matrix. Instead, doing $QR$-factorization and solving the +linear system as an equation would reduce this down to +$\mathcal{O}(n^2)$ operations. + +def ols_svd(x: np.ndarray, y: np.ndarray) -> np.ndarray: + u, s, v = scl.svd(x) + return v.T @ scl.pinv(scl.diagsvd(s, u.shape[0], v.shape[0])) @ u.T @ y + +beta = ols_svd(X_train_own,y_train) + +When extracting the $J$-matrix we need to make sure that we remove the intercept, as is done here + +J = beta[1:].reshape(L, L) + +A way of looking at the coefficients in $J$ is to plot the matrices as images. + +fig = plt.figure(figsize=(20, 14)) +im = plt.imshow(J, **cmap_args) +plt.title("OLS", fontsize=18) +plt.xticks(fontsize=18) +plt.yticks(fontsize=18) +cb = fig.colorbar(im) +cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18) +plt.show() + +It is interesting to note that OLS +considers both $J_{j, j + 1} = -0.5$ and $J_{j, j - 1} = -0.5$ as +valid matrix elements for $J$. +In our discussion below on hyperparameters and Ridge and Lasso regression we will see that +this problem can be removed, partly and only with Lasso regression. + +In this case our matrix inversion was actually possible. The obvious question now is what is the mathematics behind the SVD? + + + + + +Let us now +focus on Ridge and Lasso regression as well. We repeat some of the +basic parts of the Ising model and the setup of the training and test +data. The one-dimensional Ising model with nearest neighbor +interaction, no external field and a constant coupling constant $J$ is +given by + + +
        + +$$ +\begin{equation} + H = -J \sum_{k}^L s_k s_{k + 1}, +\label{_auto7} \tag{7} +\end{equation} +$$ + +where $s_i \in \{-1, 1\}$ and $s_{N + 1} = s_1$. The number of spins in the system is determined by $L$. For the one-dimensional system there is no phase transition. + +We will look at a system of $L = 40$ spins with a coupling constant of $J = 1$. To get enough training data we will generate 10000 states with their respective energies. + +import numpy as np +import matplotlib.pyplot as plt +from mpl_toolkits.axes_grid1 import make_axes_locatable +import seaborn as sns +import scipy.linalg as scl +from sklearn.model_selection import train_test_split +import sklearn.linear_model as skl +import tqdm +sns.set(color_codes=True) +cmap_args=dict(vmin=-1., vmax=1., cmap='seismic') + +L = 40 +n = int(1e4) + +spins = np.random.choice([-1, 1], size=(n, L)) +J = 1.0 + +energies = np.zeros(n) + +for i in range(n): + energies[i] = - J * np.dot(spins[i], np.roll(spins[i], 1)) + +A more general form for the one-dimensional Ising model is + + +
        + +$$ +\begin{equation} + H = - \sum_j^L \sum_k^L s_j s_k J_{jk}. +\label{_auto8} \tag{8} +\end{equation} +$$ + +Here we allow for interactions beyond the nearest neighbors and a more +adaptive coupling matrix. This latter expression can be formulated as +a matrix-product on the form + + +
        + +$$ +\begin{equation} + H = X J, +\label{_auto9} \tag{9} +\end{equation} +$$ + +where $X_{jk} = s_j s_k$ and $J$ is the matrix consisting of the +elements $-J_{jk}$. This form of writing the energy fits perfectly +with the form utilized in linear regression, viz. + + +
        + +$$ +\begin{equation} + \boldsymbol{y} = \boldsymbol{X}\boldsymbol{\beta} + \boldsymbol{\epsilon}. +\label{_auto10} \tag{10} +\end{equation} +$$ + +We organize the data as we did above + +X = np.zeros((n, L ** 2)) +for i in range(n): + X[i] = np.outer(spins[i], spins[i]).ravel() +y = energies +X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.96) + +X_train_own = np.concatenate( + (np.ones(len(X_train))[:, np.newaxis], X_train), + axis=1 +) + +X_test_own = np.concatenate( + (np.ones(len(X_test))[:, np.newaxis], X_test), + axis=1 +) + +We will do all fitting with **Scikit-Learn**, + +clf = skl.LinearRegression().fit(X_train, y_train) + +When extracting the $J$-matrix we make sure to remove the intercept + +J_sk = clf.coef_.reshape(L, L) + +And then we plot the results + +fig = plt.figure(figsize=(20, 14)) +im = plt.imshow(J_sk, **cmap_args) +plt.title("LinearRegression from Scikit-learn", fontsize=18) +plt.xticks(fontsize=18) +plt.yticks(fontsize=18) +cb = fig.colorbar(im) +cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18) +plt.show() + +The results agree perfectly with our previous discussion where we used our own code. + + +Having explored the ordinary least squares we move on to ridge +regression. In ridge regression we include a **regularizer**. This +involves a new cost function which leads to a new estimate for the +weights $\boldsymbol{\beta}$. This results in a penalized regression problem. The +cost function is given by + +6 +0 + +< +< +< +! +! +M +A +T +H +_ +B +L +O +C +K + +_lambda = 0.1 +clf_ridge = skl.Ridge(alpha=_lambda).fit(X_train, y_train) +J_ridge_sk = clf_ridge.coef_.reshape(L, L) +fig = plt.figure(figsize=(20, 14)) +im = plt.imshow(J_ridge_sk, **cmap_args) +plt.title("Ridge from Scikit-learn", fontsize=18) +plt.xticks(fontsize=18) +plt.yticks(fontsize=18) +cb = fig.colorbar(im) +cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18) + +plt.show() + +In the **Least Absolute Shrinkage and Selection Operator** (LASSO)-method we get a third cost function. + + +
        + +$$ +\begin{equation} + C(\boldsymbol{X}, \boldsymbol{\beta}; \lambda) = (\boldsymbol{X}\boldsymbol{\beta} - \boldsymbol{y})^T(\boldsymbol{X}\boldsymbol{\beta} - \boldsymbol{y}) + \lambda \sqrt{\boldsymbol{\beta}^T\boldsymbol{\beta}}. +\label{_auto12} \tag{12} +\end{equation} +$$ + +Finding the extremal point of this cost function is not so straight-forward as in least squares and ridge. We will therefore rely solely on the function ``Lasso`` from **Scikit-Learn**. + +clf_lasso = skl.Lasso(alpha=_lambda).fit(X_train, y_train) +J_lasso_sk = clf_lasso.coef_.reshape(L, L) +fig = plt.figure(figsize=(20, 14)) +im = plt.imshow(J_lasso_sk, **cmap_args) +plt.title("Lasso from Scikit-learn", fontsize=18) +plt.xticks(fontsize=18) +plt.yticks(fontsize=18) +cb = fig.colorbar(im) +cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18) + +plt.show() + +It is quite striking how LASSO breaks the symmetry of the coupling +constant as opposed to ridge and OLS. We get a sparse solution with +$J_{j, j + 1} = -1$. + + + + +We see how the different models perform for a different set of values for $\lambda$. + +lambdas = np.logspace(-4, 5, 10) + +train_errors = { + "ols_sk": np.zeros(lambdas.size), + "ridge_sk": np.zeros(lambdas.size), + "lasso_sk": np.zeros(lambdas.size) +} + +test_errors = { + "ols_sk": np.zeros(lambdas.size), + "ridge_sk": np.zeros(lambdas.size), + "lasso_sk": np.zeros(lambdas.size) +} + +plot_counter = 1 + +fig = plt.figure(figsize=(32, 54)) + +for i, _lambda in enumerate(tqdm.tqdm(lambdas)): + for key, method in zip( + ["ols_sk", "ridge_sk", "lasso_sk"], + [skl.LinearRegression(), skl.Ridge(alpha=_lambda), skl.Lasso(alpha=_lambda)] + ): + method = method.fit(X_train, y_train) + + train_errors[key][i] = method.score(X_train, y_train) + test_errors[key][i] = method.score(X_test, y_test) + + omega = method.coef_.reshape(L, L) + + plt.subplot(10, 5, plot_counter) + plt.imshow(omega, **cmap_args) + plt.title(r"%s, $\lambda = %.4f$" % (key, _lambda)) + plot_counter += 1 + +plt.show() + +We see that LASSO reaches a good solution for low +values of $\lambda$, but will "wither" when we increase $\lambda$ too +much. Ridge is more stable over a larger range of values for +$\lambda$, but eventually also fades away. + + +To determine which value of $\lambda$ is best we plot the accuracy of +the models when predicting the training and the testing set. We expect +the accuracy of the training set to be quite good, but if the accuracy +of the testing set is much lower this tells us that we might be +subject to an overfit model. The ideal scenario is an accuracy on the +testing set that is close to the accuracy of the training set. + +fig = plt.figure(figsize=(20, 14)) + +colors = { + "ols_sk": "r", + "ridge_sk": "y", + "lasso_sk": "c" +} + +for key in train_errors: + plt.semilogx( + lambdas, + train_errors[key], + colors[key], + label="Train {0}".format(key), + linewidth=4.0 + ) + +for key in test_errors: + plt.semilogx( + lambdas, + test_errors[key], + colors[key] + "--", + label="Test {0}".format(key), + linewidth=4.0 + ) +plt.legend(loc="best", fontsize=18) +plt.xlabel(r"$\lambda$", fontsize=18) +plt.ylabel(r"$R^2$", fontsize=18) +plt.tick_params(labelsize=18) +plt.show() + +From the above figure we can see that LASSO with $\lambda = 10^{-2}$ +achieves a very good accuracy on the test set. This by far surpasses the +other models for all values of $\lambda$. + + + + + + ## Exercises and Projects @@ -1439,6 +2402,7 @@ scipy.misc.imread Here is a simple part of a Python code which reads and plots the data from such files +""" import numpy as np from imageio import imread import matplotlib.pyplot as plt @@ -1454,6 +2418,7 @@ plt.imshow(terrain1, cmap='gray') plt.xlabel('X') plt.ylabel('Y') plt.show() +""" If you should have problems in downloading the digital terrain data, we provide two examples under the data folder of project 1. One is diff --git a/doc/LectureNotes/_build/jupyter_execute/chapter3_110_1.png b/doc/LectureNotes/_build/jupyter_execute/chapter3_110_1.png new file mode 100644 index 000000000..0d08a7f4f Binary files /dev/null and b/doc/LectureNotes/_build/jupyter_execute/chapter3_110_1.png differ diff --git a/doc/LectureNotes/_build/jupyter_execute/chapter3_118_1.png b/doc/LectureNotes/_build/jupyter_execute/chapter3_118_1.png new file mode 100644 index 000000000..78fb94a30 Binary files /dev/null and b/doc/LectureNotes/_build/jupyter_execute/chapter3_118_1.png differ diff --git a/doc/LectureNotes/_build/jupyter_execute/chapter3_120_1.png b/doc/LectureNotes/_build/jupyter_execute/chapter3_120_1.png new file mode 100644 index 000000000..92f4ae772 Binary files /dev/null and b/doc/LectureNotes/_build/jupyter_execute/chapter3_120_1.png differ diff --git a/doc/LectureNotes/_build/jupyter_execute/chapter3_151_1.png b/doc/LectureNotes/_build/jupyter_execute/chapter3_151_1.png new file mode 100644 index 000000000..a518cb04b Binary files /dev/null and b/doc/LectureNotes/_build/jupyter_execute/chapter3_151_1.png differ diff --git a/doc/LectureNotes/_build/jupyter_execute/chapter3_169_1.png b/doc/LectureNotes/_build/jupyter_execute/chapter3_169_1.png new file mode 100644 index 000000000..8098b2e40 Binary files /dev/null and b/doc/LectureNotes/_build/jupyter_execute/chapter3_169_1.png differ diff --git a/doc/LectureNotes/_build/jupyter_execute/chapter3_172_1.png b/doc/LectureNotes/_build/jupyter_execute/chapter3_172_1.png new file mode 100644 index 000000000..32745c831 Binary files /dev/null and b/doc/LectureNotes/_build/jupyter_execute/chapter3_172_1.png differ diff --git a/doc/LectureNotes/_build/jupyter_execute/chapter3_176_1.png b/doc/LectureNotes/_build/jupyter_execute/chapter3_176_1.png new file mode 100644 index 000000000..f629a218c Binary files /dev/null and b/doc/LectureNotes/_build/jupyter_execute/chapter3_176_1.png differ diff --git a/doc/LectureNotes/_build/jupyter_execute/chapter3_178_13.png b/doc/LectureNotes/_build/jupyter_execute/chapter3_178_13.png new file mode 100644 index 000000000..118120ef6 Binary files /dev/null and b/doc/LectureNotes/_build/jupyter_execute/chapter3_178_13.png differ diff --git a/doc/LectureNotes/_build/jupyter_execute/chapter3_180_0.png b/doc/LectureNotes/_build/jupyter_execute/chapter3_180_0.png new file mode 100644 index 000000000..e6bb9a232 Binary files /dev/null and b/doc/LectureNotes/_build/jupyter_execute/chapter3_180_0.png differ diff --git a/doc/LectureNotes/_build/jupyter_execute/chapter3_184_0.png b/doc/LectureNotes/_build/jupyter_execute/chapter3_184_0.png new file mode 100644 index 000000000..ef5da849b Binary files /dev/null and b/doc/LectureNotes/_build/jupyter_execute/chapter3_184_0.png differ diff --git a/doc/LectureNotes/_build/jupyter_execute/chapter3_47_0.png b/doc/LectureNotes/_build/jupyter_execute/chapter3_47_0.png index 34a363f1c..74f910023 100644 Binary files a/doc/LectureNotes/_build/jupyter_execute/chapter3_47_0.png and b/doc/LectureNotes/_build/jupyter_execute/chapter3_47_0.png differ diff --git a/doc/LectureNotes/_build/jupyter_execute/chapter3_62_5.png b/doc/LectureNotes/_build/jupyter_execute/chapter3_62_5.png new file mode 100644 index 000000000..2116c169f Binary files /dev/null and b/doc/LectureNotes/_build/jupyter_execute/chapter3_62_5.png differ diff --git a/doc/LectureNotes/_build/jupyter_execute/chapter3_65_10.png b/doc/LectureNotes/_build/jupyter_execute/chapter3_65_10.png new file mode 100644 index 000000000..df911b5f7 Binary files /dev/null and b/doc/LectureNotes/_build/jupyter_execute/chapter3_65_10.png differ diff --git a/doc/LectureNotes/chapter3.ipynb b/doc/LectureNotes/chapter3.ipynb index 413c54051..18cd038f8 100644 --- a/doc/LectureNotes/chapter3.ipynb +++ b/doc/LectureNotes/chapter3.ipynb @@ -1598,6 +1598,1604 @@ "cell_type": "markdown", "metadata": {}, "source": [ + "## More on Rescaling data\n", + "\n", + "We end this chapter by adding some words on scaling and how to deal with the intercept for regression cases.\n", + "\n", + "When you are comparing your own code with for example **Scikit-Learn**'s\n", + "library, there are some technicalities to keep in mind. The examples\n", + "here demonstrate some of these aspects with potential pitfalls.\n", + "\n", + "The discussion here focuses on the role of the intercept, how we can\n", + "set up the design matrix, what scaling we should use and other topics\n", + "which tend confuse us.\n", + "\n", + "The intercept can be interpreted as the expected value of our\n", + "target/output variables when all other predictors are set to zero.\n", + "Thus, if we cannot assume that the expected outputs/targets are zero\n", + "when all predictors are zero (the columns in the design matrix), it\n", + "may be a bad idea to implement a model which penalizes the intercept.\n", + "Furthermore, in for example Ridge and Lasso regression, the default solutions\n", + "from the library **Scikit-Learn** (when not shrinking $\\beta_0$) for the unknown parameters\n", + "$\\boldsymbol{\\beta}$, are derived under the assumption that both $\\boldsymbol{y}$ and\n", + "$\\boldsymbol{X}$ are zero centered, that is we subtract the mean values.\n", + "\n", + "\n", + "If our predictors represent different scales, then it is important to\n", + "standardize the design matrix $\\boldsymbol{X}$ by subtracting the mean of each\n", + "column from the corresponding column and dividing the column with its\n", + "standard deviation. Most machine learning libraries do this as a default. This means that if you compare your code with the results from a given library,\n", + "the results may differ. \n", + "\n", + "The\n", + "[Standadscaler](https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.StandardScaler.html)\n", + "function in **Scikit-Learn** does this for us. For the data sets we\n", + "have been studying in our various examples, the data are in many cases\n", + "already scaled and there is no need to scale them. You as a user of different machine learning algorithms, should always perform a\n", + "survey of your data, with a critical assessment of them in case you need to scale the data.\n", + "\n", + "If you need to scale the data, not doing so will give an *unfair*\n", + "penalization of the parameters since their magnitude depends on the\n", + "scale of their corresponding predictor.\n", + "\n", + "Suppose as an example that you \n", + "you have an input variable given by the heights of different persons.\n", + "Human height might be measured in inches or meters or\n", + "kilometers. If measured in kilometers, a standard linear regression\n", + "model with this predictor would probably give a much bigger\n", + "coefficient term, than if measured in millimeters.\n", + "This can clearly lead to problems in evaluating the cost/loss functions.\n", + "\n", + "\n", + "\n", + "Keep in mind that when you transform your data set before training a model, the same transformation needs to be done\n", + "on your eventual new data set before making a prediction. If we translate this into a Python code, it would could be implemented as follows" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "\"\"\"\n", + "#Model training, we compute the mean value of y and X\n", + "y_train_mean = np.mean(y_train)\n", + "X_train_mean = np.mean(X_train,axis=0)\n", + "X_train = X_train - X_train_mean\n", + "y_train = y_train - y_train_mean\n", + "\n", + "# The we fit our model with the training data\n", + "trained_model = some_model.fit(X_train,y_train)\n", + "\n", + "\n", + "#Model prediction, we need also to transform our data set used for the prediction.\n", + "X_test = X_test - X_train_mean #Use mean from training data\n", + "y_pred = trained_model(X_test)\n", + "y_pred = y_pred + y_train_mean\n", + "\"\"\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Let us try to understand what this may imply mathematically when we\n", + "subtract the mean values, also known as *zero centering*. For\n", + "simplicity, we will focus on ordinary regression, as done in the above example.\n", + "\n", + "The cost/loss function for regression is" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "C(\\beta_0, \\beta_1, ... , \\beta_{p-1}) = \\frac{1}{n}\\sum_{i=0}^{n} \\left(y_i - \\beta_0 - \\sum_{j=1}^{p-1} X_{ij}\\beta_j\\right)^2,.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Recall also that we use the squared value since this leads to an increase of the penalty for higher differences between predicted and output/target values.\n", + "\n", + "What we have done is to single out the $\\beta_0$ term in the definition of the mean squared error (MSE).\n", + "The design matrix\n", + "$X$ does in this case not contain any intercept column.\n", + "When we take the derivative with respect to $\\beta_0$, we want the derivative to obey" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\frac{\\partial C}{\\partial \\beta_j} = 0,\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "for all $j$. For $\\beta_0$ we have" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\frac{\\partial C}{\\partial \\beta_0} = -\\frac{2}{n}\\sum_{i=0}^{n-1} \\left(y_i - \\beta_0 - \\sum_{j=1}^{p-1} X_{ij} \\beta_j\\right).\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Multiplying away the constant $2/n$, we obtain" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\sum_{i=0}^{n-1} \\beta_0 = \\sum_{i=0}^{n-1}y_i - \\sum_{i=0}^{n-1} \\sum_{j=1}^{p-1} X_{ij} \\beta_j.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We assume \n", + "that every column of $\\boldsymbol{X}$ is centered, which we can do by subtracting the mean," + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "X = X - np.mean(X,axis=0)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This means that we need to rewrite $X_{ij}$ as $\\tilde{X}_{ij}=X_{ij}-\\mu_j$, where" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\mu_j = \\frac{1}{n}\\sum_{i=0}^{n-1}X_{ij}.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Let us special first to the case where we have only two parameters $\\beta_0$ and $\\beta_1$.\n", + "Our result for $\\beta_0$ simplifies then to" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "n\\beta_0 = \\sum_{i=0}^{n-1}y_i - \\sum_{i=0}^{n-1} X_{i1} \\beta_1.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Assuming that the matrix elements $X_{i1}$ are centered, what we have is" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\beta_0 = \\frac{1}{n}\\sum_{i=0}^{n-1}y_i - \\beta_1\\frac{1}{n}\\sum_{i=0}^{n-1} \\left(X_{i1}-\\mu_{1}\\right),\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "where" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\mu_1=\\frac{1}{n}\\sum_{i=0}^{n-1} (X_{i1},\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "and if we define the mean value of the outputs as" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\mu_y=\\frac{1}{n}\\sum_{i=0}^{n-1}y_i,\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "we have" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\beta_0 = \\mu_y - \\beta_1\\frac{1}{n}\\sum_{i=0}^{n-1} (X_{i1}-\\mu_{1}),\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "and it is easy to see that the last sum equals zero! This means that we have" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\beta_0 = \\mu_y,\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "if the columns of the design matrix are centered. It is straight forward to generalize this results to more values of $\\beta$.\n", + "We have thus" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\beta_0 = \\frac{1}{n}\\sum_{i=0}^{n-1} y_i = \\overline{\\boldsymbol{y}},\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "the average value of $\\boldsymbol{y}$.\n", + "\n", + "Replacing $y_i$ with $y_i - \\beta_0 = y_i - \\overline{\\boldsymbol{y}}$ and centering also our design matrix results in a cost function (in vector-matrix disguise)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "C(\\boldsymbol{\\beta}) = (\\boldsymbol{\\tilde{y}} - \\tilde{X}\\boldsymbol{\\beta})^T(\\boldsymbol{\\tilde{y}} - \\tilde{X}\\boldsymbol{\\beta}).\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "If we minimize with respect to $\\boldsymbol{\\beta}$ we have then" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\hat{\\boldsymbol{\\beta}} = (\\tilde{X}^T\\tilde{X})^{-1}\\tilde{X}^T\\boldsymbol{\\tilde{y}},\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "where $\\boldsymbol{\\tilde{y}} = \\boldsymbol{y} - \\overline{\\boldsymbol{y}}$\n", + "and $\\tilde{X}_{ij} = X_{ij} - \\frac{1}{n}\\sum_{k=0}^{n-1}X_{kj}$.\n", + "\n", + "For Ridge regression we need to add $\\lambda \\boldsymbol{\\beta}^T\\boldsymbol{\\beta}$ to the cost function and get then" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\hat{\\boldsymbol{\\beta}} = (\\tilde{X}^T\\tilde{X} + \\lambda I)^{-1}\\tilde{X}^T\\boldsymbol{\\tilde{y}}.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "What does this mean? And why do we insist on all this? Let us look at some examples.\n", + "\n", + "\n", + "This code shows a simple first-order fit to a data set using the above transformed data, where we consider the role of the intercept first, by either excluding it or including it (*code example thanks to Øyvind Sigmundson Schøyen*). Here our scaling of the data is done by subtracting the mean values only.\n", + "Note also that we do not split the data into training and test." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "\n", + "from sklearn.linear_model import LinearRegression\n", + "\n", + "\n", + "np.random.seed(2021)\n", + "\n", + "def MSE(y_data,y_model):\n", + " n = np.size(y_model)\n", + " return np.sum((y_data-y_model)**2)/n\n", + "\n", + "\n", + "def fit_beta(X, y):\n", + " return np.linalg.pinv(X.T @ X) @ X.T @ y\n", + "\n", + "\n", + "true_beta = [2, 0.5, 3.7]\n", + "\n", + "x = np.linspace(0, 1, 11)\n", + "y = np.sum(\n", + " np.asarray([x ** p * b for p, b in enumerate(true_beta)]), axis=0\n", + ") + 0.1 * np.random.normal(size=len(x))\n", + "\n", + "degree = 3\n", + "X = np.zeros((len(x), degree))\n", + "\n", + "# Include the intercept in the design matrix\n", + "for p in range(degree):\n", + " X[:, p] = x ** p\n", + "\n", + "beta = fit_beta(X, y)\n", + "\n", + "# Intercept is included in the design matrix\n", + "skl = LinearRegression(fit_intercept=False).fit(X, y)\n", + "\n", + "print(f\"True beta: {true_beta}\")\n", + "print(f\"Fitted beta: {beta}\")\n", + "print(f\"Sklearn fitted beta: {skl.coef_}\")\n", + "ypredictOwn = X @ beta\n", + "ypredictSKL = skl.predict(X)\n", + "print(f\"MSE with intercept column\")\n", + "print(MSE(y,ypredictOwn))\n", + "print(f\"MSE with intercept column from SKL\")\n", + "print(MSE(y,ypredictSKL))\n", + "\n", + "\n", + "plt.figure()\n", + "plt.scatter(x, y, label=\"Data\")\n", + "plt.plot(x, X @ beta, label=\"Fit\")\n", + "plt.plot(x, skl.predict(X), label=\"Sklearn (fit_intercept=False)\")\n", + "\n", + "\n", + "# Do not include the intercept in the design matrix\n", + "X = np.zeros((len(x), degree - 1))\n", + "\n", + "for p in range(degree - 1):\n", + " X[:, p] = x ** (p + 1)\n", + "\n", + "# Intercept is not included in the design matrix\n", + "skl = LinearRegression(fit_intercept=True).fit(X, y)\n", + "\n", + "# Use centered values for X and y when computing coefficients\n", + "y_offset = np.average(y, axis=0)\n", + "X_offset = np.average(X, axis=0)\n", + "\n", + "beta = fit_beta(X - X_offset, y - y_offset)\n", + "intercept = np.mean(y_offset - X_offset @ beta)\n", + "\n", + "print(f\"Manual intercept: {intercept}\")\n", + "print(f\"Fitted beta (wiothout intercept): {beta}\")\n", + "print(f\"Sklearn intercept: {skl.intercept_}\")\n", + "print(f\"Sklearn fitted beta (without intercept): {skl.coef_}\")\n", + "ypredictOwn = X @ beta\n", + "ypredictSKL = skl.predict(X)\n", + "print(f\"MSE with Manual intercept\")\n", + "print(MSE(y,ypredictOwn+intercept))\n", + "print(f\"MSE with Sklearn intercept\")\n", + "print(MSE(y,ypredictSKL))\n", + "\n", + "plt.plot(x, X @ beta + intercept, \"--\", label=\"Fit (manual intercept)\")\n", + "plt.plot(x, skl.predict(X), \"--\", label=\"Sklearn (fit_intercept=True)\")\n", + "plt.grid()\n", + "plt.legend()\n", + "\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The intercept is the value of our output/target variable\n", + "when all our features are zero and our function crosses the $y$-axis (for a one-dimensional case). \n", + "\n", + "Printing the MSE, we see first that both methods give the same MSE, as\n", + "they should. However, when we move to for example Ridge regression,\n", + "the way we treat the intercept may give a larger or smaller MSE,\n", + "meaning that the MSE can be penalized by the value of the\n", + "intercept. Not including the intercept in the fit, means that the\n", + "regularization term does not include $\\beta_0$. For different values\n", + "of $\\lambda$, this may lead to differeing MSE values. \n", + "\n", + "To remind the reader, the regularization term, with the intercept in Ridge regression, is given by" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\lambda \\vert\\vert \\boldsymbol{\\beta} \\vert\\vert_2^2 = \\lambda \\sum_{j=0}^{p-1}\\beta_j^2,\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "but when we take out the intercept, this equation becomes" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\lambda \\vert\\vert \\boldsymbol{\\beta} \\vert\\vert_2^2 = \\lambda \\sum_{j=1}^{p-1}\\beta_j^2.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "For Lasso regression we have" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\lambda \\vert\\vert \\boldsymbol{\\beta} \\vert\\vert_1 = \\lambda \\sum_{j=1}^{p-1}\\vert\\beta_j\\vert.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "It means that, when scaling the design matrix and the outputs/targets,\n", + "by subtracting the mean values, we have an optimization problem which\n", + "is not penalized by the intercept. The MSE value can then be smaller\n", + "since it focuses only on the remaining quantities. If we however bring\n", + "back the intercept, we will get a MSE which then contains the\n", + "intercept.\n", + "\n", + "\n", + "Armed with this wisdom, we attempt first to simply set the intercept equal to **False** in our implementation of Ridge regression for our well-known vanilla data set." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "import numpy as np\n", + "import pandas as pd\n", + "import matplotlib.pyplot as plt\n", + "from sklearn.model_selection import train_test_split\n", + "from sklearn import linear_model\n", + "\n", + "def MSE(y_data,y_model):\n", + " n = np.size(y_model)\n", + " return np.sum((y_data-y_model)**2)/n\n", + "\n", + "\n", + "# A seed just to ensure that the random numbers are the same for every run.\n", + "# Useful for eventual debugging.\n", + "np.random.seed(3155)\n", + "\n", + "n = 100\n", + "x = np.random.rand(n)\n", + "y = np.exp(-x**2) + 1.5 * np.exp(-(x-2)**2)\n", + "\n", + "Maxpolydegree = 20\n", + "X = np.zeros((n,Maxpolydegree))\n", + "#We include explicitely the intercept column\n", + "for degree in range(Maxpolydegree):\n", + " X[:,degree] = x**degree\n", + "# We split the data in test and training data\n", + "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)\n", + "\n", + "p = Maxpolydegree\n", + "I = np.eye(p,p)\n", + "# Decide which values of lambda to use\n", + "nlambdas = 6\n", + "MSEOwnRidgePredict = np.zeros(nlambdas)\n", + "MSERidgePredict = np.zeros(nlambdas)\n", + "lambdas = np.logspace(-4, 2, nlambdas)\n", + "for i in range(nlambdas):\n", + " lmb = lambdas[i]\n", + " OwnRidgeBeta = np.linalg.pinv(X_train.T @ X_train+lmb*I) @ X_train.T @ y_train\n", + " # Note: we include the intercept column and no scaling\n", + " RegRidge = linear_model.Ridge(lmb,fit_intercept=False)\n", + " RegRidge.fit(X_train,y_train)\n", + " # and then make the prediction\n", + " ytildeOwnRidge = X_train @ OwnRidgeBeta\n", + " ypredictOwnRidge = X_test @ OwnRidgeBeta\n", + " ytildeRidge = RegRidge.predict(X_train)\n", + " ypredictRidge = RegRidge.predict(X_test)\n", + " MSEOwnRidgePredict[i] = MSE(y_test,ypredictOwnRidge)\n", + " MSERidgePredict[i] = MSE(y_test,ypredictRidge)\n", + " print(\"Beta values for own Ridge implementation\")\n", + " print(OwnRidgeBeta)\n", + " print(\"Beta values for Scikit-Learn Ridge implementation\")\n", + " print(RegRidge.coef_)\n", + " print(\"MSE values for own Ridge implementation\")\n", + " print(MSEOwnRidgePredict[i])\n", + " print(\"MSE values for Scikit-Learn Ridge implementation\")\n", + " print(MSERidgePredict[i])\n", + "\n", + "# Now plot the results\n", + "plt.figure()\n", + "plt.plot(np.log10(lambdas), MSEOwnRidgePredict, 'r', label = 'MSE own Ridge Test')\n", + "plt.plot(np.log10(lambdas), MSERidgePredict, 'g', label = 'MSE Ridge Test')\n", + "\n", + "plt.xlabel('log10(lambda)')\n", + "plt.ylabel('MSE')\n", + "plt.legend()\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The results here agree when we force **Scikit-Learn**'s Ridge function to include the first column in our design matrix.\n", + "We see that the results agree very well. Here we have thus explicitely included the intercept column in the design matrix.\n", + "What happens if we do not include the intercept in our fit?\n", + "Let us see how we can change this code by zero centering." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "import numpy as np\n", + "import pandas as pd\n", + "import matplotlib.pyplot as plt\n", + "from sklearn.model_selection import train_test_split\n", + "from sklearn import linear_model\n", + "from sklearn.preprocessing import StandardScaler\n", + "\n", + "def MSE(y_data,y_model):\n", + " n = np.size(y_model)\n", + " return np.sum((y_data-y_model)**2)/n\n", + "# A seed just to ensure that the random numbers are the same for every run.\n", + "# Useful for eventual debugging.\n", + "np.random.seed(315)\n", + "\n", + "n = 100\n", + "x = np.random.rand(n)\n", + "y = np.exp(-x**2) + 1.5 * np.exp(-(x-2)**2)\n", + "\n", + "Maxpolydegree = 20\n", + "X = np.zeros((n,Maxpolydegree-1))\n", + "\n", + "for degree in range(1,Maxpolydegree): #No intercept column\n", + " X[:,degree-1] = x**(degree)\n", + "\n", + "# We split the data in test and training data\n", + "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)\n", + "\n", + "#For our own implementation, we will need to deal with the intercept by centering the design matrix and the target variable\n", + "X_train_mean = np.mean(X_train,axis=0)\n", + "#Center by removing mean from each feature\n", + "X_train_scaled = X_train - X_train_mean \n", + "X_test_scaled = X_test - X_train_mean\n", + "#The model intercept (called y_scaler) is given by the mean of the target variable (IF X is centered)\n", + "#Remove the intercept from the training data.\n", + "y_scaler = np.mean(y_train) \n", + "y_train_scaled = y_train - y_scaler \n", + "\n", + "p = Maxpolydegree-1\n", + "I = np.eye(p,p)\n", + "# Decide which values of lambda to use\n", + "nlambdas = 6\n", + "MSEOwnRidgePredict = np.zeros(nlambdas)\n", + "MSERidgePredict = np.zeros(nlambdas)\n", + "\n", + "lambdas = np.logspace(-4, 2, nlambdas)\n", + "for i in range(nlambdas):\n", + " lmb = lambdas[i]\n", + " OwnRidgeBeta = np.linalg.pinv(X_train_scaled.T @ X_train_scaled+lmb*I) @ X_train_scaled.T @ (y_train_scaled)\n", + " intercept_ = y_scaler - X_train_mean@OwnRidgeBeta #The intercept can be shifted so the model can predict on uncentered data\n", + " #Add intercept to prediction\n", + " ypredictOwnRidge = X_test @ OwnRidgeBeta + intercept_ \n", + " #Add intercept to prediction\n", + " ypredictOwnRidge = X_test_scaled @ OwnRidgeBeta + y_scaler \n", + " RegRidge = linear_model.Ridge(lmb)\n", + " RegRidge.fit(X_train,y_train)\n", + " ypredictRidge = RegRidge.predict(X_test)\n", + " MSEOwnRidgePredict[i] = MSE(y_test,ypredictOwnRidge)\n", + " MSERidgePredict[i] = MSE(y_test,ypredictRidge)\n", + " print(\"Beta values for own Ridge implementation\")\n", + " print(OwnRidgeBeta) #Intercept is given by mean of target variable\n", + " print(\"Beta values for Scikit-Learn Ridge implementation\")\n", + " print(RegRidge.coef_)\n", + " print('Intercept from own implementation:')\n", + " print(intercept_)\n", + " print('Intercept from Scikit-Learn Ridge implementation')\n", + " print(RegRidge.intercept_)\n", + " print(\"MSE values for own Ridge implementation\")\n", + " print(MSEOwnRidgePredict[i])\n", + " print(\"MSE values for Scikit-Learn Ridge implementation\")\n", + " print(MSERidgePredict[i])\n", + "\n", + "\n", + "# Now plot the results\n", + "plt.figure()\n", + "plt.plot(np.log10(lambdas), MSEOwnRidgePredict, 'b--', label = 'MSE own Ridge Test')\n", + "plt.plot(np.log10(lambdas), MSERidgePredict, 'g--', label = 'MSE SL Ridge Test')\n", + "plt.xlabel('log10(lambda)')\n", + "plt.ylabel('MSE')\n", + "plt.legend()\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We see here, when compared to the code which includes explicitely the\n", + "intercept column, that our MSE value is actually smaller. This is\n", + "because the regularization term does not include the intercept value\n", + "$\\beta_0$ in the fitting. This applies to Lasso regularization as\n", + "well. It means that our optimization is now done only with the\n", + "centered matrix and/or vector that enter the fitting procedure. Note\n", + "also that the problem with the intercept occurs mainly in these type\n", + "of polynomial fitting problem.\n", + "\n", + "The next example is indeed an example where all these discussions about the role of intercept are not present.\n", + "\n", + "## More complicated Example: The Ising model\n", + "\n", + "The one-dimensional Ising model with nearest neighbor interaction, no\n", + "external field and a constant coupling constant $J$ is given by" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
        \n", + "\n", + "$$\n", + "\\begin{equation}\n", + " H = -J \\sum_{k}^L s_k s_{k + 1},\n", + "\\label{_auto1} \\tag{1}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "where $s_i \\in \\{-1, 1\\}$ and $s_{N + 1} = s_1$. The number of spins\n", + "in the system is determined by $L$. For the one-dimensional system\n", + "there is no phase transition.\n", + "\n", + "We will look at a system of $L = 40$ spins with a coupling constant of\n", + "$J = 1$. To get enough training data we will generate 10000 states\n", + "with their respective energies." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "from mpl_toolkits.axes_grid1 import make_axes_locatable\n", + "import seaborn as sns\n", + "import scipy.linalg as scl\n", + "from sklearn.model_selection import train_test_split\n", + "import tqdm\n", + "sns.set(color_codes=True)\n", + "cmap_args=dict(vmin=-1., vmax=1., cmap='seismic')\n", + "\n", + "L = 40\n", + "n = int(1e4)\n", + "\n", + "spins = np.random.choice([-1, 1], size=(n, L))\n", + "J = 1.0\n", + "\n", + "energies = np.zeros(n)\n", + "\n", + "for i in range(n):\n", + " energies[i] = - J * np.dot(spins[i], np.roll(spins[i], 1))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Here we use ordinary least squares\n", + "regression to predict the energy for the nearest neighbor\n", + "one-dimensional Ising model on a ring, i.e., the endpoints wrap\n", + "around. We will use linear regression to fit a value for\n", + "the coupling constant to achieve this.\n", + "\n", + "A more general form for the one-dimensional Ising model is" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
        \n", + "\n", + "$$\n", + "\\begin{equation}\n", + " H = - \\sum_j^L \\sum_k^L s_j s_k J_{jk}.\n", + "\\label{_auto2} \\tag{2}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Here we allow for interactions beyond the nearest neighbors and a state dependent\n", + "coupling constant. This latter expression can be formulated as\n", + "a matrix-product" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
        \n", + "\n", + "$$\n", + "\\begin{equation}\n", + " \\boldsymbol{H} = \\boldsymbol{X} J,\n", + "\\label{_auto3} \\tag{3}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "where $X_{jk} = s_j s_k$ and $J$ is a matrix which consists of the\n", + "elements $-J_{jk}$. This form of writing the energy fits perfectly\n", + "with the form utilized in linear regression, that is" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
        \n", + "\n", + "$$\n", + "\\begin{equation}\n", + " \\boldsymbol{y} = \\boldsymbol{X}\\boldsymbol{\\beta} + \\boldsymbol{\\epsilon},\n", + "\\label{_auto4} \\tag{4}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We split the data in training and test data as discussed in the previous example" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "X = np.zeros((n, L ** 2))\n", + "for i in range(n):\n", + " X[i] = np.outer(spins[i], spins[i]).ravel()\n", + "y = energies\n", + "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In the ordinary least squares method we choose the cost function" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
        \n", + "\n", + "$$\n", + "\\begin{equation}\n", + " C(\\boldsymbol{X}, \\boldsymbol{\\beta})= \\frac{1}{n}\\left\\{(\\boldsymbol{X}\\boldsymbol{\\beta} - \\boldsymbol{y})^T(\\boldsymbol{X}\\boldsymbol{\\beta} - \\boldsymbol{y})\\right\\}.\n", + "\\label{_auto5} \\tag{5}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We then find the extremal point of $C$ by taking the derivative with respect to $\\boldsymbol{\\beta}$ as discussed above.\n", + "This yields the expression for $\\boldsymbol{\\beta}$ to be" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\boldsymbol{\\beta} = \\frac{\\boldsymbol{X}^T \\boldsymbol{y}}{\\boldsymbol{X}^T \\boldsymbol{X}},\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "which immediately imposes some requirements on $\\boldsymbol{X}$ as there must exist\n", + "an inverse of $\\boldsymbol{X}^T \\boldsymbol{X}$. If the expression we are modeling contains an\n", + "intercept, i.e., a constant term, we must make sure that the\n", + "first column of $\\boldsymbol{X}$ consists of $1$. We do this here" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "X_train_own = np.concatenate(\n", + " (np.ones(len(X_train))[:, np.newaxis], X_train),\n", + " axis=1\n", + ")\n", + "X_test_own = np.concatenate(\n", + " (np.ones(len(X_test))[:, np.newaxis], X_test),\n", + " axis=1\n", + ")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Doing the inversion directly turns out to be a bad idea since the matrix\n", + "$\\boldsymbol{X}^T\\boldsymbol{X}$ is singular. An alternative approach is to use the **singular\n", + "value decomposition**. Using the definition of the Moore-Penrose\n", + "pseudoinverse we can write the equation for $\\boldsymbol{\\beta}$ as" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\boldsymbol{\\beta} = \\boldsymbol{X}^{+}\\boldsymbol{y},\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "where the pseudoinverse of $\\boldsymbol{X}$ is given by" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\boldsymbol{X}^{+} = \\frac{\\boldsymbol{X}^T}{\\boldsymbol{X}^T\\boldsymbol{X}}.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Using singular value decomposition we can decompose the matrix $\\boldsymbol{X} = \\boldsymbol{U}\\boldsymbol{\\Sigma} \\boldsymbol{V}^T$,\n", + "where $\\boldsymbol{U}$ and $\\boldsymbol{V}$ are orthogonal(unitary) matrices and $\\boldsymbol{\\Sigma}$ contains the singular values (more details below).\n", + "where $X^{+} = V\\Sigma^{+} U^T$. This reduces the equation for\n", + "$\\omega$ to" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
        \n", + "\n", + "$$\n", + "\\begin{equation}\n", + " \\boldsymbol{\\beta} = \\boldsymbol{V}\\boldsymbol{\\Sigma}^{+} \\boldsymbol{U}^T \\boldsymbol{y}.\n", + "\\label{_auto6} \\tag{6}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Note that solving this equation by actually doing the pseudoinverse\n", + "(which is what we will do) is not a good idea as this operation scales\n", + "as $\\mathcal{O}(n^3)$, where $n$ is the number of elements in a\n", + "general matrix. Instead, doing $QR$-factorization and solving the\n", + "linear system as an equation would reduce this down to\n", + "$\\mathcal{O}(n^2)$ operations." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "def ols_svd(x: np.ndarray, y: np.ndarray) -> np.ndarray:\n", + " u, s, v = scl.svd(x)\n", + " return v.T @ scl.pinv(scl.diagsvd(s, u.shape[0], v.shape[0])) @ u.T @ y" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "beta = ols_svd(X_train_own,y_train)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "When extracting the $J$-matrix we need to make sure that we remove the intercept, as is done here" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "J = beta[1:].reshape(L, L)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "A way of looking at the coefficients in $J$ is to plot the matrices as images." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "fig = plt.figure(figsize=(20, 14))\n", + "im = plt.imshow(J, **cmap_args)\n", + "plt.title(\"OLS\", fontsize=18)\n", + "plt.xticks(fontsize=18)\n", + "plt.yticks(fontsize=18)\n", + "cb = fig.colorbar(im)\n", + "cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "It is interesting to note that OLS\n", + "considers both $J_{j, j + 1} = -0.5$ and $J_{j, j - 1} = -0.5$ as\n", + "valid matrix elements for $J$.\n", + "In our discussion below on hyperparameters and Ridge and Lasso regression we will see that\n", + "this problem can be removed, partly and only with Lasso regression. \n", + "\n", + "In this case our matrix inversion was actually possible. The obvious question now is what is the mathematics behind the SVD?\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "Let us now \n", + "focus on Ridge and Lasso regression as well. We repeat some of the\n", + "basic parts of the Ising model and the setup of the training and test\n", + "data. The one-dimensional Ising model with nearest neighbor\n", + "interaction, no external field and a constant coupling constant $J$ is\n", + "given by" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
        \n", + "\n", + "$$\n", + "\\begin{equation}\n", + " H = -J \\sum_{k}^L s_k s_{k + 1},\n", + "\\label{_auto7} \\tag{7}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "where $s_i \\in \\{-1, 1\\}$ and $s_{N + 1} = s_1$. The number of spins in the system is determined by $L$. For the one-dimensional system there is no phase transition.\n", + "\n", + "We will look at a system of $L = 40$ spins with a coupling constant of $J = 1$. To get enough training data we will generate 10000 states with their respective energies." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "from mpl_toolkits.axes_grid1 import make_axes_locatable\n", + "import seaborn as sns\n", + "import scipy.linalg as scl\n", + "from sklearn.model_selection import train_test_split\n", + "import sklearn.linear_model as skl\n", + "import tqdm\n", + "sns.set(color_codes=True)\n", + "cmap_args=dict(vmin=-1., vmax=1., cmap='seismic')\n", + "\n", + "L = 40\n", + "n = int(1e4)\n", + "\n", + "spins = np.random.choice([-1, 1], size=(n, L))\n", + "J = 1.0\n", + "\n", + "energies = np.zeros(n)\n", + "\n", + "for i in range(n):\n", + " energies[i] = - J * np.dot(spins[i], np.roll(spins[i], 1))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "A more general form for the one-dimensional Ising model is" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
        \n", + "\n", + "$$\n", + "\\begin{equation}\n", + " H = - \\sum_j^L \\sum_k^L s_j s_k J_{jk}.\n", + "\\label{_auto8} \\tag{8}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Here we allow for interactions beyond the nearest neighbors and a more\n", + "adaptive coupling matrix. This latter expression can be formulated as\n", + "a matrix-product on the form" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
        \n", + "\n", + "$$\n", + "\\begin{equation}\n", + " H = X J,\n", + "\\label{_auto9} \\tag{9}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "where $X_{jk} = s_j s_k$ and $J$ is the matrix consisting of the\n", + "elements $-J_{jk}$. This form of writing the energy fits perfectly\n", + "with the form utilized in linear regression, viz." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
        \n", + "\n", + "$$\n", + "\\begin{equation}\n", + " \\boldsymbol{y} = \\boldsymbol{X}\\boldsymbol{\\beta} + \\boldsymbol{\\epsilon}.\n", + "\\label{_auto10} \\tag{10}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We organize the data as we did above" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "X = np.zeros((n, L ** 2))\n", + "for i in range(n):\n", + " X[i] = np.outer(spins[i], spins[i]).ravel()\n", + "y = energies\n", + "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.96)\n", + "\n", + "X_train_own = np.concatenate(\n", + " (np.ones(len(X_train))[:, np.newaxis], X_train),\n", + " axis=1\n", + ")\n", + "\n", + "X_test_own = np.concatenate(\n", + " (np.ones(len(X_test))[:, np.newaxis], X_test),\n", + " axis=1\n", + ")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We will do all fitting with **Scikit-Learn**," + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "clf = skl.LinearRegression().fit(X_train, y_train)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "When extracting the $J$-matrix we make sure to remove the intercept" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "J_sk = clf.coef_.reshape(L, L)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "And then we plot the results" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "fig = plt.figure(figsize=(20, 14))\n", + "im = plt.imshow(J_sk, **cmap_args)\n", + "plt.title(\"LinearRegression from Scikit-learn\", fontsize=18)\n", + "plt.xticks(fontsize=18)\n", + "plt.yticks(fontsize=18)\n", + "cb = fig.colorbar(im)\n", + "cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The results agree perfectly with our previous discussion where we used our own code.\n", + "\n", + "\n", + "Having explored the ordinary least squares we move on to ridge\n", + "regression. In ridge regression we include a **regularizer**. This\n", + "involves a new cost function which leads to a new estimate for the\n", + "weights $\\boldsymbol{\\beta}$. This results in a penalized regression problem. The\n", + "cost function is given by" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "6\n", + "0\n", + " \n", + "<\n", + "<\n", + "<\n", + "!\n", + "!\n", + "M\n", + "A\n", + "T\n", + "H\n", + "_\n", + "B\n", + "L\n", + "O\n", + "C\n", + "K" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "_lambda = 0.1\n", + "clf_ridge = skl.Ridge(alpha=_lambda).fit(X_train, y_train)\n", + "J_ridge_sk = clf_ridge.coef_.reshape(L, L)\n", + "fig = plt.figure(figsize=(20, 14))\n", + "im = plt.imshow(J_ridge_sk, **cmap_args)\n", + "plt.title(\"Ridge from Scikit-learn\", fontsize=18)\n", + "plt.xticks(fontsize=18)\n", + "plt.yticks(fontsize=18)\n", + "cb = fig.colorbar(im)\n", + "cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)\n", + "\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In the **Least Absolute Shrinkage and Selection Operator** (LASSO)-method we get a third cost function." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
        \n", + "\n", + "$$\n", + "\\begin{equation}\n", + " C(\\boldsymbol{X}, \\boldsymbol{\\beta}; \\lambda) = (\\boldsymbol{X}\\boldsymbol{\\beta} - \\boldsymbol{y})^T(\\boldsymbol{X}\\boldsymbol{\\beta} - \\boldsymbol{y}) + \\lambda \\sqrt{\\boldsymbol{\\beta}^T\\boldsymbol{\\beta}}.\n", + "\\label{_auto12} \\tag{12}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Finding the extremal point of this cost function is not so straight-forward as in least squares and ridge. We will therefore rely solely on the function ``Lasso`` from **Scikit-Learn**." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "clf_lasso = skl.Lasso(alpha=_lambda).fit(X_train, y_train)\n", + "J_lasso_sk = clf_lasso.coef_.reshape(L, L)\n", + "fig = plt.figure(figsize=(20, 14))\n", + "im = plt.imshow(J_lasso_sk, **cmap_args)\n", + "plt.title(\"Lasso from Scikit-learn\", fontsize=18)\n", + "plt.xticks(fontsize=18)\n", + "plt.yticks(fontsize=18)\n", + "cb = fig.colorbar(im)\n", + "cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)\n", + "\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "It is quite striking how LASSO breaks the symmetry of the coupling\n", + "constant as opposed to ridge and OLS. We get a sparse solution with\n", + "$J_{j, j + 1} = -1$.\n", + "\n", + "\n", + "\n", + "\n", + "We see how the different models perform for a different set of values for $\\lambda$." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "lambdas = np.logspace(-4, 5, 10)\n", + "\n", + "train_errors = {\n", + " \"ols_sk\": np.zeros(lambdas.size),\n", + " \"ridge_sk\": np.zeros(lambdas.size),\n", + " \"lasso_sk\": np.zeros(lambdas.size)\n", + "}\n", + "\n", + "test_errors = {\n", + " \"ols_sk\": np.zeros(lambdas.size),\n", + " \"ridge_sk\": np.zeros(lambdas.size),\n", + " \"lasso_sk\": np.zeros(lambdas.size)\n", + "}\n", + "\n", + "plot_counter = 1\n", + "\n", + "fig = plt.figure(figsize=(32, 54))\n", + "\n", + "for i, _lambda in enumerate(tqdm.tqdm(lambdas)):\n", + " for key, method in zip(\n", + " [\"ols_sk\", \"ridge_sk\", \"lasso_sk\"],\n", + " [skl.LinearRegression(), skl.Ridge(alpha=_lambda), skl.Lasso(alpha=_lambda)]\n", + " ):\n", + " method = method.fit(X_train, y_train)\n", + "\n", + " train_errors[key][i] = method.score(X_train, y_train)\n", + " test_errors[key][i] = method.score(X_test, y_test)\n", + "\n", + " omega = method.coef_.reshape(L, L)\n", + "\n", + " plt.subplot(10, 5, plot_counter)\n", + " plt.imshow(omega, **cmap_args)\n", + " plt.title(r\"%s, $\\lambda = %.4f$\" % (key, _lambda))\n", + " plot_counter += 1\n", + "\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We see that LASSO reaches a good solution for low\n", + "values of $\\lambda$, but will \"wither\" when we increase $\\lambda$ too\n", + "much. Ridge is more stable over a larger range of values for\n", + "$\\lambda$, but eventually also fades away.\n", + "\n", + "\n", + "To determine which value of $\\lambda$ is best we plot the accuracy of\n", + "the models when predicting the training and the testing set. We expect\n", + "the accuracy of the training set to be quite good, but if the accuracy\n", + "of the testing set is much lower this tells us that we might be\n", + "subject to an overfit model. The ideal scenario is an accuracy on the\n", + "testing set that is close to the accuracy of the training set." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "fig = plt.figure(figsize=(20, 14))\n", + "\n", + "colors = {\n", + " \"ols_sk\": \"r\",\n", + " \"ridge_sk\": \"y\",\n", + " \"lasso_sk\": \"c\"\n", + "}\n", + "\n", + "for key in train_errors:\n", + " plt.semilogx(\n", + " lambdas,\n", + " train_errors[key],\n", + " colors[key],\n", + " label=\"Train {0}\".format(key),\n", + " linewidth=4.0\n", + " )\n", + "\n", + "for key in test_errors:\n", + " plt.semilogx(\n", + " lambdas,\n", + " test_errors[key],\n", + " colors[key] + \"--\",\n", + " label=\"Test {0}\".format(key),\n", + " linewidth=4.0\n", + " )\n", + "plt.legend(loc=\"best\", fontsize=18)\n", + "plt.xlabel(r\"$\\lambda$\", fontsize=18)\n", + "plt.ylabel(r\"$R^2$\", fontsize=18)\n", + "plt.tick_params(labelsize=18)\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "From the above figure we can see that LASSO with $\\lambda = 10^{-2}$\n", + "achieves a very good accuracy on the test set. This by far surpasses the\n", + "other models for all values of $\\lambda$.\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", "## Exercises and Projects\n", "\n", "\n", @@ -1980,6 +3578,7 @@ }, "outputs": [], "source": [ + "\"\"\"\n", "import numpy as np\n", "from imageio import imread\n", "import matplotlib.pyplot as plt\n", @@ -1994,7 +3593,8 @@ "plt.imshow(terrain1, cmap='gray')\n", "plt.xlabel('X')\n", "plt.ylabel('Y')\n", - "plt.show()" + "plt.show()\n", + "\"\"\"" ] }, { diff --git a/doc/LectureNotes/schedule.md b/doc/LectureNotes/schedule.md index a33d7bf3e..8fb9c6ab3 100644 --- a/doc/LectureNotes/schedule.md +++ b/doc/LectureNotes/schedule.md @@ -78,6 +78,7 @@ For the reading assignments we use the following abbreviations: ### Week 38 September 20-24 - Lab Wednesday: Work on Project 1 - Lecture Thursday: Classification problems and Logistic Regression, from binary cases to several categories + - Video of Lecture at https://www.uio.no/studier/emner/matnat/fys/FYS-STK4155/h21/forelesningsvideoer/LectureSeptember23.mp4?vrtx=view-as-webpage - Lecture Friday: Logistic Regression and gradient optimization - Reading recommendations: diff --git a/doc/pub/week38/ipynb/ipynb-week38-src.tar.gz b/doc/pub/week38/ipynb/ipynb-week38-src.tar.gz index 51d029e51..4a81a6d5e 100644 Binary files a/doc/pub/week38/ipynb/ipynb-week38-src.tar.gz and b/doc/pub/week38/ipynb/ipynb-week38-src.tar.gz differ diff --git a/doc/pub/week38/ipynb/week38.ipynb b/doc/pub/week38/ipynb/week38.ipynb index d836998bd..2d7f8b9a9 100644 --- a/doc/pub/week38/ipynb/week38.ipynb +++ b/doc/pub/week38/ipynb/week38.ipynb @@ -236,10 +236,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false, - "editable": true - }, + "metadata": {}, "outputs": [], "source": [ "%matplotlib inline\n", @@ -400,10 +397,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false, - "editable": true - }, + "metadata": {}, "outputs": [], "source": [ "#Model training, we compute the mean value of y and X\n", @@ -511,10 +505,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false, - "editable": true - }, + "metadata": {}, "outputs": [], "source": [ "X = X - np.mean(X,axis=0)" @@ -722,10 +713,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false, - "editable": true - }, + "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", @@ -889,10 +877,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false, - "editable": true - }, + "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", @@ -977,10 +962,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false, - "editable": true - }, + "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", @@ -1118,10 +1100,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false, - "editable": true - }, + "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", @@ -1234,10 +1213,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false, - "editable": true - }, + "metadata": {}, "outputs": [], "source": [ "X = np.zeros((n, L ** 2))\n", @@ -1301,10 +1277,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false, - "editable": true - }, + "metadata": {}, "outputs": [], "source": [ "X_train_own = np.concatenate(\n", @@ -1320,10 +1293,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false, - "editable": true - }, + "metadata": {}, "outputs": [], "source": [ "def ols_inv(x: np.ndarray, y: np.ndarray) -> np.ndarray:\n", @@ -1408,10 +1378,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false, - "editable": true - }, + "metadata": {}, "outputs": [], "source": [ "def ols_svd(x: np.ndarray, y: np.ndarray) -> np.ndarray:\n", @@ -1422,10 +1389,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false, - "editable": true - }, + "metadata": {}, "outputs": [], "source": [ "beta = ols_svd(X_train_own,y_train)" @@ -1441,10 +1405,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false, - "editable": true - }, + "metadata": {}, "outputs": [], "source": [ "J = beta[1:].reshape(L, L)" @@ -1460,10 +1421,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false, - "editable": true - }, + "metadata": {}, "outputs": [], "source": [ "fig = plt.figure(figsize=(20, 14))\n", @@ -1529,10 +1487,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false, - "editable": true - }, + "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", @@ -1638,10 +1593,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false, - "editable": true - }, + "metadata": {}, "outputs": [], "source": [ "X = np.zeros((n, L ** 2))\n", @@ -1671,10 +1623,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false, - "editable": true - }, + "metadata": {}, "outputs": [], "source": [ "clf = skl.LinearRegression().fit(X_train, y_train)" @@ -1690,10 +1639,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false, - "editable": true - }, + "metadata": {}, "outputs": [], "source": [ "J_sk = clf.coef_.reshape(L, L)" @@ -1709,10 +1655,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false, - "editable": true - }, + "metadata": {}, "outputs": [], "source": [ "fig = plt.figure(figsize=(20, 14))\n", @@ -1767,10 +1710,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false, - "editable": true - }, + "metadata": {}, "outputs": [], "source": [ "_lambda = 0.1\n", @@ -1821,10 +1761,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false, - "editable": true - }, + "metadata": {}, "outputs": [], "source": [ "clf_lasso = skl.Lasso(alpha=_lambda).fit(X_train, y_train)\n", @@ -1858,10 +1795,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false, - "editable": true - }, + "metadata": {}, "outputs": [], "source": [ "lambdas = np.logspace(-4, 5, 10)\n", @@ -1924,10 +1858,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false, - "editable": true - }, + "metadata": {}, "outputs": [], "source": [ "fig = plt.figure(figsize=(20, 14))\n", @@ -2118,10 +2049,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false, - "editable": true - }, + "metadata": {}, "outputs": [], "source": [ "# Common imports\n", @@ -2192,10 +2120,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false, - "editable": true - }, + "metadata": {}, "outputs": [], "source": [ "agegroupmean = np.array([0.1, 0.133, 0.250, 0.333, 0.462, 0.625, 0.765, 0.800])\n", @@ -2279,10 +2204,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false, - "editable": true - }, + "metadata": {}, "outputs": [], "source": [ "\"\"\"The sigmoid function (or the logistic curve) is a\n", @@ -2701,10 +2623,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false, - "editable": true - }, + "metadata": {}, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", @@ -2747,10 +2666,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false, - "editable": true - }, + "metadata": {}, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", @@ -2813,10 +2729,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false, - "editable": true - }, + "metadata": {}, "outputs": [], "source": [ "cancerpd = pd.DataFrame(cancer.data, columns=cancer.feature_names)" @@ -2832,10 +2745,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false, - "editable": true - }, + "metadata": {}, "outputs": [], "source": [ "correlation_matrix = cancerpd.corr().round(1)" @@ -2858,10 +2768,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false, - "editable": true - }, + "metadata": {}, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", @@ -3678,10 +3585,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false, - "editable": true - }, + "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", @@ -3716,10 +3620,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false, - "editable": true - }, + "metadata": {}, "outputs": [], "source": [ "pt.axis(\"equal\")\n", @@ -3737,10 +3638,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false, - "editable": true - }, + "metadata": {}, "outputs": [], "source": [ "x = guesses[-1]\n", @@ -3757,10 +3655,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false, - "editable": true - }, + "metadata": {}, "outputs": [], "source": [ "def f1d(alpha):\n", @@ -3782,10 +3677,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false, - "editable": true - }, + "metadata": {}, "outputs": [], "source": [ "pt.axis(\"equal\")\n", @@ -4161,10 +4053,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false, - "editable": true - }, + "metadata": {}, "outputs": [], "source": [ "x = 2*np.random.rand(m,1)\n", @@ -4331,10 +4220,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false, - "editable": true - }, + "metadata": {}, "outputs": [], "source": [ "\n", @@ -4395,10 +4281,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false, - "editable": true - }, + "metadata": {}, "outputs": [], "source": [ "# Importing various packages\n", @@ -4482,10 +4365,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": false, - "editable": true - }, + "metadata": {}, "outputs": [], "source": [ "from random import random, seed\n", @@ -4553,7 +4433,25 @@ ] } ], - "metadata": {}, + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.5" + } + }, "nbformat": 4, "nbformat_minor": 4 } diff --git a/doc/src/week38/._week38-bs000.html b/doc/src/week38/._week38-bs000.html new file mode 100644 index 000000000..d5042016a --- /dev/null +++ b/doc/src/week38/._week38-bs000.html @@ -0,0 +1,489 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +

     

     

     

    + + + + + + +
    +

    Data Analysis and Machine Learning: Logistic Regression

    + +

    + + +

    +Morten Hjorth-Jensen [1, 2] +
    + +

    + + +

    [1] Department of Physics, University of Oslo
    +
    [2] Department of Physics and Astronomy and National Superconducting Cyclotron Laboratory, Michigan State University
    +
    +

    +

    Sep 23, 2021

    +
    +

    + + +

    Read »

    + + +
    + +

    + +

    + + +
    + + + + + + + +
    + © 1999-2021, Morten Hjorth-Jensen. Released under CC Attribution-NonCommercial 4.0 license +
    + + + + + + diff --git a/doc/src/week38/._week38-bs001.html b/doc/src/week38/._week38-bs001.html new file mode 100644 index 000000000..3d6301961 --- /dev/null +++ b/doc/src/week38/._week38-bs001.html @@ -0,0 +1,470 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +

     

     

     

    + + + + +

    Plans for week 38

    + +
      +
    • Thursday: Summary of regression methods and discussion of project 1. Start Logistic Regression
    • +
    • Video of Lecture September 23
    • +
    • Friday: Logistic Regression and Optimization methods
    • +
    + +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs002.html b/doc/src/week38/._week38-bs002.html new file mode 100644 index 000000000..91c52aa41 --- /dev/null +++ b/doc/src/week38/._week38-bs002.html @@ -0,0 +1,466 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +

     

     

     

    + + + + +

    Thursday September 23

    + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs003.html b/doc/src/week38/._week38-bs003.html new file mode 100644 index 000000000..9d45adb15 --- /dev/null +++ b/doc/src/week38/._week38-bs003.html @@ -0,0 +1,520 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +

     

     

     

    + + + + +

    Ridge and LASSO Regression, reminder

    + +

    +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 +our optimization problem is +$$ +{\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\}. +$$ + +or we can state it as +$$ +{\displaystyle \min_{\boldsymbol{\beta}\in +{\mathbb{R}}^{p}}}\frac{1}{n}\sum_{i=0}^{n-1}\left(y_i-\tilde{y}_i\right)^2=\frac{1}{n}\vert\vert \boldsymbol{y}-\boldsymbol{X}\boldsymbol{\beta}\vert\vert_2^2, +$$ + +where we have used the definition of a norm-2 vector, that is +$$ +\vert\vert \boldsymbol{x}\vert\vert_2 = \sqrt{\sum_i x_i^2}. +$$ + +

    +By minimizing the above equation with respect to the parameters +\( \boldsymbol{\beta} \) we could then obtain an analytical expression for the +parameters \( \boldsymbol{\beta} \). We can add a regularization parameter \( \lambda \) by +defining a new cost function to be optimized, that is + +$$ +{\displaystyle \min_{\boldsymbol{\beta}\in +{\mathbb{R}}^{p}}}\frac{1}{n}\vert\vert \boldsymbol{y}-\boldsymbol{X}\boldsymbol{\beta}\vert\vert_2^2+\lambda\vert\vert \boldsymbol{\beta}\vert\vert_2^2 +$$ + +

    +which leads to the Ridge regression minimization problem where we +require that \( \vert\vert \boldsymbol{\beta}\vert\vert_2^2\le t \), where \( t \) is +a finite number larger than zero. By defining + +$$ +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, +$$ + +

    +we have a new optimization equation +$$ +{\displaystyle \min_{\boldsymbol{\beta}\in +{\mathbb{R}}^{p}}}\frac{1}{n}\vert\vert \boldsymbol{y}-\boldsymbol{X}\boldsymbol{\beta}\vert\vert_2^2+\lambda\vert\vert \boldsymbol{\beta}\vert\vert_1 +$$ + +which leads to Lasso regression. Lasso stands for least absolute shrinkage and selection operator. + +

    +Here we have defined the norm-1 as +$$ +\vert\vert \boldsymbol{x}\vert\vert_1 = \sum_i \vert x_i\vert. +$$ + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs004.html b/doc/src/week38/._week38-bs004.html new file mode 100644 index 000000000..7c57ad552 --- /dev/null +++ b/doc/src/week38/._week38-bs004.html @@ -0,0 +1,484 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +

     

     

     

    + + + + +

    Various steps in cross-validation

    + +

    +When the repetitive splitting of the data set is done randomly, +samples may accidently end up in a fast majority of the splits in +either training or test set. Such samples may have an unbalanced +influence on either model building or prediction evaluation. To avoid +this \( k \)-fold cross-validation structures the data splitting. The +samples are divided into \( k \) more or less equally sized exhaustive and +mutually exclusive subsets. In turn (at each split) one of these +subsets plays the role of the test set while the union of the +remaining subsets constitutes the training set. Such a splitting +warrants a balanced representation of each sample in both training and +test set over the splits. Still the division into the \( k \) subsets +involves a degree of randomness. This may be fully excluded when +choosing \( k=n \). This particular case is referred to as leave-one-out +cross-validation (LOOCV). + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs005.html b/doc/src/week38/._week38-bs005.html new file mode 100644 index 000000000..f5b65e226 --- /dev/null +++ b/doc/src/week38/._week38-bs005.html @@ -0,0 +1,489 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +

     

     

     

    + + + + +

    How to set up the cross-validation for Ridge and/or Lasso

    + +
      +
    • Define a range of interest for the penalty parameter.
    • +
    • Divide the data set into training and test set comprising samples \( \{1, \ldots, n\} \setminus i \) and \( \{ i \} \), respectively.
    • +
    • Fit the linear regression model by means of ridge estimation for each \( \lambda \) in the grid using the training set, and the corresponding estimate of the error variance \( \boldsymbol{\sigma}_{-i}^2(\lambda) \), as
    • +
    + +$$ +\begin{align*} +\boldsymbol{\beta}_{-i}(\lambda) & = ( \boldsymbol{X}_{-i, \ast}^{T} +\boldsymbol{X}_{-i, \ast} + \lambda \boldsymbol{I}_{pp})^{-1} +\boldsymbol{X}_{-i, \ast}^{T} \boldsymbol{y}_{-i} +\end{align*} +$$ + + +
      +
    • Evaluate the prediction performance of these models on the test set by \( C[y_i, \boldsymbol{X}_{i, \ast}; \boldsymbol{\beta}_{-i}(\lambda), \boldsymbol{\sigma}_{-i}^2(\lambda)] \). Or, by the prediction error \( |y_i - \boldsymbol{X}_{i, \ast} \boldsymbol{\beta}_{-i}(\lambda)| \), the relative error, the error squared or the R2 score function.
    • +
    • Repeat the first three steps such that each sample plays the role of the test set once.
    • +
    • Average the prediction performances of the test sets at each grid point of the penalty bias/parameter. It is an estimate of the prediction performance of the model corresponding to this value of the penalty parameter on novel data.
    • +
    + +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs006.html b/doc/src/week38/._week38-bs006.html new file mode 100644 index 000000000..7efb0d77b --- /dev/null +++ b/doc/src/week38/._week38-bs006.html @@ -0,0 +1,487 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +

     

     

     

    + + + + +

    Cross-validation in brief

    + +

    +For the various values of \( k \) + +

      +
    1. shuffle the dataset randomly.
    2. +
    3. Split the dataset into \( k \) groups.
    4. +
    5. For each unique group: + +
        +
      1. Decide which group to use as set for test data
      2. +
      3. Take the remaining groups as a training data set
      4. +
      5. Fit a model on the training set and evaluate it on the test set
      6. +
      7. Retain the evaluation score and discard the model
      8. +
      + +
    6. Summarize the model using the sample of model evaluation scores
    7. +
    + +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs007.html b/doc/src/week38/._week38-bs007.html new file mode 100644 index 000000000..15b115048 --- /dev/null +++ b/doc/src/week38/._week38-bs007.html @@ -0,0 +1,566 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +

     

     

     

    + + + + +

    Code Example for Cross-validation and \( k \)-fold Cross-validation

    + +

    +The code here uses Ridge regression with cross-validation (CV) resampling and \( k \)-fold CV in order to fit a specific polynomial. +

    + + +

    import numpy as np
    +import matplotlib.pyplot as plt
    +from sklearn.model_selection import KFold
    +from sklearn.linear_model import Ridge
    +from sklearn.model_selection import cross_val_score
    +from sklearn.preprocessing import PolynomialFeatures
    +
    +# A seed just to ensure that the random numbers are the same for every run.
    +# Useful for eventual debugging.
    +np.random.seed(3155)
    +
    +# Generate the data.
    +nsamples = 100
    +x = np.random.randn(nsamples)
    +y = 3*x**2 + np.random.randn(nsamples)
    +
    +## Cross-validation on Ridge regression using KFold only
    +
    +# Decide degree on polynomial to fit
    +poly = PolynomialFeatures(degree = 6)
    +
    +# Decide which values of lambda to use
    +nlambdas = 500
    +lambdas = np.logspace(-3, 5, nlambdas)
    +
    +# Initialize a KFold instance
    +k = 5
    +kfold = KFold(n_splits = k)
    +
    +# Perform the cross-validation to estimate MSE
    +scores_KFold = np.zeros((nlambdas, k))
    +
    +i = 0
    +for lmb in lambdas:
    +    ridge = Ridge(alpha = lmb)
    +    j = 0
    +    for train_inds, test_inds in kfold.split(x):
    +        xtrain = x[train_inds]
    +        ytrain = y[train_inds]
    +
    +        xtest = x[test_inds]
    +        ytest = y[test_inds]
    +
    +        Xtrain = poly.fit_transform(xtrain[:, np.newaxis])
    +        ridge.fit(Xtrain, ytrain[:, np.newaxis])
    +
    +        Xtest = poly.fit_transform(xtest[:, np.newaxis])
    +        ypred = ridge.predict(Xtest)
    +
    +        scores_KFold[i,j] = np.sum((ypred - ytest[:, np.newaxis])**2)/np.size(ypred)
    +
    +        j += 1
    +    i += 1
    +
    +
    +estimated_mse_KFold = np.mean(scores_KFold, axis = 1)
    +
    +## Cross-validation using cross_val_score from sklearn along with KFold
    +
    +# kfold is an instance initialized above as:
    +# kfold = KFold(n_splits = k)
    +
    +estimated_mse_sklearn = np.zeros(nlambdas)
    +i = 0
    +for lmb in lambdas:
    +    ridge = Ridge(alpha = lmb)
    +
    +    X = poly.fit_transform(x[:, np.newaxis])
    +    estimated_mse_folds = cross_val_score(ridge, X, y[:, np.newaxis], scoring='neg_mean_squared_error', cv=kfold)
    +
    +    # cross_val_score return an array containing the estimated negative mse for every fold.
    +    # we have to the the mean of every array in order to get an estimate of the mse of the model
    +    estimated_mse_sklearn[i] = np.mean(-estimated_mse_folds)
    +
    +    i += 1
    +
    +## Plot and compare the slightly different ways to perform cross-validation
    +
    +plt.figure()
    +
    +plt.plot(np.log10(lambdas), estimated_mse_sklearn, label = 'cross_val_score')
    +plt.plot(np.log10(lambdas), estimated_mse_KFold, 'r--', label = 'KFold')
    +
    +plt.xlabel('log10(lambda)')
    +plt.ylabel('mse')
    +
    +plt.legend()
    +
    +plt.show()
    +
    +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs008.html b/doc/src/week38/._week38-bs008.html new file mode 100644 index 000000000..750e13d02 --- /dev/null +++ b/doc/src/week38/._week38-bs008.html @@ -0,0 +1,493 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +

     

     

     

    + + + + +

    To think about, first part

    + +

    +When you are comparing your own code with for example Scikit-Learn's +library, there are some technicalities to keep in mind. The examples +here demonstrate some of these aspects with potential pitfalls. + +

    +The discussion here focuses on the role of the intercept, how we can +set up the design matrix, what scaling we should use and other topics +which tend confuse us. + +

    +The intercept can be interpreted as the expected value of our +target/output variables when all other predictors are set to zero. +Thus, if we cannot assume that the expected outputs/targets are zero +when all predictors are zero (the columns in the design matrix), it +may be a bad idea to implement a model which penalizes the intercept. +Furthermore, in for example Ridge and Lasso regression, the default solutions +from the library Scikit-Learn (when not shrinking \( \beta_0 \)) for the unknown parameters +\( \boldsymbol{\beta} \), are derived under the assumption that both \( \boldsymbol{y} \) and +\( \boldsymbol{X} \) are zero centered, that is we subtract the mean values. + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs009.html b/doc/src/week38/._week38-bs009.html new file mode 100644 index 000000000..5bc92cd2b --- /dev/null +++ b/doc/src/week38/._week38-bs009.html @@ -0,0 +1,502 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +

     

     

     

    + + + + +

    More thinking

    + +

    +If our predictors represent different scales, then it is important to +standardize the design matrix \( \boldsymbol{X} \) by subtracting the mean of each +column from the corresponding column and dividing the column with its +standard deviation. Most machine learning libraries do this as a default. This means that if you compare your code with the results from a given library, +the results may differ. + +

    +The +Standadscaler +function in Scikit-Learn does this for us. For the data sets we +have been studying in our various examples, the data are in many cases +already scaled and there is no need to scale them. You as a user of different machine learning algorithms, should always perform a +survey of your data, with a critical assessment of them in case you need to scale the data. + +

    +If you need to scale the data, not doing so will give an unfair +penalization of the parameters since their magnitude depends on the +scale of their corresponding predictor. + +

    +Suppose as an example that you +you have an input variable given by the heights of different persons. +Human height might be measured in inches or meters or +kilometers. If measured in kilometers, a standard linear regression +model with this predictor would probably give a much bigger +coefficient term, than if measured in millimeters. +This can clearly lead to problems in evaluating the cost/loss functions. + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs010.html b/doc/src/week38/._week38-bs010.html new file mode 100644 index 000000000..7183ff19a --- /dev/null +++ b/doc/src/week38/._week38-bs010.html @@ -0,0 +1,496 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +

     

     

     

    + + + + +

    Still thinking

    + +

    +Keep in mind that when you transform your data set before training a model, the same transformation needs to be done +on your eventual new data set before making a prediction. If we translate this into a Python code, it would could be implemented as follows + +

    + + +

    #Model training, we compute the mean value of y and X
    +y_train_mean = np.mean(y_train)
    +X_train_mean = np.mean(X_train,axis=0)
    +X_train = X_train - X_train_mean
    +y_train = y_train - y_train_mean
    +
    +# The we fit our model with the training data
    +trained_model = some_model.fit(X_train,y_train)
    +
    +
    +#Model prediction, we need also to transform our data set used for the prediction.
    +X_test = X_test - X_train_mean #Use mean from training data
    +y_pred = trained_model(X_test)
    +y_pred = y_pred + y_train_mean
    +
    +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs011.html b/doc/src/week38/._week38-bs011.html new file mode 100644 index 000000000..a2a36a0d1 --- /dev/null +++ b/doc/src/week38/._week38-bs011.html @@ -0,0 +1,508 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +

     

     

     

    + + + + +

    What does centering (subtracting the mean values) mean mathematically?

    + +

    +Let us try to understand what this may imply mathematically when we +subtract the mean values, also known as zero centering. For +simplicity, we will focus on ordinary regression, as done in the above example. + +

    +The cost/loss function for regression is +$$ +C(\beta_0, \beta_1, ... , \beta_{p-1}) = \frac{1}{n}\sum_{i=0}^{n} \left(y_i - \beta_0 - \sum_{j=1}^{p-1} X_{ij}\beta_j\right)^2,. +$$ + +Recall also that we use the squared value since this leads to an increase of the penalty for higher differences between predicted and output/target values. + +

    +What we have done is to single out the \( \beta_0 \) term in the definition of the mean squared error (MSE). +The design matrix +\( X \) does in this case not contain any intercept column. +When we take the derivative with respect to \( \beta_0 \), we want the derivative to obey +$$ +\frac{\partial C}{\partial \beta_j} = 0, +$$ + +

    +for all \( j \). For \( \beta_0 \) we have + +$$ +\frac{\partial C}{\partial \beta_0} = -\frac{2}{n}\sum_{i=0}^{n-1} \left(y_i - \beta_0 - \sum_{j=1}^{p-1} X_{ij} \beta_j\right). +$$ + +Multiplying away the constant \( 2/n \), we obtain +$$ +\sum_{i=0}^{n-1} \beta_0 = \sum_{i=0}^{n-1}y_i - \sum_{i=0}^{n-1} \sum_{j=1}^{p-1} X_{ij} \beta_j. +$$ + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs012.html b/doc/src/week38/._week38-bs012.html new file mode 100644 index 000000000..fd50ab60c --- /dev/null +++ b/doc/src/week38/._week38-bs012.html @@ -0,0 +1,534 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +

     

     

     

    + + + + +

    Further Manipulations

    + +

    +We assume +that every column of \( \boldsymbol{X} \) is centered, which we can do by subtracting the mean, +

    + + +

    X = X - np.mean(X,axis=0)
    +
    +

    +This means that we need to rewrite \( X_{ij} \) as \( \tilde{X}_{ij}=X_{ij}-\mu_j \), where +$$ +\mu_j = \frac{1}{n}\sum_{i=0}^{n-1}X_{ij}. +$$ + +

    +Let us special first to the case where we have only two parameters \( \beta_0 \) and \( \beta_1 \). +Our result for \( \beta_0 \) simplifies then to +$$ +n\beta_0 = \sum_{i=0}^{n-1}y_i - \sum_{i=0}^{n-1} X_{i1} \beta_1. +$$ + +Assuming that the matrix elements \( X_{i1} \) are centered, what we have is +$$ +\beta_0 = \frac{1}{n}\sum_{i=0}^{n-1}y_i - \beta_1\frac{1}{n}\sum_{i=0}^{n-1} \left(X_{i1}-\mu_{1}\right), +$$ + +where +$$ +\mu_1=\frac{1}{n}\sum_{i=0}^{n-1} (X_{i1}, +$$ + +and if we define the mean value of the outputs as +$$ +\mu_y=\frac{1}{n}\sum_{i=0}^{n-1}y_i, +$$ + +we have +$$ +\beta_0 = \mu_y - \beta_1\frac{1}{n}\sum_{i=0}^{n-1} (X_{i1}-\mu_{1}), +$$ + +and it is easy to see that the last sum equals zero! This means that we have +$$ +\beta_0 = \mu_y, +$$ + +if the columns of the design matrix are centered. It is straight forward to generalize this results to more values of \( \beta \). +We have thus +$$ +\beta_0 = \frac{1}{n}\sum_{i=0}^{n-1} y_i = \overline{\boldsymbol{y}}, +$$ + +the average value of \( \boldsymbol{y} \). + +

    +Replacing \( y_i \) with \( y_i - \beta_0 = y_i - \overline{\boldsymbol{y}} \) and centering also our design matrix results in a cost function (in vector-matrix disguise) +$$ +C(\boldsymbol{\beta}) = (\boldsymbol{\tilde{y}} - \tilde{X}\boldsymbol{\beta})^T(\boldsymbol{\tilde{y}} - \tilde{X}\boldsymbol{\beta}). +$$ + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs013.html b/doc/src/week38/._week38-bs013.html new file mode 100644 index 000000000..981ac928b --- /dev/null +++ b/doc/src/week38/._week38-bs013.html @@ -0,0 +1,494 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Wrapping it up

    + +

    +If we minimize with respect to \( \boldsymbol{\beta} \) we have then + +$$ +\hat{\boldsymbol{\beta}} = (\tilde{X}^T\tilde{X})^{-1}\tilde{X}^T\boldsymbol{\tilde{y}}, +$$ + +

    +where \( \boldsymbol{\tilde{y}} = \boldsymbol{y} - \overline{\boldsymbol{y}} \) +and \( \tilde{X}_{ij} = X_{ij} - \frac{1}{n}\sum_{k=0}^{n-1}X_{kj} \). + +

    +For Ridge regression we need to add \( \lambda \boldsymbol{\beta}^T\boldsymbol{\beta} \) to the cost function and get then +$$ +\hat{\boldsymbol{\beta}} = (\tilde{X}^T\tilde{X} + \lambda I)^{-1}\tilde{X}^T\boldsymbol{\tilde{y}}. +$$ + +

    +What does this mean? And why do we insist on all this? Let us look at some examples. + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs014.html b/doc/src/week38/._week38-bs014.html new file mode 100644 index 000000000..fa21e3ef4 --- /dev/null +++ b/doc/src/week38/._week38-bs014.html @@ -0,0 +1,601 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Linear Regression code, Intercept handling first

    + +

    +This code shows a simple first-order fit to a data set using the above transformed data, where we consider the role of the intercept first, by either excluding it or including it (code example thanks to Øyvind Sigmundson Schøyen). Here our scaling of the data is done by subtracting the mean values only. +Note also that we do not split the data into training and test. + +

    + + +

    import numpy as np
    +import matplotlib.pyplot as plt
    +
    +from sklearn.linear_model import LinearRegression
    +
    +
    +np.random.seed(2021)
    +
    +def MSE(y_data,y_model):
    +    n = np.size(y_model)
    +    return np.sum((y_data-y_model)**2)/n
    +
    +
    +def fit_beta(X, y):
    +    return np.linalg.pinv(X.T @ X) @ X.T @ y
    +
    +
    +true_beta = [2, 0.5, 3.7]
    +
    +x = np.linspace(0, 1, 11)
    +y = np.sum(
    +    np.asarray([x ** p * b for p, b in enumerate(true_beta)]), axis=0
    +) + 0.1 * np.random.normal(size=len(x))
    +
    +degree = 3
    +X = np.zeros((len(x), degree))
    +
    +# Include the intercept in the design matrix
    +for p in range(degree):
    +    X[:, p] = x ** p
    +
    +beta = fit_beta(X, y)
    +
    +# Intercept is included in the design matrix
    +skl = LinearRegression(fit_intercept=False).fit(X, y)
    +
    +print(f"True beta: {true_beta}")
    +print(f"Fitted beta: {beta}")
    +print(f"Sklearn fitted beta: {skl.coef_}")
    +ypredictOwn = X @ beta
    +ypredictSKL = skl.predict(X)
    +print(f"MSE with intercept column")
    +print(MSE(y,ypredictOwn))
    +print(f"MSE with intercept column from SKL")
    +print(MSE(y,ypredictSKL))
    +
    +
    +plt.figure()
    +plt.scatter(x, y, label="Data")
    +plt.plot(x, X @ beta, label="Fit")
    +plt.plot(x, skl.predict(X), label="Sklearn (fit_intercept=False)")
    +
    +
    +# Do not include the intercept in the design matrix
    +X = np.zeros((len(x), degree - 1))
    +
    +for p in range(degree - 1):
    +    X[:, p] = x ** (p + 1)
    +
    +# Intercept is not included in the design matrix
    +skl = LinearRegression(fit_intercept=True).fit(X, y)
    +
    +# Use centered values for X and y when computing coefficients
    +y_offset = np.average(y, axis=0)
    +X_offset = np.average(X, axis=0)
    +
    +beta = fit_beta(X - X_offset, y - y_offset)
    +intercept = np.mean(y_offset - X_offset @ beta)
    +
    +print(f"Manual intercept: {intercept}")
    +print(f"Fitted beta (wiothout intercept): {beta}")
    +print(f"Sklearn intercept: {skl.intercept_}")
    +print(f"Sklearn fitted beta (without intercept): {skl.coef_}")
    +ypredictOwn = X @ beta
    +ypredictSKL = skl.predict(X)
    +print(f"MSE with Manual intercept")
    +print(MSE(y,ypredictOwn+intercept))
    +print(f"MSE with Sklearn intercept")
    +print(MSE(y,ypredictSKL))
    +
    +plt.plot(x, X @ beta + intercept, "--", label="Fit (manual intercept)")
    +plt.plot(x, skl.predict(X), "--", label="Sklearn (fit_intercept=True)")
    +plt.grid()
    +plt.legend()
    +
    +plt.show()
    +
    +

    +The intercept is the value of our output/target variable +when all our features are zero and our function crosses the \( y \)-axis (for a one-dimensional case). + +

    +Printing the MSE, we see first that both methods give the same MSE, as +they should. However, when we move to for example Ridge regression, +the way we treat the intercept may give a larger or smaller MSE, +meaning that the MSE can be penalized by the value of the +intercept. Not including the intercept in the fit, means that the +regularization term does not include \( \beta_0 \). For different values +of \( \lambda \), this may lead to differeing MSE values. + +

    +To remind the reader, the regularization term, with the intercept in Ridge regression is given by +$$ +\lambda \vert\vert \boldsymbol{\beta} \vert\vert_2^2 = \lambda \sum_{j=0}^{p-1}\beta_j^2, +$$ + +but when we take out the intercept, this equation becomes +$$ +\lambda \vert\vert \boldsymbol{\beta} \vert\vert_2^2 = \lambda \sum_{j=1}^{p-1}\beta_j^2. +$$ + +

    +For Lasso regression we have +$$ +\lambda \vert\vert \boldsymbol{\beta} \vert\vert_1 = \lambda \sum_{j=1}^{p-1}\vert\beta_j\vert. +$$ + +

    +It means that, when scaling the design matrix and the outputs/targets, by subtracting the mean values, we have an optimization problem which is not penalized by the intercept. The MSE value can then be smaller since it focuses only on the remaining quantities. If we however bring back the intercept, we will get a MSE which then contains the intercept. + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs015.html b/doc/src/week38/._week38-bs015.html new file mode 100644 index 000000000..d40055597 --- /dev/null +++ b/doc/src/week38/._week38-bs015.html @@ -0,0 +1,552 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Code Examples

    + +

    +Armed with this wisdom, we attempt first to simply set the intercept equal to False in our implementation of Ridge regression for our well-known vanilla data set. + +

    + + +

    import numpy as np
    +import pandas as pd
    +import matplotlib.pyplot as plt
    +from sklearn.model_selection import train_test_split
    +from sklearn import linear_model
    +
    +def MSE(y_data,y_model):
    +    n = np.size(y_model)
    +    return np.sum((y_data-y_model)**2)/n
    +
    +
    +# A seed just to ensure that the random numbers are the same for every run.
    +# Useful for eventual debugging.
    +np.random.seed(3155)
    +
    +n = 100
    +x = np.random.rand(n)
    +y = np.exp(-x**2) + 1.5 * np.exp(-(x-2)**2)
    +
    +Maxpolydegree = 20
    +X = np.zeros((n,Maxpolydegree))
    +#We include explicitely the intercept column
    +for degree in range(Maxpolydegree):
    +    X[:,degree] = x**degree
    +# We split the data in test and training data
    +X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)
    +
    +p = Maxpolydegree
    +I = np.eye(p,p)
    +# Decide which values of lambda to use
    +nlambdas = 6
    +MSEOwnRidgePredict = np.zeros(nlambdas)
    +MSERidgePredict = np.zeros(nlambdas)
    +lambdas = np.logspace(-4, 2, nlambdas)
    +for i in range(nlambdas):
    +    lmb = lambdas[i]
    +    OwnRidgeBeta = np.linalg.pinv(X_train.T @ X_train+lmb*I) @ X_train.T @ y_train
    +    # Note: we include the intercept column and no scaling
    +    RegRidge = linear_model.Ridge(lmb,fit_intercept=False)
    +    RegRidge.fit(X_train,y_train)
    +    # and then make the prediction
    +    ytildeOwnRidge = X_train @ OwnRidgeBeta
    +    ypredictOwnRidge = X_test @ OwnRidgeBeta
    +    ytildeRidge = RegRidge.predict(X_train)
    +    ypredictRidge = RegRidge.predict(X_test)
    +    MSEOwnRidgePredict[i] = MSE(y_test,ypredictOwnRidge)
    +    MSERidgePredict[i] = MSE(y_test,ypredictRidge)
    +    print("Beta values for own Ridge implementation")
    +    print(OwnRidgeBeta)
    +    print("Beta values for Scikit-Learn Ridge implementation")
    +    print(RegRidge.coef_)
    +    print("MSE values for own Ridge implementation")
    +    print(MSEOwnRidgePredict[i])
    +    print("MSE values for Scikit-Learn Ridge implementation")
    +    print(MSERidgePredict[i])
    +
    +# Now plot the results
    +plt.figure()
    +plt.plot(np.log10(lambdas), MSEOwnRidgePredict, 'r', label = 'MSE own Ridge Test')
    +plt.plot(np.log10(lambdas), MSERidgePredict, 'g', label = 'MSE Ridge Test')
    +
    +plt.xlabel('log10(lambda)')
    +plt.ylabel('MSE')
    +plt.legend()
    +plt.show()
    +
    +

    +The results here agree when we force Scikit-Learn's Ridge function to include the first column in our design matrix. +We see that the results agree very well. Here we have thus explicitely included the intercept column in the design matrix. +What happens if we do not include the intercept in our fit? +Let us see how we can change this code by zero centering (thanks to Stian Bilek for inpouts here). + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs016.html b/doc/src/week38/._week38-bs016.html new file mode 100644 index 000000000..7f0b084f4 --- /dev/null +++ b/doc/src/week38/._week38-bs016.html @@ -0,0 +1,570 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Taking out the mean

    +

    + + +

    import numpy as np
    +import pandas as pd
    +import matplotlib.pyplot as plt
    +from sklearn.model_selection import train_test_split
    +from sklearn import linear_model
    +from sklearn.preprocessing import StandardScaler
    +
    +def MSE(y_data,y_model):
    +    n = np.size(y_model)
    +    return np.sum((y_data-y_model)**2)/n
    +# A seed just to ensure that the random numbers are the same for every run.
    +# Useful for eventual debugging.
    +np.random.seed(315)
    +
    +n = 100
    +x = np.random.rand(n)
    +y = np.exp(-x**2) + 1.5 * np.exp(-(x-2)**2)
    +
    +Maxpolydegree = 20
    +X = np.zeros((n,Maxpolydegree-1))
    +
    +for degree in range(1,Maxpolydegree): #No intercept column
    +    X[:,degree-1] = x**(degree)
    +
    +# We split the data in test and training data
    +X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)
    +
    +#For our own implementation, we will need to deal with the intercept by centering the design matrix and the target variable
    +X_train_mean = np.mean(X_train,axis=0)
    +#Center by removing mean from each feature
    +X_train_scaled = X_train - X_train_mean 
    +X_test_scaled = X_test - X_train_mean
    +#The model intercept (called y_scaler) is given by the mean of the target variable (IF X is centered)
    +#Remove the intercept from the training data.
    +y_scaler = np.mean(y_train)           
    +y_train_scaled = y_train - y_scaler   
    +
    +p = Maxpolydegree-1
    +I = np.eye(p,p)
    +# Decide which values of lambda to use
    +nlambdas = 6
    +MSEOwnRidgePredict = np.zeros(nlambdas)
    +MSERidgePredict = np.zeros(nlambdas)
    +
    +lambdas = np.logspace(-4, 2, nlambdas)
    +for i in range(nlambdas):
    +    lmb = lambdas[i]
    +    OwnRidgeBeta = np.linalg.pinv(X_train_scaled.T @ X_train_scaled+lmb*I) @ X_train_scaled.T @ (y_train_scaled)
    +    intercept_ = y_scaler - X_train_mean@OwnRidgeBeta #The intercept can be shifted so the model can predict on uncentered data
    +    #Add intercept to prediction
    +    ypredictOwnRidge = X_test @ OwnRidgeBeta + intercept_ 
    +    #Add intercept to prediction
    +    ypredictOwnRidge = X_test_scaled @ OwnRidgeBeta + y_scaler 
    +    RegRidge = linear_model.Ridge(lmb)
    +    RegRidge.fit(X_train,y_train)
    +    ypredictRidge = RegRidge.predict(X_test)
    +    MSEOwnRidgePredict[i] = MSE(y_test,ypredictOwnRidge)
    +    MSERidgePredict[i] = MSE(y_test,ypredictRidge)
    +    print("Beta values for own Ridge implementation")
    +    print(OwnRidgeBeta) #Intercept is given by mean of target variable
    +    print("Beta values for Scikit-Learn Ridge implementation")
    +    print(RegRidge.coef_)
    +    print('Intercept from own implementation:')
    +    print(intercept_)
    +    print('Intercept from Scikit-Learn Ridge implementation')
    +    print(RegRidge.intercept_)
    +    print("MSE values for own Ridge implementation")
    +    print(MSEOwnRidgePredict[i])
    +    print("MSE values for Scikit-Learn Ridge implementation")
    +    print(MSERidgePredict[i])
    +
    +
    +# Now plot the results
    +plt.figure()
    +plt.plot(np.log10(lambdas), MSEOwnRidgePredict, 'b--', label = 'MSE own Ridge Test')
    +plt.plot(np.log10(lambdas), MSERidgePredict, 'g--', label = 'MSE SL Ridge Test')
    +plt.xlabel('log10(lambda)')
    +plt.ylabel('MSE')
    +plt.legend()
    +plt.show()
    +
    +

    +We see here, when compared to the code which includes explicitely the +intercept column, that our MSE value is actually smaller. This is +because the regularization term does not include the intercept value +\( \beta_0 \) in the fitting. This applies to Lasso regularization as +well. It means that our optimization is now done only with the +centered matrix and/or vector that enter the fitting procedure. Note +also that the problem with the intercept occurs mainly in these type +of polynomial fitting problem. + +

    +The next example is indeed an example where all these discussions about the role of intercept are not present. + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs017.html b/doc/src/week38/._week38-bs017.html new file mode 100644 index 000000000..81818dadc --- /dev/null +++ b/doc/src/week38/._week38-bs017.html @@ -0,0 +1,526 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    More complicated Example: The Ising model

    + +

    +The one-dimensional Ising model with nearest neighbor interaction, no +external field and a constant coupling constant \( J \) is given by + +$$ +\begin{align} + H = -J \sum_{k}^L s_k s_{k + 1}, +\tag{1} +\end{align} +$$ + +

    +where \( s_i \in \{-1, 1\} \) and \( s_{N + 1} = s_1 \). The number of spins +in the system is determined by \( L \). For the one-dimensional system +there is no phase transition. + +

    +We will look at a system of \( L = 40 \) spins with a coupling constant of +\( J = 1 \). To get enough training data we will generate 10000 states +with their respective energies. + +

    + + +

    import numpy as np
    +import matplotlib.pyplot as plt
    +from mpl_toolkits.axes_grid1 import make_axes_locatable
    +import seaborn as sns
    +import scipy.linalg as scl
    +from sklearn.model_selection import train_test_split
    +import tqdm
    +sns.set(color_codes=True)
    +cmap_args=dict(vmin=-1., vmax=1., cmap='seismic')
    +
    +L = 40
    +n = int(1e4)
    +
    +spins = np.random.choice([-1, 1], size=(n, L))
    +J = 1.0
    +
    +energies = np.zeros(n)
    +
    +for i in range(n):
    +    energies[i] = - J * np.dot(spins[i], np.roll(spins[i], 1))
    +
    +

    +Here we use ordinary least squares +regression to predict the energy for the nearest neighbor +one-dimensional Ising model on a ring, i.e., the endpoints wrap +around. We will use linear regression to fit a value for +the coupling constant to achieve this. + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs018.html b/doc/src/week38/._week38-bs018.html new file mode 100644 index 000000000..f0f4a3def --- /dev/null +++ b/doc/src/week38/._week38-bs018.html @@ -0,0 +1,519 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Reformulating the problem to suit regression

    + +

    +A more general form for the one-dimensional Ising model is + +$$ +\begin{align} + H = - \sum_j^L \sum_k^L s_j s_k J_{jk}. +\tag{2} +\end{align} +$$ + +

    +Here we allow for interactions beyond the nearest neighbors and a state dependent +coupling constant. This latter expression can be formulated as +a matrix-product +$$ +\begin{align} + \boldsymbol{H} = \boldsymbol{X} J, +\tag{3} +\end{align} +$$ + +

    +where \( X_{jk} = s_j s_k \) and \( J \) is a matrix which consists of the +elements \( -J_{jk} \). This form of writing the energy fits perfectly +with the form utilized in linear regression, that is + +$$ +\begin{align} + \boldsymbol{y} = \boldsymbol{X}\boldsymbol{\beta} + \boldsymbol{\epsilon}, +\tag{4} +\end{align} +$$ + +

    +We split the data in training and test data as discussed in the previous example + +

    + + +

    X = np.zeros((n, L ** 2))
    +for i in range(n):
    +    X[i] = np.outer(spins[i], spins[i]).ravel()
    +y = energies
    +X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)
    +
    +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs019.html b/doc/src/week38/._week38-bs019.html new file mode 100644 index 000000000..29fa795a5 --- /dev/null +++ b/doc/src/week38/._week38-bs019.html @@ -0,0 +1,517 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Linear regression

    + +

    +In the ordinary least squares method we choose the cost function + +$$ +\begin{align} + C(\boldsymbol{X}, \boldsymbol{\beta})= \frac{1}{n}\left\{(\boldsymbol{X}\boldsymbol{\beta} - \boldsymbol{y})^T(\boldsymbol{X}\boldsymbol{\beta} - \boldsymbol{y})\right\}. +\tag{5} +\end{align} +$$ + +

    +We then find the extremal point of \( C \) by taking the derivative with respect to \( \boldsymbol{\beta} \) as discussed above. +This yields the expression for \( \boldsymbol{\beta} \) to be + +$$ + \boldsymbol{\beta} = \frac{\boldsymbol{X}^T \boldsymbol{y}}{\boldsymbol{X}^T \boldsymbol{X}}, +$$ + +

    +which immediately imposes some requirements on \( \boldsymbol{X} \) as there must exist +an inverse of \( \boldsymbol{X}^T \boldsymbol{X} \). If the expression we are modeling contains an +intercept, i.e., a constant term, we must make sure that the +first column of \( \boldsymbol{X} \) consists of \( 1 \). We do this here + +

    + + +

    X_train_own = np.concatenate(
    +    (np.ones(len(X_train))[:, np.newaxis], X_train),
    +    axis=1
    +)
    +X_test_own = np.concatenate(
    +    (np.ones(len(X_test))[:, np.newaxis], X_test),
    +    axis=1
    +)
    +
    +

    + + +

    def ols_inv(x: np.ndarray, y: np.ndarray) -> np.ndarray:
    +    return scl.inv(x.T @ x) @ (x.T @ y)
    +beta = ols_inv(X_train_own, y_train)
    +
    +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs020.html b/doc/src/week38/._week38-bs020.html new file mode 100644 index 000000000..8c4fc9923 --- /dev/null +++ b/doc/src/week38/._week38-bs020.html @@ -0,0 +1,556 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Singular Value decomposition

    + +

    +Doing the inversion directly turns out to be a bad idea since the matrix +\( \boldsymbol{X}^T\boldsymbol{X} \) is singular. An alternative approach is to use the singular +value decomposition. Using the definition of the Moore-Penrose +pseudoinverse we can write the equation for \( \boldsymbol{\beta} \) as + +$$ + \boldsymbol{\beta} = \boldsymbol{X}^{+}\boldsymbol{y}, +$$ + +

    +where the pseudoinverse of \( \boldsymbol{X} \) is given by + +$$ + \boldsymbol{X}^{+} = \frac{\boldsymbol{X}^T}{\boldsymbol{X}^T\boldsymbol{X}}. +$$ + +

    +Using singular value decomposition we can decompose the matrix \( \boldsymbol{X} = \boldsymbol{U}\boldsymbol{\Sigma} \boldsymbol{V}^T \), +where \( \boldsymbol{U} \) and \( \boldsymbol{V} \) are orthogonal(unitary) matrices and \( \boldsymbol{\Sigma} \) contains the singular values (more details below). +where \( X^{+} = V\Sigma^{+} U^T \). This reduces the equation for +\( \omega \) to +$$ +\begin{align} + \boldsymbol{\beta} = \boldsymbol{V}\boldsymbol{\Sigma}^{+} \boldsymbol{U}^T \boldsymbol{y}. +\tag{6} +\end{align} +$$ + +

    +Note that solving this equation by actually doing the pseudoinverse +(which is what we will do) is not a good idea as this operation scales +as \( \mathcal{O}(n^3) \), where \( n \) is the number of elements in a +general matrix. Instead, doing \( QR \)-factorization and solving the +linear system as an equation would reduce this down to +\( \mathcal{O}(n^2) \) operations. + +

    + + +

    def ols_svd(x: np.ndarray, y: np.ndarray) -> np.ndarray:
    +    u, s, v = scl.svd(x)
    +    return v.T @ scl.pinv(scl.diagsvd(s, u.shape[0], v.shape[0])) @ u.T @ y
    +
    +

    + + +

    beta = ols_svd(X_train_own,y_train)
    +
    +

    +When extracting the \( J \)-matrix we need to make sure that we remove the intercept, as is done here + +

    + + +

    J = beta[1:].reshape(L, L)
    +
    +

    +A way of looking at the coefficients in \( J \) is to plot the matrices as images. + +

    + + +

    fig = plt.figure(figsize=(20, 14))
    +im = plt.imshow(J, **cmap_args)
    +plt.title("OLS", fontsize=18)
    +plt.xticks(fontsize=18)
    +plt.yticks(fontsize=18)
    +cb = fig.colorbar(im)
    +cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)
    +plt.show()
    +
    +

    +It is interesting to note that OLS +considers both \( J_{j, j + 1} = -0.5 \) and \( J_{j, j - 1} = -0.5 \) as +valid matrix elements for \( J \). +In our discussion below on hyperparameters and Ridge and Lasso regression we will see that +this problem can be removed, partly and only with Lasso regression. + +

    +In this case our matrix inversion was actually possible. The obvious question now is what is the mathematics behind the SVD? + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs021.html b/doc/src/week38/._week38-bs021.html new file mode 100644 index 000000000..10aaddbc0 --- /dev/null +++ b/doc/src/week38/._week38-bs021.html @@ -0,0 +1,603 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    The one-dimensional Ising model

    + +

    +Let us bring back the Ising model again, but now with an additional +focus on Ridge and Lasso regression as well. We repeat some of the +basic parts of the Ising model and the setup of the training and test +data. The one-dimensional Ising model with nearest neighbor +interaction, no external field and a constant coupling constant \( J \) is +given by + +$$ +\begin{align} + H = -J \sum_{k}^L s_k s_{k + 1}, +\tag{7} +\end{align} +$$ + +where \( s_i \in \{-1, 1\} \) and \( s_{N + 1} = s_1 \). The number of spins in the system is determined by \( L \). For the one-dimensional system there is no phase transition. + +

    +We will look at a system of \( L = 40 \) spins with a coupling constant of \( J = 1 \). To get enough training data we will generate 10000 states with their respective energies. + +

    + + +

    import numpy as np
    +import matplotlib.pyplot as plt
    +from mpl_toolkits.axes_grid1 import make_axes_locatable
    +import seaborn as sns
    +import scipy.linalg as scl
    +from sklearn.model_selection import train_test_split
    +import sklearn.linear_model as skl
    +import tqdm
    +sns.set(color_codes=True)
    +cmap_args=dict(vmin=-1., vmax=1., cmap='seismic')
    +
    +L = 40
    +n = int(1e4)
    +
    +spins = np.random.choice([-1, 1], size=(n, L))
    +J = 1.0
    +
    +energies = np.zeros(n)
    +
    +for i in range(n):
    +    energies[i] = - J * np.dot(spins[i], np.roll(spins[i], 1))
    +
    +

    +A more general form for the one-dimensional Ising model is + +$$ +\begin{align} + H = - \sum_j^L \sum_k^L s_j s_k J_{jk}. +\tag{8} +\end{align} +$$ + +

    +Here we allow for interactions beyond the nearest neighbors and a more +adaptive coupling matrix. This latter expression can be formulated as +a matrix-product on the form +$$ +\begin{align} + H = X J, +\tag{9} +\end{align} +$$ + +

    +where \( X_{jk} = s_j s_k \) and \( J \) is the matrix consisting of the +elements \( -J_{jk} \). This form of writing the energy fits perfectly +with the form utilized in linear regression, viz. +$$ +\begin{align} + \boldsymbol{y} = \boldsymbol{X}\boldsymbol{\beta} + \boldsymbol{\epsilon}. +\tag{10} +\end{align} +$$ + +We organize the data as we did above +

    + + +

    X = np.zeros((n, L ** 2))
    +for i in range(n):
    +    X[i] = np.outer(spins[i], spins[i]).ravel()
    +y = energies
    +X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.96)
    +
    +X_train_own = np.concatenate(
    +    (np.ones(len(X_train))[:, np.newaxis], X_train),
    +    axis=1
    +)
    +
    +X_test_own = np.concatenate(
    +    (np.ones(len(X_test))[:, np.newaxis], X_test),
    +    axis=1
    +)
    +
    +

    +We will do all fitting with Scikit-Learn, + +

    + + +

    clf = skl.LinearRegression().fit(X_train, y_train)
    +
    +

    +When extracting the \( J \)-matrix we make sure to remove the intercept +

    + + +

    J_sk = clf.coef_.reshape(L, L)
    +
    +

    +And then we plot the results +

    + + +

    fig = plt.figure(figsize=(20, 14))
    +im = plt.imshow(J_sk, **cmap_args)
    +plt.title("LinearRegression from Scikit-learn", fontsize=18)
    +plt.xticks(fontsize=18)
    +plt.yticks(fontsize=18)
    +cb = fig.colorbar(im)
    +cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)
    +plt.show()
    +
    +

    +The results perfectly with our previous discussion where we used our own code. + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs022.html b/doc/src/week38/._week38-bs022.html new file mode 100644 index 000000000..d1b4e1c9a --- /dev/null +++ b/doc/src/week38/._week38-bs022.html @@ -0,0 +1,504 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Ridge regression

    + +

    +Having explored the ordinary least squares we move on to ridge +regression. In ridge regression we include a regularizer. This +involves a new cost function which leads to a new estimate for the +weights \( \boldsymbol{\beta} \). This results in a penalized regression problem. The +cost function is given by + +$$ +\begin{align} + C(\boldsymbol{X}, \boldsymbol{\beta}; \lambda) = (\boldsymbol{X}\boldsymbol{\beta} - \boldsymbol{y})^T(\boldsymbol{X}\boldsymbol{\beta} - \boldsymbol{y}) + \lambda \boldsymbol{\beta}^T\boldsymbol{\beta}. +\tag{11} +\end{align} +$$ + +

    + + +

    _lambda = 0.1
    +clf_ridge = skl.Ridge(alpha=_lambda).fit(X_train, y_train)
    +J_ridge_sk = clf_ridge.coef_.reshape(L, L)
    +fig = plt.figure(figsize=(20, 14))
    +im = plt.imshow(J_ridge_sk, **cmap_args)
    +plt.title("Ridge from Scikit-learn", fontsize=18)
    +plt.xticks(fontsize=18)
    +plt.yticks(fontsize=18)
    +cb = fig.colorbar(im)
    +cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)
    +
    +plt.show()
    +
    +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs023.html b/doc/src/week38/._week38-bs023.html new file mode 100644 index 000000000..c7b61759f --- /dev/null +++ b/doc/src/week38/._week38-bs023.html @@ -0,0 +1,507 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    LASSO regression

    + +

    +In the Least Absolute Shrinkage and Selection Operator (LASSO)-method we get a third cost function. + +$$ +\begin{align} + C(\boldsymbol{X}, \boldsymbol{\beta}; \lambda) = (\boldsymbol{X}\boldsymbol{\beta} - \boldsymbol{y})^T(\boldsymbol{X}\boldsymbol{\beta} - \boldsymbol{y}) + \lambda \sqrt{\boldsymbol{\beta}^T\boldsymbol{\beta}}. +\tag{12} +\end{align} +$$ + +

    +Finding the extremal point of this cost function is not so straight-forward as in least squares and ridge. We will therefore rely solely on the function ``Lasso`` from Scikit-Learn. + +

    + + +

    clf_lasso = skl.Lasso(alpha=_lambda).fit(X_train, y_train)
    +J_lasso_sk = clf_lasso.coef_.reshape(L, L)
    +fig = plt.figure(figsize=(20, 14))
    +im = plt.imshow(J_lasso_sk, **cmap_args)
    +plt.title("Lasso from Scikit-learn", fontsize=18)
    +plt.xticks(fontsize=18)
    +plt.yticks(fontsize=18)
    +cb = fig.colorbar(im)
    +cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)
    +
    +plt.show()
    +
    +

    +It is quite striking how LASSO breaks the symmetry of the coupling +constant as opposed to ridge and OLS. We get a sparse solution with +\( J_{j, j + 1} = -1 \). + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs024.html b/doc/src/week38/._week38-bs024.html new file mode 100644 index 000000000..7ac38c92b --- /dev/null +++ b/doc/src/week38/._week38-bs024.html @@ -0,0 +1,523 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Performance as function of the regularization parameter

    + +

    +We see how the different models perform for a different set of values for \( \lambda \). + +

    + + +

    lambdas = np.logspace(-4, 5, 10)
    +
    +train_errors = {
    +    "ols_sk": np.zeros(lambdas.size),
    +    "ridge_sk": np.zeros(lambdas.size),
    +    "lasso_sk": np.zeros(lambdas.size)
    +}
    +
    +test_errors = {
    +    "ols_sk": np.zeros(lambdas.size),
    +    "ridge_sk": np.zeros(lambdas.size),
    +    "lasso_sk": np.zeros(lambdas.size)
    +}
    +
    +plot_counter = 1
    +
    +fig = plt.figure(figsize=(32, 54))
    +
    +for i, _lambda in enumerate(tqdm.tqdm(lambdas)):
    +    for key, method in zip(
    +        ["ols_sk", "ridge_sk", "lasso_sk"],
    +        [skl.LinearRegression(), skl.Ridge(alpha=_lambda), skl.Lasso(alpha=_lambda)]
    +    ):
    +        method = method.fit(X_train, y_train)
    +
    +        train_errors[key][i] = method.score(X_train, y_train)
    +        test_errors[key][i] = method.score(X_test, y_test)
    +
    +        omega = method.coef_.reshape(L, L)
    +
    +        plt.subplot(10, 5, plot_counter)
    +        plt.imshow(omega, **cmap_args)
    +        plt.title(r"%s, $\lambda = %.4f$" % (key, _lambda))
    +        plot_counter += 1
    +
    +plt.show()
    +
    +

    +We see that LASSO reaches a good solution for low +values of \( \lambda \), but will "wither" when we increase \( \lambda \) too +much. Ridge is more stable over a larger range of values for +\( \lambda \), but eventually also fades away. + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs025.html b/doc/src/week38/._week38-bs025.html new file mode 100644 index 000000000..3b5c8f105 --- /dev/null +++ b/doc/src/week38/._week38-bs025.html @@ -0,0 +1,521 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Finding the optimal value of \( \lambda \)

    + +

    +To determine which value of \( \lambda \) is best we plot the accuracy of +the models when predicting the training and the testing set. We expect +the accuracy of the training set to be quite good, but if the accuracy +of the testing set is much lower this tells us that we might be +subject to an overfit model. The ideal scenario is an accuracy on the +testing set that is close to the accuracy of the training set. + +

    + + +

    fig = plt.figure(figsize=(20, 14))
    +
    +colors = {
    +    "ols_sk": "r",
    +    "ridge_sk": "y",
    +    "lasso_sk": "c"
    +}
    +
    +for key in train_errors:
    +    plt.semilogx(
    +        lambdas,
    +        train_errors[key],
    +        colors[key],
    +        label="Train {0}".format(key),
    +        linewidth=4.0
    +    )
    +
    +for key in test_errors:
    +    plt.semilogx(
    +        lambdas,
    +        test_errors[key],
    +        colors[key] + "--",
    +        label="Test {0}".format(key),
    +        linewidth=4.0
    +    )
    +plt.legend(loc="best", fontsize=18)
    +plt.xlabel(r"$\lambda$", fontsize=18)
    +plt.ylabel(r"$R^2$", fontsize=18)
    +plt.tick_params(labelsize=18)
    +plt.show()
    +
    +

    +From the above figure we can see that LASSO with \( \lambda = 10^{-2} \) +achieves a very good accuracy on the test set. This by far surpasses the +other models for all values of \( \lambda \). + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs026.html b/doc/src/week38/._week38-bs026.html new file mode 100644 index 000000000..8019c1d72 --- /dev/null +++ b/doc/src/week38/._week38-bs026.html @@ -0,0 +1,487 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Logistic Regression

    + +

    +In linear regression our main interest was centered on learning the +coefficients of a functional fit (say a polynomial) in order to be +able to predict the response of a continuous variable on some unseen +data. The fit to the continuous variable \( y_i \) is based on some +independent variables \( \boldsymbol{x}_i \). Linear regression resulted in +analytical expressions for standard ordinary Least Squares or Ridge +regression (in terms of matrices to invert) for several quantities, +ranging from the variance and thereby the confidence intervals of the +parameters \( \boldsymbol{\beta} \) to the mean squared error. If we can invert +the product of the design matrices, linear regression gives then a +simple recipe for fitting our data. + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs027.html b/doc/src/week38/._week38-bs027.html new file mode 100644 index 000000000..ec191791b --- /dev/null +++ b/doc/src/week38/._week38-bs027.html @@ -0,0 +1,492 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Classification problems

    + +

    +Classification problems, however, are concerned with outcomes taking +the form of discrete variables (i.e. categories). We may for example, +on the basis of DNA sequencing for a number of patients, like to find +out which mutations are important for a certain disease; or based on +scans of various patients' brains, figure out if there is a tumor or +not; or given a specific physical system, we'd like to identify its +state, say whether it is an ordered or disordered system (typical +situation in solid state physics); or classify the status of a +patient, whether she/he has a stroke or not and many other similar +situations. + +

    +The most common situation we encounter when we apply logistic +regression is that of two possible outcomes, normally denoted as a +binary outcome, true or false, positive or negative, success or +failure etc. + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs028.html b/doc/src/week38/._week38-bs028.html new file mode 100644 index 000000000..c17ab46b3 --- /dev/null +++ b/doc/src/week38/._week38-bs028.html @@ -0,0 +1,490 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Optimization and Deep learning

    + +

    +Logistic regression will also serve as our stepping stone towards +neural network algorithms and supervised deep learning. For logistic +learning, the minimization of the cost function leads to a non-linear +equation in the parameters \( \boldsymbol{\beta} \). The optimization of the +problem calls therefore for minimization algorithms. This forms the +bottle neck of all machine learning algorithms, namely how to find +reliable minima of a multi-variable function. This leads us to the +family of gradient descent methods. The latter are the working horses +of basically all modern machine learning algorithms. + +

    +We note also that many of the topics discussed here on logistic +regression are also commonly used in modern supervised Deep Learning +models, as we will see later. + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs029.html b/doc/src/week38/._week38-bs029.html new file mode 100644 index 000000000..1633e4aa3 --- /dev/null +++ b/doc/src/week38/._week38-bs029.html @@ -0,0 +1,496 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Basics

    + +

    +We consider the case where the dependent variables, also called the +responses or the outcomes, \( y_i \) are discrete and only take values +from \( k=0,\dots,K-1 \) (i.e. \( K \) classes). + +

    +The goal is to predict the +output classes from the design matrix \( \boldsymbol{X}\in\mathbb{R}^{n\times p} \) +made of \( n \) samples, each of which carries \( p \) features or predictors. The +primary goal is to identify the classes to which new unseen samples +belong. + +

    +Let us specialize to the case of two classes only, with outputs +\( y_i=0 \) and \( y_i=1 \). Our outcomes could represent the status of a +credit card user that could default or not on her/his credit card +debt. That is + +$$ +y_i = \begin{bmatrix} 0 & \mathrm{no}\\ 1 & \mathrm{yes} \end{bmatrix}. +$$ + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs030.html b/doc/src/week38/._week38-bs030.html new file mode 100644 index 000000000..ecae8af76 --- /dev/null +++ b/doc/src/week38/._week38-bs030.html @@ -0,0 +1,493 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Linear classifier

    + +

    +Before moving to the logistic model, let us try to use our linear +regression model to classify these two outcomes. We could for example +fit a linear model to the default case if \( y_i > 0.5 \) and the no +default case \( y_i \leq 0.5 \). + +

    +We would then have our +weighted linear combination, namely +$$ +\begin{equation} +\boldsymbol{y} = \boldsymbol{X}^T\boldsymbol{\beta} + \boldsymbol{\epsilon}, +\tag{13} +\end{equation} +$$ + +where \( \boldsymbol{y} \) is a vector representing the possible outcomes, \( \boldsymbol{X} \) is our +\( n\times p \) design matrix and \( \boldsymbol{\beta} \) represents our estimators/predictors. + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs031.html b/doc/src/week38/._week38-bs031.html new file mode 100644 index 000000000..806addd4a --- /dev/null +++ b/doc/src/week38/._week38-bs031.html @@ -0,0 +1,491 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Some selected properties

    + +

    +The main problem with our function is that it takes values on the +entire real axis. In the case of logistic regression, however, the +labels \( y_i \) are discrete variables. A typical example is the credit +card data discussed below here, where we can set the state of +defaulting the debt to \( y_i=1 \) and not to \( y_i=0 \) for one the persons +in the data set (see the full example below). + +

    +One simple way to get a discrete output is to have sign +functions that map the output of a linear regressor to values \( \{0,1\} \), +\( f(s_i)=sign(s_i)=1 \) if \( s_i\ge 0 \) and 0 if otherwise. +We will encounter this model in our first demonstration of neural networks. Historically it is called the ``perceptron" model in the machine learning +literature. This model is extremely simple. However, in many cases it is more +favorable to use a ``soft" classifier that outputs +the probability of a given category. This leads us to the logistic function. + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs032.html b/doc/src/week38/._week38-bs032.html new file mode 100644 index 000000000..d4bbd8380 --- /dev/null +++ b/doc/src/week38/._week38-bs032.html @@ -0,0 +1,535 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Simple example

    + +

    +The following example on data for coronary heart disease (CHD) as function of age may serve as an illustration. In the code here we read and plot whether a person has had CHD (output = 1) or not (output = 0). This ouput is plotted the person's against age. Clearly, the figure shows that attempting to make a standard linear regression fit may not be very meaningful. + +

    + + +

    # Common imports
    +import os
    +import numpy as np
    +import pandas as pd
    +import matplotlib.pyplot as plt
    +from sklearn.linear_model import LinearRegression, Ridge, Lasso
    +from sklearn.model_selection import train_test_split
    +from sklearn.utils import resample
    +from sklearn.metrics import mean_squared_error
    +from IPython.display import display
    +from pylab import plt, mpl
    +plt.style.use('seaborn')
    +mpl.rcParams['font.family'] = 'serif'
    +
    +# Where to save the figures and data files
    +PROJECT_ROOT_DIR = "Results"
    +FIGURE_ID = "Results/FigureFiles"
    +DATA_ID = "DataFiles/"
    +
    +if not os.path.exists(PROJECT_ROOT_DIR):
    +    os.mkdir(PROJECT_ROOT_DIR)
    +
    +if not os.path.exists(FIGURE_ID):
    +    os.makedirs(FIGURE_ID)
    +
    +if not os.path.exists(DATA_ID):
    +    os.makedirs(DATA_ID)
    +
    +def image_path(fig_id):
    +    return os.path.join(FIGURE_ID, fig_id)
    +
    +def data_path(dat_id):
    +    return os.path.join(DATA_ID, dat_id)
    +
    +def save_fig(fig_id):
    +    plt.savefig(image_path(fig_id) + ".png", format='png')
    +
    +infile = open(data_path("chddata.csv"),'r')
    +
    +# Read the chd data as  csv file and organize the data into arrays with age group, age, and chd
    +chd = pd.read_csv(infile, names=('ID', 'Age', 'Agegroup', 'CHD'))
    +chd.columns = ['ID', 'Age', 'Agegroup', 'CHD']
    +output = chd['CHD']
    +age = chd['Age']
    +agegroup = chd['Agegroup']
    +numberID  = chd['ID'] 
    +display(chd)
    +
    +plt.scatter(age, output, marker='o')
    +plt.axis([18,70.0,-0.1, 1.2])
    +plt.xlabel(r'Age')
    +plt.ylabel(r'CHD')
    +plt.title(r'Age distribution and Coronary heart disease')
    +plt.show()
    +
    +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs033.html b/doc/src/week38/._week38-bs033.html new file mode 100644 index 000000000..aae61091f --- /dev/null +++ b/doc/src/week38/._week38-bs033.html @@ -0,0 +1,508 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Plotting the mean value for each group

    + +

    +What we could attempt however is to plot the mean value for each group. + +

    + + +

    agegroupmean = np.array([0.1, 0.133, 0.250, 0.333, 0.462, 0.625, 0.765, 0.800])
    +group = np.array([1, 2, 3, 4, 5, 6, 7, 8])
    +plt.plot(group, agegroupmean, "r-")
    +plt.axis([0,9,0, 1.0])
    +plt.xlabel(r'Age group')
    +plt.ylabel(r'CHD mean values')
    +plt.title(r'Mean values for each age group')
    +plt.show()
    +
    +

    +We are now trying to find a function \( f(y\vert x) \), that is a function which gives us an expected value for the output \( y \) with a given input \( x \). +In standard linear regression with a linear dependence on \( x \), we would write this in terms of our model +$$ +f(y_i\vert x_i)=\beta_0+\beta_1 x_i. +$$ + +

    +This expression implies however that \( f(y_i\vert x_i) \) could take any +value from minus infinity to plus infinity. If we however let +\( f(y\vert y) \) be represented by the mean value, the above example +shows us that we can constrain the function to take values between +zero and one, that is we have \( 0 \le f(y_i\vert x_i) \le 1 \). Looking +at our last curve we see also that it has an S-shaped form. This leads +us to a very popular model for the function \( f \), namely the so-called +Sigmoid function or logistic model. We will consider this function as +representing the probability for finding a value of \( y_i \) with a given +\( x_i \). + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs034.html b/doc/src/week38/._week38-bs034.html new file mode 100644 index 000000000..850014b15 --- /dev/null +++ b/doc/src/week38/._week38-bs034.html @@ -0,0 +1,492 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    The logistic function

    + +

    +Another widely studied model, is the so-called +perceptron model, which is an example of a "hard classification" model. We +will encounter this model when we discuss neural networks as +well. Each datapoint is deterministically assigned to a category (i.e +\( y_i=0 \) or \( y_i=1 \)). In many cases, and the coronary heart disease data forms one of many such examples, it is favorable to have a "soft" +classifier that outputs the probability of a given category rather +than a single value. For example, given \( x_i \), the classifier +outputs the probability of being in a category \( k \). Logistic regression +is the most common example of a so-called soft classifier. In logistic +regression, the probability that a data point \( x_i \) +belongs to a category \( y_i=\{0,1\} \) is given by the so-called logit function (or Sigmoid) which is meant to represent the likelihood for a given event, +$$ +p(t) = \frac{1}{1+\mathrm \exp{-t}}=\frac{\exp{t}}{1+\mathrm \exp{t}}. +$$ + +Note that \( 1-p(t)= p(-t) \). + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs035.html b/doc/src/week38/._week38-bs035.html new file mode 100644 index 000000000..4acbc04d7 --- /dev/null +++ b/doc/src/week38/._week38-bs035.html @@ -0,0 +1,535 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Examples of likelihood functions used in logistic regression and nueral networks

    + +

    +The following code plots the logistic function, the step function and other functions we will encounter from here and on. + +

    + + +

    """The sigmoid function (or the logistic curve) is a
    +function that takes any real number, z, and outputs a number (0,1).
    +It is useful in neural networks for assigning weights on a relative scale.
    +The value z is the weighted sum of parameters involved in the learning algorithm."""
    +
    +import numpy
    +import matplotlib.pyplot as plt
    +import math as mt
    +
    +z = numpy.arange(-5, 5, .1)
    +sigma_fn = numpy.vectorize(lambda z: 1/(1+numpy.exp(-z)))
    +sigma = sigma_fn(z)
    +
    +fig = plt.figure()
    +ax = fig.add_subplot(111)
    +ax.plot(z, sigma)
    +ax.set_ylim([-0.1, 1.1])
    +ax.set_xlim([-5,5])
    +ax.grid(True)
    +ax.set_xlabel('z')
    +ax.set_title('sigmoid function')
    +
    +plt.show()
    +
    +"""Step Function"""
    +z = numpy.arange(-5, 5, .02)
    +step_fn = numpy.vectorize(lambda z: 1.0 if z >= 0.0 else 0.0)
    +step = step_fn(z)
    +
    +fig = plt.figure()
    +ax = fig.add_subplot(111)
    +ax.plot(z, step)
    +ax.set_ylim([-0.5, 1.5])
    +ax.set_xlim([-5,5])
    +ax.grid(True)
    +ax.set_xlabel('z')
    +ax.set_title('step function')
    +
    +plt.show()
    +
    +"""tanh Function"""
    +z = numpy.arange(-2*mt.pi, 2*mt.pi, 0.1)
    +t = numpy.tanh(z)
    +
    +fig = plt.figure()
    +ax = fig.add_subplot(111)
    +ax.plot(z, t)
    +ax.set_ylim([-1.0, 1.0])
    +ax.set_xlim([-2*mt.pi,2*mt.pi])
    +ax.grid(True)
    +ax.set_xlabel('z')
    +ax.set_title('tanh function')
    +
    +plt.show()
    +
    +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs036.html b/doc/src/week38/._week38-bs036.html new file mode 100644 index 000000000..e6c59bd28 --- /dev/null +++ b/doc/src/week38/._week38-bs036.html @@ -0,0 +1,491 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Two parameters

    + +

    +We assume now that we have two classes with \( y_i \) either \( 0 \) or \( 1 \). Furthermore we assume also that we have only two parameters \( \beta \) in our fitting of the Sigmoid function, that is we define probabilities +$$ +\begin{align*} +p(y_i=1|x_i,\boldsymbol{\beta}) &= \frac{\exp{(\beta_0+\beta_1x_i)}}{1+\exp{(\beta_0+\beta_1x_i)}},\nonumber\\ +p(y_i=0|x_i,\boldsymbol{\beta}) &= 1 - p(y_i=1|x_i,\boldsymbol{\beta}), +\end{align*} +$$ + +where \( \boldsymbol{\beta} \) are the weights we wish to extract from data, in our case \( \beta_0 \) and \( \beta_1 \). + +

    +Note that we used +$$ +p(y_i=0\vert x_i, \boldsymbol{\beta}) = 1-p(y_i=1\vert x_i, \boldsymbol{\beta}). +$$ + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs037.html b/doc/src/week38/._week38-bs037.html new file mode 100644 index 000000000..63291841f --- /dev/null +++ b/doc/src/week38/._week38-bs037.html @@ -0,0 +1,492 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Maximum likelihood

    + +

    +In order to define the total likelihood for all possible outcomes from a +dataset \( \mathcal{D}=\{(y_i,x_i)\} \), with the binary labels +\( y_i\in\{0,1\} \) and where the data points are drawn independently, we use the so-called Maximum Likelihood Estimation (MLE) principle. +We aim thus at maximizing +the probability of seeing the observed data. We can then approximate the +likelihood in terms of the product of the individual probabilities of a specific outcome \( y_i \), that is +$$ +\begin{align*} +P(\mathcal{D}|\boldsymbol{\beta})& = \prod_{i=1}^n \left[p(y_i=1|x_i,\boldsymbol{\beta})\right]^{y_i}\left[1-p(y_i=1|x_i,\boldsymbol{\beta}))\right]^{1-y_i}\nonumber \\ +\end{align*} +$$ + +from which we obtain the log-likelihood and our cost/loss function +$$ +\mathcal{C}(\boldsymbol{\beta}) = \sum_{i=1}^n \left( y_i\log{p(y_i=1|x_i,\boldsymbol{\beta})} + (1-y_i)\log\left[1-p(y_i=1|x_i,\boldsymbol{\beta}))\right]\right). +$$ + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs038.html b/doc/src/week38/._week38-bs038.html new file mode 100644 index 000000000..58c4b249a --- /dev/null +++ b/doc/src/week38/._week38-bs038.html @@ -0,0 +1,490 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    The cost function rewritten

    + +

    +Reordering the logarithms, we can rewrite the cost/loss function as +$$ +\mathcal{C}(\boldsymbol{\beta}) = \sum_{i=1}^n \left(y_i(\beta_0+\beta_1x_i) -\log{(1+\exp{(\beta_0+\beta_1x_i)})}\right). +$$ + +

    +The maximum likelihood estimator is defined as the set of parameters that maximize the log-likelihood where we maximize with respect to \( \beta \). +Since the cost (error) function is just the negative log-likelihood, for logistic regression we have that +$$ +\mathcal{C}(\boldsymbol{\beta})=-\sum_{i=1}^n \left(y_i(\beta_0+\beta_1x_i) -\log{(1+\exp{(\beta_0+\beta_1x_i)})}\right). +$$ + +This equation is known in statistics as the cross entropy. Finally, we note that just as in linear regression, +in practice we often supplement the cross-entropy with additional regularization terms, usually \( L_1 \) and \( L_2 \) regularization as we did for Ridge and Lasso regression. + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs039.html b/doc/src/week38/._week38-bs039.html new file mode 100644 index 000000000..e177ad1ab --- /dev/null +++ b/doc/src/week38/._week38-bs039.html @@ -0,0 +1,491 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Minimizing the cross entropy

    + +

    +The cross entropy is a convex function of the weights \( \boldsymbol{\beta} \) and, +therefore, any local minimizer is a global minimizer. + +

    +Minimizing this +cost function with respect to the two parameters \( \beta_0 \) and \( \beta_1 \) we obtain + +$$ +\frac{\partial \mathcal{C}(\boldsymbol{\beta})}{\partial \beta_0} = -\sum_{i=1}^n \left(y_i -\frac{\exp{(\beta_0+\beta_1x_i)}}{1+\exp{(\beta_0+\beta_1x_i)}}\right), +$$ + +and +$$ +\frac{\partial \mathcal{C}(\boldsymbol{\beta})}{\partial \beta_1} = -\sum_{i=1}^n \left(y_ix_i -x_i\frac{\exp{(\beta_0+\beta_1x_i)}}{1+\exp{(\beta_0+\beta_1x_i)}}\right). +$$ + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs040.html b/doc/src/week38/._week38-bs040.html new file mode 100644 index 000000000..6010937b7 --- /dev/null +++ b/doc/src/week38/._week38-bs040.html @@ -0,0 +1,492 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    A more compact expression

    + +

    +Let us now define a vector \( \boldsymbol{y} \) with \( n \) elements \( y_i \), an +\( n\times p \) matrix \( \boldsymbol{X} \) which contains the \( x_i \) values and a +vector \( \boldsymbol{p} \) of fitted probabilities \( p(y_i\vert x_i,\boldsymbol{\beta}) \). We can rewrite in a more compact form the first +derivative of cost function as + +$$ +\frac{\partial \mathcal{C}(\boldsymbol{\beta})}{\partial \boldsymbol{\beta}} = -\boldsymbol{X}^T\left(\boldsymbol{y}-\boldsymbol{p}\right). +$$ + +

    +If we in addition define a diagonal matrix \( \boldsymbol{W} \) with elements +\( p(y_i\vert x_i,\boldsymbol{\beta})(1-p(y_i\vert x_i,\boldsymbol{\beta}) \), we can obtain a compact expression of the second derivative as + +$$ +\frac{\partial^2 \mathcal{C}(\boldsymbol{\beta})}{\partial \boldsymbol{\beta}\partial \boldsymbol{\beta}^T} = \boldsymbol{X}^T\boldsymbol{W}\boldsymbol{X}. +$$ + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs041.html b/doc/src/week38/._week38-bs041.html new file mode 100644 index 000000000..1024a0957 --- /dev/null +++ b/doc/src/week38/._week38-bs041.html @@ -0,0 +1,485 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Extending to more predictors

    + +

    +Within a binary classification problem, we can easily expand our model to include multiple predictors. Our ratio between likelihoods is then with \( p \) predictors +$$ +\log{ \frac{p(\boldsymbol{\beta}\boldsymbol{x})}{1-p(\boldsymbol{\beta}\boldsymbol{x})}} = \beta_0+\beta_1x_1+\beta_2x_2+\dots+\beta_px_p. +$$ + +Here we defined \( \boldsymbol{x}=[1,x_1,x_2,\dots,x_p] \) and \( \boldsymbol{\beta}=[\beta_0, \beta_1, \dots, \beta_p] \) leading to +$$ +p(\boldsymbol{\beta}\boldsymbol{x})=\frac{ \exp{(\beta_0+\beta_1x_1+\beta_2x_2+\dots+\beta_px_p)}}{1+\exp{(\beta_0+\beta_1x_1+\beta_2x_2+\dots+\beta_px_p)}}. +$$ + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs042.html b/doc/src/week38/._week38-bs042.html new file mode 100644 index 000000000..6e8f03803 --- /dev/null +++ b/doc/src/week38/._week38-bs042.html @@ -0,0 +1,497 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Including more classes

    + +

    +Till now we have mainly focused on two classes, the so-called binary +system. Suppose we wish to extend to \( K \) classes. Let us for the sake +of simplicity assume we have only two predictors. We have then following model + +$$ +\log{\frac{p(C=1\vert x)}{p(K\vert x)}} = \beta_{10}+\beta_{11}x_1, +$$ + +and +$$ +\log{\frac{p(C=2\vert x)}{p(K\vert x)}} = \beta_{20}+\beta_{21}x_1, +$$ + +and so on till the class \( C=K-1 \) class +$$ +\log{\frac{p(C=K-1\vert x)}{p(K\vert x)}} = \beta_{(K-1)0}+\beta_{(K-1)1}x_1, +$$ + +

    +and the model is specified in term of \( K-1 \) so-called log-odds or +logit transformations. + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs043.html b/doc/src/week38/._week38-bs043.html new file mode 100644 index 000000000..848293c8f --- /dev/null +++ b/doc/src/week38/._week38-bs043.html @@ -0,0 +1,509 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    More classes

    + +

    +In our discussion of neural networks we will encounter the above again +in terms of a slightly modified function, the so-called Softmax function. + +

    +The softmax function is used in various multiclass classification +methods, such as multinomial logistic regression (also known as +softmax regression), multiclass linear discriminant analysis, naive +Bayes classifiers, and artificial neural networks. Specifically, in +multinomial logistic regression and linear discriminant analysis, the +input to the function is the result of \( K \) distinct linear functions, +and the predicted probability for the \( k \)-th class given a sample +vector \( \boldsymbol{x} \) and a weighting vector \( \boldsymbol{\beta} \) is (with two +predictors): + +$$ +p(C=k\vert \mathbf {x} )=\frac{\exp{(\beta_{k0}+\beta_{k1}x_1)}}{1+\sum_{l=1}^{K-1}\exp{(\beta_{l0}+\beta_{l1}x_1)}}. +$$ + +It is easy to extend to more predictors. The final class is +$$ +p(C=K\vert \mathbf {x} )=\frac{1}{1+\sum_{l=1}^{K-1}\exp{(\beta_{l0}+\beta_{l1}x_1)}}, +$$ + +

    +and they sum to one. Our earlier discussions were all specialized to +the case with two classes only. It is easy to see from the above that +what we derived earlier is compatible with these equations. + +

    +To find the optimal parameters we would typically use a gradient +descent method. Newton's method and gradient descent methods are +discussed in the material on optimization +methods. + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs044.html b/doc/src/week38/._week38-bs044.html new file mode 100644 index 000000000..32da696d2 --- /dev/null +++ b/doc/src/week38/._week38-bs044.html @@ -0,0 +1,474 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Friday September 24

    + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs045.html b/doc/src/week38/._week38-bs045.html new file mode 100644 index 000000000..881079a82 --- /dev/null +++ b/doc/src/week38/._week38-bs045.html @@ -0,0 +1,508 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Wisconsin Cancer Data

    + +

    +We show here how we can use a simple regression case on the breast +cancer data using Logistic regression as our algorithm for +classification. + +

    + + +

    import matplotlib.pyplot as plt
    +import numpy as np
    +from sklearn.model_selection import  train_test_split 
    +from sklearn.datasets import load_breast_cancer
    +from sklearn.linear_model import LogisticRegression
    +
    +# Load the data
    +cancer = load_breast_cancer()
    +
    +X_train, X_test, y_train, y_test = train_test_split(cancer.data,cancer.target,random_state=0)
    +print(X_train.shape)
    +print(X_test.shape)
    +# Logistic Regression
    +logreg = LogisticRegression(solver='lbfgs')
    +logreg.fit(X_train, y_train)
    +print("Test set accuracy with Logistic Regression: {:.2f}".format(logreg.score(X_test,y_test)))
    +#now scale the data
    +from sklearn.preprocessing import StandardScaler
    +scaler = StandardScaler()
    +scaler.fit(X_train)
    +X_train_scaled = scaler.transform(X_train)
    +X_test_scaled = scaler.transform(X_test)
    +# Logistic Regression
    +logreg.fit(X_train_scaled, y_train)
    +print("Test set accuracy Logistic Regression with scaled data: {:.2f}".format(logreg.score(X_test_scaled,y_test)))
    +
    +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs046.html b/doc/src/week38/._week38-bs046.html new file mode 100644 index 000000000..cc7b0ba3f --- /dev/null +++ b/doc/src/week38/._week38-bs046.html @@ -0,0 +1,515 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Using the correlation matrix

    + +

    +In addition to the above scores, we could also study the covariance (and the correlation matrix). +We use Pandas to compute the correlation matrix. +

    + + +

    import matplotlib.pyplot as plt
    +import numpy as np
    +from sklearn.model_selection import  train_test_split 
    +from sklearn.datasets import load_breast_cancer
    +from sklearn.linear_model import LogisticRegression
    +cancer = load_breast_cancer()
    +import pandas as pd
    +# Making a data frame
    +cancerpd = pd.DataFrame(cancer.data, columns=cancer.feature_names)
    +
    +fig, axes = plt.subplots(15,2,figsize=(10,20))
    +malignant = cancer.data[cancer.target == 0]
    +benign = cancer.data[cancer.target == 1]
    +ax = axes.ravel()
    +
    +for i in range(30):
    +    _, bins = np.histogram(cancer.data[:,i], bins =50)
    +    ax[i].hist(malignant[:,i], bins = bins, alpha = 0.5)
    +    ax[i].hist(benign[:,i], bins = bins, alpha = 0.5)
    +    ax[i].set_title(cancer.feature_names[i])
    +    ax[i].set_yticks(())
    +ax[0].set_xlabel("Feature magnitude")
    +ax[0].set_ylabel("Frequency")
    +ax[0].legend(["Malignant", "Benign"], loc ="best")
    +fig.tight_layout()
    +plt.show()
    +
    +import seaborn as sns
    +correlation_matrix = cancerpd.corr().round(1)
    +# use the heatmap function from seaborn to plot the correlation matrix
    +# annot = True to print the values inside the square
    +plt.figure(figsize=(15,8))
    +sns.heatmap(data=correlation_matrix, annot=True)
    +plt.show()
    +
    +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs047.html b/doc/src/week38/._week38-bs047.html new file mode 100644 index 000000000..551a60724 --- /dev/null +++ b/doc/src/week38/._week38-bs047.html @@ -0,0 +1,508 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Discussing the correlation data

    + +

    +In the above example we note two things. In the first plot we display +the overlap of benign and malignant tumors as functions of the various +features in the Wisconsing breast cancer data set. We see that for +some of the features we can distinguish clearly the benign and +malignant cases while for other features we cannot. This can point to +us which features may be of greater interest when we wish to classify +a benign or not benign tumour. + +

    +In the second figure we have computed the so-called correlation +matrix, which in our case with thirty features becomes a \( 30\times 30 \) +matrix. + +

    +We constructed this matrix using pandas via the statements +

    + + +

    cancerpd = pd.DataFrame(cancer.data, columns=cancer.feature_names)
    +
    +

    +and then +

    + + +

    correlation_matrix = cancerpd.corr().round(1)
    +
    +

    +Diagonalizing this matrix we can in turn say something about which +features are of relevance and which are not. This leads us to +the classical Principal Component Analysis (PCA) theorem with +applications. This will be discussed later this semester (week 43). + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs048.html b/doc/src/week38/._week38-bs048.html new file mode 100644 index 000000000..f6e077615 --- /dev/null +++ b/doc/src/week38/._week38-bs048.html @@ -0,0 +1,521 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Other measures in classification studies: Cancer Data again

    +

    + + +

    import matplotlib.pyplot as plt
    +import numpy as np
    +from sklearn.model_selection import  train_test_split 
    +from sklearn.datasets import load_breast_cancer
    +from sklearn.linear_model import LogisticRegression
    +
    +# Load the data
    +cancer = load_breast_cancer()
    +
    +X_train, X_test, y_train, y_test = train_test_split(cancer.data,cancer.target,random_state=0)
    +print(X_train.shape)
    +print(X_test.shape)
    +# Logistic Regression
    +logreg = LogisticRegression(solver='lbfgs')
    +logreg.fit(X_train, y_train)
    +print("Test set accuracy with Logistic Regression: {:.2f}".format(logreg.score(X_test,y_test)))
    +#now scale the data
    +from sklearn.preprocessing import StandardScaler
    +scaler = StandardScaler()
    +scaler.fit(X_train)
    +X_train_scaled = scaler.transform(X_train)
    +X_test_scaled = scaler.transform(X_test)
    +# Logistic Regression
    +logreg.fit(X_train_scaled, y_train)
    +print("Test set accuracy Logistic Regression with scaled data: {:.2f}".format(logreg.score(X_test_scaled,y_test)))
    +
    +
    +from sklearn.preprocessing import LabelEncoder
    +from sklearn.model_selection import cross_validate
    +#Cross validation
    +accuracy = cross_validate(logreg,X_test_scaled,y_test,cv=10)['test_score']
    +print(accuracy)
    +print("Test set accuracy with Logistic Regression  and scaled data: {:.2f}".format(logreg.score(X_test_scaled,y_test)))
    +
    +
    +import scikitplot as skplt
    +y_pred = logreg.predict(X_test_scaled)
    +skplt.metrics.plot_confusion_matrix(y_test, y_pred, normalize=True)
    +plt.show()
    +y_probas = logreg.predict_proba(X_test_scaled)
    +skplt.metrics.plot_roc(y_test, y_probas)
    +plt.show()
    +skplt.metrics.plot_cumulative_gain(y_test, y_probas)
    +plt.show()
    +
    +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs049.html b/doc/src/week38/._week38-bs049.html new file mode 100644 index 000000000..bfe19b5ac --- /dev/null +++ b/doc/src/week38/._week38-bs049.html @@ -0,0 +1,487 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Optimization, the central part of any Machine Learning algortithm

    + +

    +Overview Video, why do we care about gradient methods? + +

    +Almost every problem in machine learning and data science starts with +a dataset \( X \), a model \( g(\beta) \), which is a function of the +parameters \( \beta \) and a cost function \( C(X, g(\beta)) \) that allows +us to judge how well the model \( g(\beta) \) explains the observations +\( X \). The model is fit by finding the values of \( \beta \) that minimize +the cost function. Ideally we would be able to solve for \( \beta \) +analytically, however this is not possible in general and we must use +some approximative/numerical method to compute the minimum. + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs050.html b/doc/src/week38/._week38-bs050.html new file mode 100644 index 000000000..eed576414 --- /dev/null +++ b/doc/src/week38/._week38-bs050.html @@ -0,0 +1,491 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Revisiting our Logistic Regression case

    + +

    +In our discussion on Logistic Regression we studied the +case of +two classes, with \( y_i \) either +\( 0 \) or \( 1 \). Furthermore we assumed also that we have only two +parameters \( \beta \) in our fitting, that is we +defined probabilities + +$$ +\begin{align*} +p(y_i=1|x_i,\boldsymbol{\beta}) &= \frac{\exp{(\beta_0+\beta_1x_i)}}{1+\exp{(\beta_0+\beta_1x_i)}},\nonumber\\ +p(y_i=0|x_i,\boldsymbol{\beta}) &= 1 - p(y_i=1|x_i,\boldsymbol{\beta}), +\end{align*} +$$ + +where \( \boldsymbol{\beta} \) are the weights we wish to extract from data, in our case \( \beta_0 \) and \( \beta_1 \). + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs051.html b/doc/src/week38/._week38-bs051.html new file mode 100644 index 000000000..81537bd29 --- /dev/null +++ b/doc/src/week38/._week38-bs051.html @@ -0,0 +1,495 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    The equations to solve

    + +

    +Our compact equations used a definition of a vector \( \boldsymbol{y} \) with \( n \) +elements \( y_i \), an \( n\times p \) matrix \( \boldsymbol{X} \) which contains the +\( x_i \) values and a vector \( \boldsymbol{p} \) of fitted probabilities +\( p(y_i\vert x_i,\boldsymbol{\beta}) \). We rewrote in a more compact form +the first derivative of the cost function as + +$$ +\frac{\partial \mathcal{C}(\boldsymbol{\beta})}{\partial \boldsymbol{\beta}} = -\boldsymbol{X}^T\left(\boldsymbol{y}-\boldsymbol{p}\right). +$$ + +

    +If we in addition define a diagonal matrix \( \boldsymbol{W} \) with elements +\( p(y_i\vert x_i,\boldsymbol{\beta})(1-p(y_i\vert x_i,\boldsymbol{\beta}) \), we can obtain a compact expression of the second derivative as + +$$ +\frac{\partial^2 \mathcal{C}(\boldsymbol{\beta})}{\partial \boldsymbol{\beta}\partial \boldsymbol{\beta}^T} = \boldsymbol{X}^T\boldsymbol{W}\boldsymbol{X}. +$$ + +This defines what is called the Hessian matrix. + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs052.html b/doc/src/week38/._week38-bs052.html new file mode 100644 index 000000000..1bddec882 --- /dev/null +++ b/doc/src/week38/._week38-bs052.html @@ -0,0 +1,495 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Solving using Newton-Raphson's method

    + +

    +If we can set up these equations, Newton-Raphson's iterative method is normally the method of choice. It requires however that we can compute in an efficient way the matrices that define the first and second derivatives. + +

    +Our iterative scheme is then given by + +$$ +\boldsymbol{\beta}^{\mathrm{new}} = \boldsymbol{\beta}^{\mathrm{old}}-\left(\frac{\partial^2 \mathcal{C}(\boldsymbol{\beta})}{\partial \boldsymbol{\beta}\partial \boldsymbol{\beta}^T}\right)^{-1}_{\boldsymbol{\beta}^{\mathrm{old}}}\times \left(\frac{\partial \mathcal{C}(\boldsymbol{\beta})}{\partial \boldsymbol{\beta}}\right)_{\boldsymbol{\beta}^{\mathrm{old}}}, +$$ + +or in matrix form as + +$$ +\boldsymbol{\beta}^{\mathrm{new}} = \boldsymbol{\beta}^{\mathrm{old}}-\left(\boldsymbol{X}^T\boldsymbol{W}\boldsymbol{X} \right)^{-1}\times \left(-\boldsymbol{X}^T(\boldsymbol{y}-\boldsymbol{p}) \right)_{\boldsymbol{\beta}^{\mathrm{old}}}. +$$ + +The right-hand side is computed with the old values of \( \beta \). + +

    +If we can compute these matrices, in particular the Hessian, the above is often the easiest method to implement. + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs053.html b/doc/src/week38/._week38-bs053.html new file mode 100644 index 000000000..d79bdaf12 --- /dev/null +++ b/doc/src/week38/._week38-bs053.html @@ -0,0 +1,486 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Brief reminder on Newton-Raphson's method

    + +

    +Let us quickly remind ourselves how we derive the above method. + +

    +Perhaps the most celebrated of all one-dimensional root-finding +routines is Newton's method, also called the Newton-Raphson +method. This method requires the evaluation of both the +function \( f \) and its derivative \( f' \) at arbitrary points. +If you can only calculate the derivative +numerically and/or your function is not of the smooth type, we +normally discourage the use of this method. + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs054.html b/doc/src/week38/._week38-bs054.html new file mode 100644 index 000000000..a4a7c5cdf --- /dev/null +++ b/doc/src/week38/._week38-bs054.html @@ -0,0 +1,505 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    The equations

    + +

    +The Newton-Raphson formula consists geometrically of extending the +tangent line at a current point until it crosses zero, then setting +the next guess to the abscissa of that zero-crossing. The mathematics +behind this method is rather simple. Employing a Taylor expansion for +\( x \) sufficiently close to the solution \( s \), we have + +$$ + f(s)=0=f(x)+(s-x)f'(x)+\frac{(s-x)^2}{2}f''(x) +\dots. + \tag{14} +$$ + +

    +For small enough values of the function and for well-behaved +functions, the terms beyond linear are unimportant, hence we obtain + +$$ + f(x)+(s-x)f'(x)\approx 0, +$$ + +yielding +$$ + s\approx x-\frac{f(x)}{f'(x)}. +$$ + +

    +Having in mind an iterative procedure, it is natural to start iterating with +$$ + x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)}. +$$ + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs055.html b/doc/src/week38/._week38-bs055.html new file mode 100644 index 000000000..f27c067c2 --- /dev/null +++ b/doc/src/week38/._week38-bs055.html @@ -0,0 +1,487 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Simple geometric interpretation

    + +

    +The above is Newton-Raphson's method. It has a simple geometric +interpretation, namely \( x_{n+1} \) is the point where the tangent from +\( (x_n,f(x_n)) \) crosses the \( x \)-axis. Close to the solution, +Newton-Raphson converges fast to the desired result. However, if we +are far from a root, where the higher-order terms in the series are +important, the Newton-Raphson formula can give grossly inaccurate +results. For instance, the initial guess for the root might be so far +from the true root as to let the search interval include a local +maximum or minimum of the function. If an iteration places a trial +guess near such a local extremum, so that the first derivative nearly +vanishes, then Newton-Raphson may fail totally + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs056.html b/doc/src/week38/._week38-bs056.html new file mode 100644 index 000000000..ab1b7c6cf --- /dev/null +++ b/doc/src/week38/._week38-bs056.html @@ -0,0 +1,524 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Extending to more than one variable

    + +

    +Newton's method can be generalized to systems of several non-linear equations +and variables. Consider the case with two equations +$$ + \begin{array}{cc} f_1(x_1,x_2) &=0\\ + f_2(x_1,x_2) &=0,\end{array} +$$ + +which we Taylor expand to obtain + +$$ + \begin{array}{cc} 0=f_1(x_1+h_1,x_2+h_2)=&f_1(x_1,x_2)+h_1 + \partial f_1/\partial x_1+h_2 + \partial f_1/\partial x_2+\dots\\ + 0=f_2(x_1+h_1,x_2+h_2)=&f_2(x_1,x_2)+h_1 + \partial f_2/\partial x_1+h_2 + \partial f_2/\partial x_2+\dots + \end{array}. +$$ + +Defining the Jacobian matrix \( {\bf \boldsymbol{J}} \) we have +$$ + {\bf \boldsymbol{J}}=\left( \begin{array}{cc} + \partial f_1/\partial x_1 & \partial f_1/\partial x_2 \\ + \partial f_2/\partial x_1 &\partial f_2/\partial x_2 + \end{array} \right), +$$ + +we can rephrase Newton's method as +$$ +\left(\begin{array}{c} x_1^{n+1} \\ x_2^{n+1} \end{array} \right)= +\left(\begin{array}{c} x_1^{n} \\ x_2^{n} \end{array} \right)+ +\left(\begin{array}{c} h_1^{n} \\ h_2^{n} \end{array} \right), +$$ + +where we have defined +$$ + \left(\begin{array}{c} h_1^{n} \\ h_2^{n} \end{array} \right)= + -{\bf \boldsymbol{J}}^{-1} + \left(\begin{array}{c} f_1(x_1^{n},x_2^{n}) \\ f_2(x_1^{n},x_2^{n}) \end{array} \right). +$$ + +We need thus to compute the inverse of the Jacobian matrix and it +is to understand that difficulties may +arise in case \( {\bf \boldsymbol{J}} \) is nearly singular. + +

    +It is rather straightforward to extend the above scheme to systems of +more than two non-linear equations. In our case, the Jacobian matrix is given by the Hessian that represents the second derivative of cost function. + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs057.html b/doc/src/week38/._week38-bs057.html new file mode 100644 index 000000000..64e88be19 --- /dev/null +++ b/doc/src/week38/._week38-bs057.html @@ -0,0 +1,493 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Steepest descent

    + +

    +The basic idea of gradient descent is +that a function \( F(\mathbf{x}) \), +\( \mathbf{x} \equiv (x_1,\cdots,x_n) \), decreases fastest if one goes from \( \bf {x} \) in the +direction of the negative gradient \( -\nabla F(\mathbf{x}) \). + +

    +It can be shown that if +$$ +\mathbf{x}_{k+1} = \mathbf{x}_k - \gamma_k \nabla F(\mathbf{x}_k), +$$ + +with \( \gamma_k > 0 \). + +

    +For \( \gamma_k \) small enough, then \( F(\mathbf{x}_{k+1}) \leq +F(\mathbf{x}_k) \). This means that for a sufficiently small \( \gamma_k \) +we are always moving towards smaller function values, i.e a minimum. + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs058.html b/doc/src/week38/._week38-bs058.html new file mode 100644 index 000000000..337f676e8 --- /dev/null +++ b/doc/src/week38/._week38-bs058.html @@ -0,0 +1,488 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    More on Steepest descent

    + +

    +The previous observation is the basis of the method of steepest +descent, which is also referred to as just gradient descent (GD). One +starts with an initial guess \( \mathbf{x}_0 \) for a minimum of \( F \) and +computes new approximations according to + +$$ +\mathbf{x}_{k+1} = \mathbf{x}_k - \gamma_k \nabla F(\mathbf{x}_k), \ \ k \geq 0. +$$ + +

    +The parameter \( \gamma_k \) is often referred to as the step length or +the learning rate within the context of Machine Learning. + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs059.html b/doc/src/week38/._week38-bs059.html new file mode 100644 index 000000000..557803452 --- /dev/null +++ b/doc/src/week38/._week38-bs059.html @@ -0,0 +1,495 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    The ideal

    + +

    +Ideally the sequence \( \{\mathbf{x}_k \}_{k=0} \) converges to a global +minimum of the function \( F \). In general we do not know if we are in a +global or local minimum. In the special case when \( F \) is a convex +function, all local minima are also global minima, so in this case +gradient descent can converge to the global solution. The advantage of +this scheme is that it is conceptually simple and straightforward to +implement. However the method in this form has some severe +limitations: + +

    +In machine learing we are often faced with non-convex high dimensional +cost functions with many local minima. Since GD is deterministic we +will get stuck in a local minimum, if the method converges, unless we +have a very good intial guess. This also implies that the scheme is +sensitive to the chosen initial condition. + +

    +Note that the gradient is a function of \( \mathbf{x} = +(x_1,\cdots,x_n) \) which makes it expensive to compute numerically. + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs060.html b/doc/src/week38/._week38-bs060.html new file mode 100644 index 000000000..47d7ef48c --- /dev/null +++ b/doc/src/week38/._week38-bs060.html @@ -0,0 +1,488 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    The sensitiveness of the gradient descent

    + +

    +The gradient descent method +is sensitive to the choice of learning rate \( \gamma_k \). This is due +to the fact that we are only guaranteed that \( F(\mathbf{x}_{k+1}) \leq +F(\mathbf{x}_k) \) for sufficiently small \( \gamma_k \). The problem is to +determine an optimal learning rate. If the learning rate is chosen too +small the method will take a long time to converge and if it is too +large we can experience erratic behavior. + +

    +Many of these shortcomings can be alleviated by introducing +randomness. One such method is that of Stochastic Gradient Descent +(SGD), see below. + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs061.html b/doc/src/week38/._week38-bs061.html new file mode 100644 index 000000000..a841cb61f --- /dev/null +++ b/doc/src/week38/._week38-bs061.html @@ -0,0 +1,489 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Convex functions

    + +

    +Ideally we want our cost/loss function to be convex(concave). + +

    +First we give the definition of a convex set: A set \( C \) in +\( \mathbb{R}^n \) is said to be convex if, for all \( x \) and \( y \) in \( C \) and +all \( t \in (0,1) \) , the point \( (1 − t)x + ty \) also belongs to +C. Geometrically this means that every point on the line segment +connecting \( x \) and \( y \) is in \( C \) as discussed below. + +

    +The convex subsets of \( \mathbb{R} \) are the intervals of +\( \mathbb{R} \). Examples of convex sets of \( \mathbb{R}^2 \) are the +regular polygons (triangles, rectangles, pentagons, etc...). + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs062.html b/doc/src/week38/._week38-bs062.html new file mode 100644 index 000000000..d5b05cda6 --- /dev/null +++ b/doc/src/week38/._week38-bs062.html @@ -0,0 +1,477 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Convex function

    + +

    +Convex function: Let \( X \subset \mathbb{R}^n \) be a convex set. Assume that the function \( f: X \rightarrow \mathbb{R} \) is continuous, then \( f \) is said to be convex if $$f(tx_1 + (1-t)x_2) \leq tf(x_1) + (1-t)f(x_2) $$ for all \( x_1, x_2 \in X \) and for all \( t \in [0,1] \). If \( \leq \) is replaced with a strict inequaltiy in the definition, we demand \( x_1 \neq x_2 \) and \( t\in(0,1) \) then \( f \) is said to be strictly convex. For a single variable function, convexity means that if you draw a straight line connecting \( f(x_1) \) and \( f(x_2) \), the value of the function on the interval \( [x_1,x_2] \) is always below the line as illustrated below. + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs063.html b/doc/src/week38/._week38-bs063.html new file mode 100644 index 000000000..6bdfcea11 --- /dev/null +++ b/doc/src/week38/._week38-bs063.html @@ -0,0 +1,513 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Conditions on convex functions

    + +

    +In the following we state first and second-order conditions which +ensures convexity of a function \( f \). We write \( D_f \) to denote the +domain of \( f \), i.e the subset of \( R^n \) where \( f \) is defined. For more +details and proofs we refer to: S. Boyd and L. Vandenberghe. Convex Optimization. Cambridge University Press. + +

    +

    +
    +

    +Suppose \( f \) is differentiable (i.e \( \nabla f(x) \) is well defined for +all \( x \) in the domain of \( f \)). Then \( f \) is convex if and only if \( D_f \) +is a convex set and $$f(y) \geq f(x) + \nabla f(x)^T (y-x) $$ holds +for all \( x,y \in D_f \). This condition means that for a convex function +the first order Taylor expansion (right hand side above) at any point +a global under estimator of the function. To convince yourself you can +make a drawing of \( f(x) = x^2+1 \) and draw the tangent line to \( f(x) \) and +note that it is always below the graph. +

    +
    + + +

    +

    +
    +

    +Assume that \( f \) is twice +differentiable, i.e the Hessian matrix exists at each point in +\( D_f \). Then \( f \) is convex if and only if \( D_f \) is a convex set and its +Hessian is positive semi-definite for all \( x\in D_f \). For a +single-variable function this reduces to \( f''(x) \geq 0 \). Geometrically this means that \( f \) has nonnegative curvature +everywhere. +

    +
    + + +

    +This condition is particularly useful since it gives us an procedure for determining if the function under consideration is convex, apart from using the definition. + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs064.html b/doc/src/week38/._week38-bs064.html new file mode 100644 index 000000000..8dc93609d --- /dev/null +++ b/doc/src/week38/._week38-bs064.html @@ -0,0 +1,500 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    More on convex functions

    + +

    +The next result is of great importance to us and the reason why we are +going on about convex functions. In machine learning we frequently +have to minimize a loss/cost function in order to find the best +parameters for the model we are considering. + +

    +Ideally we want the +global minimum (for high-dimensional models it is hard to know +if we have local or global minimum). However, if the cost/loss function +is convex the following result provides invaluable information: + +

    +

    +
    +

    +Consider the problem of finding \( x \in \mathbb{R}^n \) such that \( f(x) \) +is minimal, where \( f \) is convex and differentiable. Then, any point +\( x^* \) that satisfies \( \nabla f(x^*) = 0 \) is a global minimum. +

    +
    + + +

    +This result means that if we know that the cost/loss function is convex and we are able to find a minimum, we are guaranteed that it is a global minimum. + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs065.html b/doc/src/week38/._week38-bs065.html new file mode 100644 index 000000000..ff58f0f02 --- /dev/null +++ b/doc/src/week38/._week38-bs065.html @@ -0,0 +1,496 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Some simple problems

    + +
      +
    1. Show that \( f(x)=x^2 \) is convex for \( x \in \mathbb{R} \) using the definition of convexity. Hint: If you re-write the definition, \( f \) is convex if the following holds for all \( x,y \in D_f \) and any \( \lambda \in [0,1] \) $\lambda f(x)+(1-\lambda)f(y)-f(\lambda x + (1-\lambda) y ) \geq 0$.
    2. +
    3. Using the second order condition show that the following functions are convex on the specified domain.
    4. + +
        +
      • \( f(x) = e^x \) is convex for \( x \in \mathbb{R} \).
      • +
      • \( g(x) = -\ln(x) \) is convex for \( x \in (0,\infty) \).
      • +
      + +
    5. Let \( f(x) = x^2 \) and \( g(x) = e^x \). Show that \( f(g(x)) \) and \( g(f(x)) \) is convex for \( x \in \mathbb{R} \). Also show that if \( f(x) \) is any convex function than \( h(x) = e^{f(x)} \) is convex.
    6. +
    7. A norm is any function that satisfy the following properties
    8. + +
        +
      • \( f(\alpha x) = |\alpha| f(x) \) for all \( \alpha \in \mathbb{R} \).
      • +
      • \( f(x+y) \leq f(x) + f(y) \)
      • +
      • \( f(x) \leq 0 \) for all \( x \in \mathbb{R}^n \) with equality if and only if \( x = 0 \)
      • +
      + +
    + +Using the definition of convexity, try to show that a function satisfying the properties above is convex (the third condition is not needed to show this). + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs066.html b/doc/src/week38/._week38-bs066.html new file mode 100644 index 000000000..69a90fc65 --- /dev/null +++ b/doc/src/week38/._week38-bs066.html @@ -0,0 +1,477 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Friday September 25

    + +

    +Video of Lecture and link to handwritten notes. + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs067.html b/doc/src/week38/._week38-bs067.html new file mode 100644 index 000000000..fefe789b3 --- /dev/null +++ b/doc/src/week38/._week38-bs067.html @@ -0,0 +1,505 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Standard steepest descent

    + +

    +Before we proceed, we would like to discuss the approach called the +standard Steepest descent (different from the above steepest descent discussion), which again leads to us having to be able +to compute a matrix. It belongs to the class of Conjugate Gradient methods (CG). + +

    +The success of the CG method +for finding solutions of non-linear problems is based on the theory +of conjugate gradients for linear systems of equations. It belongs to +the class of iterative methods for solving problems from linear +algebra of the type +$$ +\begin{equation*} +\boldsymbol{A}\boldsymbol{x} = \boldsymbol{b}. +\end{equation*} +$$ + +

    +In the iterative process we end up with a problem like + +$$ +\begin{equation*} + \boldsymbol{r}= \boldsymbol{b}-\boldsymbol{A}\boldsymbol{x}, +\end{equation*} +$$ + +where \( \boldsymbol{r} \) is the so-called residual or error in the iterative process. + +

    +When we have found the exact solution, \( \boldsymbol{r}=0 \). + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs068.html b/doc/src/week38/._week38-bs068.html new file mode 100644 index 000000000..e01e0b790 --- /dev/null +++ b/doc/src/week38/._week38-bs068.html @@ -0,0 +1,486 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Gradient method

    + +

    +The residual is zero when we reach the minimum of the quadratic equation +$$ +\begin{equation*} + P(\boldsymbol{x})=\frac{1}{2}\boldsymbol{x}^T\boldsymbol{A}\boldsymbol{x} - \boldsymbol{x}^T\boldsymbol{b}, +\end{equation*} +$$ + +

    +with the constraint that the matrix \( \boldsymbol{A} \) is positive definite and +symmetric. This defines also the Hessian and we want it to be positive definite. + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs069.html b/doc/src/week38/._week38-bs069.html new file mode 100644 index 000000000..abafd9f72 --- /dev/null +++ b/doc/src/week38/._week38-bs069.html @@ -0,0 +1,492 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Steepest descent method

    + +

    +We denote the initial guess for \( \boldsymbol{x} \) as \( \boldsymbol{x}_0 \). +We can assume without loss of generality that +$$ +\begin{equation*} +\boldsymbol{x}_0=0, +\end{equation*} +$$ + +or consider the system +$$ +\begin{equation*} +\boldsymbol{A}\boldsymbol{z} = \boldsymbol{b}-\boldsymbol{A}\boldsymbol{x}_0, +\end{equation*} +$$ + +instead. + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs070.html b/doc/src/week38/._week38-bs070.html new file mode 100644 index 000000000..119a171c9 --- /dev/null +++ b/doc/src/week38/._week38-bs070.html @@ -0,0 +1,500 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Steepest descent method

    +
    +
    +

    +One can show that the solution \( \boldsymbol{x} \) is also the unique minimizer of the quadratic form +$$ +\begin{equation*} + f(\boldsymbol{x}) = \frac{1}{2}\boldsymbol{x}^T\boldsymbol{A}\boldsymbol{x} - \boldsymbol{x}^T \boldsymbol{x} , \quad \boldsymbol{x}\in\mathbf{R}^n. +\end{equation*} +$$ + +This suggests taking the first basis vector \( \boldsymbol{r}_1 \) (see below for definition) +to be the gradient of \( f \) at \( \boldsymbol{x}=\boldsymbol{x}_0 \), +which equals +$$ +\begin{equation*} +\boldsymbol{A}\boldsymbol{x}_0-\boldsymbol{b}, +\end{equation*} +$$ + +and +\( \boldsymbol{x}_0=0 \) it is equal \( -\boldsymbol{b} \). + +

    +

    +
    + + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs071.html b/doc/src/week38/._week38-bs071.html new file mode 100644 index 000000000..ed3f90010 --- /dev/null +++ b/doc/src/week38/._week38-bs071.html @@ -0,0 +1,513 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Final expressions

    +
    +
    +

    +We can compute the residual iteratively as +$$ +\begin{equation*} +\boldsymbol{r}_{k+1}=\boldsymbol{b}-\boldsymbol{A}\boldsymbol{x}_{k+1}, + \end{equation*} +$$ + +which equals +$$ +\begin{equation*} +\boldsymbol{b}-\boldsymbol{A}(\boldsymbol{x}_k+\alpha_k\boldsymbol{r}_k), + \end{equation*} +$$ + +or +$$ +\begin{equation*} +(\boldsymbol{b}-\boldsymbol{A}\boldsymbol{x}_k)-\alpha_k\boldsymbol{A}\boldsymbol{r}_k, + \end{equation*} +$$ + +which gives + +$$ +\alpha_k = \frac{\boldsymbol{r}_k^T\boldsymbol{r}_k}{\boldsymbol{r}_k^T\boldsymbol{A}\boldsymbol{r}_k} +$$ + +leading to the iterative scheme +$$ +\begin{equation*} +\boldsymbol{x}_{k+1}=\boldsymbol{x}_k-\alpha_k\boldsymbol{r}_{k}, + \end{equation*} +$$ +

    +
    + + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs072.html b/doc/src/week38/._week38-bs072.html new file mode 100644 index 000000000..82456b210 --- /dev/null +++ b/doc/src/week38/._week38-bs072.html @@ -0,0 +1,538 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Steepest descent example

    + +

    + + +

    import numpy as np
    +import numpy.linalg as la
    +
    +import scipy.optimize as sopt
    +
    +import matplotlib.pyplot as pt
    +from mpl_toolkits.mplot3d import axes3d
    +
    +def f(x):
    +    return 0.5*x[0]**2 + 2.5*x[1]**2
    +
    +def df(x):
    +    return np.array([x[0], 5*x[1]])
    +
    +fig = pt.figure()
    +ax = fig.gca(projection="3d")
    +
    +xmesh, ymesh = np.mgrid[-2:2:50j,-2:2:50j]
    +fmesh = f(np.array([xmesh, ymesh]))
    +ax.plot_surface(xmesh, ymesh, fmesh)
    +
    +

    +And then as countor plot +

    + + +

    pt.axis("equal")
    +pt.contour(xmesh, ymesh, fmesh)
    +guesses = [np.array([2, 2./5])]
    +
    +

    +Find guesses +

    + + +

    x = guesses[-1]
    +s = -df(x)
    +
    +

    +Run it! +

    + + +

    def f1d(alpha):
    +    return f(x + alpha*s)
    +
    +alpha_opt = sopt.golden(f1d)
    +next_guess = x + alpha_opt * s
    +guesses.append(next_guess)
    +print(next_guess)
    +
    +

    +What happened? +

    + + +

    pt.axis("equal")
    +pt.contour(xmesh, ymesh, fmesh, 50)
    +it_array = np.array(guesses)
    +pt.plot(it_array.T[0], it_array.T[1], "x-")
    +
    +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs073.html b/doc/src/week38/._week38-bs073.html new file mode 100644 index 000000000..cf6347c33 --- /dev/null +++ b/doc/src/week38/._week38-bs073.html @@ -0,0 +1,500 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Conjugate gradient method

    +
    +
    +

    +In the CG method we define so-called conjugate directions and two vectors +\( \boldsymbol{s} \) and \( \boldsymbol{t} \) +are said to be +conjugate if +$$ +\begin{equation*} +\boldsymbol{s}^T\boldsymbol{A}\boldsymbol{t}= 0. +\end{equation*} +$$ + +The philosophy of the CG method is to perform searches in various conjugate directions +of our vectors \( \boldsymbol{x}_i \) obeying the above criterion, namely +$$ +\begin{equation*} +\boldsymbol{x}_i^T\boldsymbol{A}\boldsymbol{x}_j= 0. +\end{equation*} +$$ + +Two vectors are conjugate if they are orthogonal with respect to +this inner product. Being conjugate is a symmetric relation: if \( \boldsymbol{s} \) is conjugate to \( \boldsymbol{t} \), then \( \boldsymbol{t} \) is conjugate to \( \boldsymbol{s} \). +

    +
    + + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs074.html b/doc/src/week38/._week38-bs074.html new file mode 100644 index 000000000..7a264147b --- /dev/null +++ b/doc/src/week38/._week38-bs074.html @@ -0,0 +1,488 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Conjugate gradient method

    +
    +
    +

    +An example is given by the eigenvectors of the matrix +$$ +\begin{equation*} +\boldsymbol{v}_i^T\boldsymbol{A}\boldsymbol{v}_j= \lambda\boldsymbol{v}_i^T\boldsymbol{v}_j, +\end{equation*} +$$ + +which is zero unless \( i=j \). +

    +
    + + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs075.html b/doc/src/week38/._week38-bs075.html new file mode 100644 index 000000000..9899df475 --- /dev/null +++ b/doc/src/week38/._week38-bs075.html @@ -0,0 +1,497 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Conjugate gradient method

    +
    +
    +

    +Assume now that we have a symmetric positive-definite matrix \( \boldsymbol{A} \) of size +\( n\times n \). At each iteration \( i+1 \) we obtain the conjugate direction of a vector +$$ +\begin{equation*} +\boldsymbol{x}_{i+1}=\boldsymbol{x}_{i}+\alpha_i\boldsymbol{p}_{i}. +\end{equation*} +$$ + +We assume that \( \boldsymbol{p}_{i} \) is a sequence of \( n \) mutually conjugate directions. +Then the \( \boldsymbol{p}_{i} \) form a basis of \( R^n \) and we can expand the solution +$ \boldsymbol{A}\boldsymbol{x} = \boldsymbol{b}$ in this basis, namely + +$$ +\begin{equation*} + \boldsymbol{x} = \sum^{n}_{i=1} \alpha_i \boldsymbol{p}_i. +\end{equation*} +$$ +

    +
    + + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs076.html b/doc/src/week38/._week38-bs076.html new file mode 100644 index 000000000..5009c8ca4 --- /dev/null +++ b/doc/src/week38/._week38-bs076.html @@ -0,0 +1,502 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Conjugate gradient method

    +
    +
    +

    +The coefficients are given by +$$ +\begin{equation*} + \mathbf{A}\mathbf{x} = \sum^{n}_{i=1} \alpha_i \mathbf{A} \mathbf{p}_i = \mathbf{b}. +\end{equation*} +$$ + +Multiplying with \( \boldsymbol{p}_k^T \) from the left gives + +$$ +\begin{equation*} + \boldsymbol{p}_k^T \boldsymbol{A}\boldsymbol{x} = \sum^{n}_{i=1} \alpha_i\boldsymbol{p}_k^T \boldsymbol{A}\boldsymbol{p}_i= \boldsymbol{p}_k^T \boldsymbol{b}, +\end{equation*} +$$ + +and we can define the coefficients \( \alpha_k \) as + +$$ +\begin{equation*} + \alpha_k = \frac{\boldsymbol{p}_k^T \boldsymbol{b}}{\boldsymbol{p}_k^T \boldsymbol{A} \boldsymbol{p}_k} +\end{equation*} +$$ +

    +
    + + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs077.html b/doc/src/week38/._week38-bs077.html new file mode 100644 index 000000000..45c78930c --- /dev/null +++ b/doc/src/week38/._week38-bs077.html @@ -0,0 +1,506 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Conjugate gradient method and iterations

    +
    +
    +

    + +

    +If we choose the conjugate vectors \( \boldsymbol{p}_k \) carefully, +then we may not need all of them to obtain a good approximation to the solution +\( \boldsymbol{x} \). +We want to regard the conjugate gradient method as an iterative method. +This will us to solve systems where \( n \) is so large that the direct +method would take too much time. + +

    +We denote the initial guess for \( \boldsymbol{x} \) as \( \boldsymbol{x}_0 \). +We can assume without loss of generality that +$$ +\begin{equation*} +\boldsymbol{x}_0=0, +\end{equation*} +$$ + +or consider the system +$$ +\begin{equation*} +\boldsymbol{A}\boldsymbol{z} = \boldsymbol{b}-\boldsymbol{A}\boldsymbol{x}_0, +\end{equation*} +$$ + +instead. +

    +
    + + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs078.html b/doc/src/week38/._week38-bs078.html new file mode 100644 index 000000000..486549454 --- /dev/null +++ b/doc/src/week38/._week38-bs078.html @@ -0,0 +1,500 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Conjugate gradient method

    +
    +
    +

    +One can show that the solution \( \boldsymbol{x} \) is also the unique minimizer of the quadratic form +$$ +\begin{equation*} + f(\boldsymbol{x}) = \frac{1}{2}\boldsymbol{x}^T\boldsymbol{A}\boldsymbol{x} - \boldsymbol{x}^T \boldsymbol{x} , \quad \boldsymbol{x}\in\mathbf{R}^n. +\end{equation*} +$$ + +This suggests taking the first basis vector \( \boldsymbol{p}_1 \) +to be the gradient of \( f \) at \( \boldsymbol{x}=\boldsymbol{x}_0 \), +which equals +$$ +\begin{equation*} +\boldsymbol{A}\boldsymbol{x}_0-\boldsymbol{b}, +\end{equation*} +$$ + +and +\( \boldsymbol{x}_0=0 \) it is equal \( -\boldsymbol{b} \). +The other vectors in the basis will be conjugate to the gradient, +hence the name conjugate gradient method. +

    +
    + + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs079.html b/doc/src/week38/._week38-bs079.html new file mode 100644 index 000000000..6624a70c7 --- /dev/null +++ b/doc/src/week38/._week38-bs079.html @@ -0,0 +1,499 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Conjugate gradient method

    +
    +
    +

    +Let \( \boldsymbol{r}_k \) be the residual at the \( k \)-th step: +$$ +\begin{equation*} +\boldsymbol{r}_k=\boldsymbol{b}-\boldsymbol{A}\boldsymbol{x}_k. +\end{equation*} +$$ + +Note that \( \boldsymbol{r}_k \) is the negative gradient of \( f \) at +\( \boldsymbol{x}=\boldsymbol{x}_k \), +so the gradient descent method would be to move in the direction \( \boldsymbol{r}_k \). +Here, we insist that the directions \( \boldsymbol{p}_k \) are conjugate to each other, +so we take the direction closest to the gradient \( \boldsymbol{r}_k \) +under the conjugacy constraint. +This gives the following expression +$$ +\begin{equation*} +\boldsymbol{p}_{k+1}=\boldsymbol{r}_k-\frac{\boldsymbol{p}_k^T \boldsymbol{A}\boldsymbol{r}_k}{\boldsymbol{p}_k^T\boldsymbol{A}\boldsymbol{p}_k} \boldsymbol{p}_k. +\end{equation*} +$$ +

    +
    + + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs080.html b/doc/src/week38/._week38-bs080.html new file mode 100644 index 000000000..ce62aeb36 --- /dev/null +++ b/doc/src/week38/._week38-bs080.html @@ -0,0 +1,508 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Conjugate gradient method

    +
    +
    +

    +We can also compute the residual iteratively as +$$ +\begin{equation*} +\boldsymbol{r}_{k+1}=\boldsymbol{b}-\boldsymbol{A}\boldsymbol{x}_{k+1}, + \end{equation*} +$$ + +which equals +$$ +\begin{equation*} +\boldsymbol{b}-\boldsymbol{A}(\boldsymbol{x}_k+\alpha_k\boldsymbol{p}_k), + \end{equation*} +$$ + +or +$$ +\begin{equation*} +(\boldsymbol{b}-\boldsymbol{A}\boldsymbol{x}_k)-\alpha_k\boldsymbol{A}\boldsymbol{p}_k, + \end{equation*} +$$ + +which gives + +$$ +\begin{equation*} +\boldsymbol{r}_{k+1}=\boldsymbol{r}_k-\boldsymbol{A}\boldsymbol{p}_{k}, + \end{equation*} +$$ +

    +
    + + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs081.html b/doc/src/week38/._week38-bs081.html new file mode 100644 index 000000000..0588efbef --- /dev/null +++ b/doc/src/week38/._week38-bs081.html @@ -0,0 +1,504 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Revisiting some of our first Linear Regression Encounters

    + +

    +We will use linear regression as a case study for the gradient descent +methods. Linear regression is a great test case for the gradient +descent methods discussed in the lectures since it has several +desirable properties such as: + +

      +
    1. An analytical solution (recall homework set 1).
    2. +
    3. The gradient can be computed analytically.
    4. +
    5. The cost function is convex which guarantees that gradient descent converges for small enough learning rates
    6. +
    + +We revisit an example similar to what we had in the first homework set. We had a function of the type + +

    + + +

    x = 2*np.random.rand(m,1)
    +y = 4+3*x+np.random.randn(m,1)
    +
    +

    +with \( x_i \in [0,1] \) is chosen randomly using a uniform distribution. Additionally we have a stochastic noise chosen according to a normal distribution \( \cal {N}(0,1) \). +The linear regression model is given by +$$ +h_\beta(x) = \boldsymbol{y} = \beta_0 + \beta_1 x, +$$ + +such that +$$ +\boldsymbol{y}_i = \beta_0 + \beta_1 x_i. +$$ + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs082.html b/doc/src/week38/._week38-bs082.html new file mode 100644 index 000000000..c3558d6fb --- /dev/null +++ b/doc/src/week38/._week38-bs082.html @@ -0,0 +1,491 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Gradient descent example

    + +

    +Let \( \mathbf{y} = (y_1,\cdots,y_n)^T \), \( \mathbf{\boldsymbol{y}} = (\boldsymbol{y}_1,\cdots,\boldsymbol{y}_n)^T \) and \( \beta = (\beta_0, \beta_1)^T \) + +

    +It is convenient to write \( \mathbf{\boldsymbol{y}} = X\beta \) where \( X \in \mathbb{R}^{100 \times 2} \) is the design matrix given by (we keep the intercept here) +$$ +X \equiv \begin{bmatrix} +1 & x_1 \\ +\vdots & \vdots \\ +1 & x_{100} & \\ +\end{bmatrix}. +$$ + +The cost/loss/risk function is given by ( +$$ +C(\beta) = \frac{1}{n}||X\beta-\mathbf{y}||_{2}^{2} = \frac{1}{n}\sum_{i=1}^{100}\left[ (\beta_0 + \beta_1 x_i)^2 - 2 y_i (\beta_0 + \beta_1 x_i) + y_i^2\right] +$$ + +and we want to find \( \beta \) such that \( C(\beta) \) is minimized. + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs083.html b/doc/src/week38/._week38-bs083.html new file mode 100644 index 000000000..9642eea66 --- /dev/null +++ b/doc/src/week38/._week38-bs083.html @@ -0,0 +1,480 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    The derivative of the cost/loss function

    + +

    +Computing \( \partial C(\beta) / \partial \beta_0 \) and \( \partial C(\beta) / \partial \beta_1 \) we can show that the gradient can be written as +$$ +\nabla_{\beta} C(\beta) = \frac{2}{n}\begin{bmatrix} \sum_{i=1}^{100} \left(\beta_0+\beta_1x_i-y_i\right) \\ +\sum_{i=1}^{100}\left( x_i (\beta_0+\beta_1x_i)-y_ix_i\right) \\ +\end{bmatrix} = \frac{2}{n}X^T(X\beta - \mathbf{y}), +$$ + +where \( X \) is the design matrix defined above. + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs084.html b/doc/src/week38/._week38-bs084.html new file mode 100644 index 000000000..37d47bae2 --- /dev/null +++ b/doc/src/week38/._week38-bs084.html @@ -0,0 +1,478 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    The Hessian matrix

    +The Hessian matrix of \( C(\beta) \) is given by +$$ +\boldsymbol{H} \equiv \begin{bmatrix} +\frac{\partial^2 C(\beta)}{\partial \beta_0^2} & \frac{\partial^2 C(\beta)}{\partial \beta_0 \partial \beta_1} \\ +\frac{\partial^2 C(\beta)}{\partial \beta_0 \partial \beta_1} & \frac{\partial^2 C(\beta)}{\partial \beta_1^2} & \\ +\end{bmatrix} = \frac{2}{n}X^T X. +$$ + +This result implies that \( C(\beta) \) is a convex function since the matrix \( X^T X \) always is positive semi-definite. + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs085.html b/doc/src/week38/._week38-bs085.html new file mode 100644 index 000000000..b3af57617 --- /dev/null +++ b/doc/src/week38/._week38-bs085.html @@ -0,0 +1,483 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Simple program

    + +

    +We can now write a program that minimizes \( C(\beta) \) using the gradient descent method with a constant learning rate \( \gamma \) according to +$$ +\beta_{k+1} = \beta_k - \gamma \nabla_\beta C(\beta_k), \ k=0,1,\cdots +$$ + +

    +We can use the expression we computed for the gradient and let use a +\( \beta_0 \) be chosen randomly and let \( \gamma = 0.001 \). Stop iterating +when \( ||\nabla_\beta C(\beta_k) || \leq \epsilon = 10^{-8} \). Note that the code below does not include the latter stop criterion. + +

    +And finally we can compare our solution for \( \beta \) with the analytic result given by +\( \beta= (X^TX)^{-1} X^T \mathbf{y} \). + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs086.html b/doc/src/week38/._week38-bs086.html new file mode 100644 index 000000000..defc78c5c --- /dev/null +++ b/doc/src/week38/._week38-bs086.html @@ -0,0 +1,518 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Gradient Descent Example

    + +

    +Here our simple example +

    + + +

    # Importing various packages
    +from random import random, seed
    +import numpy as np
    +import matplotlib.pyplot as plt
    +from mpl_toolkits.mplot3d import Axes3D
    +from matplotlib import cm
    +from matplotlib.ticker import LinearLocator, FormatStrFormatter
    +import sys
    +
    +# the number of datapoints
    +n = 100
    +x = 2*np.random.rand(n,1)
    +y = 4+3*x+np.random.randn(n,1)
    +
    +X = np.c_[np.ones((n,1)), x]
    +# Hessian matrix
    +H = (2.0/n)* X.T @ X
    +# Get the eigenvalues
    +EigValues, EigVectors = np.linalg.eig(H)
    +print(EigValues)
    +
    +beta_linreg = np.linalg.inv(X.T @ X) @ X.T @ y
    +print(beta_linreg)
    +beta = np.random.randn(2,1)
    +
    +eta = 1.0/np.max(EigValues)
    +Niterations = 1000
    +
    +for iter in range(Niterations):
    +    gradient = (2.0/n)*X.T @ (X @ beta-y)
    +    beta -= eta*gradient
    +
    +print(beta)
    +xnew = np.array([[0],[2]])
    +xbnew = np.c_[np.ones((2,1)), xnew]
    +ypredict = xbnew.dot(beta)
    +ypredict2 = xbnew.dot(beta_linreg)
    +plt.plot(xnew, ypredict, "r-")
    +plt.plot(xnew, ypredict2, "b-")
    +plt.plot(x, y ,'ro')
    +plt.axis([0,2.0,0, 15.0])
    +plt.xlabel(r'$x$')
    +plt.ylabel(r'$y$')
    +plt.title(r'Gradient descent example')
    +plt.show()
    +
    +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs087.html b/doc/src/week38/._week38-bs087.html new file mode 100644 index 000000000..84e8fcde1 --- /dev/null +++ b/doc/src/week38/._week38-bs087.html @@ -0,0 +1,486 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    And a corresponding example using scikit-learn

    + +

    + + +

    # Importing various packages
    +from random import random, seed
    +import numpy as np
    +import matplotlib.pyplot as plt
    +from sklearn.linear_model import SGDRegressor
    +
    +n = 100
    +x = 2*np.random.rand(n,1)
    +y = 4+3*x+np.random.randn(n,1)
    +
    +X = np.c_[np.ones((n,1)), x]
    +beta_linreg = np.linalg.inv(X.T @ X) @ (X.T @ y)
    +print(beta_linreg)
    +sgdreg = SGDRegressor(max_iter = 50, penalty=None, eta0=0.1)
    +sgdreg.fit(x,y.ravel())
    +print(sgdreg.intercept_, sgdreg.coef_)
    +
    +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs088.html b/doc/src/week38/._week38-bs088.html new file mode 100644 index 000000000..fa932c7d8 --- /dev/null +++ b/doc/src/week38/._week38-bs088.html @@ -0,0 +1,485 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Gradient descent and Ridge

    + +

    +We have also discussed Ridge regression where the loss function contains a regularized term given by the \( L_2 \) norm of \( \beta \), +$$ +C_{\text{ridge}}(\beta) = \frac{1}{n}||X\beta -\mathbf{y}||^2 + \lambda ||\beta||^2, \ \lambda \geq 0. +$$ + +

    +In order to minimize \( C_{\text{ridge}}(\beta) \) using GD we only have adjust the gradient as follows +$$ +\nabla_\beta C_{\text{ridge}}(\beta) = \frac{2}{n}\begin{bmatrix} \sum_{i=1}^{100} \left(\beta_0+\beta_1x_i-y_i\right) \\ +\sum_{i=1}^{100}\left( x_i (\beta_0+\beta_1x_i)-y_ix_i\right) \\ +\end{bmatrix} + 2\lambda\begin{bmatrix} \beta_0 \\ \beta_1\end{bmatrix} = 2 (X^T(X\beta - \mathbf{y})+\lambda \beta). +$$ + +

    +We can easily extend our program to minimize \( C_{\text{ridge}}(\beta) \) using gradient descent and compare with the analytical solution given by +$$ +\beta_{\text{ridge}} = \left(X^T X + \lambda I_{2 \times 2} \right)^{-1} X^T \mathbf{y}. +$$ + +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs089.html b/doc/src/week38/._week38-bs089.html new file mode 100644 index 000000000..e1d0be7a0 --- /dev/null +++ b/doc/src/week38/._week38-bs089.html @@ -0,0 +1,510 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Program example for gradient descent with Ridge Regression

    +

    + + +

    from random import random, seed
    +import numpy as np
    +import matplotlib.pyplot as plt
    +from mpl_toolkits.mplot3d import Axes3D
    +from matplotlib import cm
    +from matplotlib.ticker import LinearLocator, FormatStrFormatter
    +import sys
    +
    +# the number of datapoints
    +n = 100
    +x = 2*np.random.rand(n,1)
    +y = 4+3*x+np.random.randn(n,1)
    +
    +X = np.c_[np.ones((n,1)), x]
    +XT_X = X.T @ X
    +
    +#Ridge parameter lambda
    +lmbda  = 0.001
    +Id = lmbda* np.eye(XT_X.shape[0])
    +
    +beta_linreg = np.linalg.inv(XT_X+Id) @ X.T @ y
    +print(beta_linreg)
    +# Start plain gradient descent
    +beta = np.random.randn(2,1)
    +
    +eta = 0.1
    +Niterations = 100
    +
    +for iter in range(Niterations):
    +    gradients = 2.0/n*X.T @ (X @ (beta)-y)+2*lmbda*beta
    +    beta -= eta*gradients
    +
    +print(beta)
    +ypredict = X @ beta
    +ypredict2 = X @ beta_linreg
    +plt.plot(x, ypredict, "r-")
    +plt.plot(x, ypredict2, "b-")
    +plt.plot(x, y ,'ro')
    +plt.axis([0,2.0,0, 15.0])
    +plt.xlabel(r'$x$')
    +plt.ylabel(r'$y$')
    +plt.title(r'Gradient descent example for Ridge')
    +plt.show()
    +
    +

    +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/._week38-bs090.html b/doc/src/week38/._week38-bs090.html new file mode 100644 index 000000000..92c7f49f1 --- /dev/null +++ b/doc/src/week38/._week38-bs090.html @@ -0,0 +1,471 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

     

     

     

    + + + + +

    Using gradient descent methods, limitations

    + +
      +
    • Gradient descent (GD) finds local minima of our function. Since the GD algorithm is deterministic, if it converges, it will converge to a local minimum of our cost/loss/risk function. Because in ML we are often dealing with extremely rugged landscapes with many local minima, this can lead to poor performance.
    • +
    • GD is sensitive to initial conditions. One consequence of the local nature of GD is that initial conditions matter. Depending on where one starts, one will end up at a different local minima. Therefore, it is very important to think about how one initializes the training process. This is true for GD as well as more complicated variants of GD.
    • +
    • Gradients are computationally expensive to calculate for large datasets. In many cases in statistics and ML, the cost/loss/risk function is a sum of terms, with one term for each data point. For example, in linear regression, \( E \propto \sum_{i=1}^n (y_i - \mathbf{w}^T\cdot\mathbf{x}_i)^2 \); for logistic regression, the square error is replaced by the cross entropy. To calculate the gradient we have to sum over all \( n \) data points. Doing this at every GD step becomes extremely computationally expensive. An ingenious solution to this, is to calculate the gradients using small subsets of the data called "mini batches". This has the added benefit of introducing stochasticity into our algorithm.
    • +
    • GD is very sensitive to choices of learning rates. GD is extremely sensitive to the choice of learning rates. If the learning rate is very small, the training process take an extremely long time. For larger learning rates, GD can diverge and give poor results. Furthermore, depending on what the local landscape looks like, we have to modify the learning rates to ensure convergence. Ideally, we would adaptively choose the learning rates to match the landscape.
    • +
    • GD treats all directions in parameter space uniformly. Another major drawback of GD is that unlike Newton's method, the learning rate for GD is the same in all directions in parameter space. For this reason, the maximum learning rate is set by the behavior of the steepest direction and this can significantly slow down training. Ideally, we would like to take large steps in flat directions and small steps in steep directions. Since we are exploring rugged landscapes where curvatures change, this requires us to keep track of not only the gradient but second derivatives. The ideal scenario would be to calculate the Hessian but this proves to be too computationally expensive.
    • +
    • GD can take exponential time to escape saddle points, even with random initialization. As we mentioned, GD is extremely sensitive to initial condition since it determines the particular local minimum GD would eventually reach. However, even with a good initialization scheme, through the introduction of randomness, GD can still take exponential time to escape saddle points. This leads us to our next topic, Stochastic Gradient Methods.
    • +
    + + +

    + +

    + + +
    + + + + + + + +
    + +
    + + + + + + diff --git a/doc/src/week38/README.txt b/doc/src/week38/README.txt new file mode 100644 index 000000000..589bb9764 --- /dev/null +++ b/doc/src/week38/README.txt @@ -0,0 +1,2 @@ +This IPython notebook week38.ipynb does not require any additional +programs. diff --git a/doc/src/week38/ipynb-week38-src.tar.gz b/doc/src/week38/ipynb-week38-src.tar.gz new file mode 100644 index 000000000..4a81a6d5e Binary files /dev/null and b/doc/src/week38/ipynb-week38-src.tar.gz differ diff --git a/doc/src/week38/reveal.js/.gitignore b/doc/src/week38/reveal.js/.gitignore new file mode 100644 index 000000000..a5df3133d --- /dev/null +++ b/doc/src/week38/reveal.js/.gitignore @@ -0,0 +1,8 @@ +.DS_Store +.svn +log/*.log +tmp/** +node_modules/ +.sass-cache +css/reveal.min.css +js/reveal.min.js diff --git a/doc/src/week38/reveal.js/.travis.yml b/doc/src/week38/reveal.js/.travis.yml new file mode 100644 index 000000000..165d9ae9f --- /dev/null +++ b/doc/src/week38/reveal.js/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - 0.10 +before_script: + - npm install -g grunt-cli \ No newline at end of file diff --git a/doc/src/week38/reveal.js/CONTRIBUTING.md b/doc/src/week38/reveal.js/CONTRIBUTING.md new file mode 100644 index 000000000..c2091e88f --- /dev/null +++ b/doc/src/week38/reveal.js/CONTRIBUTING.md @@ -0,0 +1,23 @@ +## Contributing + +Please keep the [issue tracker](http://github.com/hakimel/reveal.js/issues) limited to **bug reports**, **feature requests** and **pull requests**. + + +### Personal Support +If you have personal support or setup questions the best place to ask those are [StackOverflow](http://stackoverflow.com/questions/tagged/reveal.js). + + +### Bug Reports +When reporting a bug make sure to include information about which browser and operating system you are on as well as the necessary steps to reproduce the issue. If possible please include a link to a sample presentation where the bug can be tested. + + +### Pull Requests +- Should follow the coding style of the file you work in, most importantly: + - Tabs to indent + - Single-quoted strings +- Should be made towards the **dev branch** +- Should be submitted from a feature/topic branch (not your master) + + +### Plugins +Please do not submit plugins as pull requests. They should be maintained in their own separate repository. More information here: https://github.com/hakimel/reveal.js/wiki/Plugin-Guidelines diff --git a/doc/src/week38/reveal.js/Gruntfile.js b/doc/src/week38/reveal.js/Gruntfile.js new file mode 100644 index 000000000..b257e8f32 --- /dev/null +++ b/doc/src/week38/reveal.js/Gruntfile.js @@ -0,0 +1,140 @@ +/* global module:false */ +module.exports = function(grunt) { + var port = grunt.option('port') || 8000; + // Project configuration + grunt.initConfig({ + pkg: grunt.file.readJSON('package.json'), + meta: { + banner: + '/*!\n' + + ' * reveal.js <%= pkg.version %> (<%= grunt.template.today("yyyy-mm-dd, HH:MM") %>)\n' + + ' * http://lab.hakim.se/reveal-js\n' + + ' * MIT licensed\n' + + ' *\n' + + ' * Copyright (C) 2014 Hakim El Hattab, http://hakim.se\n' + + ' */' + }, + + qunit: { + files: [ 'test/*.html' ] + }, + + uglify: { + options: { + banner: '<%= meta.banner %>\n' + }, + build: { + src: 'js/reveal.js', + dest: 'js/reveal.min.js' + } + }, + + cssmin: { + compress: { + files: { + 'css/reveal.min.css': [ 'css/reveal.css' ] + } + } + }, + + sass: { + main: { + files: { + 'css/theme/darkgray.css': 'css/theme/source/darkgray.scss', + 'css/theme/beigesmall.css': 'css/theme/source/beigesmall.scss', + 'css/theme/cbc.css': 'css/theme/source/cbc.scss', + 'css/theme/default.css': 'css/theme/source/default.scss', + 'css/theme/beige.css': 'css/theme/source/beige.scss', + 'css/theme/night.css': 'css/theme/source/night.scss', + 'css/theme/serif.css': 'css/theme/source/serif.scss', + 'css/theme/simple.css': 'css/theme/source/simple.scss', + 'css/theme/sky.css': 'css/theme/source/sky.scss', + 'css/theme/moon.css': 'css/theme/source/moon.scss', + 'css/theme/solarized.css': 'css/theme/source/solarized.scss', + 'css/theme/blood.css': 'css/theme/source/blood.scss' + } + } + }, + + jshint: { + options: { + curly: false, + eqeqeq: true, + immed: true, + latedef: true, + newcap: true, + noarg: true, + sub: true, + undef: true, + eqnull: true, + browser: true, + expr: true, + globals: { + head: false, + module: false, + console: false, + unescape: false + } + }, + files: [ 'Gruntfile.js', 'js/reveal.js' ] + }, + + connect: { + server: { + options: { + port: port, + base: '.' + } + } + }, + + zip: { + 'reveal-js-presentation.zip': [ + 'index.html', + 'css/**', + 'js/**', + 'lib/**', + 'images/**', + 'plugin/**' + ] + }, + + watch: { + main: { + files: [ 'Gruntfile.js', 'js/reveal.js', 'css/reveal.css' ], + tasks: 'default' + }, + theme: { + files: [ 'css/theme/source/*.scss', 'css/theme/template/*.scss' ], + tasks: 'themes' + } + } + + }); + + // Dependencies + grunt.loadNpmTasks( 'grunt-contrib-qunit' ); + grunt.loadNpmTasks( 'grunt-contrib-jshint' ); + grunt.loadNpmTasks( 'grunt-contrib-cssmin' ); + grunt.loadNpmTasks( 'grunt-contrib-uglify' ); + grunt.loadNpmTasks( 'grunt-contrib-watch' ); + grunt.loadNpmTasks( 'grunt-contrib-sass' ); + grunt.loadNpmTasks( 'grunt-contrib-connect' ); + grunt.loadNpmTasks( 'grunt-zip' ); + + // Default task + grunt.registerTask( 'default', [ 'jshint', 'cssmin', 'uglify', 'qunit' ] ); + + // Theme task + grunt.registerTask( 'themes', [ 'sass' ] ); + + // Package presentation to archive + grunt.registerTask( 'package', [ 'default', 'zip' ] ); + + // Serve presentation locally + grunt.registerTask( 'serve', [ 'connect', 'watch' ] ); + + // Run tests + grunt.registerTask( 'test', [ 'jshint', 'qunit' ] ); + +}; diff --git a/doc/src/week38/reveal.js/LICENSE b/doc/src/week38/reveal.js/LICENSE new file mode 100644 index 000000000..09623076f --- /dev/null +++ b/doc/src/week38/reveal.js/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2015 Hakim El Hattab, http://hakim.se + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/doc/src/week38/reveal.js/README.md b/doc/src/week38/reveal.js/README.md new file mode 100644 index 000000000..573b19597 --- /dev/null +++ b/doc/src/week38/reveal.js/README.md @@ -0,0 +1,1052 @@ +# reveal.js [![Build Status](https://travis-ci.org/hakimel/reveal.js.svg?branch=master)](https://travis-ci.org/hakimel/reveal.js) + +A framework for easily creating beautiful presentations using HTML. [Check out the live demo](http://lab.hakim.se/reveal-js/). + +reveal.js comes with a broad range of features including [nested slides](https://github.com/hakimel/reveal.js#markup), [Markdown contents](https://github.com/hakimel/reveal.js#markdown), [PDF export](https://github.com/hakimel/reveal.js#pdf-export), [speaker notes](https://github.com/hakimel/reveal.js#speaker-notes) and a [JavaScript API](https://github.com/hakimel/reveal.js#api). It's best viewed in a modern browser but [fallbacks](https://github.com/hakimel/reveal.js/wiki/Browser-Support) are available to make sure your presentation can still be viewed elsewhere. + + +#### More reading: +- [Installation](#installation): Step-by-step instructions for getting reveal.js running on your computer. +- [Changelog](https://github.com/hakimel/reveal.js/releases): Up-to-date version history. +- [Examples](https://github.com/hakimel/reveal.js/wiki/Example-Presentations): Presentations created with reveal.js, add your own! +- [Browser Support](https://github.com/hakimel/reveal.js/wiki/Browser-Support): Explanation of browser support and fallbacks. +- [Plugins](https://github.com/hakimel/reveal.js/wiki/Plugins,-Tools-and-Hardware): A list of plugins that can be used to extend reveal.js. + +## Online Editor + +Presentations are written using HTML or Markdown but there's also an online editor for those of you who prefer a graphical interface. Give it a try at [http://slides.com](http://slides.com). + + +## Instructions + +### Markup + +Markup hierarchy needs to be ``
    `` where the ``
    `` represents one slide and can be repeated indefinitely. If you place multiple ``
    ``'s inside of another ``
    `` they will be shown as vertical slides. The first of the vertical slides is the "root" of the others (at the top), and it will be included in the horizontal sequence. For example: + +```html +
    +
    +
    Single Horizontal Slide
    +
    +
    Vertical Slide 1
    +
    Vertical Slide 2
    +
    +
    +
    +``` + +### Markdown + +It's possible to write your slides using Markdown. To enable Markdown, add the ```data-markdown``` attribute to your ```
    ``` elements and wrap the contents in a ``` +
    +``` + +#### External Markdown + +You can write your content as a separate file and have reveal.js load it at runtime. Note the separator arguments which determine how slides are delimited in the external file. The ```data-charset``` attribute is optional and specifies which charset to use when loading the external file. + +When used locally, this feature requires that reveal.js [runs from a local web server](#full-setup). + +```html +
    +
    +``` + +#### Element Attributes + +Special syntax (in html comment) is available for adding attributes to Markdown elements. This is useful for fragments, amongst other things. + +```html +
    + +
    +``` + +#### Slide Attributes + +Special syntax (in html comment) is available for adding attributes to the slide `
    ` elements generated by your Markdown. + +```html +
    + +
    +``` + + +### Configuration + +At the end of your page you need to initialize reveal by running the following code. Note that all config values are optional and will default as specified below. + +```javascript +Reveal.initialize({ + + // Display controls in the bottom right corner + controls: true, + + // Display a presentation progress bar + progress: true, + + // Display the page number of the current slide + slideNumber: false, + + // Push each slide change to the browser history + history: false, + + // Enable keyboard shortcuts for navigation + keyboard: true, + + // Enable the slide overview mode + overview: true, + + // Vertical centering of slides + center: true, + + // Enables touch navigation on devices with touch input + touch: true, + + // Loop the presentation + loop: false, + + // Change the presentation direction to be RTL + rtl: false, + + // Turns fragments on and off globally + fragments: true, + + // Flags if the presentation is running in an embedded mode, + // i.e. contained within a limited portion of the screen + embedded: false, + + // Flags if we should show a help overlay when the questionmark + // key is pressed + help: true, + + // Number of milliseconds between automatically proceeding to the + // next slide, disabled when set to 0, this value can be overwritten + // by using a data-autoslide attribute on your slides + autoSlide: 0, + + // Stop auto-sliding after user input + autoSlideStoppable: true, + + // Enable slide navigation via mouse wheel + mouseWheel: false, + + // Hides the address bar on mobile devices + hideAddressBar: true, + + // Opens links in an iframe preview overlay + previewLinks: false, + + // Transition style + transition: 'default', // none/fade/slide/convex/concave/zoom + + // Transition speed + transitionSpeed: 'default', // default/fast/slow + + // Transition style for full page slide backgrounds + backgroundTransition: 'default', // none/fade/slide/convex/concave/zoom + + // Number of slides away from the current that are visible + viewDistance: 3, + + // Parallax background image + parallaxBackgroundImage: '', // e.g. "'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg'" + + // Parallax background size + parallaxBackgroundSize: '', // CSS syntax, e.g. "2100px 900px" + + // Amount to move parallax background (horizontal and vertical) on slide change + // Number, e.g. 100 + parallaxBackgroundHorizontal: '', + parallaxBackgroundVertical: '' + +}); +``` + + +The configuration can be updated after initialization using the ```configure``` method: + +```javascript +// Turn autoSlide off +Reveal.configure({ autoSlide: 0 }); + +// Start auto-sliding every 5s +Reveal.configure({ autoSlide: 5000 }); +``` + + +### Dependencies + +Reveal.js doesn't _rely_ on any third party scripts to work but a few optional libraries are included by default. These libraries are loaded as dependencies in the order they appear, for example: + +```javascript +Reveal.initialize({ + dependencies: [ + // Cross-browser shim that fully implements classList - https://github.com/eligrey/classList.js/ + { src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } }, + + // Interpret Markdown in
    elements + { src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } }, + { src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } }, + + // Syntax highlight for elements + { src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }, + + // Zoom in and out with Alt+click + { src: 'plugin/zoom-js/zoom.js', async: true }, + + // Speaker notes + { src: 'plugin/notes/notes.js', async: true }, + + // Remote control your reveal.js presentation using a touch device + { src: 'plugin/remotes/remotes.js', async: true }, + + // MathJax + { src: 'plugin/math/math.js', async: true } + ] +}); +``` + +You can add your own extensions using the same syntax. The following properties are available for each dependency object: +- **src**: Path to the script to load +- **async**: [optional] Flags if the script should load after reveal.js has started, defaults to false +- **callback**: [optional] Function to execute when the script has loaded +- **condition**: [optional] Function which must return true for the script to be loaded + + +### Ready Event + +A 'ready' event is fired when reveal.js has loaded all non-async dependencies and is ready to start navigating. To check if reveal.js is already 'ready' you can call `Reveal.isReady()`. + +```javascript +Reveal.addEventListener( 'ready', function( event ) { + // event.currentSlide, event.indexh, event.indexv +} ); +``` + + +### Presentation Size + +All presentations have a normal size, that is the resolution at which they are authored. The framework will automatically scale presentations uniformly based on this size to ensure that everything fits on any given display or viewport. + +See below for a list of configuration options related to sizing, including default values: + +```javascript +Reveal.initialize({ + + ... + + // The "normal" size of the presentation, aspect ratio will be preserved + // when the presentation is scaled to fit different resolutions. Can be + // specified using percentage units. + width: 960, + height: 700, + + // Factor of the display size that should remain empty around the content + margin: 0.1, + + // Bounds for smallest/largest possible scale to apply to content + minScale: 0.2, + maxScale: 1.5 + +}); +``` + + +### Auto-sliding + +Presentations can be configured to progress through slides automatically, without any user input. To enable this you will need to tell the framework how many milliseconds it should wait between slides: + +```javascript +// Slide every five seconds +Reveal.configure({ + autoSlide: 5000 +}); +``` +When this is turned on a control element will appear that enables users to pause and resume auto-sliding. Alternatively, sliding can be paused or resumed by pressing »a« on the keyboard. Sliding is paused automatically as soon as the user starts navigating. You can disable these controls by specifying ```autoSlideStoppable: false``` in your reveal.js config. + +You can also override the slide duration for individual slides and fragments by using the ```data-autoslide``` attribute: + +```html +
    +

    After 2 seconds the first fragment will be shown.

    +

    After 10 seconds the next fragment will be shown.

    +

    Now, the fragment is displayed for 2 seconds before the next slide is shown.

    +
    +``` + +Whenever the auto-slide mode is resumed or paused the ```autoslideresumed``` and ```autoslidepaused``` events are fired. + + +### Keyboard Bindings + +If you're unhappy with any of the default keyboard bindings you can override them using the ```keyboard``` config option: + +```javascript +Reveal.configure({ + keyboard: { + 13: 'next', // go to the next slide when the ENTER key is pressed + 27: function() {}, // do something custom when ESC is pressed + 32: null // don't do anything when SPACE is pressed (i.e. disable a reveal.js default binding) + } +}); +``` + +### Lazy Loading + +When working on presentation with a lot of media or iframe content it's important to load lazily. Lazy loading means that reveal.js will only load content for the few slides nearest to the current slide. The number of slides that are preloaded is determined by the `viewDistance` configuration option. + +To enable lazy loading all you need to do is change your "src" attributes to "data-src" as shown below. This is supported for image, video, audio and iframe elements. Lazy loaded iframes will also unload when the containing slide is no longer visible. + +```html +
    + + + +
    +``` + + +### API + +The ``Reveal`` object exposes a JavaScript API for controlling navigation and reading state: + +```javascript +// Navigation +Reveal.slide( indexh, indexv, indexf ); +Reveal.left(); +Reveal.right(); +Reveal.up(); +Reveal.down(); +Reveal.prev(); +Reveal.next(); +Reveal.prevFragment(); +Reveal.nextFragment(); + +// Toggle presentation states, optionally pass true/false to force on/off +Reveal.toggleOverview(); +Reveal.togglePause(); +Reveal.toggleAutoSlide(); + +// Change a config value at runtime +Reveal.configure({ controls: true }); + +// Returns the present configuration options +Reveal.getConfig(); + +// Fetch the current scale of the presentation +Reveal.getScale(); + +// Retrieves the previous and current slide elements +Reveal.getPreviousSlide(); +Reveal.getCurrentSlide(); + +Reveal.getIndices(); // { h: 0, v: 0 } } +Reveal.getProgress(); // 0-1 +Reveal.getTotalSlides(); + +// State checks +Reveal.isFirstSlide(); +Reveal.isLastSlide(); +Reveal.isOverview(); +Reveal.isPaused(); +Reveal.isAutoSliding(); +``` + +### Slide Changed Event + +A 'slidechanged' event is fired each time the slide is changed (regardless of state). The event object holds the index values of the current slide as well as a reference to the previous and current slide HTML nodes. + +Some libraries, like MathJax (see [#226](https://github.com/hakimel/reveal.js/issues/226#issuecomment-10261609)), get confused by the transforms and display states of slides. Often times, this can be fixed by calling their update or render function from this callback. + +```javascript +Reveal.addEventListener( 'slidechanged', function( event ) { + // event.previousSlide, event.currentSlide, event.indexh, event.indexv +} ); +``` + +### Presentation State + +The presentation's current state can be fetched by using the `getState` method. A state object contains all of the information required to put the presentation back as it was when `getState` was first called. Sort of like a snapshot. It's a simple object that can easily be stringified and persisted or sent over the wire. + +```javascript +Reveal.slide( 1 ); +// we're on slide 1 + +var state = Reveal.getState(); + +Reveal.slide( 3 ); +// we're on slide 3 + +Reveal.setState( state ); +// we're back on slide 1 +``` + +### Slide States + +If you set ``data-state="somestate"`` on a slide ``
    ``, "somestate" will be applied as a class on the document element when that slide is opened. This allows you to apply broad style changes to the page based on the active slide. + +Furthermore you can also listen to these changes in state via JavaScript: + +```javascript +Reveal.addEventListener( 'somestate', function() { + // TODO: Sprinkle magic +}, false ); +``` + +### Slide Backgrounds + +Slides are contained within a limited portion of the screen by default to allow them to fit any display and scale uniformly. You can apply full page backgrounds outside of the slide area by adding a ```data-background``` attribute to your ```
    ``` elements. Four different types of backgrounds are supported: color, image, video and iframe. Below are a few examples. + +```html +
    +

    All CSS color formats are supported, like rgba() or hsl().

    +
    +
    +

    This slide will have a full-size background image.

    +
    +
    +

    This background image will be sized to 100px and repeated.

    +
    +
    +

    Video. Multiple sources can be defined using a comma separated list. Video will loop when the data-background-video-loop attribute is provided.

    +
    +
    +

    Embeds a web page as a background. Note that the page won't be interactive.

    +
    +``` + +Backgrounds transition using a fade animation by default. This can be changed to a linear sliding transition by passing ```backgroundTransition: 'slide'``` to the ```Reveal.initialize()``` call. Alternatively you can set ```data-background-transition``` on any section with a background to override that specific transition. + + +### Parallax Background + +If you want to use a parallax scrolling background, set the first two config properties below when initializing reveal.js (the other two are optional). + +```javascript +Reveal.initialize({ + + // Parallax background image + parallaxBackgroundImage: '', // e.g. "https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg" + + // Parallax background size + parallaxBackgroundSize: '', // CSS syntax, e.g. "2100px 900px" - currently only pixels are supported (don't use % or auto) + + // Amount of pixels to move the parallax background per slide step, + // a value of 0 disables movement along the given axis + // These are optional, if they aren't specified they'll be calculated automatically + parallaxBackgroundHorizontal: 200, + parallaxBackgroundVertical: 50 + +}); +``` + +Make sure that the background size is much bigger than screen size to allow for some scrolling. [View example](http://lab.hakim.se/reveal-js/?parallaxBackgroundImage=https%3A%2F%2Fs3.amazonaws.com%2Fhakim-static%2Freveal-js%2Freveal-parallax-1.jpg¶llaxBackgroundSize=2100px%20900px). + + + +### Slide Transitions +The global presentation transition is set using the ```transition``` config value. You can override the global transition for a specific slide by using the ```data-transition``` attribute: + +```html +
    +

    This slide will override the presentation transition and zoom!

    +
    + +
    +

    Choose from three transition speeds: default, fast or slow!

    +
    +``` + +You can also use different in and out transitions for the same slide: + +```html +
    + The train goes on … +
    +
    + and on … +
    +
    + and stops. +
    +
    + (Passengers entering and leaving) +
    +
    + And it starts again. +
    +``` + + +Note that this does not work with the page and cube transitions. + + +### Internal links + +It's easy to link between slides. The first example below targets the index of another slide whereas the second targets a slide with an ID attribute (```
    ```): + +```html +Link +Link +``` + +You can also add relative navigation links, similar to the built in reveal.js controls, by appending one of the following classes on any element. Note that each element is automatically given an ```enabled``` class when it's a valid navigation route based on the current slide. + +```html + + + + + + +``` + + +### Fragments +Fragments are used to highlight individual elements on a slide. Every element with the class ```fragment``` will be stepped through before moving on to the next slide. Here's an example: http://lab.hakim.se/reveal-js/#/fragments + +The default fragment style is to start out invisible and fade in. This style can be changed by appending a different class to the fragment: + +```html +
    +

    grow

    +

    shrink

    +

    fade-out

    +

    visible only once

    +

    blue only once

    +

    highlight-red

    +

    highlight-green

    +

    highlight-blue

    +
    +``` + +Multiple fragments can be applied to the same element sequentially by wrapping it, this will fade in the text on the first step and fade it back out on the second. + +```html +
    + + I'll fade in, then out + +
    +``` + +The display order of fragments can be controlled using the ```data-fragment-index``` attribute. + +```html +
    +

    Appears last

    +

    Appears first

    +

    Appears second

    +
    +``` + +### Fragment events + +When a slide fragment is either shown or hidden reveal.js will dispatch an event. + +Some libraries, like MathJax (see #505), get confused by the initially hidden fragment elements. Often times this can be fixed by calling their update or render function from this callback. + +```javascript +Reveal.addEventListener( 'fragmentshown', function( event ) { + // event.fragment = the fragment DOM element +} ); +Reveal.addEventListener( 'fragmenthidden', function( event ) { + // event.fragment = the fragment DOM element +} ); +``` + +### Code syntax highlighting + +By default, Reveal is configured with [highlight.js](http://softwaremaniacs.org/soft/highlight/en/) for code syntax highlighting. Below is an example with clojure code that will be syntax highlighted. When the `data-trim` attribute is present surrounding whitespace is automatically removed. + +```html +
    +
    
    +(def lazy-fib
    +  (concat
    +   [0 1]
    +   ((fn rfib [a b]
    +        (lazy-cons (+ a b) (rfib b (+ a b)))) 0 1)))
    +	
    +
    +``` + +### Slide number +If you would like to display the page number of the current slide you can do so using the ```slideNumber``` configuration value. + +```javascript +// Shows the slide number using default formatting +Reveal.configure({ slideNumber: true }); + +// Slide number formatting can be configured using these variables: +// h: current slide's horizontal index +// v: current slide's vertical index +// c: current slide index (flattened) +// t: total number of slides (flattened) +Reveal.configure({ slideNumber: 'c / t' }); + +``` + + +### Overview mode + +Press "Esc" or "o" keys to toggle the overview mode on and off. While you're in this mode, you can still navigate between slides, +as if you were at 1,000 feet above your presentation. The overview mode comes with a few API hooks: + +```javascript +Reveal.addEventListener( 'overviewshown', function( event ) { /* ... */ } ); +Reveal.addEventListener( 'overviewhidden', function( event ) { /* ... */ } ); + +// Toggle the overview mode programmatically +Reveal.toggleOverview(); +``` + +### Fullscreen mode +Just press »F« on your keyboard to show your presentation in fullscreen mode. Press the »ESC« key to exit fullscreen mode. + + +### Embedded media +Embedded HTML5 `
    + +
    + +

     

     

     

    + + + + + + +
    +

    Data Analysis and Machine Learning: Logistic Regression

    + +

    + + +

    +Morten Hjorth-Jensen [1, 2] +
    + +

    + + +

    [1] Department of Physics, University of Oslo
    +
    [2] Department of Physics and Astronomy and National Superconducting Cyclotron Laboratory, Michigan State University
    +
    +

    +

    Sep 23, 2021

    +
    +

    + + +

    Read »

    + + +
    + +

    + +

    + + +
    + + + + + + + +
    + © 1999-2021, Morten Hjorth-Jensen. Released under CC Attribution-NonCommercial 4.0 license +
    + + + + + + diff --git a/doc/src/week38/week38-reveal.html b/doc/src/week38/week38-reveal.html new file mode 100644 index 000000000..9d28f2209 --- /dev/null +++ b/doc/src/week38/week38-reveal.html @@ -0,0 +1,3759 @@ + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + + + + + + + + + + + + + + +
    + + + + +

    Data Analysis and Machine Learning: Logistic Regression

    + +

    + + +

    +Morten Hjorth-Jensen [1, 2] +
    + +

     
    + + +

    [1] Department of Physics, University of Oslo
    +
    [2] Department of Physics and Astronomy and National Superconducting Cyclotron Laboratory, Michigan State University
    +
    +

     
    +

    Sep 23, 2021

    +
    +

    + +

    + © 1999-2021, Morten Hjorth-Jensen. Released under CC Attribution-NonCommercial 4.0 license +
    +
    + + +
    +

    Plans for week 38

    + +
      +

    • Thursday: Summary of regression methods and discussion of project 1. Start Logistic Regression
    • +

    • Video of Lecture September 23
    • +

    • Friday: Logistic Regression and Optimization methods
    • +
    +
    + + +
    +

    Thursday September 23

    +
    + + +
    +

    Ridge and LASSO Regression, reminder

    + +

    +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 +our optimization problem is +

     
    +$$ +{\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\}. +$$ +

     
    + +or we can state it as +

     
    +$$ +{\displaystyle \min_{\boldsymbol{\beta}\in +{\mathbb{R}}^{p}}}\frac{1}{n}\sum_{i=0}^{n-1}\left(y_i-\tilde{y}_i\right)^2=\frac{1}{n}\vert\vert \boldsymbol{y}-\boldsymbol{X}\boldsymbol{\beta}\vert\vert_2^2, +$$ +

     
    + +where we have used the definition of a norm-2 vector, that is +

     
    +$$ +\vert\vert \boldsymbol{x}\vert\vert_2 = \sqrt{\sum_i x_i^2}. +$$ +

     
    + +

    +By minimizing the above equation with respect to the parameters +\( \boldsymbol{\beta} \) we could then obtain an analytical expression for the +parameters \( \boldsymbol{\beta} \). We can add a regularization parameter \( \lambda \) by +defining a new cost function to be optimized, that is + +

     
    +$$ +{\displaystyle \min_{\boldsymbol{\beta}\in +{\mathbb{R}}^{p}}}\frac{1}{n}\vert\vert \boldsymbol{y}-\boldsymbol{X}\boldsymbol{\beta}\vert\vert_2^2+\lambda\vert\vert \boldsymbol{\beta}\vert\vert_2^2 +$$ +

     
    + +

    +which leads to the Ridge regression minimization problem where we +require that \( \vert\vert \boldsymbol{\beta}\vert\vert_2^2\le t \), where \( t \) is +a finite number larger than zero. By defining + +

     
    +$$ +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, +$$ +

     
    + +

    +we have a new optimization equation +

     
    +$$ +{\displaystyle \min_{\boldsymbol{\beta}\in +{\mathbb{R}}^{p}}}\frac{1}{n}\vert\vert \boldsymbol{y}-\boldsymbol{X}\boldsymbol{\beta}\vert\vert_2^2+\lambda\vert\vert \boldsymbol{\beta}\vert\vert_1 +$$ +

     
    + +which leads to Lasso regression. Lasso stands for least absolute shrinkage and selection operator. + +

    +Here we have defined the norm-1 as +

     
    +$$ +\vert\vert \boldsymbol{x}\vert\vert_1 = \sum_i \vert x_i\vert. +$$ +

     
    +

    + + +
    +

    Various steps in cross-validation

    + +

    +When the repetitive splitting of the data set is done randomly, +samples may accidently end up in a fast majority of the splits in +either training or test set. Such samples may have an unbalanced +influence on either model building or prediction evaluation. To avoid +this \( k \)-fold cross-validation structures the data splitting. The +samples are divided into \( k \) more or less equally sized exhaustive and +mutually exclusive subsets. In turn (at each split) one of these +subsets plays the role of the test set while the union of the +remaining subsets constitutes the training set. Such a splitting +warrants a balanced representation of each sample in both training and +test set over the splits. Still the division into the \( k \) subsets +involves a degree of randomness. This may be fully excluded when +choosing \( k=n \). This particular case is referred to as leave-one-out +cross-validation (LOOCV). +

    + + +
    +

    How to set up the cross-validation for Ridge and/or Lasso

    + +
      +

    • Define a range of interest for the penalty parameter.
    • +

    • Divide the data set into training and test set comprising samples \( \{1, \ldots, n\} \setminus i \) and \( \{ i \} \), respectively.
    • +

    • Fit the linear regression model by means of ridge estimation for each \( \lambda \) in the grid using the training set, and the corresponding estimate of the error variance \( \boldsymbol{\sigma}_{-i}^2(\lambda) \), as
    • +
    +

     
    +$$ +\begin{align*} +\boldsymbol{\beta}_{-i}(\lambda) & = ( \boldsymbol{X}_{-i, \ast}^{T} +\boldsymbol{X}_{-i, \ast} + \lambda \boldsymbol{I}_{pp})^{-1} +\boldsymbol{X}_{-i, \ast}^{T} \boldsymbol{y}_{-i} +\end{align*} +$$ +

     
    + + +

      +

    • Evaluate the prediction performance of these models on the test set by \( C[y_i, \boldsymbol{X}_{i, \ast}; \boldsymbol{\beta}_{-i}(\lambda), \boldsymbol{\sigma}_{-i}^2(\lambda)] \). Or, by the prediction error \( |y_i - \boldsymbol{X}_{i, \ast} \boldsymbol{\beta}_{-i}(\lambda)| \), the relative error, the error squared or the R2 score function.
    • +

    • Repeat the first three steps such that each sample plays the role of the test set once.
    • +

    • Average the prediction performances of the test sets at each grid point of the penalty bias/parameter. It is an estimate of the prediction performance of the model corresponding to this value of the penalty parameter on novel data.
    • +
    +
    + + +
    +

    Cross-validation in brief

    + +

    +For the various values of \( k \) + +

      +

    1. shuffle the dataset randomly.
    2. +

    3. Split the dataset into \( k \) groups.
    4. +

    5. For each unique group: + +
        +

      1. Decide which group to use as set for test data
      2. +

      3. Take the remaining groups as a training data set
      4. +

      5. Fit a model on the training set and evaluate it on the test set
      6. +

      7. Retain the evaluation score and discard the model
      8. +
      +

    6. Summarize the model using the sample of model evaluation scores
    7. +
    +
    + + +
    +

    Code Example for Cross-validation and \( k \)-fold Cross-validation

    + +

    +The code here uses Ridge regression with cross-validation (CV) resampling and \( k \)-fold CV in order to fit a specific polynomial. +

    + + +

    import numpy as np
    +import matplotlib.pyplot as plt
    +from sklearn.model_selection import KFold
    +from sklearn.linear_model import Ridge
    +from sklearn.model_selection import cross_val_score
    +from sklearn.preprocessing import PolynomialFeatures
    +
    +# A seed just to ensure that the random numbers are the same for every run.
    +# Useful for eventual debugging.
    +np.random.seed(3155)
    +
    +# Generate the data.
    +nsamples = 100
    +x = np.random.randn(nsamples)
    +y = 3*x**2 + np.random.randn(nsamples)
    +
    +## Cross-validation on Ridge regression using KFold only
    +
    +# Decide degree on polynomial to fit
    +poly = PolynomialFeatures(degree = 6)
    +
    +# Decide which values of lambda to use
    +nlambdas = 500
    +lambdas = np.logspace(-3, 5, nlambdas)
    +
    +# Initialize a KFold instance
    +k = 5
    +kfold = KFold(n_splits = k)
    +
    +# Perform the cross-validation to estimate MSE
    +scores_KFold = np.zeros((nlambdas, k))
    +
    +i = 0
    +for lmb in lambdas:
    +    ridge = Ridge(alpha = lmb)
    +    j = 0
    +    for train_inds, test_inds in kfold.split(x):
    +        xtrain = x[train_inds]
    +        ytrain = y[train_inds]
    +
    +        xtest = x[test_inds]
    +        ytest = y[test_inds]
    +
    +        Xtrain = poly.fit_transform(xtrain[:, np.newaxis])
    +        ridge.fit(Xtrain, ytrain[:, np.newaxis])
    +
    +        Xtest = poly.fit_transform(xtest[:, np.newaxis])
    +        ypred = ridge.predict(Xtest)
    +
    +        scores_KFold[i,j] = np.sum((ypred - ytest[:, np.newaxis])**2)/np.size(ypred)
    +
    +        j += 1
    +    i += 1
    +
    +
    +estimated_mse_KFold = np.mean(scores_KFold, axis = 1)
    +
    +## Cross-validation using cross_val_score from sklearn along with KFold
    +
    +# kfold is an instance initialized above as:
    +# kfold = KFold(n_splits = k)
    +
    +estimated_mse_sklearn = np.zeros(nlambdas)
    +i = 0
    +for lmb in lambdas:
    +    ridge = Ridge(alpha = lmb)
    +
    +    X = poly.fit_transform(x[:, np.newaxis])
    +    estimated_mse_folds = cross_val_score(ridge, X, y[:, np.newaxis], scoring='neg_mean_squared_error', cv=kfold)
    +
    +    # cross_val_score return an array containing the estimated negative mse for every fold.
    +    # we have to the the mean of every array in order to get an estimate of the mse of the model
    +    estimated_mse_sklearn[i] = np.mean(-estimated_mse_folds)
    +
    +    i += 1
    +
    +## Plot and compare the slightly different ways to perform cross-validation
    +
    +plt.figure()
    +
    +plt.plot(np.log10(lambdas), estimated_mse_sklearn, label = 'cross_val_score')
    +plt.plot(np.log10(lambdas), estimated_mse_KFold, 'r--', label = 'KFold')
    +
    +plt.xlabel('log10(lambda)')
    +plt.ylabel('mse')
    +
    +plt.legend()
    +
    +plt.show()
    +
    +
    + + +
    +

    To think about, first part

    + +

    +When you are comparing your own code with for example Scikit-Learn's +library, there are some technicalities to keep in mind. The examples +here demonstrate some of these aspects with potential pitfalls. + +

    +The discussion here focuses on the role of the intercept, how we can +set up the design matrix, what scaling we should use and other topics +which tend confuse us. + +

    +The intercept can be interpreted as the expected value of our +target/output variables when all other predictors are set to zero. +Thus, if we cannot assume that the expected outputs/targets are zero +when all predictors are zero (the columns in the design matrix), it +may be a bad idea to implement a model which penalizes the intercept. +Furthermore, in for example Ridge and Lasso regression, the default solutions +from the library Scikit-Learn (when not shrinking \( \beta_0 \)) for the unknown parameters +\( \boldsymbol{\beta} \), are derived under the assumption that both \( \boldsymbol{y} \) and +\( \boldsymbol{X} \) are zero centered, that is we subtract the mean values. +

    + + +
    +

    More thinking

    + +

    +If our predictors represent different scales, then it is important to +standardize the design matrix \( \boldsymbol{X} \) by subtracting the mean of each +column from the corresponding column and dividing the column with its +standard deviation. Most machine learning libraries do this as a default. This means that if you compare your code with the results from a given library, +the results may differ. + +

    +The +Standadscaler +function in Scikit-Learn does this for us. For the data sets we +have been studying in our various examples, the data are in many cases +already scaled and there is no need to scale them. You as a user of different machine learning algorithms, should always perform a +survey of your data, with a critical assessment of them in case you need to scale the data. + +

    +If you need to scale the data, not doing so will give an unfair +penalization of the parameters since their magnitude depends on the +scale of their corresponding predictor. + +

    +Suppose as an example that you +you have an input variable given by the heights of different persons. +Human height might be measured in inches or meters or +kilometers. If measured in kilometers, a standard linear regression +model with this predictor would probably give a much bigger +coefficient term, than if measured in millimeters. +This can clearly lead to problems in evaluating the cost/loss functions. +

    + + +
    +

    Still thinking

    + +

    +Keep in mind that when you transform your data set before training a model, the same transformation needs to be done +on your eventual new data set before making a prediction. If we translate this into a Python code, it would could be implemented as follows + +

    + + +

    #Model training, we compute the mean value of y and X
    +y_train_mean = np.mean(y_train)
    +X_train_mean = np.mean(X_train,axis=0)
    +X_train = X_train - X_train_mean
    +y_train = y_train - y_train_mean
    +
    +# The we fit our model with the training data
    +trained_model = some_model.fit(X_train,y_train)
    +
    +
    +#Model prediction, we need also to transform our data set used for the prediction.
    +X_test = X_test - X_train_mean #Use mean from training data
    +y_pred = trained_model(X_test)
    +y_pred = y_pred + y_train_mean
    +
    +
    + + +
    +

    What does centering (subtracting the mean values) mean mathematically?

    + +

    +Let us try to understand what this may imply mathematically when we +subtract the mean values, also known as zero centering. For +simplicity, we will focus on ordinary regression, as done in the above example. + +

    +The cost/loss function for regression is +

     
    +$$ +C(\beta_0, \beta_1, ... , \beta_{p-1}) = \frac{1}{n}\sum_{i=0}^{n} \left(y_i - \beta_0 - \sum_{j=1}^{p-1} X_{ij}\beta_j\right)^2,. +$$ +

     
    + +Recall also that we use the squared value since this leads to an increase of the penalty for higher differences between predicted and output/target values. + +

    +What we have done is to single out the \( \beta_0 \) term in the definition of the mean squared error (MSE). +The design matrix +\( X \) does in this case not contain any intercept column. +When we take the derivative with respect to \( \beta_0 \), we want the derivative to obey +

     
    +$$ +\frac{\partial C}{\partial \beta_j} = 0, +$$ +

     
    + +

    +for all \( j \). For \( \beta_0 \) we have + +

     
    +$$ +\frac{\partial C}{\partial \beta_0} = -\frac{2}{n}\sum_{i=0}^{n-1} \left(y_i - \beta_0 - \sum_{j=1}^{p-1} X_{ij} \beta_j\right). +$$ +

     
    + +Multiplying away the constant \( 2/n \), we obtain +

     
    +$$ +\sum_{i=0}^{n-1} \beta_0 = \sum_{i=0}^{n-1}y_i - \sum_{i=0}^{n-1} \sum_{j=1}^{p-1} X_{ij} \beta_j. +$$ +

     
    +

    + + +
    +

    Further Manipulations

    + +

    +We assume +that every column of \( \boldsymbol{X} \) is centered, which we can do by subtracting the mean, +

    + + +

    X = X - np.mean(X,axis=0)
    +
    +

    +This means that we need to rewrite \( X_{ij} \) as \( \tilde{X}_{ij}=X_{ij}-\mu_j \), where +

     
    +$$ +\mu_j = \frac{1}{n}\sum_{i=0}^{n-1}X_{ij}. +$$ +

     
    + +

    +Let us special first to the case where we have only two parameters \( \beta_0 \) and \( \beta_1 \). +Our result for \( \beta_0 \) simplifies then to +

     
    +$$ +n\beta_0 = \sum_{i=0}^{n-1}y_i - \sum_{i=0}^{n-1} X_{i1} \beta_1. +$$ +

     
    + +Assuming that the matrix elements \( X_{i1} \) are centered, what we have is +

     
    +$$ +\beta_0 = \frac{1}{n}\sum_{i=0}^{n-1}y_i - \beta_1\frac{1}{n}\sum_{i=0}^{n-1} \left(X_{i1}-\mu_{1}\right), +$$ +

     
    + +where +

     
    +$$ +\mu_1=\frac{1}{n}\sum_{i=0}^{n-1} (X_{i1}, +$$ +

     
    + +and if we define the mean value of the outputs as +

     
    +$$ +\mu_y=\frac{1}{n}\sum_{i=0}^{n-1}y_i, +$$ +

     
    + +we have +

     
    +$$ +\beta_0 = \mu_y - \beta_1\frac{1}{n}\sum_{i=0}^{n-1} (X_{i1}-\mu_{1}), +$$ +

     
    + +and it is easy to see that the last sum equals zero! This means that we have +

     
    +$$ +\beta_0 = \mu_y, +$$ +

     
    + +if the columns of the design matrix are centered. It is straight forward to generalize this results to more values of \( \beta \). +We have thus +

     
    +$$ +\beta_0 = \frac{1}{n}\sum_{i=0}^{n-1} y_i = \overline{\boldsymbol{y}}, +$$ +

     
    + +the average value of \( \boldsymbol{y} \). + +

    +Replacing \( y_i \) with \( y_i - \beta_0 = y_i - \overline{\boldsymbol{y}} \) and centering also our design matrix results in a cost function (in vector-matrix disguise) +

     
    +$$ +C(\boldsymbol{\beta}) = (\boldsymbol{\tilde{y}} - \tilde{X}\boldsymbol{\beta})^T(\boldsymbol{\tilde{y}} - \tilde{X}\boldsymbol{\beta}). +$$ +

     
    +

    + + +
    +

    Wrapping it up

    + +

    +If we minimize with respect to \( \boldsymbol{\beta} \) we have then + +

     
    +$$ +\hat{\boldsymbol{\beta}} = (\tilde{X}^T\tilde{X})^{-1}\tilde{X}^T\boldsymbol{\tilde{y}}, +$$ +

     
    + +

    +where \( \boldsymbol{\tilde{y}} = \boldsymbol{y} - \overline{\boldsymbol{y}} \) +and \( \tilde{X}_{ij} = X_{ij} - \frac{1}{n}\sum_{k=0}^{n-1}X_{kj} \). + +

    +For Ridge regression we need to add \( \lambda \boldsymbol{\beta}^T\boldsymbol{\beta} \) to the cost function and get then +

     
    +$$ +\hat{\boldsymbol{\beta}} = (\tilde{X}^T\tilde{X} + \lambda I)^{-1}\tilde{X}^T\boldsymbol{\tilde{y}}. +$$ +

     
    + +

    +What does this mean? And why do we insist on all this? Let us look at some examples. +

    + + +
    +

    Linear Regression code, Intercept handling first

    + +

    +This code shows a simple first-order fit to a data set using the above transformed data, where we consider the role of the intercept first, by either excluding it or including it (code example thanks to Øyvind Sigmundson Schøyen). Here our scaling of the data is done by subtracting the mean values only. +Note also that we do not split the data into training and test. + +

    + + +

    import numpy as np
    +import matplotlib.pyplot as plt
    +
    +from sklearn.linear_model import LinearRegression
    +
    +
    +np.random.seed(2021)
    +
    +def MSE(y_data,y_model):
    +    n = np.size(y_model)
    +    return np.sum((y_data-y_model)**2)/n
    +
    +
    +def fit_beta(X, y):
    +    return np.linalg.pinv(X.T @ X) @ X.T @ y
    +
    +
    +true_beta = [2, 0.5, 3.7]
    +
    +x = np.linspace(0, 1, 11)
    +y = np.sum(
    +    np.asarray([x ** p * b for p, b in enumerate(true_beta)]), axis=0
    +) + 0.1 * np.random.normal(size=len(x))
    +
    +degree = 3
    +X = np.zeros((len(x), degree))
    +
    +# Include the intercept in the design matrix
    +for p in range(degree):
    +    X[:, p] = x ** p
    +
    +beta = fit_beta(X, y)
    +
    +# Intercept is included in the design matrix
    +skl = LinearRegression(fit_intercept=False).fit(X, y)
    +
    +print(f"True beta: {true_beta}")
    +print(f"Fitted beta: {beta}")
    +print(f"Sklearn fitted beta: {skl.coef_}")
    +ypredictOwn = X @ beta
    +ypredictSKL = skl.predict(X)
    +print(f"MSE with intercept column")
    +print(MSE(y,ypredictOwn))
    +print(f"MSE with intercept column from SKL")
    +print(MSE(y,ypredictSKL))
    +
    +
    +plt.figure()
    +plt.scatter(x, y, label="Data")
    +plt.plot(x, X @ beta, label="Fit")
    +plt.plot(x, skl.predict(X), label="Sklearn (fit_intercept=False)")
    +
    +
    +# Do not include the intercept in the design matrix
    +X = np.zeros((len(x), degree - 1))
    +
    +for p in range(degree - 1):
    +    X[:, p] = x ** (p + 1)
    +
    +# Intercept is not included in the design matrix
    +skl = LinearRegression(fit_intercept=True).fit(X, y)
    +
    +# Use centered values for X and y when computing coefficients
    +y_offset = np.average(y, axis=0)
    +X_offset = np.average(X, axis=0)
    +
    +beta = fit_beta(X - X_offset, y - y_offset)
    +intercept = np.mean(y_offset - X_offset @ beta)
    +
    +print(f"Manual intercept: {intercept}")
    +print(f"Fitted beta (wiothout intercept): {beta}")
    +print(f"Sklearn intercept: {skl.intercept_}")
    +print(f"Sklearn fitted beta (without intercept): {skl.coef_}")
    +ypredictOwn = X @ beta
    +ypredictSKL = skl.predict(X)
    +print(f"MSE with Manual intercept")
    +print(MSE(y,ypredictOwn+intercept))
    +print(f"MSE with Sklearn intercept")
    +print(MSE(y,ypredictSKL))
    +
    +plt.plot(x, X @ beta + intercept, "--", label="Fit (manual intercept)")
    +plt.plot(x, skl.predict(X), "--", label="Sklearn (fit_intercept=True)")
    +plt.grid()
    +plt.legend()
    +
    +plt.show()
    +
    +

    +The intercept is the value of our output/target variable +when all our features are zero and our function crosses the \( y \)-axis (for a one-dimensional case). + +

    +Printing the MSE, we see first that both methods give the same MSE, as +they should. However, when we move to for example Ridge regression, +the way we treat the intercept may give a larger or smaller MSE, +meaning that the MSE can be penalized by the value of the +intercept. Not including the intercept in the fit, means that the +regularization term does not include \( \beta_0 \). For different values +of \( \lambda \), this may lead to differeing MSE values. + +

    +To remind the reader, the regularization term, with the intercept in Ridge regression is given by +

     
    +$$ +\lambda \vert\vert \boldsymbol{\beta} \vert\vert_2^2 = \lambda \sum_{j=0}^{p-1}\beta_j^2, +$$ +

     
    + +but when we take out the intercept, this equation becomes +

     
    +$$ +\lambda \vert\vert \boldsymbol{\beta} \vert\vert_2^2 = \lambda \sum_{j=1}^{p-1}\beta_j^2. +$$ +

     
    + +

    +For Lasso regression we have +

     
    +$$ +\lambda \vert\vert \boldsymbol{\beta} \vert\vert_1 = \lambda \sum_{j=1}^{p-1}\vert\beta_j\vert. +$$ +

     
    + +

    +It means that, when scaling the design matrix and the outputs/targets, by subtracting the mean values, we have an optimization problem which is not penalized by the intercept. The MSE value can then be smaller since it focuses only on the remaining quantities. If we however bring back the intercept, we will get a MSE which then contains the intercept. +

    + + +
    +

    Code Examples

    + +

    +Armed with this wisdom, we attempt first to simply set the intercept equal to False in our implementation of Ridge regression for our well-known vanilla data set. + +

    + + +

    import numpy as np
    +import pandas as pd
    +import matplotlib.pyplot as plt
    +from sklearn.model_selection import train_test_split
    +from sklearn import linear_model
    +
    +def MSE(y_data,y_model):
    +    n = np.size(y_model)
    +    return np.sum((y_data-y_model)**2)/n
    +
    +
    +# A seed just to ensure that the random numbers are the same for every run.
    +# Useful for eventual debugging.
    +np.random.seed(3155)
    +
    +n = 100
    +x = np.random.rand(n)
    +y = np.exp(-x**2) + 1.5 * np.exp(-(x-2)**2)
    +
    +Maxpolydegree = 20
    +X = np.zeros((n,Maxpolydegree))
    +#We include explicitely the intercept column
    +for degree in range(Maxpolydegree):
    +    X[:,degree] = x**degree
    +# We split the data in test and training data
    +X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)
    +
    +p = Maxpolydegree
    +I = np.eye(p,p)
    +# Decide which values of lambda to use
    +nlambdas = 6
    +MSEOwnRidgePredict = np.zeros(nlambdas)
    +MSERidgePredict = np.zeros(nlambdas)
    +lambdas = np.logspace(-4, 2, nlambdas)
    +for i in range(nlambdas):
    +    lmb = lambdas[i]
    +    OwnRidgeBeta = np.linalg.pinv(X_train.T @ X_train+lmb*I) @ X_train.T @ y_train
    +    # Note: we include the intercept column and no scaling
    +    RegRidge = linear_model.Ridge(lmb,fit_intercept=False)
    +    RegRidge.fit(X_train,y_train)
    +    # and then make the prediction
    +    ytildeOwnRidge = X_train @ OwnRidgeBeta
    +    ypredictOwnRidge = X_test @ OwnRidgeBeta
    +    ytildeRidge = RegRidge.predict(X_train)
    +    ypredictRidge = RegRidge.predict(X_test)
    +    MSEOwnRidgePredict[i] = MSE(y_test,ypredictOwnRidge)
    +    MSERidgePredict[i] = MSE(y_test,ypredictRidge)
    +    print("Beta values for own Ridge implementation")
    +    print(OwnRidgeBeta)
    +    print("Beta values for Scikit-Learn Ridge implementation")
    +    print(RegRidge.coef_)
    +    print("MSE values for own Ridge implementation")
    +    print(MSEOwnRidgePredict[i])
    +    print("MSE values for Scikit-Learn Ridge implementation")
    +    print(MSERidgePredict[i])
    +
    +# Now plot the results
    +plt.figure()
    +plt.plot(np.log10(lambdas), MSEOwnRidgePredict, 'r', label = 'MSE own Ridge Test')
    +plt.plot(np.log10(lambdas), MSERidgePredict, 'g', label = 'MSE Ridge Test')
    +
    +plt.xlabel('log10(lambda)')
    +plt.ylabel('MSE')
    +plt.legend()
    +plt.show()
    +
    +

    +The results here agree when we force Scikit-Learn's Ridge function to include the first column in our design matrix. +We see that the results agree very well. Here we have thus explicitely included the intercept column in the design matrix. +What happens if we do not include the intercept in our fit? +Let us see how we can change this code by zero centering (thanks to Stian Bilek for inpouts here). +

    + + +
    +

    Taking out the mean

    +

    + + +

    import numpy as np
    +import pandas as pd
    +import matplotlib.pyplot as plt
    +from sklearn.model_selection import train_test_split
    +from sklearn import linear_model
    +from sklearn.preprocessing import StandardScaler
    +
    +def MSE(y_data,y_model):
    +    n = np.size(y_model)
    +    return np.sum((y_data-y_model)**2)/n
    +# A seed just to ensure that the random numbers are the same for every run.
    +# Useful for eventual debugging.
    +np.random.seed(315)
    +
    +n = 100
    +x = np.random.rand(n)
    +y = np.exp(-x**2) + 1.5 * np.exp(-(x-2)**2)
    +
    +Maxpolydegree = 20
    +X = np.zeros((n,Maxpolydegree-1))
    +
    +for degree in range(1,Maxpolydegree): #No intercept column
    +    X[:,degree-1] = x**(degree)
    +
    +# We split the data in test and training data
    +X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)
    +
    +#For our own implementation, we will need to deal with the intercept by centering the design matrix and the target variable
    +X_train_mean = np.mean(X_train,axis=0)
    +#Center by removing mean from each feature
    +X_train_scaled = X_train - X_train_mean 
    +X_test_scaled = X_test - X_train_mean
    +#The model intercept (called y_scaler) is given by the mean of the target variable (IF X is centered)
    +#Remove the intercept from the training data.
    +y_scaler = np.mean(y_train)           
    +y_train_scaled = y_train - y_scaler   
    +
    +p = Maxpolydegree-1
    +I = np.eye(p,p)
    +# Decide which values of lambda to use
    +nlambdas = 6
    +MSEOwnRidgePredict = np.zeros(nlambdas)
    +MSERidgePredict = np.zeros(nlambdas)
    +
    +lambdas = np.logspace(-4, 2, nlambdas)
    +for i in range(nlambdas):
    +    lmb = lambdas[i]
    +    OwnRidgeBeta = np.linalg.pinv(X_train_scaled.T @ X_train_scaled+lmb*I) @ X_train_scaled.T @ (y_train_scaled)
    +    intercept_ = y_scaler - X_train_mean@OwnRidgeBeta #The intercept can be shifted so the model can predict on uncentered data
    +    #Add intercept to prediction
    +    ypredictOwnRidge = X_test @ OwnRidgeBeta + intercept_ 
    +    #Add intercept to prediction
    +    ypredictOwnRidge = X_test_scaled @ OwnRidgeBeta + y_scaler 
    +    RegRidge = linear_model.Ridge(lmb)
    +    RegRidge.fit(X_train,y_train)
    +    ypredictRidge = RegRidge.predict(X_test)
    +    MSEOwnRidgePredict[i] = MSE(y_test,ypredictOwnRidge)
    +    MSERidgePredict[i] = MSE(y_test,ypredictRidge)
    +    print("Beta values for own Ridge implementation")
    +    print(OwnRidgeBeta) #Intercept is given by mean of target variable
    +    print("Beta values for Scikit-Learn Ridge implementation")
    +    print(RegRidge.coef_)
    +    print('Intercept from own implementation:')
    +    print(intercept_)
    +    print('Intercept from Scikit-Learn Ridge implementation')
    +    print(RegRidge.intercept_)
    +    print("MSE values for own Ridge implementation")
    +    print(MSEOwnRidgePredict[i])
    +    print("MSE values for Scikit-Learn Ridge implementation")
    +    print(MSERidgePredict[i])
    +
    +
    +# Now plot the results
    +plt.figure()
    +plt.plot(np.log10(lambdas), MSEOwnRidgePredict, 'b--', label = 'MSE own Ridge Test')
    +plt.plot(np.log10(lambdas), MSERidgePredict, 'g--', label = 'MSE SL Ridge Test')
    +plt.xlabel('log10(lambda)')
    +plt.ylabel('MSE')
    +plt.legend()
    +plt.show()
    +
    +

    +We see here, when compared to the code which includes explicitely the +intercept column, that our MSE value is actually smaller. This is +because the regularization term does not include the intercept value +\( \beta_0 \) in the fitting. This applies to Lasso regularization as +well. It means that our optimization is now done only with the +centered matrix and/or vector that enter the fitting procedure. Note +also that the problem with the intercept occurs mainly in these type +of polynomial fitting problem. + +

    +The next example is indeed an example where all these discussions about the role of intercept are not present. +

    + + +
    +

    More complicated Example: The Ising model

    + +

    +The one-dimensional Ising model with nearest neighbor interaction, no +external field and a constant coupling constant \( J \) is given by + +

     
    +$$ +\begin{align} + H = -J \sum_{k}^L s_k s_{k + 1}, +\tag{1} +\end{align} +$$ +

     
    + +

    +where \( s_i \in \{-1, 1\} \) and \( s_{N + 1} = s_1 \). The number of spins +in the system is determined by \( L \). For the one-dimensional system +there is no phase transition. + +

    +We will look at a system of \( L = 40 \) spins with a coupling constant of +\( J = 1 \). To get enough training data we will generate 10000 states +with their respective energies. + +

    + + +

    import numpy as np
    +import matplotlib.pyplot as plt
    +from mpl_toolkits.axes_grid1 import make_axes_locatable
    +import seaborn as sns
    +import scipy.linalg as scl
    +from sklearn.model_selection import train_test_split
    +import tqdm
    +sns.set(color_codes=True)
    +cmap_args=dict(vmin=-1., vmax=1., cmap='seismic')
    +
    +L = 40
    +n = int(1e4)
    +
    +spins = np.random.choice([-1, 1], size=(n, L))
    +J = 1.0
    +
    +energies = np.zeros(n)
    +
    +for i in range(n):
    +    energies[i] = - J * np.dot(spins[i], np.roll(spins[i], 1))
    +
    +

    +Here we use ordinary least squares +regression to predict the energy for the nearest neighbor +one-dimensional Ising model on a ring, i.e., the endpoints wrap +around. We will use linear regression to fit a value for +the coupling constant to achieve this. +

    + + +
    +

    Reformulating the problem to suit regression

    + +

    +A more general form for the one-dimensional Ising model is + +

     
    +$$ +\begin{align} + H = - \sum_j^L \sum_k^L s_j s_k J_{jk}. +\tag{2} +\end{align} +$$ +

     
    + +

    +Here we allow for interactions beyond the nearest neighbors and a state dependent +coupling constant. This latter expression can be formulated as +a matrix-product +

     
    +$$ +\begin{align} + \boldsymbol{H} = \boldsymbol{X} J, +\tag{3} +\end{align} +$$ +

     
    + +

    +where \( X_{jk} = s_j s_k \) and \( J \) is a matrix which consists of the +elements \( -J_{jk} \). This form of writing the energy fits perfectly +with the form utilized in linear regression, that is + +

     
    +$$ +\begin{align} + \boldsymbol{y} = \boldsymbol{X}\boldsymbol{\beta} + \boldsymbol{\epsilon}, +\tag{4} +\end{align} +$$ +

     
    + +

    +We split the data in training and test data as discussed in the previous example + +

    + + +

    X = np.zeros((n, L ** 2))
    +for i in range(n):
    +    X[i] = np.outer(spins[i], spins[i]).ravel()
    +y = energies
    +X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)
    +
    +
    + + +
    +

    Linear regression

    + +

    +In the ordinary least squares method we choose the cost function + +

     
    +$$ +\begin{align} + C(\boldsymbol{X}, \boldsymbol{\beta})= \frac{1}{n}\left\{(\boldsymbol{X}\boldsymbol{\beta} - \boldsymbol{y})^T(\boldsymbol{X}\boldsymbol{\beta} - \boldsymbol{y})\right\}. +\tag{5} +\end{align} +$$ +

     
    + +

    +We then find the extremal point of \( C \) by taking the derivative with respect to \( \boldsymbol{\beta} \) as discussed above. +This yields the expression for \( \boldsymbol{\beta} \) to be + +

     
    +$$ + \boldsymbol{\beta} = \frac{\boldsymbol{X}^T \boldsymbol{y}}{\boldsymbol{X}^T \boldsymbol{X}}, +$$ +

     
    + +

    +which immediately imposes some requirements on \( \boldsymbol{X} \) as there must exist +an inverse of \( \boldsymbol{X}^T \boldsymbol{X} \). If the expression we are modeling contains an +intercept, i.e., a constant term, we must make sure that the +first column of \( \boldsymbol{X} \) consists of \( 1 \). We do this here + +

    + + +

    X_train_own = np.concatenate(
    +    (np.ones(len(X_train))[:, np.newaxis], X_train),
    +    axis=1
    +)
    +X_test_own = np.concatenate(
    +    (np.ones(len(X_test))[:, np.newaxis], X_test),
    +    axis=1
    +)
    +
    +

    + + +

    def ols_inv(x: np.ndarray, y: np.ndarray) -> np.ndarray:
    +    return scl.inv(x.T @ x) @ (x.T @ y)
    +beta = ols_inv(X_train_own, y_train)
    +
    +
    + + +
    +

    Singular Value decomposition

    + +

    +Doing the inversion directly turns out to be a bad idea since the matrix +\( \boldsymbol{X}^T\boldsymbol{X} \) is singular. An alternative approach is to use the singular +value decomposition. Using the definition of the Moore-Penrose +pseudoinverse we can write the equation for \( \boldsymbol{\beta} \) as + +

     
    +$$ + \boldsymbol{\beta} = \boldsymbol{X}^{+}\boldsymbol{y}, +$$ +

     
    + +

    +where the pseudoinverse of \( \boldsymbol{X} \) is given by + +

     
    +$$ + \boldsymbol{X}^{+} = \frac{\boldsymbol{X}^T}{\boldsymbol{X}^T\boldsymbol{X}}. +$$ +

     
    + +

    +Using singular value decomposition we can decompose the matrix \( \boldsymbol{X} = \boldsymbol{U}\boldsymbol{\Sigma} \boldsymbol{V}^T \), +where \( \boldsymbol{U} \) and \( \boldsymbol{V} \) are orthogonal(unitary) matrices and \( \boldsymbol{\Sigma} \) contains the singular values (more details below). +where \( X^{+} = V\Sigma^{+} U^T \). This reduces the equation for +\( \omega \) to +

     
    +$$ +\begin{align} + \boldsymbol{\beta} = \boldsymbol{V}\boldsymbol{\Sigma}^{+} \boldsymbol{U}^T \boldsymbol{y}. +\tag{6} +\end{align} +$$ +

     
    + +

    +Note that solving this equation by actually doing the pseudoinverse +(which is what we will do) is not a good idea as this operation scales +as \( \mathcal{O}(n^3) \), where \( n \) is the number of elements in a +general matrix. Instead, doing \( QR \)-factorization and solving the +linear system as an equation would reduce this down to +\( \mathcal{O}(n^2) \) operations. + +

    + + +

    def ols_svd(x: np.ndarray, y: np.ndarray) -> np.ndarray:
    +    u, s, v = scl.svd(x)
    +    return v.T @ scl.pinv(scl.diagsvd(s, u.shape[0], v.shape[0])) @ u.T @ y
    +
    +

    + + +

    beta = ols_svd(X_train_own,y_train)
    +
    +

    +When extracting the \( J \)-matrix we need to make sure that we remove the intercept, as is done here + +

    + + +

    J = beta[1:].reshape(L, L)
    +
    +

    +A way of looking at the coefficients in \( J \) is to plot the matrices as images. + +

    + + +

    fig = plt.figure(figsize=(20, 14))
    +im = plt.imshow(J, **cmap_args)
    +plt.title("OLS", fontsize=18)
    +plt.xticks(fontsize=18)
    +plt.yticks(fontsize=18)
    +cb = fig.colorbar(im)
    +cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)
    +plt.show()
    +
    +

    +It is interesting to note that OLS +considers both \( J_{j, j + 1} = -0.5 \) and \( J_{j, j - 1} = -0.5 \) as +valid matrix elements for \( J \). +In our discussion below on hyperparameters and Ridge and Lasso regression we will see that +this problem can be removed, partly and only with Lasso regression. + +

    +In this case our matrix inversion was actually possible. The obvious question now is what is the mathematics behind the SVD? +

    + + +
    +

    The one-dimensional Ising model

    + +

    +Let us bring back the Ising model again, but now with an additional +focus on Ridge and Lasso regression as well. We repeat some of the +basic parts of the Ising model and the setup of the training and test +data. The one-dimensional Ising model with nearest neighbor +interaction, no external field and a constant coupling constant \( J \) is +given by + +

     
    +$$ +\begin{align} + H = -J \sum_{k}^L s_k s_{k + 1}, +\tag{7} +\end{align} +$$ +

     
    + +where \( s_i \in \{-1, 1\} \) and \( s_{N + 1} = s_1 \). The number of spins in the system is determined by \( L \). For the one-dimensional system there is no phase transition. + +

    +We will look at a system of \( L = 40 \) spins with a coupling constant of \( J = 1 \). To get enough training data we will generate 10000 states with their respective energies. + +

    + + +

    import numpy as np
    +import matplotlib.pyplot as plt
    +from mpl_toolkits.axes_grid1 import make_axes_locatable
    +import seaborn as sns
    +import scipy.linalg as scl
    +from sklearn.model_selection import train_test_split
    +import sklearn.linear_model as skl
    +import tqdm
    +sns.set(color_codes=True)
    +cmap_args=dict(vmin=-1., vmax=1., cmap='seismic')
    +
    +L = 40
    +n = int(1e4)
    +
    +spins = np.random.choice([-1, 1], size=(n, L))
    +J = 1.0
    +
    +energies = np.zeros(n)
    +
    +for i in range(n):
    +    energies[i] = - J * np.dot(spins[i], np.roll(spins[i], 1))
    +
    +

    +A more general form for the one-dimensional Ising model is + +

     
    +$$ +\begin{align} + H = - \sum_j^L \sum_k^L s_j s_k J_{jk}. +\tag{8} +\end{align} +$$ +

     
    + +

    +Here we allow for interactions beyond the nearest neighbors and a more +adaptive coupling matrix. This latter expression can be formulated as +a matrix-product on the form +

     
    +$$ +\begin{align} + H = X J, +\tag{9} +\end{align} +$$ +

     
    + +

    +where \( X_{jk} = s_j s_k \) and \( J \) is the matrix consisting of the +elements \( -J_{jk} \). This form of writing the energy fits perfectly +with the form utilized in linear regression, viz. +

     
    +$$ +\begin{align} + \boldsymbol{y} = \boldsymbol{X}\boldsymbol{\beta} + \boldsymbol{\epsilon}. +\tag{10} +\end{align} +$$ +

     
    + +We organize the data as we did above +

    + + +

    X = np.zeros((n, L ** 2))
    +for i in range(n):
    +    X[i] = np.outer(spins[i], spins[i]).ravel()
    +y = energies
    +X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.96)
    +
    +X_train_own = np.concatenate(
    +    (np.ones(len(X_train))[:, np.newaxis], X_train),
    +    axis=1
    +)
    +
    +X_test_own = np.concatenate(
    +    (np.ones(len(X_test))[:, np.newaxis], X_test),
    +    axis=1
    +)
    +
    +

    +We will do all fitting with Scikit-Learn, + +

    + + +

    clf = skl.LinearRegression().fit(X_train, y_train)
    +
    +

    +When extracting the \( J \)-matrix we make sure to remove the intercept +

    + + +

    J_sk = clf.coef_.reshape(L, L)
    +
    +

    +And then we plot the results +

    + + +

    fig = plt.figure(figsize=(20, 14))
    +im = plt.imshow(J_sk, **cmap_args)
    +plt.title("LinearRegression from Scikit-learn", fontsize=18)
    +plt.xticks(fontsize=18)
    +plt.yticks(fontsize=18)
    +cb = fig.colorbar(im)
    +cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)
    +plt.show()
    +
    +

    +The results perfectly with our previous discussion where we used our own code. +

    + + +
    +

    Ridge regression

    + +

    +Having explored the ordinary least squares we move on to ridge +regression. In ridge regression we include a regularizer. This +involves a new cost function which leads to a new estimate for the +weights \( \boldsymbol{\beta} \). This results in a penalized regression problem. The +cost function is given by + +

     
    +$$ +\begin{align} + C(\boldsymbol{X}, \boldsymbol{\beta}; \lambda) = (\boldsymbol{X}\boldsymbol{\beta} - \boldsymbol{y})^T(\boldsymbol{X}\boldsymbol{\beta} - \boldsymbol{y}) + \lambda \boldsymbol{\beta}^T\boldsymbol{\beta}. +\tag{11} +\end{align} +$$ +

     
    + +

    + + +

    _lambda = 0.1
    +clf_ridge = skl.Ridge(alpha=_lambda).fit(X_train, y_train)
    +J_ridge_sk = clf_ridge.coef_.reshape(L, L)
    +fig = plt.figure(figsize=(20, 14))
    +im = plt.imshow(J_ridge_sk, **cmap_args)
    +plt.title("Ridge from Scikit-learn", fontsize=18)
    +plt.xticks(fontsize=18)
    +plt.yticks(fontsize=18)
    +cb = fig.colorbar(im)
    +cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)
    +
    +plt.show()
    +
    +
    + + +
    +

    LASSO regression

    + +

    +In the Least Absolute Shrinkage and Selection Operator (LASSO)-method we get a third cost function. + +

     
    +$$ +\begin{align} + C(\boldsymbol{X}, \boldsymbol{\beta}; \lambda) = (\boldsymbol{X}\boldsymbol{\beta} - \boldsymbol{y})^T(\boldsymbol{X}\boldsymbol{\beta} - \boldsymbol{y}) + \lambda \sqrt{\boldsymbol{\beta}^T\boldsymbol{\beta}}. +\tag{12} +\end{align} +$$ +

     
    + +

    +Finding the extremal point of this cost function is not so straight-forward as in least squares and ridge. We will therefore rely solely on the function ``Lasso`` from Scikit-Learn. + +

    + + +

    clf_lasso = skl.Lasso(alpha=_lambda).fit(X_train, y_train)
    +J_lasso_sk = clf_lasso.coef_.reshape(L, L)
    +fig = plt.figure(figsize=(20, 14))
    +im = plt.imshow(J_lasso_sk, **cmap_args)
    +plt.title("Lasso from Scikit-learn", fontsize=18)
    +plt.xticks(fontsize=18)
    +plt.yticks(fontsize=18)
    +cb = fig.colorbar(im)
    +cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)
    +
    +plt.show()
    +
    +

    +It is quite striking how LASSO breaks the symmetry of the coupling +constant as opposed to ridge and OLS. We get a sparse solution with +\( J_{j, j + 1} = -1 \). +

    + + +
    +

    Performance as function of the regularization parameter

    + +

    +We see how the different models perform for a different set of values for \( \lambda \). + +

    + + +

    lambdas = np.logspace(-4, 5, 10)
    +
    +train_errors = {
    +    "ols_sk": np.zeros(lambdas.size),
    +    "ridge_sk": np.zeros(lambdas.size),
    +    "lasso_sk": np.zeros(lambdas.size)
    +}
    +
    +test_errors = {
    +    "ols_sk": np.zeros(lambdas.size),
    +    "ridge_sk": np.zeros(lambdas.size),
    +    "lasso_sk": np.zeros(lambdas.size)
    +}
    +
    +plot_counter = 1
    +
    +fig = plt.figure(figsize=(32, 54))
    +
    +for i, _lambda in enumerate(tqdm.tqdm(lambdas)):
    +    for key, method in zip(
    +        ["ols_sk", "ridge_sk", "lasso_sk"],
    +        [skl.LinearRegression(), skl.Ridge(alpha=_lambda), skl.Lasso(alpha=_lambda)]
    +    ):
    +        method = method.fit(X_train, y_train)
    +
    +        train_errors[key][i] = method.score(X_train, y_train)
    +        test_errors[key][i] = method.score(X_test, y_test)
    +
    +        omega = method.coef_.reshape(L, L)
    +
    +        plt.subplot(10, 5, plot_counter)
    +        plt.imshow(omega, **cmap_args)
    +        plt.title(r"%s, $\lambda = %.4f$" % (key, _lambda))
    +        plot_counter += 1
    +
    +plt.show()
    +
    +

    +We see that LASSO reaches a good solution for low +values of \( \lambda \), but will "wither" when we increase \( \lambda \) too +much. Ridge is more stable over a larger range of values for +\( \lambda \), but eventually also fades away. +

    + + +
    +

    Finding the optimal value of \( \lambda \)

    + +

    +To determine which value of \( \lambda \) is best we plot the accuracy of +the models when predicting the training and the testing set. We expect +the accuracy of the training set to be quite good, but if the accuracy +of the testing set is much lower this tells us that we might be +subject to an overfit model. The ideal scenario is an accuracy on the +testing set that is close to the accuracy of the training set. + +

    + + +

    fig = plt.figure(figsize=(20, 14))
    +
    +colors = {
    +    "ols_sk": "r",
    +    "ridge_sk": "y",
    +    "lasso_sk": "c"
    +}
    +
    +for key in train_errors:
    +    plt.semilogx(
    +        lambdas,
    +        train_errors[key],
    +        colors[key],
    +        label="Train {0}".format(key),
    +        linewidth=4.0
    +    )
    +
    +for key in test_errors:
    +    plt.semilogx(
    +        lambdas,
    +        test_errors[key],
    +        colors[key] + "--",
    +        label="Test {0}".format(key),
    +        linewidth=4.0
    +    )
    +plt.legend(loc="best", fontsize=18)
    +plt.xlabel(r"$\lambda$", fontsize=18)
    +plt.ylabel(r"$R^2$", fontsize=18)
    +plt.tick_params(labelsize=18)
    +plt.show()
    +
    +

    +From the above figure we can see that LASSO with \( \lambda = 10^{-2} \) +achieves a very good accuracy on the test set. This by far surpasses the +other models for all values of \( \lambda \). +

    + + +
    +

    Logistic Regression

    + +

    +In linear regression our main interest was centered on learning the +coefficients of a functional fit (say a polynomial) in order to be +able to predict the response of a continuous variable on some unseen +data. The fit to the continuous variable \( y_i \) is based on some +independent variables \( \boldsymbol{x}_i \). Linear regression resulted in +analytical expressions for standard ordinary Least Squares or Ridge +regression (in terms of matrices to invert) for several quantities, +ranging from the variance and thereby the confidence intervals of the +parameters \( \boldsymbol{\beta} \) to the mean squared error. If we can invert +the product of the design matrices, linear regression gives then a +simple recipe for fitting our data. +

    + + +
    +

    Classification problems

    + +

    +Classification problems, however, are concerned with outcomes taking +the form of discrete variables (i.e. categories). We may for example, +on the basis of DNA sequencing for a number of patients, like to find +out which mutations are important for a certain disease; or based on +scans of various patients' brains, figure out if there is a tumor or +not; or given a specific physical system, we'd like to identify its +state, say whether it is an ordered or disordered system (typical +situation in solid state physics); or classify the status of a +patient, whether she/he has a stroke or not and many other similar +situations. + +

    +The most common situation we encounter when we apply logistic +regression is that of two possible outcomes, normally denoted as a +binary outcome, true or false, positive or negative, success or +failure etc. +

    + + +
    +

    Optimization and Deep learning

    + +

    +Logistic regression will also serve as our stepping stone towards +neural network algorithms and supervised deep learning. For logistic +learning, the minimization of the cost function leads to a non-linear +equation in the parameters \( \boldsymbol{\beta} \). The optimization of the +problem calls therefore for minimization algorithms. This forms the +bottle neck of all machine learning algorithms, namely how to find +reliable minima of a multi-variable function. This leads us to the +family of gradient descent methods. The latter are the working horses +of basically all modern machine learning algorithms. + +

    +We note also that many of the topics discussed here on logistic +regression are also commonly used in modern supervised Deep Learning +models, as we will see later. +

    + + +
    +

    Basics

    + +

    +We consider the case where the dependent variables, also called the +responses or the outcomes, \( y_i \) are discrete and only take values +from \( k=0,\dots,K-1 \) (i.e. \( K \) classes). + +

    +The goal is to predict the +output classes from the design matrix \( \boldsymbol{X}\in\mathbb{R}^{n\times p} \) +made of \( n \) samples, each of which carries \( p \) features or predictors. The +primary goal is to identify the classes to which new unseen samples +belong. + +

    +Let us specialize to the case of two classes only, with outputs +\( y_i=0 \) and \( y_i=1 \). Our outcomes could represent the status of a +credit card user that could default or not on her/his credit card +debt. That is + +

     
    +$$ +y_i = \begin{bmatrix} 0 & \mathrm{no}\\ 1 & \mathrm{yes} \end{bmatrix}. +$$ +

     
    +

    + + +
    +

    Linear classifier

    + +

    +Before moving to the logistic model, let us try to use our linear +regression model to classify these two outcomes. We could for example +fit a linear model to the default case if \( y_i > 0.5 \) and the no +default case \( y_i \leq 0.5 \). + +

    +We would then have our +weighted linear combination, namely +

     
    +$$ +\begin{equation} +\boldsymbol{y} = \boldsymbol{X}^T\boldsymbol{\beta} + \boldsymbol{\epsilon}, +\tag{13} +\end{equation} +$$ +

     
    + +where \( \boldsymbol{y} \) is a vector representing the possible outcomes, \( \boldsymbol{X} \) is our +\( n\times p \) design matrix and \( \boldsymbol{\beta} \) represents our estimators/predictors. +

    + + +
    +

    Some selected properties

    + +

    +The main problem with our function is that it takes values on the +entire real axis. In the case of logistic regression, however, the +labels \( y_i \) are discrete variables. A typical example is the credit +card data discussed below here, where we can set the state of +defaulting the debt to \( y_i=1 \) and not to \( y_i=0 \) for one the persons +in the data set (see the full example below). + +

    +One simple way to get a discrete output is to have sign +functions that map the output of a linear regressor to values \( \{0,1\} \), +\( f(s_i)=sign(s_i)=1 \) if \( s_i\ge 0 \) and 0 if otherwise. +We will encounter this model in our first demonstration of neural networks. Historically it is called the ``perceptron" model in the machine learning +literature. This model is extremely simple. However, in many cases it is more +favorable to use a ``soft" classifier that outputs +the probability of a given category. This leads us to the logistic function. +

    + + +
    +

    Simple example

    + +

    +The following example on data for coronary heart disease (CHD) as function of age may serve as an illustration. In the code here we read and plot whether a person has had CHD (output = 1) or not (output = 0). This ouput is plotted the person's against age. Clearly, the figure shows that attempting to make a standard linear regression fit may not be very meaningful. + +

    + + +

    # Common imports
    +import os
    +import numpy as np
    +import pandas as pd
    +import matplotlib.pyplot as plt
    +from sklearn.linear_model import LinearRegression, Ridge, Lasso
    +from sklearn.model_selection import train_test_split
    +from sklearn.utils import resample
    +from sklearn.metrics import mean_squared_error
    +from IPython.display import display
    +from pylab import plt, mpl
    +plt.style.use('seaborn')
    +mpl.rcParams['font.family'] = 'serif'
    +
    +# Where to save the figures and data files
    +PROJECT_ROOT_DIR = "Results"
    +FIGURE_ID = "Results/FigureFiles"
    +DATA_ID = "DataFiles/"
    +
    +if not os.path.exists(PROJECT_ROOT_DIR):
    +    os.mkdir(PROJECT_ROOT_DIR)
    +
    +if not os.path.exists(FIGURE_ID):
    +    os.makedirs(FIGURE_ID)
    +
    +if not os.path.exists(DATA_ID):
    +    os.makedirs(DATA_ID)
    +
    +def image_path(fig_id):
    +    return os.path.join(FIGURE_ID, fig_id)
    +
    +def data_path(dat_id):
    +    return os.path.join(DATA_ID, dat_id)
    +
    +def save_fig(fig_id):
    +    plt.savefig(image_path(fig_id) + ".png", format='png')
    +
    +infile = open(data_path("chddata.csv"),'r')
    +
    +# Read the chd data as  csv file and organize the data into arrays with age group, age, and chd
    +chd = pd.read_csv(infile, names=('ID', 'Age', 'Agegroup', 'CHD'))
    +chd.columns = ['ID', 'Age', 'Agegroup', 'CHD']
    +output = chd['CHD']
    +age = chd['Age']
    +agegroup = chd['Agegroup']
    +numberID  = chd['ID'] 
    +display(chd)
    +
    +plt.scatter(age, output, marker='o')
    +plt.axis([18,70.0,-0.1, 1.2])
    +plt.xlabel(r'Age')
    +plt.ylabel(r'CHD')
    +plt.title(r'Age distribution and Coronary heart disease')
    +plt.show()
    +
    +
    + + +
    +

    Plotting the mean value for each group

    + +

    +What we could attempt however is to plot the mean value for each group. + +

    + + +

    agegroupmean = np.array([0.1, 0.133, 0.250, 0.333, 0.462, 0.625, 0.765, 0.800])
    +group = np.array([1, 2, 3, 4, 5, 6, 7, 8])
    +plt.plot(group, agegroupmean, "r-")
    +plt.axis([0,9,0, 1.0])
    +plt.xlabel(r'Age group')
    +plt.ylabel(r'CHD mean values')
    +plt.title(r'Mean values for each age group')
    +plt.show()
    +
    +

    +We are now trying to find a function \( f(y\vert x) \), that is a function which gives us an expected value for the output \( y \) with a given input \( x \). +In standard linear regression with a linear dependence on \( x \), we would write this in terms of our model +

     
    +$$ +f(y_i\vert x_i)=\beta_0+\beta_1 x_i. +$$ +

     
    + +

    +This expression implies however that \( f(y_i\vert x_i) \) could take any +value from minus infinity to plus infinity. If we however let +\( f(y\vert y) \) be represented by the mean value, the above example +shows us that we can constrain the function to take values between +zero and one, that is we have \( 0 \le f(y_i\vert x_i) \le 1 \). Looking +at our last curve we see also that it has an S-shaped form. This leads +us to a very popular model for the function \( f \), namely the so-called +Sigmoid function or logistic model. We will consider this function as +representing the probability for finding a value of \( y_i \) with a given +\( x_i \). +

    + + +
    +

    The logistic function

    + +

    +Another widely studied model, is the so-called +perceptron model, which is an example of a "hard classification" model. We +will encounter this model when we discuss neural networks as +well. Each datapoint is deterministically assigned to a category (i.e +\( y_i=0 \) or \( y_i=1 \)). In many cases, and the coronary heart disease data forms one of many such examples, it is favorable to have a "soft" +classifier that outputs the probability of a given category rather +than a single value. For example, given \( x_i \), the classifier +outputs the probability of being in a category \( k \). Logistic regression +is the most common example of a so-called soft classifier. In logistic +regression, the probability that a data point \( x_i \) +belongs to a category \( y_i=\{0,1\} \) is given by the so-called logit function (or Sigmoid) which is meant to represent the likelihood for a given event, +

     
    +$$ +p(t) = \frac{1}{1+\mathrm \exp{-t}}=\frac{\exp{t}}{1+\mathrm \exp{t}}. +$$ +

     
    + +Note that \( 1-p(t)= p(-t) \). +

    + + +
    +

    Examples of likelihood functions used in logistic regression and nueral networks

    + +

    +The following code plots the logistic function, the step function and other functions we will encounter from here and on. + +

    + + +

    """The sigmoid function (or the logistic curve) is a
    +function that takes any real number, z, and outputs a number (0,1).
    +It is useful in neural networks for assigning weights on a relative scale.
    +The value z is the weighted sum of parameters involved in the learning algorithm."""
    +
    +import numpy
    +import matplotlib.pyplot as plt
    +import math as mt
    +
    +z = numpy.arange(-5, 5, .1)
    +sigma_fn = numpy.vectorize(lambda z: 1/(1+numpy.exp(-z)))
    +sigma = sigma_fn(z)
    +
    +fig = plt.figure()
    +ax = fig.add_subplot(111)
    +ax.plot(z, sigma)
    +ax.set_ylim([-0.1, 1.1])
    +ax.set_xlim([-5,5])
    +ax.grid(True)
    +ax.set_xlabel('z')
    +ax.set_title('sigmoid function')
    +
    +plt.show()
    +
    +"""Step Function"""
    +z = numpy.arange(-5, 5, .02)
    +step_fn = numpy.vectorize(lambda z: 1.0 if z >= 0.0 else 0.0)
    +step = step_fn(z)
    +
    +fig = plt.figure()
    +ax = fig.add_subplot(111)
    +ax.plot(z, step)
    +ax.set_ylim([-0.5, 1.5])
    +ax.set_xlim([-5,5])
    +ax.grid(True)
    +ax.set_xlabel('z')
    +ax.set_title('step function')
    +
    +plt.show()
    +
    +"""tanh Function"""
    +z = numpy.arange(-2*mt.pi, 2*mt.pi, 0.1)
    +t = numpy.tanh(z)
    +
    +fig = plt.figure()
    +ax = fig.add_subplot(111)
    +ax.plot(z, t)
    +ax.set_ylim([-1.0, 1.0])
    +ax.set_xlim([-2*mt.pi,2*mt.pi])
    +ax.grid(True)
    +ax.set_xlabel('z')
    +ax.set_title('tanh function')
    +
    +plt.show()
    +
    +
    + + +
    +

    Two parameters

    + +

    +We assume now that we have two classes with \( y_i \) either \( 0 \) or \( 1 \). Furthermore we assume also that we have only two parameters \( \beta \) in our fitting of the Sigmoid function, that is we define probabilities +

     
    +$$ +\begin{align*} +p(y_i=1|x_i,\boldsymbol{\beta}) &= \frac{\exp{(\beta_0+\beta_1x_i)}}{1+\exp{(\beta_0+\beta_1x_i)}},\nonumber\\ +p(y_i=0|x_i,\boldsymbol{\beta}) &= 1 - p(y_i=1|x_i,\boldsymbol{\beta}), +\end{align*} +$$ +

     
    + +where \( \boldsymbol{\beta} \) are the weights we wish to extract from data, in our case \( \beta_0 \) and \( \beta_1 \). + +

    +Note that we used +

     
    +$$ +p(y_i=0\vert x_i, \boldsymbol{\beta}) = 1-p(y_i=1\vert x_i, \boldsymbol{\beta}). +$$ +

     
    +

    + + +
    +

    Maximum likelihood

    + +

    +In order to define the total likelihood for all possible outcomes from a +dataset \( \mathcal{D}=\{(y_i,x_i)\} \), with the binary labels +\( y_i\in\{0,1\} \) and where the data points are drawn independently, we use the so-called Maximum Likelihood Estimation (MLE) principle. +We aim thus at maximizing +the probability of seeing the observed data. We can then approximate the +likelihood in terms of the product of the individual probabilities of a specific outcome \( y_i \), that is +

     
    +$$ +\begin{align*} +P(\mathcal{D}|\boldsymbol{\beta})& = \prod_{i=1}^n \left[p(y_i=1|x_i,\boldsymbol{\beta})\right]^{y_i}\left[1-p(y_i=1|x_i,\boldsymbol{\beta}))\right]^{1-y_i}\nonumber \\ +\end{align*} +$$ +

     
    + +from which we obtain the log-likelihood and our cost/loss function +

     
    +$$ +\mathcal{C}(\boldsymbol{\beta}) = \sum_{i=1}^n \left( y_i\log{p(y_i=1|x_i,\boldsymbol{\beta})} + (1-y_i)\log\left[1-p(y_i=1|x_i,\boldsymbol{\beta}))\right]\right). +$$ +

     
    +

    + + +
    +

    The cost function rewritten

    + +

    +Reordering the logarithms, we can rewrite the cost/loss function as +

     
    +$$ +\mathcal{C}(\boldsymbol{\beta}) = \sum_{i=1}^n \left(y_i(\beta_0+\beta_1x_i) -\log{(1+\exp{(\beta_0+\beta_1x_i)})}\right). +$$ +

     
    + +

    +The maximum likelihood estimator is defined as the set of parameters that maximize the log-likelihood where we maximize with respect to \( \beta \). +Since the cost (error) function is just the negative log-likelihood, for logistic regression we have that +

     
    +$$ +\mathcal{C}(\boldsymbol{\beta})=-\sum_{i=1}^n \left(y_i(\beta_0+\beta_1x_i) -\log{(1+\exp{(\beta_0+\beta_1x_i)})}\right). +$$ +

     
    + +This equation is known in statistics as the cross entropy. Finally, we note that just as in linear regression, +in practice we often supplement the cross-entropy with additional regularization terms, usually \( L_1 \) and \( L_2 \) regularization as we did for Ridge and Lasso regression. +

    + + +
    +

    Minimizing the cross entropy

    + +

    +The cross entropy is a convex function of the weights \( \boldsymbol{\beta} \) and, +therefore, any local minimizer is a global minimizer. + +

    +Minimizing this +cost function with respect to the two parameters \( \beta_0 \) and \( \beta_1 \) we obtain + +

     
    +$$ +\frac{\partial \mathcal{C}(\boldsymbol{\beta})}{\partial \beta_0} = -\sum_{i=1}^n \left(y_i -\frac{\exp{(\beta_0+\beta_1x_i)}}{1+\exp{(\beta_0+\beta_1x_i)}}\right), +$$ +

     
    + +and +

     
    +$$ +\frac{\partial \mathcal{C}(\boldsymbol{\beta})}{\partial \beta_1} = -\sum_{i=1}^n \left(y_ix_i -x_i\frac{\exp{(\beta_0+\beta_1x_i)}}{1+\exp{(\beta_0+\beta_1x_i)}}\right). +$$ +

     
    +

    + + +
    +

    A more compact expression

    + +

    +Let us now define a vector \( \boldsymbol{y} \) with \( n \) elements \( y_i \), an +\( n\times p \) matrix \( \boldsymbol{X} \) which contains the \( x_i \) values and a +vector \( \boldsymbol{p} \) of fitted probabilities \( p(y_i\vert x_i,\boldsymbol{\beta}) \). We can rewrite in a more compact form the first +derivative of cost function as + +

     
    +$$ +\frac{\partial \mathcal{C}(\boldsymbol{\beta})}{\partial \boldsymbol{\beta}} = -\boldsymbol{X}^T\left(\boldsymbol{y}-\boldsymbol{p}\right). +$$ +

     
    + +

    +If we in addition define a diagonal matrix \( \boldsymbol{W} \) with elements +\( p(y_i\vert x_i,\boldsymbol{\beta})(1-p(y_i\vert x_i,\boldsymbol{\beta}) \), we can obtain a compact expression of the second derivative as + +

     
    +$$ +\frac{\partial^2 \mathcal{C}(\boldsymbol{\beta})}{\partial \boldsymbol{\beta}\partial \boldsymbol{\beta}^T} = \boldsymbol{X}^T\boldsymbol{W}\boldsymbol{X}. +$$ +

     
    +

    + + +
    +

    Extending to more predictors

    + +

    +Within a binary classification problem, we can easily expand our model to include multiple predictors. Our ratio between likelihoods is then with \( p \) predictors +

     
    +$$ +\log{ \frac{p(\boldsymbol{\beta}\boldsymbol{x})}{1-p(\boldsymbol{\beta}\boldsymbol{x})}} = \beta_0+\beta_1x_1+\beta_2x_2+\dots+\beta_px_p. +$$ +

     
    + +Here we defined \( \boldsymbol{x}=[1,x_1,x_2,\dots,x_p] \) and \( \boldsymbol{\beta}=[\beta_0, \beta_1, \dots, \beta_p] \) leading to +

     
    +$$ +p(\boldsymbol{\beta}\boldsymbol{x})=\frac{ \exp{(\beta_0+\beta_1x_1+\beta_2x_2+\dots+\beta_px_p)}}{1+\exp{(\beta_0+\beta_1x_1+\beta_2x_2+\dots+\beta_px_p)}}. +$$ +

     
    +

    + + +
    +

    Including more classes

    + +

    +Till now we have mainly focused on two classes, the so-called binary +system. Suppose we wish to extend to \( K \) classes. Let us for the sake +of simplicity assume we have only two predictors. We have then following model + +

     
    +$$ +\log{\frac{p(C=1\vert x)}{p(K\vert x)}} = \beta_{10}+\beta_{11}x_1, +$$ +

     
    + +and +

     
    +$$ +\log{\frac{p(C=2\vert x)}{p(K\vert x)}} = \beta_{20}+\beta_{21}x_1, +$$ +

     
    + +and so on till the class \( C=K-1 \) class +

     
    +$$ +\log{\frac{p(C=K-1\vert x)}{p(K\vert x)}} = \beta_{(K-1)0}+\beta_{(K-1)1}x_1, +$$ +

     
    + +

    +and the model is specified in term of \( K-1 \) so-called log-odds or +logit transformations. +

    + + +
    +

    More classes

    + +

    +In our discussion of neural networks we will encounter the above again +in terms of a slightly modified function, the so-called Softmax function. + +

    +The softmax function is used in various multiclass classification +methods, such as multinomial logistic regression (also known as +softmax regression), multiclass linear discriminant analysis, naive +Bayes classifiers, and artificial neural networks. Specifically, in +multinomial logistic regression and linear discriminant analysis, the +input to the function is the result of \( K \) distinct linear functions, +and the predicted probability for the \( k \)-th class given a sample +vector \( \boldsymbol{x} \) and a weighting vector \( \boldsymbol{\beta} \) is (with two +predictors): + +

     
    +$$ +p(C=k\vert \mathbf {x} )=\frac{\exp{(\beta_{k0}+\beta_{k1}x_1)}}{1+\sum_{l=1}^{K-1}\exp{(\beta_{l0}+\beta_{l1}x_1)}}. +$$ +

     
    + +It is easy to extend to more predictors. The final class is +

     
    +$$ +p(C=K\vert \mathbf {x} )=\frac{1}{1+\sum_{l=1}^{K-1}\exp{(\beta_{l0}+\beta_{l1}x_1)}}, +$$ +

     
    + +

    +and they sum to one. Our earlier discussions were all specialized to +the case with two classes only. It is easy to see from the above that +what we derived earlier is compatible with these equations. + +

    +To find the optimal parameters we would typically use a gradient +descent method. Newton's method and gradient descent methods are +discussed in the material on optimization +methods. +

    + + +
    +

    Friday September 24

    +
    + + +
    +

    Wisconsin Cancer Data

    + +

    +We show here how we can use a simple regression case on the breast +cancer data using Logistic regression as our algorithm for +classification. + +

    + + +

    import matplotlib.pyplot as plt
    +import numpy as np
    +from sklearn.model_selection import  train_test_split 
    +from sklearn.datasets import load_breast_cancer
    +from sklearn.linear_model import LogisticRegression
    +
    +# Load the data
    +cancer = load_breast_cancer()
    +
    +X_train, X_test, y_train, y_test = train_test_split(cancer.data,cancer.target,random_state=0)
    +print(X_train.shape)
    +print(X_test.shape)
    +# Logistic Regression
    +logreg = LogisticRegression(solver='lbfgs')
    +logreg.fit(X_train, y_train)
    +print("Test set accuracy with Logistic Regression: {:.2f}".format(logreg.score(X_test,y_test)))
    +#now scale the data
    +from sklearn.preprocessing import StandardScaler
    +scaler = StandardScaler()
    +scaler.fit(X_train)
    +X_train_scaled = scaler.transform(X_train)
    +X_test_scaled = scaler.transform(X_test)
    +# Logistic Regression
    +logreg.fit(X_train_scaled, y_train)
    +print("Test set accuracy Logistic Regression with scaled data: {:.2f}".format(logreg.score(X_test_scaled,y_test)))
    +
    +
    + + +
    +

    Using the correlation matrix

    + +

    +In addition to the above scores, we could also study the covariance (and the correlation matrix). +We use Pandas to compute the correlation matrix. +

    + + +

    import matplotlib.pyplot as plt
    +import numpy as np
    +from sklearn.model_selection import  train_test_split 
    +from sklearn.datasets import load_breast_cancer
    +from sklearn.linear_model import LogisticRegression
    +cancer = load_breast_cancer()
    +import pandas as pd
    +# Making a data frame
    +cancerpd = pd.DataFrame(cancer.data, columns=cancer.feature_names)
    +
    +fig, axes = plt.subplots(15,2,figsize=(10,20))
    +malignant = cancer.data[cancer.target == 0]
    +benign = cancer.data[cancer.target == 1]
    +ax = axes.ravel()
    +
    +for i in range(30):
    +    _, bins = np.histogram(cancer.data[:,i], bins =50)
    +    ax[i].hist(malignant[:,i], bins = bins, alpha = 0.5)
    +    ax[i].hist(benign[:,i], bins = bins, alpha = 0.5)
    +    ax[i].set_title(cancer.feature_names[i])
    +    ax[i].set_yticks(())
    +ax[0].set_xlabel("Feature magnitude")
    +ax[0].set_ylabel("Frequency")
    +ax[0].legend(["Malignant", "Benign"], loc ="best")
    +fig.tight_layout()
    +plt.show()
    +
    +import seaborn as sns
    +correlation_matrix = cancerpd.corr().round(1)
    +# use the heatmap function from seaborn to plot the correlation matrix
    +# annot = True to print the values inside the square
    +plt.figure(figsize=(15,8))
    +sns.heatmap(data=correlation_matrix, annot=True)
    +plt.show()
    +
    +
    + + +
    +

    Discussing the correlation data

    + +

    +In the above example we note two things. In the first plot we display +the overlap of benign and malignant tumors as functions of the various +features in the Wisconsing breast cancer data set. We see that for +some of the features we can distinguish clearly the benign and +malignant cases while for other features we cannot. This can point to +us which features may be of greater interest when we wish to classify +a benign or not benign tumour. + +

    +In the second figure we have computed the so-called correlation +matrix, which in our case with thirty features becomes a \( 30\times 30 \) +matrix. + +

    +We constructed this matrix using pandas via the statements +

    + + +

    cancerpd = pd.DataFrame(cancer.data, columns=cancer.feature_names)
    +
    +

    +and then +

    + + +

    correlation_matrix = cancerpd.corr().round(1)
    +
    +

    +Diagonalizing this matrix we can in turn say something about which +features are of relevance and which are not. This leads us to +the classical Principal Component Analysis (PCA) theorem with +applications. This will be discussed later this semester (week 43). +

    + + +
    +

    Other measures in classification studies: Cancer Data again

    +

    + + +

    import matplotlib.pyplot as plt
    +import numpy as np
    +from sklearn.model_selection import  train_test_split 
    +from sklearn.datasets import load_breast_cancer
    +from sklearn.linear_model import LogisticRegression
    +
    +# Load the data
    +cancer = load_breast_cancer()
    +
    +X_train, X_test, y_train, y_test = train_test_split(cancer.data,cancer.target,random_state=0)
    +print(X_train.shape)
    +print(X_test.shape)
    +# Logistic Regression
    +logreg = LogisticRegression(solver='lbfgs')
    +logreg.fit(X_train, y_train)
    +print("Test set accuracy with Logistic Regression: {:.2f}".format(logreg.score(X_test,y_test)))
    +#now scale the data
    +from sklearn.preprocessing import StandardScaler
    +scaler = StandardScaler()
    +scaler.fit(X_train)
    +X_train_scaled = scaler.transform(X_train)
    +X_test_scaled = scaler.transform(X_test)
    +# Logistic Regression
    +logreg.fit(X_train_scaled, y_train)
    +print("Test set accuracy Logistic Regression with scaled data: {:.2f}".format(logreg.score(X_test_scaled,y_test)))
    +
    +
    +from sklearn.preprocessing import LabelEncoder
    +from sklearn.model_selection import cross_validate
    +#Cross validation
    +accuracy = cross_validate(logreg,X_test_scaled,y_test,cv=10)['test_score']
    +print(accuracy)
    +print("Test set accuracy with Logistic Regression  and scaled data: {:.2f}".format(logreg.score(X_test_scaled,y_test)))
    +
    +
    +import scikitplot as skplt
    +y_pred = logreg.predict(X_test_scaled)
    +skplt.metrics.plot_confusion_matrix(y_test, y_pred, normalize=True)
    +plt.show()
    +y_probas = logreg.predict_proba(X_test_scaled)
    +skplt.metrics.plot_roc(y_test, y_probas)
    +plt.show()
    +skplt.metrics.plot_cumulative_gain(y_test, y_probas)
    +plt.show()
    +
    +
    + + +
    +

    Optimization, the central part of any Machine Learning algortithm

    + +

    +Overview Video, why do we care about gradient methods? + +

    +Almost every problem in machine learning and data science starts with +a dataset \( X \), a model \( g(\beta) \), which is a function of the +parameters \( \beta \) and a cost function \( C(X, g(\beta)) \) that allows +us to judge how well the model \( g(\beta) \) explains the observations +\( X \). The model is fit by finding the values of \( \beta \) that minimize +the cost function. Ideally we would be able to solve for \( \beta \) +analytically, however this is not possible in general and we must use +some approximative/numerical method to compute the minimum. +

    + + +
    +

    Revisiting our Logistic Regression case

    + +

    +In our discussion on Logistic Regression we studied the +case of +two classes, with \( y_i \) either +\( 0 \) or \( 1 \). Furthermore we assumed also that we have only two +parameters \( \beta \) in our fitting, that is we +defined probabilities + +

     
    +$$ +\begin{align*} +p(y_i=1|x_i,\boldsymbol{\beta}) &= \frac{\exp{(\beta_0+\beta_1x_i)}}{1+\exp{(\beta_0+\beta_1x_i)}},\nonumber\\ +p(y_i=0|x_i,\boldsymbol{\beta}) &= 1 - p(y_i=1|x_i,\boldsymbol{\beta}), +\end{align*} +$$ +

     
    + +where \( \boldsymbol{\beta} \) are the weights we wish to extract from data, in our case \( \beta_0 \) and \( \beta_1 \). +

    + + +
    +

    The equations to solve

    + +

    +Our compact equations used a definition of a vector \( \boldsymbol{y} \) with \( n \) +elements \( y_i \), an \( n\times p \) matrix \( \boldsymbol{X} \) which contains the +\( x_i \) values and a vector \( \boldsymbol{p} \) of fitted probabilities +\( p(y_i\vert x_i,\boldsymbol{\beta}) \). We rewrote in a more compact form +the first derivative of the cost function as + +

     
    +$$ +\frac{\partial \mathcal{C}(\boldsymbol{\beta})}{\partial \boldsymbol{\beta}} = -\boldsymbol{X}^T\left(\boldsymbol{y}-\boldsymbol{p}\right). +$$ +

     
    + +

    +If we in addition define a diagonal matrix \( \boldsymbol{W} \) with elements +\( p(y_i\vert x_i,\boldsymbol{\beta})(1-p(y_i\vert x_i,\boldsymbol{\beta}) \), we can obtain a compact expression of the second derivative as + +

     
    +$$ +\frac{\partial^2 \mathcal{C}(\boldsymbol{\beta})}{\partial \boldsymbol{\beta}\partial \boldsymbol{\beta}^T} = \boldsymbol{X}^T\boldsymbol{W}\boldsymbol{X}. +$$ +

     
    + +This defines what is called the Hessian matrix. +

    + + +
    +

    Solving using Newton-Raphson's method

    + +

    +If we can set up these equations, Newton-Raphson's iterative method is normally the method of choice. It requires however that we can compute in an efficient way the matrices that define the first and second derivatives. + +

    +Our iterative scheme is then given by + +

     
    +$$ +\boldsymbol{\beta}^{\mathrm{new}} = \boldsymbol{\beta}^{\mathrm{old}}-\left(\frac{\partial^2 \mathcal{C}(\boldsymbol{\beta})}{\partial \boldsymbol{\beta}\partial \boldsymbol{\beta}^T}\right)^{-1}_{\boldsymbol{\beta}^{\mathrm{old}}}\times \left(\frac{\partial \mathcal{C}(\boldsymbol{\beta})}{\partial \boldsymbol{\beta}}\right)_{\boldsymbol{\beta}^{\mathrm{old}}}, +$$ +

     
    + +or in matrix form as + +

     
    +$$ +\boldsymbol{\beta}^{\mathrm{new}} = \boldsymbol{\beta}^{\mathrm{old}}-\left(\boldsymbol{X}^T\boldsymbol{W}\boldsymbol{X} \right)^{-1}\times \left(-\boldsymbol{X}^T(\boldsymbol{y}-\boldsymbol{p}) \right)_{\boldsymbol{\beta}^{\mathrm{old}}}. +$$ +

     
    + +The right-hand side is computed with the old values of \( \beta \). + +

    +If we can compute these matrices, in particular the Hessian, the above is often the easiest method to implement. +

    + + +
    +

    Brief reminder on Newton-Raphson's method

    + +

    +Let us quickly remind ourselves how we derive the above method. + +

    +Perhaps the most celebrated of all one-dimensional root-finding +routines is Newton's method, also called the Newton-Raphson +method. This method requires the evaluation of both the +function \( f \) and its derivative \( f' \) at arbitrary points. +If you can only calculate the derivative +numerically and/or your function is not of the smooth type, we +normally discourage the use of this method. +

    + + +
    +

    The equations

    + +

    +The Newton-Raphson formula consists geometrically of extending the +tangent line at a current point until it crosses zero, then setting +the next guess to the abscissa of that zero-crossing. The mathematics +behind this method is rather simple. Employing a Taylor expansion for +\( x \) sufficiently close to the solution \( s \), we have + +

     
    +$$ + f(s)=0=f(x)+(s-x)f'(x)+\frac{(s-x)^2}{2}f''(x) +\dots. + \tag{14} +$$ +

     
    + +

    +For small enough values of the function and for well-behaved +functions, the terms beyond linear are unimportant, hence we obtain + +

     
    +$$ + f(x)+(s-x)f'(x)\approx 0, +$$ +

     
    + +yielding +

     
    +$$ + s\approx x-\frac{f(x)}{f'(x)}. +$$ +

     
    + +

    +Having in mind an iterative procedure, it is natural to start iterating with +

     
    +$$ + x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)}. +$$ +

     
    +

    + + +
    +

    Simple geometric interpretation

    + +

    +The above is Newton-Raphson's method. It has a simple geometric +interpretation, namely \( x_{n+1} \) is the point where the tangent from +\( (x_n,f(x_n)) \) crosses the \( x \)-axis. Close to the solution, +Newton-Raphson converges fast to the desired result. However, if we +are far from a root, where the higher-order terms in the series are +important, the Newton-Raphson formula can give grossly inaccurate +results. For instance, the initial guess for the root might be so far +from the true root as to let the search interval include a local +maximum or minimum of the function. If an iteration places a trial +guess near such a local extremum, so that the first derivative nearly +vanishes, then Newton-Raphson may fail totally +

    + + +
    +

    Extending to more than one variable

    + +

    +Newton's method can be generalized to systems of several non-linear equations +and variables. Consider the case with two equations +

     
    +$$ + \begin{array}{cc} f_1(x_1,x_2) &=0\\ + f_2(x_1,x_2) &=0,\end{array} +$$ +

     
    + +which we Taylor expand to obtain + +

     
    +$$ + \begin{array}{cc} 0=f_1(x_1+h_1,x_2+h_2)=&f_1(x_1,x_2)+h_1 + \partial f_1/\partial x_1+h_2 + \partial f_1/\partial x_2+\dots\\ + 0=f_2(x_1+h_1,x_2+h_2)=&f_2(x_1,x_2)+h_1 + \partial f_2/\partial x_1+h_2 + \partial f_2/\partial x_2+\dots + \end{array}. +$$ +

     
    + +Defining the Jacobian matrix \( {\bf \boldsymbol{J}} \) we have +

     
    +$$ + {\bf \boldsymbol{J}}=\left( \begin{array}{cc} + \partial f_1/\partial x_1 & \partial f_1/\partial x_2 \\ + \partial f_2/\partial x_1 &\partial f_2/\partial x_2 + \end{array} \right), +$$ +

     
    + +we can rephrase Newton's method as +

     
    +$$ +\left(\begin{array}{c} x_1^{n+1} \\ x_2^{n+1} \end{array} \right)= +\left(\begin{array}{c} x_1^{n} \\ x_2^{n} \end{array} \right)+ +\left(\begin{array}{c} h_1^{n} \\ h_2^{n} \end{array} \right), +$$ +

     
    + +where we have defined +

     
    +$$ + \left(\begin{array}{c} h_1^{n} \\ h_2^{n} \end{array} \right)= + -{\bf \boldsymbol{J}}^{-1} + \left(\begin{array}{c} f_1(x_1^{n},x_2^{n}) \\ f_2(x_1^{n},x_2^{n}) \end{array} \right). +$$ +

     
    + +We need thus to compute the inverse of the Jacobian matrix and it +is to understand that difficulties may +arise in case \( {\bf \boldsymbol{J}} \) is nearly singular. + +

    +It is rather straightforward to extend the above scheme to systems of +more than two non-linear equations. In our case, the Jacobian matrix is given by the Hessian that represents the second derivative of cost function. +

    + + +
    +

    Steepest descent

    + +

    +The basic idea of gradient descent is +that a function \( F(\mathbf{x}) \), +\( \mathbf{x} \equiv (x_1,\cdots,x_n) \), decreases fastest if one goes from \( \bf {x} \) in the +direction of the negative gradient \( -\nabla F(\mathbf{x}) \). + +

    +It can be shown that if +

     
    +$$ +\mathbf{x}_{k+1} = \mathbf{x}_k - \gamma_k \nabla F(\mathbf{x}_k), +$$ +

     
    + +with \( \gamma_k > 0 \). + +

    +For \( \gamma_k \) small enough, then \( F(\mathbf{x}_{k+1}) \leq +F(\mathbf{x}_k) \). This means that for a sufficiently small \( \gamma_k \) +we are always moving towards smaller function values, i.e a minimum. +

    + + +
    +

    More on Steepest descent

    + +

    +The previous observation is the basis of the method of steepest +descent, which is also referred to as just gradient descent (GD). One +starts with an initial guess \( \mathbf{x}_0 \) for a minimum of \( F \) and +computes new approximations according to + +

     
    +$$ +\mathbf{x}_{k+1} = \mathbf{x}_k - \gamma_k \nabla F(\mathbf{x}_k), \ \ k \geq 0. +$$ +

     
    + +

    +The parameter \( \gamma_k \) is often referred to as the step length or +the learning rate within the context of Machine Learning. +

    + + +
    +

    The ideal

    + +

    +Ideally the sequence \( \{\mathbf{x}_k \}_{k=0} \) converges to a global +minimum of the function \( F \). In general we do not know if we are in a +global or local minimum. In the special case when \( F \) is a convex +function, all local minima are also global minima, so in this case +gradient descent can converge to the global solution. The advantage of +this scheme is that it is conceptually simple and straightforward to +implement. However the method in this form has some severe +limitations: + +

    +In machine learing we are often faced with non-convex high dimensional +cost functions with many local minima. Since GD is deterministic we +will get stuck in a local minimum, if the method converges, unless we +have a very good intial guess. This also implies that the scheme is +sensitive to the chosen initial condition. + +

    +Note that the gradient is a function of \( \mathbf{x} = +(x_1,\cdots,x_n) \) which makes it expensive to compute numerically. +

    + + +
    +

    The sensitiveness of the gradient descent

    + +

    +The gradient descent method +is sensitive to the choice of learning rate \( \gamma_k \). This is due +to the fact that we are only guaranteed that \( F(\mathbf{x}_{k+1}) \leq +F(\mathbf{x}_k) \) for sufficiently small \( \gamma_k \). The problem is to +determine an optimal learning rate. If the learning rate is chosen too +small the method will take a long time to converge and if it is too +large we can experience erratic behavior. + +

    +Many of these shortcomings can be alleviated by introducing +randomness. One such method is that of Stochastic Gradient Descent +(SGD), see below. +

    + + +
    +

    Convex functions

    + +

    +Ideally we want our cost/loss function to be convex(concave). + +

    +First we give the definition of a convex set: A set \( C \) in +\( \mathbb{R}^n \) is said to be convex if, for all \( x \) and \( y \) in \( C \) and +all \( t \in (0,1) \) , the point \( (1 − t)x + ty \) also belongs to +C. Geometrically this means that every point on the line segment +connecting \( x \) and \( y \) is in \( C \) as discussed below. + +

    +The convex subsets of \( \mathbb{R} \) are the intervals of +\( \mathbb{R} \). Examples of convex sets of \( \mathbb{R}^2 \) are the +regular polygons (triangles, rectangles, pentagons, etc...). +

    + + +
    +

    Convex function

    + +

    +Convex function: Let \( X \subset \mathbb{R}^n \) be a convex set. Assume that the function \( f: X \rightarrow \mathbb{R} \) is continuous, then \( f \) is said to be convex if

     
    +$$f(tx_1 + (1-t)x_2) \leq tf(x_1) + (1-t)f(x_2) $$ +

     
    for all \( x_1, x_2 \in X \) and for all \( t \in [0,1] \). If \( \leq \) is replaced with a strict inequaltiy in the definition, we demand \( x_1 \neq x_2 \) and \( t\in(0,1) \) then \( f \) is said to be strictly convex. For a single variable function, convexity means that if you draw a straight line connecting \( f(x_1) \) and \( f(x_2) \), the value of the function on the interval \( [x_1,x_2] \) is always below the line as illustrated below. +

    + + +
    +

    Conditions on convex functions

    + +

    +In the following we state first and second-order conditions which +ensures convexity of a function \( f \). We write \( D_f \) to denote the +domain of \( f \), i.e the subset of \( R^n \) where \( f \) is defined. For more +details and proofs we refer to: S. Boyd and L. Vandenberghe. Convex Optimization. Cambridge University Press. + +

    +

    +First order condition +

    +Suppose \( f \) is differentiable (i.e \( \nabla f(x) \) is well defined for +all \( x \) in the domain of \( f \)). Then \( f \) is convex if and only if \( D_f \) +is a convex set and

     
    +$$f(y) \geq f(x) + \nabla f(x)^T (y-x) $$ +

     
    holds +for all \( x,y \in D_f \). This condition means that for a convex function +the first order Taylor expansion (right hand side above) at any point +a global under estimator of the function. To convince yourself you can +make a drawing of \( f(x) = x^2+1 \) and draw the tangent line to \( f(x) \) and +note that it is always below the graph. +

    + +

    +

    +Second order condition +

    +Assume that \( f \) is twice +differentiable, i.e the Hessian matrix exists at each point in +\( D_f \). Then \( f \) is convex if and only if \( D_f \) is a convex set and its +Hessian is positive semi-definite for all \( x\in D_f \). For a +single-variable function this reduces to \( f''(x) \geq 0 \). Geometrically this means that \( f \) has nonnegative curvature +everywhere. +

    + +

    +This condition is particularly useful since it gives us an procedure for determining if the function under consideration is convex, apart from using the definition. +

    + + +
    +

    More on convex functions

    + +

    +The next result is of great importance to us and the reason why we are +going on about convex functions. In machine learning we frequently +have to minimize a loss/cost function in order to find the best +parameters for the model we are considering. + +

    +Ideally we want the +global minimum (for high-dimensional models it is hard to know +if we have local or global minimum). However, if the cost/loss function +is convex the following result provides invaluable information: + +

    +

    +Any minimum is global for convex functions +

    +Consider the problem of finding \( x \in \mathbb{R}^n \) such that \( f(x) \) +is minimal, where \( f \) is convex and differentiable. Then, any point +\( x^* \) that satisfies \( \nabla f(x^*) = 0 \) is a global minimum. +

    + +

    +This result means that if we know that the cost/loss function is convex and we are able to find a minimum, we are guaranteed that it is a global minimum. +

    + + +
    +

    Some simple problems

    + +
      +

    1. Show that \( f(x)=x^2 \) is convex for \( x \in \mathbb{R} \) using the definition of convexity. Hint: If you re-write the definition, \( f \) is convex if the following holds for all \( x,y \in D_f \) and any \( \lambda \in [0,1] \) $\lambda f(x)+(1-\lambda)f(y)-f(\lambda x + (1-\lambda) y ) \geq 0$.
    2. +

    3. Using the second order condition show that the following functions are convex on the specified domain.
    4. + +
        +

      • \( f(x) = e^x \) is convex for \( x \in \mathbb{R} \).
      • +

      • \( g(x) = -\ln(x) \) is convex for \( x \in (0,\infty) \).
      • +
      +

    5. Let \( f(x) = x^2 \) and \( g(x) = e^x \). Show that \( f(g(x)) \) and \( g(f(x)) \) is convex for \( x \in \mathbb{R} \). Also show that if \( f(x) \) is any convex function than \( h(x) = e^{f(x)} \) is convex.
    6. +

    7. A norm is any function that satisfy the following properties
    8. + +
        +

      • \( f(\alpha x) = |\alpha| f(x) \) for all \( \alpha \in \mathbb{R} \).
      • +

      • \( f(x+y) \leq f(x) + f(y) \)
      • +

      • \( f(x) \leq 0 \) for all \( x \in \mathbb{R}^n \) with equality if and only if \( x = 0 \)
      • +
      +

      +

    +

    + +Using the definition of convexity, try to show that a function satisfying the properties above is convex (the third condition is not needed to show this). +

    + + +
    +

    Friday September 25

    + +

    +Video of Lecture and link to handwritten notes. +

    + + +
    +

    Standard steepest descent

    + +

    +Before we proceed, we would like to discuss the approach called the +standard Steepest descent (different from the above steepest descent discussion), which again leads to us having to be able +to compute a matrix. It belongs to the class of Conjugate Gradient methods (CG). + +

    +The success of the CG method +for finding solutions of non-linear problems is based on the theory +of conjugate gradients for linear systems of equations. It belongs to +the class of iterative methods for solving problems from linear +algebra of the type +

     
    +$$ +\begin{equation*} +\boldsymbol{A}\boldsymbol{x} = \boldsymbol{b}. +\end{equation*} +$$ +

     
    + +

    +In the iterative process we end up with a problem like + +

     
    +$$ +\begin{equation*} + \boldsymbol{r}= \boldsymbol{b}-\boldsymbol{A}\boldsymbol{x}, +\end{equation*} +$$ +

     
    + +where \( \boldsymbol{r} \) is the so-called residual or error in the iterative process. + +

    +When we have found the exact solution, \( \boldsymbol{r}=0 \). +

    + + +
    +

    Gradient method

    + +

    +The residual is zero when we reach the minimum of the quadratic equation +

     
    +$$ +\begin{equation*} + P(\boldsymbol{x})=\frac{1}{2}\boldsymbol{x}^T\boldsymbol{A}\boldsymbol{x} - \boldsymbol{x}^T\boldsymbol{b}, +\end{equation*} +$$ +

     
    + +

    +with the constraint that the matrix \( \boldsymbol{A} \) is positive definite and +symmetric. This defines also the Hessian and we want it to be positive definite. +

    + + +
    +

    Steepest descent method

    + +

    +We denote the initial guess for \( \boldsymbol{x} \) as \( \boldsymbol{x}_0 \). +We can assume without loss of generality that +

     
    +$$ +\begin{equation*} +\boldsymbol{x}_0=0, +\end{equation*} +$$ +

     
    + +or consider the system +

     
    +$$ +\begin{equation*} +\boldsymbol{A}\boldsymbol{z} = \boldsymbol{b}-\boldsymbol{A}\boldsymbol{x}_0, +\end{equation*} +$$ +

     
    + +instead. +

    + + +
    +

    Steepest descent method

    +
    + +

    +One can show that the solution \( \boldsymbol{x} \) is also the unique minimizer of the quadratic form +

     
    +$$ +\begin{equation*} + f(\boldsymbol{x}) = \frac{1}{2}\boldsymbol{x}^T\boldsymbol{A}\boldsymbol{x} - \boldsymbol{x}^T \boldsymbol{x} , \quad \boldsymbol{x}\in\mathbf{R}^n. +\end{equation*} +$$ +

     
    + +This suggests taking the first basis vector \( \boldsymbol{r}_1 \) (see below for definition) +to be the gradient of \( f \) at \( \boldsymbol{x}=\boldsymbol{x}_0 \), +which equals +

     
    +$$ +\begin{equation*} +\boldsymbol{A}\boldsymbol{x}_0-\boldsymbol{b}, +\end{equation*} +$$ +

     
    + +and +\( \boldsymbol{x}_0=0 \) it is equal \( -\boldsymbol{b} \). + + +

    +
    + + +
    +

    Final expressions

    +
    + +

    +We can compute the residual iteratively as +

     
    +$$ +\begin{equation*} +\boldsymbol{r}_{k+1}=\boldsymbol{b}-\boldsymbol{A}\boldsymbol{x}_{k+1}, + \end{equation*} +$$ +

     
    + +which equals +

     
    +$$ +\begin{equation*} +\boldsymbol{b}-\boldsymbol{A}(\boldsymbol{x}_k+\alpha_k\boldsymbol{r}_k), + \end{equation*} +$$ +

     
    + +or +

     
    +$$ +\begin{equation*} +(\boldsymbol{b}-\boldsymbol{A}\boldsymbol{x}_k)-\alpha_k\boldsymbol{A}\boldsymbol{r}_k, + \end{equation*} +$$ +

     
    + +which gives + +

     
    +$$ +\alpha_k = \frac{\boldsymbol{r}_k^T\boldsymbol{r}_k}{\boldsymbol{r}_k^T\boldsymbol{A}\boldsymbol{r}_k} +$$ +

     
    + +leading to the iterative scheme +

     
    +$$ +\begin{equation*} +\boldsymbol{x}_{k+1}=\boldsymbol{x}_k-\alpha_k\boldsymbol{r}_{k}, + \end{equation*} +$$ +

     
    +

    +
    + + +
    +

    Steepest descent example

    + +

    + + +

    import numpy as np
    +import numpy.linalg as la
    +
    +import scipy.optimize as sopt
    +
    +import matplotlib.pyplot as pt
    +from mpl_toolkits.mplot3d import axes3d
    +
    +def f(x):
    +    return 0.5*x[0]**2 + 2.5*x[1]**2
    +
    +def df(x):
    +    return np.array([x[0], 5*x[1]])
    +
    +fig = pt.figure()
    +ax = fig.gca(projection="3d")
    +
    +xmesh, ymesh = np.mgrid[-2:2:50j,-2:2:50j]
    +fmesh = f(np.array([xmesh, ymesh]))
    +ax.plot_surface(xmesh, ymesh, fmesh)
    +
    +

    +And then as countor plot +

    + + +

    pt.axis("equal")
    +pt.contour(xmesh, ymesh, fmesh)
    +guesses = [np.array([2, 2./5])]
    +
    +

    +Find guesses +

    + + +

    x = guesses[-1]
    +s = -df(x)
    +
    +

    +Run it! +

    + + +

    def f1d(alpha):
    +    return f(x + alpha*s)
    +
    +alpha_opt = sopt.golden(f1d)
    +next_guess = x + alpha_opt * s
    +guesses.append(next_guess)
    +print(next_guess)
    +
    +

    +What happened? +

    + + +

    pt.axis("equal")
    +pt.contour(xmesh, ymesh, fmesh, 50)
    +it_array = np.array(guesses)
    +pt.plot(it_array.T[0], it_array.T[1], "x-")
    +
    +
    + + +
    +

    Conjugate gradient method

    +
    + +

    +In the CG method we define so-called conjugate directions and two vectors +\( \boldsymbol{s} \) and \( \boldsymbol{t} \) +are said to be +conjugate if +

     
    +$$ +\begin{equation*} +\boldsymbol{s}^T\boldsymbol{A}\boldsymbol{t}= 0. +\end{equation*} +$$ +

     
    + +The philosophy of the CG method is to perform searches in various conjugate directions +of our vectors \( \boldsymbol{x}_i \) obeying the above criterion, namely +

     
    +$$ +\begin{equation*} +\boldsymbol{x}_i^T\boldsymbol{A}\boldsymbol{x}_j= 0. +\end{equation*} +$$ +

     
    + +Two vectors are conjugate if they are orthogonal with respect to +this inner product. Being conjugate is a symmetric relation: if \( \boldsymbol{s} \) is conjugate to \( \boldsymbol{t} \), then \( \boldsymbol{t} \) is conjugate to \( \boldsymbol{s} \). +

    +
    + + +
    +

    Conjugate gradient method

    +
    + +

    +An example is given by the eigenvectors of the matrix +

     
    +$$ +\begin{equation*} +\boldsymbol{v}_i^T\boldsymbol{A}\boldsymbol{v}_j= \lambda\boldsymbol{v}_i^T\boldsymbol{v}_j, +\end{equation*} +$$ +

     
    + +which is zero unless \( i=j \). +

    +
    + + +
    +

    Conjugate gradient method

    +
    + +

    +Assume now that we have a symmetric positive-definite matrix \( \boldsymbol{A} \) of size +\( n\times n \). At each iteration \( i+1 \) we obtain the conjugate direction of a vector +

     
    +$$ +\begin{equation*} +\boldsymbol{x}_{i+1}=\boldsymbol{x}_{i}+\alpha_i\boldsymbol{p}_{i}. +\end{equation*} +$$ +

     
    + +We assume that \( \boldsymbol{p}_{i} \) is a sequence of \( n \) mutually conjugate directions. +Then the \( \boldsymbol{p}_{i} \) form a basis of \( R^n \) and we can expand the solution +$ \boldsymbol{A}\boldsymbol{x} = \boldsymbol{b}$ in this basis, namely + +

     
    +$$ +\begin{equation*} + \boldsymbol{x} = \sum^{n}_{i=1} \alpha_i \boldsymbol{p}_i. +\end{equation*} +$$ +

     
    +

    +
    + + +
    +

    Conjugate gradient method

    +
    + +

    +The coefficients are given by +

     
    +$$ +\begin{equation*} + \mathbf{A}\mathbf{x} = \sum^{n}_{i=1} \alpha_i \mathbf{A} \mathbf{p}_i = \mathbf{b}. +\end{equation*} +$$ +

     
    + +Multiplying with \( \boldsymbol{p}_k^T \) from the left gives + +

     
    +$$ +\begin{equation*} + \boldsymbol{p}_k^T \boldsymbol{A}\boldsymbol{x} = \sum^{n}_{i=1} \alpha_i\boldsymbol{p}_k^T \boldsymbol{A}\boldsymbol{p}_i= \boldsymbol{p}_k^T \boldsymbol{b}, +\end{equation*} +$$ +

     
    + +and we can define the coefficients \( \alpha_k \) as + +

     
    +$$ +\begin{equation*} + \alpha_k = \frac{\boldsymbol{p}_k^T \boldsymbol{b}}{\boldsymbol{p}_k^T \boldsymbol{A} \boldsymbol{p}_k} +\end{equation*} +$$ +

     
    +

    +
    + + +
    +

    Conjugate gradient method and iterations

    +
    + +

    +If we choose the conjugate vectors \( \boldsymbol{p}_k \) carefully, +then we may not need all of them to obtain a good approximation to the solution +\( \boldsymbol{x} \). +We want to regard the conjugate gradient method as an iterative method. +This will us to solve systems where \( n \) is so large that the direct +method would take too much time. + +

    +We denote the initial guess for \( \boldsymbol{x} \) as \( \boldsymbol{x}_0 \). +We can assume without loss of generality that +

     
    +$$ +\begin{equation*} +\boldsymbol{x}_0=0, +\end{equation*} +$$ +

     
    + +or consider the system +

     
    +$$ +\begin{equation*} +\boldsymbol{A}\boldsymbol{z} = \boldsymbol{b}-\boldsymbol{A}\boldsymbol{x}_0, +\end{equation*} +$$ +

     
    + +instead. +

    +
    + + +
    +

    Conjugate gradient method

    +
    + +

    +One can show that the solution \( \boldsymbol{x} \) is also the unique minimizer of the quadratic form +

     
    +$$ +\begin{equation*} + f(\boldsymbol{x}) = \frac{1}{2}\boldsymbol{x}^T\boldsymbol{A}\boldsymbol{x} - \boldsymbol{x}^T \boldsymbol{x} , \quad \boldsymbol{x}\in\mathbf{R}^n. +\end{equation*} +$$ +

     
    + +This suggests taking the first basis vector \( \boldsymbol{p}_1 \) +to be the gradient of \( f \) at \( \boldsymbol{x}=\boldsymbol{x}_0 \), +which equals +

     
    +$$ +\begin{equation*} +\boldsymbol{A}\boldsymbol{x}_0-\boldsymbol{b}, +\end{equation*} +$$ +

     
    + +and +\( \boldsymbol{x}_0=0 \) it is equal \( -\boldsymbol{b} \). +The other vectors in the basis will be conjugate to the gradient, +hence the name conjugate gradient method. +

    +
    + + +
    +

    Conjugate gradient method

    +
    + +

    +Let \( \boldsymbol{r}_k \) be the residual at the \( k \)-th step: +

     
    +$$ +\begin{equation*} +\boldsymbol{r}_k=\boldsymbol{b}-\boldsymbol{A}\boldsymbol{x}_k. +\end{equation*} +$$ +

     
    + +Note that \( \boldsymbol{r}_k \) is the negative gradient of \( f \) at +\( \boldsymbol{x}=\boldsymbol{x}_k \), +so the gradient descent method would be to move in the direction \( \boldsymbol{r}_k \). +Here, we insist that the directions \( \boldsymbol{p}_k \) are conjugate to each other, +so we take the direction closest to the gradient \( \boldsymbol{r}_k \) +under the conjugacy constraint. +This gives the following expression +

     
    +$$ +\begin{equation*} +\boldsymbol{p}_{k+1}=\boldsymbol{r}_k-\frac{\boldsymbol{p}_k^T \boldsymbol{A}\boldsymbol{r}_k}{\boldsymbol{p}_k^T\boldsymbol{A}\boldsymbol{p}_k} \boldsymbol{p}_k. +\end{equation*} +$$ +

     
    +

    +
    + + +
    +

    Conjugate gradient method

    +
    + +

    +We can also compute the residual iteratively as +

     
    +$$ +\begin{equation*} +\boldsymbol{r}_{k+1}=\boldsymbol{b}-\boldsymbol{A}\boldsymbol{x}_{k+1}, + \end{equation*} +$$ +

     
    + +which equals +

     
    +$$ +\begin{equation*} +\boldsymbol{b}-\boldsymbol{A}(\boldsymbol{x}_k+\alpha_k\boldsymbol{p}_k), + \end{equation*} +$$ +

     
    + +or +

     
    +$$ +\begin{equation*} +(\boldsymbol{b}-\boldsymbol{A}\boldsymbol{x}_k)-\alpha_k\boldsymbol{A}\boldsymbol{p}_k, + \end{equation*} +$$ +

     
    + +which gives + +

     
    +$$ +\begin{equation*} +\boldsymbol{r}_{k+1}=\boldsymbol{r}_k-\boldsymbol{A}\boldsymbol{p}_{k}, + \end{equation*} +$$ +

     
    +

    +
    + + +
    +

    Revisiting some of our first Linear Regression Encounters

    + +

    +We will use linear regression as a case study for the gradient descent +methods. Linear regression is a great test case for the gradient +descent methods discussed in the lectures since it has several +desirable properties such as: + +

      +

    1. An analytical solution (recall homework set 1).
    2. +

    3. The gradient can be computed analytically.
    4. +

    5. The cost function is convex which guarantees that gradient descent converges for small enough learning rates
    6. +
    +

    + +We revisit an example similar to what we had in the first homework set. We had a function of the type + +

    + + +

    x = 2*np.random.rand(m,1)
    +y = 4+3*x+np.random.randn(m,1)
    +
    +

    +with \( x_i \in [0,1] \) is chosen randomly using a uniform distribution. Additionally we have a stochastic noise chosen according to a normal distribution \( \cal {N}(0,1) \). +The linear regression model is given by +

     
    +$$ +h_\beta(x) = \boldsymbol{y} = \beta_0 + \beta_1 x, +$$ +

     
    + +such that +

     
    +$$ +\boldsymbol{y}_i = \beta_0 + \beta_1 x_i. +$$ +

     
    +

    + + +
    +

    Gradient descent example

    + +

    +Let \( \mathbf{y} = (y_1,\cdots,y_n)^T \), \( \mathbf{\boldsymbol{y}} = (\boldsymbol{y}_1,\cdots,\boldsymbol{y}_n)^T \) and \( \beta = (\beta_0, \beta_1)^T \) + +

    +It is convenient to write \( \mathbf{\boldsymbol{y}} = X\beta \) where \( X \in \mathbb{R}^{100 \times 2} \) is the design matrix given by (we keep the intercept here) +

     
    +$$ +X \equiv \begin{bmatrix} +1 & x_1 \\ +\vdots & \vdots \\ +1 & x_{100} & \\ +\end{bmatrix}. +$$ +

     
    + +The cost/loss/risk function is given by ( +

     
    +$$ +C(\beta) = \frac{1}{n}||X\beta-\mathbf{y}||_{2}^{2} = \frac{1}{n}\sum_{i=1}^{100}\left[ (\beta_0 + \beta_1 x_i)^2 - 2 y_i (\beta_0 + \beta_1 x_i) + y_i^2\right] +$$ +

     
    + +and we want to find \( \beta \) such that \( C(\beta) \) is minimized. +

    + + +
    +

    The derivative of the cost/loss function

    + +

    +Computing \( \partial C(\beta) / \partial \beta_0 \) and \( \partial C(\beta) / \partial \beta_1 \) we can show that the gradient can be written as +

     
    +$$ +\nabla_{\beta} C(\beta) = \frac{2}{n}\begin{bmatrix} \sum_{i=1}^{100} \left(\beta_0+\beta_1x_i-y_i\right) \\ +\sum_{i=1}^{100}\left( x_i (\beta_0+\beta_1x_i)-y_ix_i\right) \\ +\end{bmatrix} = \frac{2}{n}X^T(X\beta - \mathbf{y}), +$$ +

     
    + +where \( X \) is the design matrix defined above. +

    + + +
    +

    The Hessian matrix

    +The Hessian matrix of \( C(\beta) \) is given by +

     
    +$$ +\boldsymbol{H} \equiv \begin{bmatrix} +\frac{\partial^2 C(\beta)}{\partial \beta_0^2} & \frac{\partial^2 C(\beta)}{\partial \beta_0 \partial \beta_1} \\ +\frac{\partial^2 C(\beta)}{\partial \beta_0 \partial \beta_1} & \frac{\partial^2 C(\beta)}{\partial \beta_1^2} & \\ +\end{bmatrix} = \frac{2}{n}X^T X. +$$ +

     
    + +This result implies that \( C(\beta) \) is a convex function since the matrix \( X^T X \) always is positive semi-definite. +

    + + +
    +

    Simple program

    + +

    +We can now write a program that minimizes \( C(\beta) \) using the gradient descent method with a constant learning rate \( \gamma \) according to +

     
    +$$ +\beta_{k+1} = \beta_k - \gamma \nabla_\beta C(\beta_k), \ k=0,1,\cdots +$$ +

     
    + +

    +We can use the expression we computed for the gradient and let use a +\( \beta_0 \) be chosen randomly and let \( \gamma = 0.001 \). Stop iterating +when \( ||\nabla_\beta C(\beta_k) || \leq \epsilon = 10^{-8} \). Note that the code below does not include the latter stop criterion. + +

    +And finally we can compare our solution for \( \beta \) with the analytic result given by +\( \beta= (X^TX)^{-1} X^T \mathbf{y} \). +

    + + +
    +

    Gradient Descent Example

    + +

    +Here our simple example +

    + + +

    # Importing various packages
    +from random import random, seed
    +import numpy as np
    +import matplotlib.pyplot as plt
    +from mpl_toolkits.mplot3d import Axes3D
    +from matplotlib import cm
    +from matplotlib.ticker import LinearLocator, FormatStrFormatter
    +import sys
    +
    +# the number of datapoints
    +n = 100
    +x = 2*np.random.rand(n,1)
    +y = 4+3*x+np.random.randn(n,1)
    +
    +X = np.c_[np.ones((n,1)), x]
    +# Hessian matrix
    +H = (2.0/n)* X.T @ X
    +# Get the eigenvalues
    +EigValues, EigVectors = np.linalg.eig(H)
    +print(EigValues)
    +
    +beta_linreg = np.linalg.inv(X.T @ X) @ X.T @ y
    +print(beta_linreg)
    +beta = np.random.randn(2,1)
    +
    +eta = 1.0/np.max(EigValues)
    +Niterations = 1000
    +
    +for iter in range(Niterations):
    +    gradient = (2.0/n)*X.T @ (X @ beta-y)
    +    beta -= eta*gradient
    +
    +print(beta)
    +xnew = np.array([[0],[2]])
    +xbnew = np.c_[np.ones((2,1)), xnew]
    +ypredict = xbnew.dot(beta)
    +ypredict2 = xbnew.dot(beta_linreg)
    +plt.plot(xnew, ypredict, "r-")
    +plt.plot(xnew, ypredict2, "b-")
    +plt.plot(x, y ,'ro')
    +plt.axis([0,2.0,0, 15.0])
    +plt.xlabel(r'$x$')
    +plt.ylabel(r'$y$')
    +plt.title(r'Gradient descent example')
    +plt.show()
    +
    +
    + + +
    +

    And a corresponding example using scikit-learn

    + +

    + + +

    # Importing various packages
    +from random import random, seed
    +import numpy as np
    +import matplotlib.pyplot as plt
    +from sklearn.linear_model import SGDRegressor
    +
    +n = 100
    +x = 2*np.random.rand(n,1)
    +y = 4+3*x+np.random.randn(n,1)
    +
    +X = np.c_[np.ones((n,1)), x]
    +beta_linreg = np.linalg.inv(X.T @ X) @ (X.T @ y)
    +print(beta_linreg)
    +sgdreg = SGDRegressor(max_iter = 50, penalty=None, eta0=0.1)
    +sgdreg.fit(x,y.ravel())
    +print(sgdreg.intercept_, sgdreg.coef_)
    +
    +
    + + +
    +

    Gradient descent and Ridge

    + +

    +We have also discussed Ridge regression where the loss function contains a regularized term given by the \( L_2 \) norm of \( \beta \), +

     
    +$$ +C_{\text{ridge}}(\beta) = \frac{1}{n}||X\beta -\mathbf{y}||^2 + \lambda ||\beta||^2, \ \lambda \geq 0. +$$ +

     
    + +

    +In order to minimize \( C_{\text{ridge}}(\beta) \) using GD we only have adjust the gradient as follows +

     
    +$$ +\nabla_\beta C_{\text{ridge}}(\beta) = \frac{2}{n}\begin{bmatrix} \sum_{i=1}^{100} \left(\beta_0+\beta_1x_i-y_i\right) \\ +\sum_{i=1}^{100}\left( x_i (\beta_0+\beta_1x_i)-y_ix_i\right) \\ +\end{bmatrix} + 2\lambda\begin{bmatrix} \beta_0 \\ \beta_1\end{bmatrix} = 2 (X^T(X\beta - \mathbf{y})+\lambda \beta). +$$ +

     
    + +

    +We can easily extend our program to minimize \( C_{\text{ridge}}(\beta) \) using gradient descent and compare with the analytical solution given by +

     
    +$$ +\beta_{\text{ridge}} = \left(X^T X + \lambda I_{2 \times 2} \right)^{-1} X^T \mathbf{y}. +$$ +

     
    +

    + + +
    +

    Program example for gradient descent with Ridge Regression

    +

    + + +

    from random import random, seed
    +import numpy as np
    +import matplotlib.pyplot as plt
    +from mpl_toolkits.mplot3d import Axes3D
    +from matplotlib import cm
    +from matplotlib.ticker import LinearLocator, FormatStrFormatter
    +import sys
    +
    +# the number of datapoints
    +n = 100
    +x = 2*np.random.rand(n,1)
    +y = 4+3*x+np.random.randn(n,1)
    +
    +X = np.c_[np.ones((n,1)), x]
    +XT_X = X.T @ X
    +
    +#Ridge parameter lambda
    +lmbda  = 0.001
    +Id = lmbda* np.eye(XT_X.shape[0])
    +
    +beta_linreg = np.linalg.inv(XT_X+Id) @ X.T @ y
    +print(beta_linreg)
    +# Start plain gradient descent
    +beta = np.random.randn(2,1)
    +
    +eta = 0.1
    +Niterations = 100
    +
    +for iter in range(Niterations):
    +    gradients = 2.0/n*X.T @ (X @ (beta)-y)+2*lmbda*beta
    +    beta -= eta*gradients
    +
    +print(beta)
    +ypredict = X @ beta
    +ypredict2 = X @ beta_linreg
    +plt.plot(x, ypredict, "r-")
    +plt.plot(x, ypredict2, "b-")
    +plt.plot(x, y ,'ro')
    +plt.axis([0,2.0,0, 15.0])
    +plt.xlabel(r'$x$')
    +plt.ylabel(r'$y$')
    +plt.title(r'Gradient descent example for Ridge')
    +plt.show()
    +
    +
    + + +
    +

    Using gradient descent methods, limitations

    + +
      +

    • Gradient descent (GD) finds local minima of our function. Since the GD algorithm is deterministic, if it converges, it will converge to a local minimum of our cost/loss/risk function. Because in ML we are often dealing with extremely rugged landscapes with many local minima, this can lead to poor performance.
    • +

    • GD is sensitive to initial conditions. One consequence of the local nature of GD is that initial conditions matter. Depending on where one starts, one will end up at a different local minima. Therefore, it is very important to think about how one initializes the training process. This is true for GD as well as more complicated variants of GD.
    • +

    • Gradients are computationally expensive to calculate for large datasets. In many cases in statistics and ML, the cost/loss/risk function is a sum of terms, with one term for each data point. For example, in linear regression, \( E \propto \sum_{i=1}^n (y_i - \mathbf{w}^T\cdot\mathbf{x}_i)^2 \); for logistic regression, the square error is replaced by the cross entropy. To calculate the gradient we have to sum over all \( n \) data points. Doing this at every GD step becomes extremely computationally expensive. An ingenious solution to this, is to calculate the gradients using small subsets of the data called "mini batches". This has the added benefit of introducing stochasticity into our algorithm.
    • +

    • GD is very sensitive to choices of learning rates. GD is extremely sensitive to the choice of learning rates. If the learning rate is very small, the training process take an extremely long time. For larger learning rates, GD can diverge and give poor results. Furthermore, depending on what the local landscape looks like, we have to modify the learning rates to ensure convergence. Ideally, we would adaptively choose the learning rates to match the landscape.
    • +

    • GD treats all directions in parameter space uniformly. Another major drawback of GD is that unlike Newton's method, the learning rate for GD is the same in all directions in parameter space. For this reason, the maximum learning rate is set by the behavior of the steepest direction and this can significantly slow down training. Ideally, we would like to take large steps in flat directions and small steps in steep directions. Since we are exploring rugged landscapes where curvatures change, this requires us to keep track of not only the gradient but second derivatives. The ideal scenario would be to calculate the Hessian but this proves to be too computationally expensive.
    • +

    • GD can take exponential time to escape saddle points, even with random initialization. As we mentioned, GD is extremely sensitive to initial condition since it determines the particular local minimum GD would eventually reach. However, even with a good initialization scheme, through the introduction of randomness, GD can still take exponential time to escape saddle points. This leads us to our next topic, Stochastic Gradient Methods.
    • +
    +
    + + + +
    +
    + + + + + + + + + + + + diff --git a/doc/src/week38/week38-solarized.html b/doc/src/week38/week38-solarized.html new file mode 100644 index 000000000..480bb1016 --- /dev/null +++ b/doc/src/week38/week38-solarized.html @@ -0,0 +1,3568 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Data Analysis and Machine Learning: Logistic Regression

    + +

    + + +

    +Morten Hjorth-Jensen [1, 2] +
    + +

    + + +

    [1] Department of Physics, University of Oslo
    +
    [2] Department of Physics and Astronomy and National Superconducting Cyclotron Laboratory, Michigan State University
    +
    +

    +

    Sep 23, 2021

    +
    +

    +









    + +

    Plans for week 38

    + +
      +
    • Thursday: Summary of regression methods and discussion of project 1. Start Logistic Regression
    • +
    • Video of Lecture September 23
    • +
    • Friday: Logistic Regression and Optimization methods
    • +
    + +









    + +

    Thursday September 23

    + +

    +









    + +

    Ridge and LASSO Regression, reminder

    + +

    +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 +our optimization problem is +$$ +{\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\}. +$$ + +or we can state it as +$$ +{\displaystyle \min_{\boldsymbol{\beta}\in +{\mathbb{R}}^{p}}}\frac{1}{n}\sum_{i=0}^{n-1}\left(y_i-\tilde{y}_i\right)^2=\frac{1}{n}\vert\vert \boldsymbol{y}-\boldsymbol{X}\boldsymbol{\beta}\vert\vert_2^2, +$$ + +where we have used the definition of a norm-2 vector, that is +$$ +\vert\vert \boldsymbol{x}\vert\vert_2 = \sqrt{\sum_i x_i^2}. +$$ + +

    +By minimizing the above equation with respect to the parameters +\( \boldsymbol{\beta} \) we could then obtain an analytical expression for the +parameters \( \boldsymbol{\beta} \). We can add a regularization parameter \( \lambda \) by +defining a new cost function to be optimized, that is + +$$ +{\displaystyle \min_{\boldsymbol{\beta}\in +{\mathbb{R}}^{p}}}\frac{1}{n}\vert\vert \boldsymbol{y}-\boldsymbol{X}\boldsymbol{\beta}\vert\vert_2^2+\lambda\vert\vert \boldsymbol{\beta}\vert\vert_2^2 +$$ + +

    +which leads to the Ridge regression minimization problem where we +require that \( \vert\vert \boldsymbol{\beta}\vert\vert_2^2\le t \), where \( t \) is +a finite number larger than zero. By defining + +$$ +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, +$$ + +

    +we have a new optimization equation +$$ +{\displaystyle \min_{\boldsymbol{\beta}\in +{\mathbb{R}}^{p}}}\frac{1}{n}\vert\vert \boldsymbol{y}-\boldsymbol{X}\boldsymbol{\beta}\vert\vert_2^2+\lambda\vert\vert \boldsymbol{\beta}\vert\vert_1 +$$ + +which leads to Lasso regression. Lasso stands for least absolute shrinkage and selection operator. + +

    +Here we have defined the norm-1 as +$$ +\vert\vert \boldsymbol{x}\vert\vert_1 = \sum_i \vert x_i\vert. +$$ + +

    + + +

    Various steps in cross-validation

    + +

    +When the repetitive splitting of the data set is done randomly, +samples may accidently end up in a fast majority of the splits in +either training or test set. Such samples may have an unbalanced +influence on either model building or prediction evaluation. To avoid +this \( k \)-fold cross-validation structures the data splitting. The +samples are divided into \( k \) more or less equally sized exhaustive and +mutually exclusive subsets. In turn (at each split) one of these +subsets plays the role of the test set while the union of the +remaining subsets constitutes the training set. Such a splitting +warrants a balanced representation of each sample in both training and +test set over the splits. Still the division into the \( k \) subsets +involves a degree of randomness. This may be fully excluded when +choosing \( k=n \). This particular case is referred to as leave-one-out +cross-validation (LOOCV). + +

    + + +

    How to set up the cross-validation for Ridge and/or Lasso

    + +
      +
    • Define a range of interest for the penalty parameter.
    • +
    • Divide the data set into training and test set comprising samples \( \{1, \ldots, n\} \setminus i \) and \( \{ i \} \), respectively.
    • +
    • Fit the linear regression model by means of ridge estimation for each \( \lambda \) in the grid using the training set, and the corresponding estimate of the error variance \( \boldsymbol{\sigma}_{-i}^2(\lambda) \), as
    • +
    + +$$ +\begin{align*} +\boldsymbol{\beta}_{-i}(\lambda) & = ( \boldsymbol{X}_{-i, \ast}^{T} +\boldsymbol{X}_{-i, \ast} + \lambda \boldsymbol{I}_{pp})^{-1} +\boldsymbol{X}_{-i, \ast}^{T} \boldsymbol{y}_{-i} +\end{align*} +$$ + + +
      +
    • Evaluate the prediction performance of these models on the test set by \( C[y_i, \boldsymbol{X}_{i, \ast}; \boldsymbol{\beta}_{-i}(\lambda), \boldsymbol{\sigma}_{-i}^2(\lambda)] \). Or, by the prediction error \( |y_i - \boldsymbol{X}_{i, \ast} \boldsymbol{\beta}_{-i}(\lambda)| \), the relative error, the error squared or the R2 score function.
    • +
    • Repeat the first three steps such that each sample plays the role of the test set once.
    • +
    • Average the prediction performances of the test sets at each grid point of the penalty bias/parameter. It is an estimate of the prediction performance of the model corresponding to this value of the penalty parameter on novel data.
    • +
    + +









    + +

    Cross-validation in brief

    + +

    +For the various values of \( k \) + +

      +
    1. shuffle the dataset randomly.
    2. +
    3. Split the dataset into \( k \) groups.
    4. +
    5. For each unique group: + +
        +
      1. Decide which group to use as set for test data
      2. +
      3. Take the remaining groups as a training data set
      4. +
      5. Fit a model on the training set and evaluate it on the test set
      6. +
      7. Retain the evaluation score and discard the model
      8. +
      + +
    6. Summarize the model using the sample of model evaluation scores
    7. +
    + +









    + +

    Code Example for Cross-validation and \( k \)-fold Cross-validation

    + +

    +The code here uses Ridge regression with cross-validation (CV) resampling and \( k \)-fold CV in order to fit a specific polynomial. +

    + + +

    import numpy as np
    +import matplotlib.pyplot as plt
    +from sklearn.model_selection import KFold
    +from sklearn.linear_model import Ridge
    +from sklearn.model_selection import cross_val_score
    +from sklearn.preprocessing import PolynomialFeatures
    +
    +# A seed just to ensure that the random numbers are the same for every run.
    +# Useful for eventual debugging.
    +np.random.seed(3155)
    +
    +# Generate the data.
    +nsamples = 100
    +x = np.random.randn(nsamples)
    +y = 3*x**2 + np.random.randn(nsamples)
    +
    +## Cross-validation on Ridge regression using KFold only
    +
    +# Decide degree on polynomial to fit
    +poly = PolynomialFeatures(degree = 6)
    +
    +# Decide which values of lambda to use
    +nlambdas = 500
    +lambdas = np.logspace(-3, 5, nlambdas)
    +
    +# Initialize a KFold instance
    +k = 5
    +kfold = KFold(n_splits = k)
    +
    +# Perform the cross-validation to estimate MSE
    +scores_KFold = np.zeros((nlambdas, k))
    +
    +i = 0
    +for lmb in lambdas:
    +    ridge = Ridge(alpha = lmb)
    +    j = 0
    +    for train_inds, test_inds in kfold.split(x):
    +        xtrain = x[train_inds]
    +        ytrain = y[train_inds]
    +
    +        xtest = x[test_inds]
    +        ytest = y[test_inds]
    +
    +        Xtrain = poly.fit_transform(xtrain[:, np.newaxis])
    +        ridge.fit(Xtrain, ytrain[:, np.newaxis])
    +
    +        Xtest = poly.fit_transform(xtest[:, np.newaxis])
    +        ypred = ridge.predict(Xtest)
    +
    +        scores_KFold[i,j] = np.sum((ypred - ytest[:, np.newaxis])**2)/np.size(ypred)
    +
    +        j += 1
    +    i += 1
    +
    +
    +estimated_mse_KFold = np.mean(scores_KFold, axis = 1)
    +
    +## Cross-validation using cross_val_score from sklearn along with KFold
    +
    +# kfold is an instance initialized above as:
    +# kfold = KFold(n_splits = k)
    +
    +estimated_mse_sklearn = np.zeros(nlambdas)
    +i = 0
    +for lmb in lambdas:
    +    ridge = Ridge(alpha = lmb)
    +
    +    X = poly.fit_transform(x[:, np.newaxis])
    +    estimated_mse_folds = cross_val_score(ridge, X, y[:, np.newaxis], scoring='neg_mean_squared_error', cv=kfold)
    +
    +    # cross_val_score return an array containing the estimated negative mse for every fold.
    +    # we have to the the mean of every array in order to get an estimate of the mse of the model
    +    estimated_mse_sklearn[i] = np.mean(-estimated_mse_folds)
    +
    +    i += 1
    +
    +## Plot and compare the slightly different ways to perform cross-validation
    +
    +plt.figure()
    +
    +plt.plot(np.log10(lambdas), estimated_mse_sklearn, label = 'cross_val_score')
    +plt.plot(np.log10(lambdas), estimated_mse_KFold, 'r--', label = 'KFold')
    +
    +plt.xlabel('log10(lambda)')
    +plt.ylabel('mse')
    +
    +plt.legend()
    +
    +plt.show()
    +
    +

    +









    + +

    To think about, first part

    + +

    +When you are comparing your own code with for example Scikit-Learn's +library, there are some technicalities to keep in mind. The examples +here demonstrate some of these aspects with potential pitfalls. + +

    +The discussion here focuses on the role of the intercept, how we can +set up the design matrix, what scaling we should use and other topics +which tend confuse us. + +

    +The intercept can be interpreted as the expected value of our +target/output variables when all other predictors are set to zero. +Thus, if we cannot assume that the expected outputs/targets are zero +when all predictors are zero (the columns in the design matrix), it +may be a bad idea to implement a model which penalizes the intercept. +Furthermore, in for example Ridge and Lasso regression, the default solutions +from the library Scikit-Learn (when not shrinking \( \beta_0 \)) for the unknown parameters +\( \boldsymbol{\beta} \), are derived under the assumption that both \( \boldsymbol{y} \) and +\( \boldsymbol{X} \) are zero centered, that is we subtract the mean values. + +

    +









    + +

    More thinking

    + +

    +If our predictors represent different scales, then it is important to +standardize the design matrix \( \boldsymbol{X} \) by subtracting the mean of each +column from the corresponding column and dividing the column with its +standard deviation. Most machine learning libraries do this as a default. This means that if you compare your code with the results from a given library, +the results may differ. + +

    +The +Standadscaler +function in Scikit-Learn does this for us. For the data sets we +have been studying in our various examples, the data are in many cases +already scaled and there is no need to scale them. You as a user of different machine learning algorithms, should always perform a +survey of your data, with a critical assessment of them in case you need to scale the data. + +

    +If you need to scale the data, not doing so will give an unfair +penalization of the parameters since their magnitude depends on the +scale of their corresponding predictor. + +

    +Suppose as an example that you +you have an input variable given by the heights of different persons. +Human height might be measured in inches or meters or +kilometers. If measured in kilometers, a standard linear regression +model with this predictor would probably give a much bigger +coefficient term, than if measured in millimeters. +This can clearly lead to problems in evaluating the cost/loss functions. + +

    +









    + +

    Still thinking

    + +

    +Keep in mind that when you transform your data set before training a model, the same transformation needs to be done +on your eventual new data set before making a prediction. If we translate this into a Python code, it would could be implemented as follows + +

    + + +

    #Model training, we compute the mean value of y and X
    +y_train_mean = np.mean(y_train)
    +X_train_mean = np.mean(X_train,axis=0)
    +X_train = X_train - X_train_mean
    +y_train = y_train - y_train_mean
    +
    +# The we fit our model with the training data
    +trained_model = some_model.fit(X_train,y_train)
    +
    +
    +#Model prediction, we need also to transform our data set used for the prediction.
    +X_test = X_test - X_train_mean #Use mean from training data
    +y_pred = trained_model(X_test)
    +y_pred = y_pred + y_train_mean
    +
    +

    +









    + +

    What does centering (subtracting the mean values) mean mathematically?

    + +

    +Let us try to understand what this may imply mathematically when we +subtract the mean values, also known as zero centering. For +simplicity, we will focus on ordinary regression, as done in the above example. + +

    +The cost/loss function for regression is +$$ +C(\beta_0, \beta_1, ... , \beta_{p-1}) = \frac{1}{n}\sum_{i=0}^{n} \left(y_i - \beta_0 - \sum_{j=1}^{p-1} X_{ij}\beta_j\right)^2,. +$$ + +Recall also that we use the squared value since this leads to an increase of the penalty for higher differences between predicted and output/target values. + +

    +What we have done is to single out the \( \beta_0 \) term in the definition of the mean squared error (MSE). +The design matrix +\( X \) does in this case not contain any intercept column. +When we take the derivative with respect to \( \beta_0 \), we want the derivative to obey +$$ +\frac{\partial C}{\partial \beta_j} = 0, +$$ + +

    +for all \( j \). For \( \beta_0 \) we have + +$$ +\frac{\partial C}{\partial \beta_0} = -\frac{2}{n}\sum_{i=0}^{n-1} \left(y_i - \beta_0 - \sum_{j=1}^{p-1} X_{ij} \beta_j\right). +$$ + +Multiplying away the constant \( 2/n \), we obtain +$$ +\sum_{i=0}^{n-1} \beta_0 = \sum_{i=0}^{n-1}y_i - \sum_{i=0}^{n-1} \sum_{j=1}^{p-1} X_{ij} \beta_j. +$$ + +

    +









    + +

    Further Manipulations

    + +

    +We assume +that every column of \( \boldsymbol{X} \) is centered, which we can do by subtracting the mean, +

    + + +

    X = X - np.mean(X,axis=0)
    +
    +

    +This means that we need to rewrite \( X_{ij} \) as \( \tilde{X}_{ij}=X_{ij}-\mu_j \), where +$$ +\mu_j = \frac{1}{n}\sum_{i=0}^{n-1}X_{ij}. +$$ + +

    +Let us special first to the case where we have only two parameters \( \beta_0 \) and \( \beta_1 \). +Our result for \( \beta_0 \) simplifies then to +$$ +n\beta_0 = \sum_{i=0}^{n-1}y_i - \sum_{i=0}^{n-1} X_{i1} \beta_1. +$$ + +Assuming that the matrix elements \( X_{i1} \) are centered, what we have is +$$ +\beta_0 = \frac{1}{n}\sum_{i=0}^{n-1}y_i - \beta_1\frac{1}{n}\sum_{i=0}^{n-1} \left(X_{i1}-\mu_{1}\right), +$$ + +where +$$ +\mu_1=\frac{1}{n}\sum_{i=0}^{n-1} (X_{i1}, +$$ + +and if we define the mean value of the outputs as +$$ +\mu_y=\frac{1}{n}\sum_{i=0}^{n-1}y_i, +$$ + +we have +$$ +\beta_0 = \mu_y - \beta_1\frac{1}{n}\sum_{i=0}^{n-1} (X_{i1}-\mu_{1}), +$$ + +and it is easy to see that the last sum equals zero! This means that we have +$$ +\beta_0 = \mu_y, +$$ + +if the columns of the design matrix are centered. It is straight forward to generalize this results to more values of \( \beta \). +We have thus +$$ +\beta_0 = \frac{1}{n}\sum_{i=0}^{n-1} y_i = \overline{\boldsymbol{y}}, +$$ + +the average value of \( \boldsymbol{y} \). + +

    +Replacing \( y_i \) with \( y_i - \beta_0 = y_i - \overline{\boldsymbol{y}} \) and centering also our design matrix results in a cost function (in vector-matrix disguise) +$$ +C(\boldsymbol{\beta}) = (\boldsymbol{\tilde{y}} - \tilde{X}\boldsymbol{\beta})^T(\boldsymbol{\tilde{y}} - \tilde{X}\boldsymbol{\beta}). +$$ + +

    +









    + +

    Wrapping it up

    + +

    +If we minimize with respect to \( \boldsymbol{\beta} \) we have then + +$$ +\hat{\boldsymbol{\beta}} = (\tilde{X}^T\tilde{X})^{-1}\tilde{X}^T\boldsymbol{\tilde{y}}, +$$ + +

    +where \( \boldsymbol{\tilde{y}} = \boldsymbol{y} - \overline{\boldsymbol{y}} \) +and \( \tilde{X}_{ij} = X_{ij} - \frac{1}{n}\sum_{k=0}^{n-1}X_{kj} \). + +

    +For Ridge regression we need to add \( \lambda \boldsymbol{\beta}^T\boldsymbol{\beta} \) to the cost function and get then +$$ +\hat{\boldsymbol{\beta}} = (\tilde{X}^T\tilde{X} + \lambda I)^{-1}\tilde{X}^T\boldsymbol{\tilde{y}}. +$$ + +

    +What does this mean? And why do we insist on all this? Let us look at some examples. + +

    +









    + +

    Linear Regression code, Intercept handling first

    + +

    +This code shows a simple first-order fit to a data set using the above transformed data, where we consider the role of the intercept first, by either excluding it or including it (code example thanks to Øyvind Sigmundson Schøyen). Here our scaling of the data is done by subtracting the mean values only. +Note also that we do not split the data into training and test. + +

    + + +

    import numpy as np
    +import matplotlib.pyplot as plt
    +
    +from sklearn.linear_model import LinearRegression
    +
    +
    +np.random.seed(2021)
    +
    +def MSE(y_data,y_model):
    +    n = np.size(y_model)
    +    return np.sum((y_data-y_model)**2)/n
    +
    +
    +def fit_beta(X, y):
    +    return np.linalg.pinv(X.T @ X) @ X.T @ y
    +
    +
    +true_beta = [2, 0.5, 3.7]
    +
    +x = np.linspace(0, 1, 11)
    +y = np.sum(
    +    np.asarray([x ** p * b for p, b in enumerate(true_beta)]), axis=0
    +) + 0.1 * np.random.normal(size=len(x))
    +
    +degree = 3
    +X = np.zeros((len(x), degree))
    +
    +# Include the intercept in the design matrix
    +for p in range(degree):
    +    X[:, p] = x ** p
    +
    +beta = fit_beta(X, y)
    +
    +# Intercept is included in the design matrix
    +skl = LinearRegression(fit_intercept=False).fit(X, y)
    +
    +print(f"True beta: {true_beta}")
    +print(f"Fitted beta: {beta}")
    +print(f"Sklearn fitted beta: {skl.coef_}")
    +ypredictOwn = X @ beta
    +ypredictSKL = skl.predict(X)
    +print(f"MSE with intercept column")
    +print(MSE(y,ypredictOwn))
    +print(f"MSE with intercept column from SKL")
    +print(MSE(y,ypredictSKL))
    +
    +
    +plt.figure()
    +plt.scatter(x, y, label="Data")
    +plt.plot(x, X @ beta, label="Fit")
    +plt.plot(x, skl.predict(X), label="Sklearn (fit_intercept=False)")
    +
    +
    +# Do not include the intercept in the design matrix
    +X = np.zeros((len(x), degree - 1))
    +
    +for p in range(degree - 1):
    +    X[:, p] = x ** (p + 1)
    +
    +# Intercept is not included in the design matrix
    +skl = LinearRegression(fit_intercept=True).fit(X, y)
    +
    +# Use centered values for X and y when computing coefficients
    +y_offset = np.average(y, axis=0)
    +X_offset = np.average(X, axis=0)
    +
    +beta = fit_beta(X - X_offset, y - y_offset)
    +intercept = np.mean(y_offset - X_offset @ beta)
    +
    +print(f"Manual intercept: {intercept}")
    +print(f"Fitted beta (wiothout intercept): {beta}")
    +print(f"Sklearn intercept: {skl.intercept_}")
    +print(f"Sklearn fitted beta (without intercept): {skl.coef_}")
    +ypredictOwn = X @ beta
    +ypredictSKL = skl.predict(X)
    +print(f"MSE with Manual intercept")
    +print(MSE(y,ypredictOwn+intercept))
    +print(f"MSE with Sklearn intercept")
    +print(MSE(y,ypredictSKL))
    +
    +plt.plot(x, X @ beta + intercept, "--", label="Fit (manual intercept)")
    +plt.plot(x, skl.predict(X), "--", label="Sklearn (fit_intercept=True)")
    +plt.grid()
    +plt.legend()
    +
    +plt.show()
    +
    +

    +The intercept is the value of our output/target variable +when all our features are zero and our function crosses the \( y \)-axis (for a one-dimensional case). + +

    +Printing the MSE, we see first that both methods give the same MSE, as +they should. However, when we move to for example Ridge regression, +the way we treat the intercept may give a larger or smaller MSE, +meaning that the MSE can be penalized by the value of the +intercept. Not including the intercept in the fit, means that the +regularization term does not include \( \beta_0 \). For different values +of \( \lambda \), this may lead to differeing MSE values. + +

    +To remind the reader, the regularization term, with the intercept in Ridge regression is given by +$$ +\lambda \vert\vert \boldsymbol{\beta} \vert\vert_2^2 = \lambda \sum_{j=0}^{p-1}\beta_j^2, +$$ + +but when we take out the intercept, this equation becomes +$$ +\lambda \vert\vert \boldsymbol{\beta} \vert\vert_2^2 = \lambda \sum_{j=1}^{p-1}\beta_j^2. +$$ + +

    +For Lasso regression we have +$$ +\lambda \vert\vert \boldsymbol{\beta} \vert\vert_1 = \lambda \sum_{j=1}^{p-1}\vert\beta_j\vert. +$$ + +

    +It means that, when scaling the design matrix and the outputs/targets, by subtracting the mean values, we have an optimization problem which is not penalized by the intercept. The MSE value can then be smaller since it focuses only on the remaining quantities. If we however bring back the intercept, we will get a MSE which then contains the intercept. + +

    +









    + +

    Code Examples

    + +

    +Armed with this wisdom, we attempt first to simply set the intercept equal to False in our implementation of Ridge regression for our well-known vanilla data set. + +

    + + +

    import numpy as np
    +import pandas as pd
    +import matplotlib.pyplot as plt
    +from sklearn.model_selection import train_test_split
    +from sklearn import linear_model
    +
    +def MSE(y_data,y_model):
    +    n = np.size(y_model)
    +    return np.sum((y_data-y_model)**2)/n
    +
    +
    +# A seed just to ensure that the random numbers are the same for every run.
    +# Useful for eventual debugging.
    +np.random.seed(3155)
    +
    +n = 100
    +x = np.random.rand(n)
    +y = np.exp(-x**2) + 1.5 * np.exp(-(x-2)**2)
    +
    +Maxpolydegree = 20
    +X = np.zeros((n,Maxpolydegree))
    +#We include explicitely the intercept column
    +for degree in range(Maxpolydegree):
    +    X[:,degree] = x**degree
    +# We split the data in test and training data
    +X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)
    +
    +p = Maxpolydegree
    +I = np.eye(p,p)
    +# Decide which values of lambda to use
    +nlambdas = 6
    +MSEOwnRidgePredict = np.zeros(nlambdas)
    +MSERidgePredict = np.zeros(nlambdas)
    +lambdas = np.logspace(-4, 2, nlambdas)
    +for i in range(nlambdas):
    +    lmb = lambdas[i]
    +    OwnRidgeBeta = np.linalg.pinv(X_train.T @ X_train+lmb*I) @ X_train.T @ y_train
    +    # Note: we include the intercept column and no scaling
    +    RegRidge = linear_model.Ridge(lmb,fit_intercept=False)
    +    RegRidge.fit(X_train,y_train)
    +    # and then make the prediction
    +    ytildeOwnRidge = X_train @ OwnRidgeBeta
    +    ypredictOwnRidge = X_test @ OwnRidgeBeta
    +    ytildeRidge = RegRidge.predict(X_train)
    +    ypredictRidge = RegRidge.predict(X_test)
    +    MSEOwnRidgePredict[i] = MSE(y_test,ypredictOwnRidge)
    +    MSERidgePredict[i] = MSE(y_test,ypredictRidge)
    +    print("Beta values for own Ridge implementation")
    +    print(OwnRidgeBeta)
    +    print("Beta values for Scikit-Learn Ridge implementation")
    +    print(RegRidge.coef_)
    +    print("MSE values for own Ridge implementation")
    +    print(MSEOwnRidgePredict[i])
    +    print("MSE values for Scikit-Learn Ridge implementation")
    +    print(MSERidgePredict[i])
    +
    +# Now plot the results
    +plt.figure()
    +plt.plot(np.log10(lambdas), MSEOwnRidgePredict, 'r', label = 'MSE own Ridge Test')
    +plt.plot(np.log10(lambdas), MSERidgePredict, 'g', label = 'MSE Ridge Test')
    +
    +plt.xlabel('log10(lambda)')
    +plt.ylabel('MSE')
    +plt.legend()
    +plt.show()
    +
    +

    +The results here agree when we force Scikit-Learn's Ridge function to include the first column in our design matrix. +We see that the results agree very well. Here we have thus explicitely included the intercept column in the design matrix. +What happens if we do not include the intercept in our fit? +Let us see how we can change this code by zero centering (thanks to Stian Bilek for inpouts here). + +

    +









    + +

    Taking out the mean

    +

    + + +

    import numpy as np
    +import pandas as pd
    +import matplotlib.pyplot as plt
    +from sklearn.model_selection import train_test_split
    +from sklearn import linear_model
    +from sklearn.preprocessing import StandardScaler
    +
    +def MSE(y_data,y_model):
    +    n = np.size(y_model)
    +    return np.sum((y_data-y_model)**2)/n
    +# A seed just to ensure that the random numbers are the same for every run.
    +# Useful for eventual debugging.
    +np.random.seed(315)
    +
    +n = 100
    +x = np.random.rand(n)
    +y = np.exp(-x**2) + 1.5 * np.exp(-(x-2)**2)
    +
    +Maxpolydegree = 20
    +X = np.zeros((n,Maxpolydegree-1))
    +
    +for degree in range(1,Maxpolydegree): #No intercept column
    +    X[:,degree-1] = x**(degree)
    +
    +# We split the data in test and training data
    +X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)
    +
    +#For our own implementation, we will need to deal with the intercept by centering the design matrix and the target variable
    +X_train_mean = np.mean(X_train,axis=0)
    +#Center by removing mean from each feature
    +X_train_scaled = X_train - X_train_mean 
    +X_test_scaled = X_test - X_train_mean
    +#The model intercept (called y_scaler) is given by the mean of the target variable (IF X is centered)
    +#Remove the intercept from the training data.
    +y_scaler = np.mean(y_train)           
    +y_train_scaled = y_train - y_scaler   
    +
    +p = Maxpolydegree-1
    +I = np.eye(p,p)
    +# Decide which values of lambda to use
    +nlambdas = 6
    +MSEOwnRidgePredict = np.zeros(nlambdas)
    +MSERidgePredict = np.zeros(nlambdas)
    +
    +lambdas = np.logspace(-4, 2, nlambdas)
    +for i in range(nlambdas):
    +    lmb = lambdas[i]
    +    OwnRidgeBeta = np.linalg.pinv(X_train_scaled.T @ X_train_scaled+lmb*I) @ X_train_scaled.T @ (y_train_scaled)
    +    intercept_ = y_scaler - X_train_mean@OwnRidgeBeta #The intercept can be shifted so the model can predict on uncentered data
    +    #Add intercept to prediction
    +    ypredictOwnRidge = X_test @ OwnRidgeBeta + intercept_ 
    +    #Add intercept to prediction
    +    ypredictOwnRidge = X_test_scaled @ OwnRidgeBeta + y_scaler 
    +    RegRidge = linear_model.Ridge(lmb)
    +    RegRidge.fit(X_train,y_train)
    +    ypredictRidge = RegRidge.predict(X_test)
    +    MSEOwnRidgePredict[i] = MSE(y_test,ypredictOwnRidge)
    +    MSERidgePredict[i] = MSE(y_test,ypredictRidge)
    +    print("Beta values for own Ridge implementation")
    +    print(OwnRidgeBeta) #Intercept is given by mean of target variable
    +    print("Beta values for Scikit-Learn Ridge implementation")
    +    print(RegRidge.coef_)
    +    print('Intercept from own implementation:')
    +    print(intercept_)
    +    print('Intercept from Scikit-Learn Ridge implementation')
    +    print(RegRidge.intercept_)
    +    print("MSE values for own Ridge implementation")
    +    print(MSEOwnRidgePredict[i])
    +    print("MSE values for Scikit-Learn Ridge implementation")
    +    print(MSERidgePredict[i])
    +
    +
    +# Now plot the results
    +plt.figure()
    +plt.plot(np.log10(lambdas), MSEOwnRidgePredict, 'b--', label = 'MSE own Ridge Test')
    +plt.plot(np.log10(lambdas), MSERidgePredict, 'g--', label = 'MSE SL Ridge Test')
    +plt.xlabel('log10(lambda)')
    +plt.ylabel('MSE')
    +plt.legend()
    +plt.show()
    +
    +

    +We see here, when compared to the code which includes explicitely the +intercept column, that our MSE value is actually smaller. This is +because the regularization term does not include the intercept value +\( \beta_0 \) in the fitting. This applies to Lasso regularization as +well. It means that our optimization is now done only with the +centered matrix and/or vector that enter the fitting procedure. Note +also that the problem with the intercept occurs mainly in these type +of polynomial fitting problem. + +

    +The next example is indeed an example where all these discussions about the role of intercept are not present. + +

    +









    + +

    More complicated Example: The Ising model

    + +

    +The one-dimensional Ising model with nearest neighbor interaction, no +external field and a constant coupling constant \( J \) is given by + +$$ +\begin{align} + H = -J \sum_{k}^L s_k s_{k + 1}, +\label{_auto1} +\end{align} +$$ + +

    +where \( s_i \in \{-1, 1\} \) and \( s_{N + 1} = s_1 \). The number of spins +in the system is determined by \( L \). For the one-dimensional system +there is no phase transition. + +

    +We will look at a system of \( L = 40 \) spins with a coupling constant of +\( J = 1 \). To get enough training data we will generate 10000 states +with their respective energies. + +

    + + +

    import numpy as np
    +import matplotlib.pyplot as plt
    +from mpl_toolkits.axes_grid1 import make_axes_locatable
    +import seaborn as sns
    +import scipy.linalg as scl
    +from sklearn.model_selection import train_test_split
    +import tqdm
    +sns.set(color_codes=True)
    +cmap_args=dict(vmin=-1., vmax=1., cmap='seismic')
    +
    +L = 40
    +n = int(1e4)
    +
    +spins = np.random.choice([-1, 1], size=(n, L))
    +J = 1.0
    +
    +energies = np.zeros(n)
    +
    +for i in range(n):
    +    energies[i] = - J * np.dot(spins[i], np.roll(spins[i], 1))
    +
    +

    +Here we use ordinary least squares +regression to predict the energy for the nearest neighbor +one-dimensional Ising model on a ring, i.e., the endpoints wrap +around. We will use linear regression to fit a value for +the coupling constant to achieve this. + +

    +









    + +

    Reformulating the problem to suit regression

    + +

    +A more general form for the one-dimensional Ising model is + +$$ +\begin{align} + H = - \sum_j^L \sum_k^L s_j s_k J_{jk}. +\label{_auto2} +\end{align} +$$ + +

    +Here we allow for interactions beyond the nearest neighbors and a state dependent +coupling constant. This latter expression can be formulated as +a matrix-product +$$ +\begin{align} + \boldsymbol{H} = \boldsymbol{X} J, +\label{_auto3} +\end{align} +$$ + +

    +where \( X_{jk} = s_j s_k \) and \( J \) is a matrix which consists of the +elements \( -J_{jk} \). This form of writing the energy fits perfectly +with the form utilized in linear regression, that is + +$$ +\begin{align} + \boldsymbol{y} = \boldsymbol{X}\boldsymbol{\beta} + \boldsymbol{\epsilon}, +\label{_auto4} +\end{align} +$$ + +

    +We split the data in training and test data as discussed in the previous example + +

    + + +

    X = np.zeros((n, L ** 2))
    +for i in range(n):
    +    X[i] = np.outer(spins[i], spins[i]).ravel()
    +y = energies
    +X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)
    +
    +

    +









    + +

    Linear regression

    + +

    +In the ordinary least squares method we choose the cost function + +$$ +\begin{align} + C(\boldsymbol{X}, \boldsymbol{\beta})= \frac{1}{n}\left\{(\boldsymbol{X}\boldsymbol{\beta} - \boldsymbol{y})^T(\boldsymbol{X}\boldsymbol{\beta} - \boldsymbol{y})\right\}. +\label{_auto5} +\end{align} +$$ + +

    +We then find the extremal point of \( C \) by taking the derivative with respect to \( \boldsymbol{\beta} \) as discussed above. +This yields the expression for \( \boldsymbol{\beta} \) to be + +$$ + \boldsymbol{\beta} = \frac{\boldsymbol{X}^T \boldsymbol{y}}{\boldsymbol{X}^T \boldsymbol{X}}, +$$ + +

    +which immediately imposes some requirements on \( \boldsymbol{X} \) as there must exist +an inverse of \( \boldsymbol{X}^T \boldsymbol{X} \). If the expression we are modeling contains an +intercept, i.e., a constant term, we must make sure that the +first column of \( \boldsymbol{X} \) consists of \( 1 \). We do this here + +

    + + +

    X_train_own = np.concatenate(
    +    (np.ones(len(X_train))[:, np.newaxis], X_train),
    +    axis=1
    +)
    +X_test_own = np.concatenate(
    +    (np.ones(len(X_test))[:, np.newaxis], X_test),
    +    axis=1
    +)
    +
    +

    + + +

    def ols_inv(x: np.ndarray, y: np.ndarray) -> np.ndarray:
    +    return scl.inv(x.T @ x) @ (x.T @ y)
    +beta = ols_inv(X_train_own, y_train)
    +
    +

    +









    + +

    Singular Value decomposition

    + +

    +Doing the inversion directly turns out to be a bad idea since the matrix +\( \boldsymbol{X}^T\boldsymbol{X} \) is singular. An alternative approach is to use the singular +value decomposition. Using the definition of the Moore-Penrose +pseudoinverse we can write the equation for \( \boldsymbol{\beta} \) as + +$$ + \boldsymbol{\beta} = \boldsymbol{X}^{+}\boldsymbol{y}, +$$ + +

    +where the pseudoinverse of \( \boldsymbol{X} \) is given by + +$$ + \boldsymbol{X}^{+} = \frac{\boldsymbol{X}^T}{\boldsymbol{X}^T\boldsymbol{X}}. +$$ + +

    +Using singular value decomposition we can decompose the matrix \( \boldsymbol{X} = \boldsymbol{U}\boldsymbol{\Sigma} \boldsymbol{V}^T \), +where \( \boldsymbol{U} \) and \( \boldsymbol{V} \) are orthogonal(unitary) matrices and \( \boldsymbol{\Sigma} \) contains the singular values (more details below). +where \( X^{+} = V\Sigma^{+} U^T \). This reduces the equation for +\( \omega \) to +$$ +\begin{align} + \boldsymbol{\beta} = \boldsymbol{V}\boldsymbol{\Sigma}^{+} \boldsymbol{U}^T \boldsymbol{y}. +\label{_auto6} +\end{align} +$$ + +

    +Note that solving this equation by actually doing the pseudoinverse +(which is what we will do) is not a good idea as this operation scales +as \( \mathcal{O}(n^3) \), where \( n \) is the number of elements in a +general matrix. Instead, doing \( QR \)-factorization and solving the +linear system as an equation would reduce this down to +\( \mathcal{O}(n^2) \) operations. + +

    + + +

    def ols_svd(x: np.ndarray, y: np.ndarray) -> np.ndarray:
    +    u, s, v = scl.svd(x)
    +    return v.T @ scl.pinv(scl.diagsvd(s, u.shape[0], v.shape[0])) @ u.T @ y
    +
    +

    + + +

    beta = ols_svd(X_train_own,y_train)
    +
    +

    +When extracting the \( J \)-matrix we need to make sure that we remove the intercept, as is done here + +

    + + +

    J = beta[1:].reshape(L, L)
    +
    +

    +A way of looking at the coefficients in \( J \) is to plot the matrices as images. + +

    + + +

    fig = plt.figure(figsize=(20, 14))
    +im = plt.imshow(J, **cmap_args)
    +plt.title("OLS", fontsize=18)
    +plt.xticks(fontsize=18)
    +plt.yticks(fontsize=18)
    +cb = fig.colorbar(im)
    +cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)
    +plt.show()
    +
    +

    +It is interesting to note that OLS +considers both \( J_{j, j + 1} = -0.5 \) and \( J_{j, j - 1} = -0.5 \) as +valid matrix elements for \( J \). +In our discussion below on hyperparameters and Ridge and Lasso regression we will see that +this problem can be removed, partly and only with Lasso regression. + +

    +In this case our matrix inversion was actually possible. The obvious question now is what is the mathematics behind the SVD? + +

    +









    + +

    The one-dimensional Ising model

    + +

    +Let us bring back the Ising model again, but now with an additional +focus on Ridge and Lasso regression as well. We repeat some of the +basic parts of the Ising model and the setup of the training and test +data. The one-dimensional Ising model with nearest neighbor +interaction, no external field and a constant coupling constant \( J \) is +given by + +$$ +\begin{align} + H = -J \sum_{k}^L s_k s_{k + 1}, +\label{_auto7} +\end{align} +$$ + +where \( s_i \in \{-1, 1\} \) and \( s_{N + 1} = s_1 \). The number of spins in the system is determined by \( L \). For the one-dimensional system there is no phase transition. + +

    +We will look at a system of \( L = 40 \) spins with a coupling constant of \( J = 1 \). To get enough training data we will generate 10000 states with their respective energies. + +

    + + +

    import numpy as np
    +import matplotlib.pyplot as plt
    +from mpl_toolkits.axes_grid1 import make_axes_locatable
    +import seaborn as sns
    +import scipy.linalg as scl
    +from sklearn.model_selection import train_test_split
    +import sklearn.linear_model as skl
    +import tqdm
    +sns.set(color_codes=True)
    +cmap_args=dict(vmin=-1., vmax=1., cmap='seismic')
    +
    +L = 40
    +n = int(1e4)
    +
    +spins = np.random.choice([-1, 1], size=(n, L))
    +J = 1.0
    +
    +energies = np.zeros(n)
    +
    +for i in range(n):
    +    energies[i] = - J * np.dot(spins[i], np.roll(spins[i], 1))
    +
    +

    +A more general form for the one-dimensional Ising model is + +$$ +\begin{align} + H = - \sum_j^L \sum_k^L s_j s_k J_{jk}. +\label{_auto8} +\end{align} +$$ + +

    +Here we allow for interactions beyond the nearest neighbors and a more +adaptive coupling matrix. This latter expression can be formulated as +a matrix-product on the form +$$ +\begin{align} + H = X J, +\label{_auto9} +\end{align} +$$ + +

    +where \( X_{jk} = s_j s_k \) and \( J \) is the matrix consisting of the +elements \( -J_{jk} \). This form of writing the energy fits perfectly +with the form utilized in linear regression, viz. +$$ +\begin{align} + \boldsymbol{y} = \boldsymbol{X}\boldsymbol{\beta} + \boldsymbol{\epsilon}. +\label{_auto10} +\end{align} +$$ + +We organize the data as we did above +

    + + +

    X = np.zeros((n, L ** 2))
    +for i in range(n):
    +    X[i] = np.outer(spins[i], spins[i]).ravel()
    +y = energies
    +X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.96)
    +
    +X_train_own = np.concatenate(
    +    (np.ones(len(X_train))[:, np.newaxis], X_train),
    +    axis=1
    +)
    +
    +X_test_own = np.concatenate(
    +    (np.ones(len(X_test))[:, np.newaxis], X_test),
    +    axis=1
    +)
    +
    +

    +We will do all fitting with Scikit-Learn, + +

    + + +

    clf = skl.LinearRegression().fit(X_train, y_train)
    +
    +

    +When extracting the \( J \)-matrix we make sure to remove the intercept +

    + + +

    J_sk = clf.coef_.reshape(L, L)
    +
    +

    +And then we plot the results +

    + + +

    fig = plt.figure(figsize=(20, 14))
    +im = plt.imshow(J_sk, **cmap_args)
    +plt.title("LinearRegression from Scikit-learn", fontsize=18)
    +plt.xticks(fontsize=18)
    +plt.yticks(fontsize=18)
    +cb = fig.colorbar(im)
    +cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)
    +plt.show()
    +
    +

    +The results perfectly with our previous discussion where we used our own code. + +

    +









    + +

    Ridge regression

    + +

    +Having explored the ordinary least squares we move on to ridge +regression. In ridge regression we include a regularizer. This +involves a new cost function which leads to a new estimate for the +weights \( \boldsymbol{\beta} \). This results in a penalized regression problem. The +cost function is given by + +$$ +\begin{align} + C(\boldsymbol{X}, \boldsymbol{\beta}; \lambda) = (\boldsymbol{X}\boldsymbol{\beta} - \boldsymbol{y})^T(\boldsymbol{X}\boldsymbol{\beta} - \boldsymbol{y}) + \lambda \boldsymbol{\beta}^T\boldsymbol{\beta}. +\label{_auto11} +\end{align} +$$ + +

    + + +

    _lambda = 0.1
    +clf_ridge = skl.Ridge(alpha=_lambda).fit(X_train, y_train)
    +J_ridge_sk = clf_ridge.coef_.reshape(L, L)
    +fig = plt.figure(figsize=(20, 14))
    +im = plt.imshow(J_ridge_sk, **cmap_args)
    +plt.title("Ridge from Scikit-learn", fontsize=18)
    +plt.xticks(fontsize=18)
    +plt.yticks(fontsize=18)
    +cb = fig.colorbar(im)
    +cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)
    +
    +plt.show()
    +
    +

    +









    + +

    LASSO regression

    + +

    +In the Least Absolute Shrinkage and Selection Operator (LASSO)-method we get a third cost function. + +$$ +\begin{align} + C(\boldsymbol{X}, \boldsymbol{\beta}; \lambda) = (\boldsymbol{X}\boldsymbol{\beta} - \boldsymbol{y})^T(\boldsymbol{X}\boldsymbol{\beta} - \boldsymbol{y}) + \lambda \sqrt{\boldsymbol{\beta}^T\boldsymbol{\beta}}. +\label{_auto12} +\end{align} +$$ + +

    +Finding the extremal point of this cost function is not so straight-forward as in least squares and ridge. We will therefore rely solely on the function ``Lasso`` from Scikit-Learn. + +

    + + +

    clf_lasso = skl.Lasso(alpha=_lambda).fit(X_train, y_train)
    +J_lasso_sk = clf_lasso.coef_.reshape(L, L)
    +fig = plt.figure(figsize=(20, 14))
    +im = plt.imshow(J_lasso_sk, **cmap_args)
    +plt.title("Lasso from Scikit-learn", fontsize=18)
    +plt.xticks(fontsize=18)
    +plt.yticks(fontsize=18)
    +cb = fig.colorbar(im)
    +cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)
    +
    +plt.show()
    +
    +

    +It is quite striking how LASSO breaks the symmetry of the coupling +constant as opposed to ridge and OLS. We get a sparse solution with +\( J_{j, j + 1} = -1 \). + +

    +









    + +

    Performance as function of the regularization parameter

    + +

    +We see how the different models perform for a different set of values for \( \lambda \). + +

    + + +

    lambdas = np.logspace(-4, 5, 10)
    +
    +train_errors = {
    +    "ols_sk": np.zeros(lambdas.size),
    +    "ridge_sk": np.zeros(lambdas.size),
    +    "lasso_sk": np.zeros(lambdas.size)
    +}
    +
    +test_errors = {
    +    "ols_sk": np.zeros(lambdas.size),
    +    "ridge_sk": np.zeros(lambdas.size),
    +    "lasso_sk": np.zeros(lambdas.size)
    +}
    +
    +plot_counter = 1
    +
    +fig = plt.figure(figsize=(32, 54))
    +
    +for i, _lambda in enumerate(tqdm.tqdm(lambdas)):
    +    for key, method in zip(
    +        ["ols_sk", "ridge_sk", "lasso_sk"],
    +        [skl.LinearRegression(), skl.Ridge(alpha=_lambda), skl.Lasso(alpha=_lambda)]
    +    ):
    +        method = method.fit(X_train, y_train)
    +
    +        train_errors[key][i] = method.score(X_train, y_train)
    +        test_errors[key][i] = method.score(X_test, y_test)
    +
    +        omega = method.coef_.reshape(L, L)
    +
    +        plt.subplot(10, 5, plot_counter)
    +        plt.imshow(omega, **cmap_args)
    +        plt.title(r"%s, $\lambda = %.4f$" % (key, _lambda))
    +        plot_counter += 1
    +
    +plt.show()
    +
    +

    +We see that LASSO reaches a good solution for low +values of \( \lambda \), but will "wither" when we increase \( \lambda \) too +much. Ridge is more stable over a larger range of values for +\( \lambda \), but eventually also fades away. + +

    +









    + +

    Finding the optimal value of \( \lambda \)

    + +

    +To determine which value of \( \lambda \) is best we plot the accuracy of +the models when predicting the training and the testing set. We expect +the accuracy of the training set to be quite good, but if the accuracy +of the testing set is much lower this tells us that we might be +subject to an overfit model. The ideal scenario is an accuracy on the +testing set that is close to the accuracy of the training set. + +

    + + +

    fig = plt.figure(figsize=(20, 14))
    +
    +colors = {
    +    "ols_sk": "r",
    +    "ridge_sk": "y",
    +    "lasso_sk": "c"
    +}
    +
    +for key in train_errors:
    +    plt.semilogx(
    +        lambdas,
    +        train_errors[key],
    +        colors[key],
    +        label="Train {0}".format(key),
    +        linewidth=4.0
    +    )
    +
    +for key in test_errors:
    +    plt.semilogx(
    +        lambdas,
    +        test_errors[key],
    +        colors[key] + "--",
    +        label="Test {0}".format(key),
    +        linewidth=4.0
    +    )
    +plt.legend(loc="best", fontsize=18)
    +plt.xlabel(r"$\lambda$", fontsize=18)
    +plt.ylabel(r"$R^2$", fontsize=18)
    +plt.tick_params(labelsize=18)
    +plt.show()
    +
    +

    +From the above figure we can see that LASSO with \( \lambda = 10^{-2} \) +achieves a very good accuracy on the test set. This by far surpasses the +other models for all values of \( \lambda \). + +

    + + +

    Logistic Regression

    + +

    +In linear regression our main interest was centered on learning the +coefficients of a functional fit (say a polynomial) in order to be +able to predict the response of a continuous variable on some unseen +data. The fit to the continuous variable \( y_i \) is based on some +independent variables \( \boldsymbol{x}_i \). Linear regression resulted in +analytical expressions for standard ordinary Least Squares or Ridge +regression (in terms of matrices to invert) for several quantities, +ranging from the variance and thereby the confidence intervals of the +parameters \( \boldsymbol{\beta} \) to the mean squared error. If we can invert +the product of the design matrices, linear regression gives then a +simple recipe for fitting our data. + +

    + + +

    Classification problems

    + +

    +Classification problems, however, are concerned with outcomes taking +the form of discrete variables (i.e. categories). We may for example, +on the basis of DNA sequencing for a number of patients, like to find +out which mutations are important for a certain disease; or based on +scans of various patients' brains, figure out if there is a tumor or +not; or given a specific physical system, we'd like to identify its +state, say whether it is an ordered or disordered system (typical +situation in solid state physics); or classify the status of a +patient, whether she/he has a stroke or not and many other similar +situations. + +

    +The most common situation we encounter when we apply logistic +regression is that of two possible outcomes, normally denoted as a +binary outcome, true or false, positive or negative, success or +failure etc. + +

    +









    + +

    Optimization and Deep learning

    + +

    +Logistic regression will also serve as our stepping stone towards +neural network algorithms and supervised deep learning. For logistic +learning, the minimization of the cost function leads to a non-linear +equation in the parameters \( \boldsymbol{\beta} \). The optimization of the +problem calls therefore for minimization algorithms. This forms the +bottle neck of all machine learning algorithms, namely how to find +reliable minima of a multi-variable function. This leads us to the +family of gradient descent methods. The latter are the working horses +of basically all modern machine learning algorithms. + +

    +We note also that many of the topics discussed here on logistic +regression are also commonly used in modern supervised Deep Learning +models, as we will see later. + +

    + + +

    Basics

    + +

    +We consider the case where the dependent variables, also called the +responses or the outcomes, \( y_i \) are discrete and only take values +from \( k=0,\dots,K-1 \) (i.e. \( K \) classes). + +

    +The goal is to predict the +output classes from the design matrix \( \boldsymbol{X}\in\mathbb{R}^{n\times p} \) +made of \( n \) samples, each of which carries \( p \) features or predictors. The +primary goal is to identify the classes to which new unseen samples +belong. + +

    +Let us specialize to the case of two classes only, with outputs +\( y_i=0 \) and \( y_i=1 \). Our outcomes could represent the status of a +credit card user that could default or not on her/his credit card +debt. That is + +$$ +y_i = \begin{bmatrix} 0 & \mathrm{no}\\ 1 & \mathrm{yes} \end{bmatrix}. +$$ + +

    +









    + +

    Linear classifier

    + +

    +Before moving to the logistic model, let us try to use our linear +regression model to classify these two outcomes. We could for example +fit a linear model to the default case if \( y_i > 0.5 \) and the no +default case \( y_i \leq 0.5 \). + +

    +We would then have our +weighted linear combination, namely +$$ +\begin{equation} +\boldsymbol{y} = \boldsymbol{X}^T\boldsymbol{\beta} + \boldsymbol{\epsilon}, +\label{_auto13} +\end{equation} +$$ + +where \( \boldsymbol{y} \) is a vector representing the possible outcomes, \( \boldsymbol{X} \) is our +\( n\times p \) design matrix and \( \boldsymbol{\beta} \) represents our estimators/predictors. + +

    +









    + +

    Some selected properties

    + +

    +The main problem with our function is that it takes values on the +entire real axis. In the case of logistic regression, however, the +labels \( y_i \) are discrete variables. A typical example is the credit +card data discussed below here, where we can set the state of +defaulting the debt to \( y_i=1 \) and not to \( y_i=0 \) for one the persons +in the data set (see the full example below). + +

    +One simple way to get a discrete output is to have sign +functions that map the output of a linear regressor to values \( \{0,1\} \), +\( f(s_i)=sign(s_i)=1 \) if \( s_i\ge 0 \) and 0 if otherwise. +We will encounter this model in our first demonstration of neural networks. Historically it is called the ``perceptron" model in the machine learning +literature. This model is extremely simple. However, in many cases it is more +favorable to use a ``soft" classifier that outputs +the probability of a given category. This leads us to the logistic function. + +

    +









    + +

    Simple example

    + +

    +The following example on data for coronary heart disease (CHD) as function of age may serve as an illustration. In the code here we read and plot whether a person has had CHD (output = 1) or not (output = 0). This ouput is plotted the person's against age. Clearly, the figure shows that attempting to make a standard linear regression fit may not be very meaningful. + +

    + + +

    # Common imports
    +import os
    +import numpy as np
    +import pandas as pd
    +import matplotlib.pyplot as plt
    +from sklearn.linear_model import LinearRegression, Ridge, Lasso
    +from sklearn.model_selection import train_test_split
    +from sklearn.utils import resample
    +from sklearn.metrics import mean_squared_error
    +from IPython.display import display
    +from pylab import plt, mpl
    +plt.style.use('seaborn')
    +mpl.rcParams['font.family'] = 'serif'
    +
    +# Where to save the figures and data files
    +PROJECT_ROOT_DIR = "Results"
    +FIGURE_ID = "Results/FigureFiles"
    +DATA_ID = "DataFiles/"
    +
    +if not os.path.exists(PROJECT_ROOT_DIR):
    +    os.mkdir(PROJECT_ROOT_DIR)
    +
    +if not os.path.exists(FIGURE_ID):
    +    os.makedirs(FIGURE_ID)
    +
    +if not os.path.exists(DATA_ID):
    +    os.makedirs(DATA_ID)
    +
    +def image_path(fig_id):
    +    return os.path.join(FIGURE_ID, fig_id)
    +
    +def data_path(dat_id):
    +    return os.path.join(DATA_ID, dat_id)
    +
    +def save_fig(fig_id):
    +    plt.savefig(image_path(fig_id) + ".png", format='png')
    +
    +infile = open(data_path("chddata.csv"),'r')
    +
    +# Read the chd data as  csv file and organize the data into arrays with age group, age, and chd
    +chd = pd.read_csv(infile, names=('ID', 'Age', 'Agegroup', 'CHD'))
    +chd.columns = ['ID', 'Age', 'Agegroup', 'CHD']
    +output = chd['CHD']
    +age = chd['Age']
    +agegroup = chd['Agegroup']
    +numberID  = chd['ID'] 
    +display(chd)
    +
    +plt.scatter(age, output, marker='o')
    +plt.axis([18,70.0,-0.1, 1.2])
    +plt.xlabel(r'Age')
    +plt.ylabel(r'CHD')
    +plt.title(r'Age distribution and Coronary heart disease')
    +plt.show()
    +
    +

    +









    + +

    Plotting the mean value for each group

    + +

    +What we could attempt however is to plot the mean value for each group. + +

    + + +

    agegroupmean = np.array([0.1, 0.133, 0.250, 0.333, 0.462, 0.625, 0.765, 0.800])
    +group = np.array([1, 2, 3, 4, 5, 6, 7, 8])
    +plt.plot(group, agegroupmean, "r-")
    +plt.axis([0,9,0, 1.0])
    +plt.xlabel(r'Age group')
    +plt.ylabel(r'CHD mean values')
    +plt.title(r'Mean values for each age group')
    +plt.show()
    +
    +

    +We are now trying to find a function \( f(y\vert x) \), that is a function which gives us an expected value for the output \( y \) with a given input \( x \). +In standard linear regression with a linear dependence on \( x \), we would write this in terms of our model +$$ +f(y_i\vert x_i)=\beta_0+\beta_1 x_i. +$$ + +

    +This expression implies however that \( f(y_i\vert x_i) \) could take any +value from minus infinity to plus infinity. If we however let +\( f(y\vert y) \) be represented by the mean value, the above example +shows us that we can constrain the function to take values between +zero and one, that is we have \( 0 \le f(y_i\vert x_i) \le 1 \). Looking +at our last curve we see also that it has an S-shaped form. This leads +us to a very popular model for the function \( f \), namely the so-called +Sigmoid function or logistic model. We will consider this function as +representing the probability for finding a value of \( y_i \) with a given +\( x_i \). + +

    +









    + +

    The logistic function

    + +

    +Another widely studied model, is the so-called +perceptron model, which is an example of a "hard classification" model. We +will encounter this model when we discuss neural networks as +well. Each datapoint is deterministically assigned to a category (i.e +\( y_i=0 \) or \( y_i=1 \)). In many cases, and the coronary heart disease data forms one of many such examples, it is favorable to have a "soft" +classifier that outputs the probability of a given category rather +than a single value. For example, given \( x_i \), the classifier +outputs the probability of being in a category \( k \). Logistic regression +is the most common example of a so-called soft classifier. In logistic +regression, the probability that a data point \( x_i \) +belongs to a category \( y_i=\{0,1\} \) is given by the so-called logit function (or Sigmoid) which is meant to represent the likelihood for a given event, +$$ +p(t) = \frac{1}{1+\mathrm \exp{-t}}=\frac{\exp{t}}{1+\mathrm \exp{t}}. +$$ + +Note that \( 1-p(t)= p(-t) \). + +

    +









    + +

    Examples of likelihood functions used in logistic regression and nueral networks

    + +

    +The following code plots the logistic function, the step function and other functions we will encounter from here and on. + +

    + + +

    """The sigmoid function (or the logistic curve) is a
    +function that takes any real number, z, and outputs a number (0,1).
    +It is useful in neural networks for assigning weights on a relative scale.
    +The value z is the weighted sum of parameters involved in the learning algorithm."""
    +
    +import numpy
    +import matplotlib.pyplot as plt
    +import math as mt
    +
    +z = numpy.arange(-5, 5, .1)
    +sigma_fn = numpy.vectorize(lambda z: 1/(1+numpy.exp(-z)))
    +sigma = sigma_fn(z)
    +
    +fig = plt.figure()
    +ax = fig.add_subplot(111)
    +ax.plot(z, sigma)
    +ax.set_ylim([-0.1, 1.1])
    +ax.set_xlim([-5,5])
    +ax.grid(True)
    +ax.set_xlabel('z')
    +ax.set_title('sigmoid function')
    +
    +plt.show()
    +
    +"""Step Function"""
    +z = numpy.arange(-5, 5, .02)
    +step_fn = numpy.vectorize(lambda z: 1.0 if z >= 0.0 else 0.0)
    +step = step_fn(z)
    +
    +fig = plt.figure()
    +ax = fig.add_subplot(111)
    +ax.plot(z, step)
    +ax.set_ylim([-0.5, 1.5])
    +ax.set_xlim([-5,5])
    +ax.grid(True)
    +ax.set_xlabel('z')
    +ax.set_title('step function')
    +
    +plt.show()
    +
    +"""tanh Function"""
    +z = numpy.arange(-2*mt.pi, 2*mt.pi, 0.1)
    +t = numpy.tanh(z)
    +
    +fig = plt.figure()
    +ax = fig.add_subplot(111)
    +ax.plot(z, t)
    +ax.set_ylim([-1.0, 1.0])
    +ax.set_xlim([-2*mt.pi,2*mt.pi])
    +ax.grid(True)
    +ax.set_xlabel('z')
    +ax.set_title('tanh function')
    +
    +plt.show()
    +
    +

    +









    + +

    Two parameters

    + +

    +We assume now that we have two classes with \( y_i \) either \( 0 \) or \( 1 \). Furthermore we assume also that we have only two parameters \( \beta \) in our fitting of the Sigmoid function, that is we define probabilities +$$ +\begin{align*} +p(y_i=1|x_i,\boldsymbol{\beta}) &= \frac{\exp{(\beta_0+\beta_1x_i)}}{1+\exp{(\beta_0+\beta_1x_i)}},\nonumber\\ +p(y_i=0|x_i,\boldsymbol{\beta}) &= 1 - p(y_i=1|x_i,\boldsymbol{\beta}), +\end{align*} +$$ + +where \( \boldsymbol{\beta} \) are the weights we wish to extract from data, in our case \( \beta_0 \) and \( \beta_1 \). + +

    +Note that we used +$$ +p(y_i=0\vert x_i, \boldsymbol{\beta}) = 1-p(y_i=1\vert x_i, \boldsymbol{\beta}). +$$ + +

    + + +

    Maximum likelihood

    + +

    +In order to define the total likelihood for all possible outcomes from a +dataset \( \mathcal{D}=\{(y_i,x_i)\} \), with the binary labels +\( y_i\in\{0,1\} \) and where the data points are drawn independently, we use the so-called Maximum Likelihood Estimation (MLE) principle. +We aim thus at maximizing +the probability of seeing the observed data. We can then approximate the +likelihood in terms of the product of the individual probabilities of a specific outcome \( y_i \), that is +$$ +\begin{align*} +P(\mathcal{D}|\boldsymbol{\beta})& = \prod_{i=1}^n \left[p(y_i=1|x_i,\boldsymbol{\beta})\right]^{y_i}\left[1-p(y_i=1|x_i,\boldsymbol{\beta}))\right]^{1-y_i}\nonumber \\ +\end{align*} +$$ + +from which we obtain the log-likelihood and our cost/loss function +$$ +\mathcal{C}(\boldsymbol{\beta}) = \sum_{i=1}^n \left( y_i\log{p(y_i=1|x_i,\boldsymbol{\beta})} + (1-y_i)\log\left[1-p(y_i=1|x_i,\boldsymbol{\beta}))\right]\right). +$$ + +

    +









    + +

    The cost function rewritten

    + +

    +Reordering the logarithms, we can rewrite the cost/loss function as +$$ +\mathcal{C}(\boldsymbol{\beta}) = \sum_{i=1}^n \left(y_i(\beta_0+\beta_1x_i) -\log{(1+\exp{(\beta_0+\beta_1x_i)})}\right). +$$ + +

    +The maximum likelihood estimator is defined as the set of parameters that maximize the log-likelihood where we maximize with respect to \( \beta \). +Since the cost (error) function is just the negative log-likelihood, for logistic regression we have that +$$ +\mathcal{C}(\boldsymbol{\beta})=-\sum_{i=1}^n \left(y_i(\beta_0+\beta_1x_i) -\log{(1+\exp{(\beta_0+\beta_1x_i)})}\right). +$$ + +This equation is known in statistics as the cross entropy. Finally, we note that just as in linear regression, +in practice we often supplement the cross-entropy with additional regularization terms, usually \( L_1 \) and \( L_2 \) regularization as we did for Ridge and Lasso regression. + +

    +









    + +

    Minimizing the cross entropy

    + +

    +The cross entropy is a convex function of the weights \( \boldsymbol{\beta} \) and, +therefore, any local minimizer is a global minimizer. + +

    +Minimizing this +cost function with respect to the two parameters \( \beta_0 \) and \( \beta_1 \) we obtain + +$$ +\frac{\partial \mathcal{C}(\boldsymbol{\beta})}{\partial \beta_0} = -\sum_{i=1}^n \left(y_i -\frac{\exp{(\beta_0+\beta_1x_i)}}{1+\exp{(\beta_0+\beta_1x_i)}}\right), +$$ + +and +$$ +\frac{\partial \mathcal{C}(\boldsymbol{\beta})}{\partial \beta_1} = -\sum_{i=1}^n \left(y_ix_i -x_i\frac{\exp{(\beta_0+\beta_1x_i)}}{1+\exp{(\beta_0+\beta_1x_i)}}\right). +$$ + +

    +









    + +

    A more compact expression

    + +

    +Let us now define a vector \( \boldsymbol{y} \) with \( n \) elements \( y_i \), an +\( n\times p \) matrix \( \boldsymbol{X} \) which contains the \( x_i \) values and a +vector \( \boldsymbol{p} \) of fitted probabilities \( p(y_i\vert x_i,\boldsymbol{\beta}) \). We can rewrite in a more compact form the first +derivative of cost function as + +$$ +\frac{\partial \mathcal{C}(\boldsymbol{\beta})}{\partial \boldsymbol{\beta}} = -\boldsymbol{X}^T\left(\boldsymbol{y}-\boldsymbol{p}\right). +$$ + +

    +If we in addition define a diagonal matrix \( \boldsymbol{W} \) with elements +\( p(y_i\vert x_i,\boldsymbol{\beta})(1-p(y_i\vert x_i,\boldsymbol{\beta}) \), we can obtain a compact expression of the second derivative as + +$$ +\frac{\partial^2 \mathcal{C}(\boldsymbol{\beta})}{\partial \boldsymbol{\beta}\partial \boldsymbol{\beta}^T} = \boldsymbol{X}^T\boldsymbol{W}\boldsymbol{X}. +$$ + +

    +









    + +

    Extending to more predictors

    + +

    +Within a binary classification problem, we can easily expand our model to include multiple predictors. Our ratio between likelihoods is then with \( p \) predictors +$$ +\log{ \frac{p(\boldsymbol{\beta}\boldsymbol{x})}{1-p(\boldsymbol{\beta}\boldsymbol{x})}} = \beta_0+\beta_1x_1+\beta_2x_2+\dots+\beta_px_p. +$$ + +Here we defined \( \boldsymbol{x}=[1,x_1,x_2,\dots,x_p] \) and \( \boldsymbol{\beta}=[\beta_0, \beta_1, \dots, \beta_p] \) leading to +$$ +p(\boldsymbol{\beta}\boldsymbol{x})=\frac{ \exp{(\beta_0+\beta_1x_1+\beta_2x_2+\dots+\beta_px_p)}}{1+\exp{(\beta_0+\beta_1x_1+\beta_2x_2+\dots+\beta_px_p)}}. +$$ + +

    +









    + +

    Including more classes

    + +

    +Till now we have mainly focused on two classes, the so-called binary +system. Suppose we wish to extend to \( K \) classes. Let us for the sake +of simplicity assume we have only two predictors. We have then following model + +$$ +\log{\frac{p(C=1\vert x)}{p(K\vert x)}} = \beta_{10}+\beta_{11}x_1, +$$ + +and +$$ +\log{\frac{p(C=2\vert x)}{p(K\vert x)}} = \beta_{20}+\beta_{21}x_1, +$$ + +and so on till the class \( C=K-1 \) class +$$ +\log{\frac{p(C=K-1\vert x)}{p(K\vert x)}} = \beta_{(K-1)0}+\beta_{(K-1)1}x_1, +$$ + +

    +and the model is specified in term of \( K-1 \) so-called log-odds or +logit transformations. + +

    +









    + +

    More classes

    + +

    +In our discussion of neural networks we will encounter the above again +in terms of a slightly modified function, the so-called Softmax function. + +

    +The softmax function is used in various multiclass classification +methods, such as multinomial logistic regression (also known as +softmax regression), multiclass linear discriminant analysis, naive +Bayes classifiers, and artificial neural networks. Specifically, in +multinomial logistic regression and linear discriminant analysis, the +input to the function is the result of \( K \) distinct linear functions, +and the predicted probability for the \( k \)-th class given a sample +vector \( \boldsymbol{x} \) and a weighting vector \( \boldsymbol{\beta} \) is (with two +predictors): + +$$ +p(C=k\vert \mathbf {x} )=\frac{\exp{(\beta_{k0}+\beta_{k1}x_1)}}{1+\sum_{l=1}^{K-1}\exp{(\beta_{l0}+\beta_{l1}x_1)}}. +$$ + +It is easy to extend to more predictors. The final class is +$$ +p(C=K\vert \mathbf {x} )=\frac{1}{1+\sum_{l=1}^{K-1}\exp{(\beta_{l0}+\beta_{l1}x_1)}}, +$$ + +

    +and they sum to one. Our earlier discussions were all specialized to +the case with two classes only. It is easy to see from the above that +what we derived earlier is compatible with these equations. + +

    +To find the optimal parameters we would typically use a gradient +descent method. Newton's method and gradient descent methods are +discussed in the material on optimization +methods. + +

    +









    + +

    Friday September 24

    + +

    +









    + +

    Wisconsin Cancer Data

    + +

    +We show here how we can use a simple regression case on the breast +cancer data using Logistic regression as our algorithm for +classification. + +

    + + +

    import matplotlib.pyplot as plt
    +import numpy as np
    +from sklearn.model_selection import  train_test_split 
    +from sklearn.datasets import load_breast_cancer
    +from sklearn.linear_model import LogisticRegression
    +
    +# Load the data
    +cancer = load_breast_cancer()
    +
    +X_train, X_test, y_train, y_test = train_test_split(cancer.data,cancer.target,random_state=0)
    +print(X_train.shape)
    +print(X_test.shape)
    +# Logistic Regression
    +logreg = LogisticRegression(solver='lbfgs')
    +logreg.fit(X_train, y_train)
    +print("Test set accuracy with Logistic Regression: {:.2f}".format(logreg.score(X_test,y_test)))
    +#now scale the data
    +from sklearn.preprocessing import StandardScaler
    +scaler = StandardScaler()
    +scaler.fit(X_train)
    +X_train_scaled = scaler.transform(X_train)
    +X_test_scaled = scaler.transform(X_test)
    +# Logistic Regression
    +logreg.fit(X_train_scaled, y_train)
    +print("Test set accuracy Logistic Regression with scaled data: {:.2f}".format(logreg.score(X_test_scaled,y_test)))
    +
    +

    +









    + +

    Using the correlation matrix

    + +

    +In addition to the above scores, we could also study the covariance (and the correlation matrix). +We use Pandas to compute the correlation matrix. +

    + + +

    import matplotlib.pyplot as plt
    +import numpy as np
    +from sklearn.model_selection import  train_test_split 
    +from sklearn.datasets import load_breast_cancer
    +from sklearn.linear_model import LogisticRegression
    +cancer = load_breast_cancer()
    +import pandas as pd
    +# Making a data frame
    +cancerpd = pd.DataFrame(cancer.data, columns=cancer.feature_names)
    +
    +fig, axes = plt.subplots(15,2,figsize=(10,20))
    +malignant = cancer.data[cancer.target == 0]
    +benign = cancer.data[cancer.target == 1]
    +ax = axes.ravel()
    +
    +for i in range(30):
    +    _, bins = np.histogram(cancer.data[:,i], bins =50)
    +    ax[i].hist(malignant[:,i], bins = bins, alpha = 0.5)
    +    ax[i].hist(benign[:,i], bins = bins, alpha = 0.5)
    +    ax[i].set_title(cancer.feature_names[i])
    +    ax[i].set_yticks(())
    +ax[0].set_xlabel("Feature magnitude")
    +ax[0].set_ylabel("Frequency")
    +ax[0].legend(["Malignant", "Benign"], loc ="best")
    +fig.tight_layout()
    +plt.show()
    +
    +import seaborn as sns
    +correlation_matrix = cancerpd.corr().round(1)
    +# use the heatmap function from seaborn to plot the correlation matrix
    +# annot = True to print the values inside the square
    +plt.figure(figsize=(15,8))
    +sns.heatmap(data=correlation_matrix, annot=True)
    +plt.show()
    +
    +

    +









    + +

    Discussing the correlation data

    + +

    +In the above example we note two things. In the first plot we display +the overlap of benign and malignant tumors as functions of the various +features in the Wisconsing breast cancer data set. We see that for +some of the features we can distinguish clearly the benign and +malignant cases while for other features we cannot. This can point to +us which features may be of greater interest when we wish to classify +a benign or not benign tumour. + +

    +In the second figure we have computed the so-called correlation +matrix, which in our case with thirty features becomes a \( 30\times 30 \) +matrix. + +

    +We constructed this matrix using pandas via the statements +

    + + +

    cancerpd = pd.DataFrame(cancer.data, columns=cancer.feature_names)
    +
    +

    +and then +

    + + +

    correlation_matrix = cancerpd.corr().round(1)
    +
    +

    +Diagonalizing this matrix we can in turn say something about which +features are of relevance and which are not. This leads us to +the classical Principal Component Analysis (PCA) theorem with +applications. This will be discussed later this semester (week 43). + +

    +









    + +

    Other measures in classification studies: Cancer Data again

    +

    + + +

    import matplotlib.pyplot as plt
    +import numpy as np
    +from sklearn.model_selection import  train_test_split 
    +from sklearn.datasets import load_breast_cancer
    +from sklearn.linear_model import LogisticRegression
    +
    +# Load the data
    +cancer = load_breast_cancer()
    +
    +X_train, X_test, y_train, y_test = train_test_split(cancer.data,cancer.target,random_state=0)
    +print(X_train.shape)
    +print(X_test.shape)
    +# Logistic Regression
    +logreg = LogisticRegression(solver='lbfgs')
    +logreg.fit(X_train, y_train)
    +print("Test set accuracy with Logistic Regression: {:.2f}".format(logreg.score(X_test,y_test)))
    +#now scale the data
    +from sklearn.preprocessing import StandardScaler
    +scaler = StandardScaler()
    +scaler.fit(X_train)
    +X_train_scaled = scaler.transform(X_train)
    +X_test_scaled = scaler.transform(X_test)
    +# Logistic Regression
    +logreg.fit(X_train_scaled, y_train)
    +print("Test set accuracy Logistic Regression with scaled data: {:.2f}".format(logreg.score(X_test_scaled,y_test)))
    +
    +
    +from sklearn.preprocessing import LabelEncoder
    +from sklearn.model_selection import cross_validate
    +#Cross validation
    +accuracy = cross_validate(logreg,X_test_scaled,y_test,cv=10)['test_score']
    +print(accuracy)
    +print("Test set accuracy with Logistic Regression  and scaled data: {:.2f}".format(logreg.score(X_test_scaled,y_test)))
    +
    +
    +import scikitplot as skplt
    +y_pred = logreg.predict(X_test_scaled)
    +skplt.metrics.plot_confusion_matrix(y_test, y_pred, normalize=True)
    +plt.show()
    +y_probas = logreg.predict_proba(X_test_scaled)
    +skplt.metrics.plot_roc(y_test, y_probas)
    +plt.show()
    +skplt.metrics.plot_cumulative_gain(y_test, y_probas)
    +plt.show()
    +
    +

    +









    + +

    Optimization, the central part of any Machine Learning algortithm

    + +

    +Overview Video, why do we care about gradient methods? + +

    +Almost every problem in machine learning and data science starts with +a dataset \( X \), a model \( g(\beta) \), which is a function of the +parameters \( \beta \) and a cost function \( C(X, g(\beta)) \) that allows +us to judge how well the model \( g(\beta) \) explains the observations +\( X \). The model is fit by finding the values of \( \beta \) that minimize +the cost function. Ideally we would be able to solve for \( \beta \) +analytically, however this is not possible in general and we must use +some approximative/numerical method to compute the minimum. + +

    +









    + +

    Revisiting our Logistic Regression case

    + +

    +In our discussion on Logistic Regression we studied the +case of +two classes, with \( y_i \) either +\( 0 \) or \( 1 \). Furthermore we assumed also that we have only two +parameters \( \beta \) in our fitting, that is we +defined probabilities + +$$ +\begin{align*} +p(y_i=1|x_i,\boldsymbol{\beta}) &= \frac{\exp{(\beta_0+\beta_1x_i)}}{1+\exp{(\beta_0+\beta_1x_i)}},\nonumber\\ +p(y_i=0|x_i,\boldsymbol{\beta}) &= 1 - p(y_i=1|x_i,\boldsymbol{\beta}), +\end{align*} +$$ + +where \( \boldsymbol{\beta} \) are the weights we wish to extract from data, in our case \( \beta_0 \) and \( \beta_1 \). + +

    +









    + +

    The equations to solve

    + +

    +Our compact equations used a definition of a vector \( \boldsymbol{y} \) with \( n \) +elements \( y_i \), an \( n\times p \) matrix \( \boldsymbol{X} \) which contains the +\( x_i \) values and a vector \( \boldsymbol{p} \) of fitted probabilities +\( p(y_i\vert x_i,\boldsymbol{\beta}) \). We rewrote in a more compact form +the first derivative of the cost function as + +$$ +\frac{\partial \mathcal{C}(\boldsymbol{\beta})}{\partial \boldsymbol{\beta}} = -\boldsymbol{X}^T\left(\boldsymbol{y}-\boldsymbol{p}\right). +$$ + +

    +If we in addition define a diagonal matrix \( \boldsymbol{W} \) with elements +\( p(y_i\vert x_i,\boldsymbol{\beta})(1-p(y_i\vert x_i,\boldsymbol{\beta}) \), we can obtain a compact expression of the second derivative as + +$$ +\frac{\partial^2 \mathcal{C}(\boldsymbol{\beta})}{\partial \boldsymbol{\beta}\partial \boldsymbol{\beta}^T} = \boldsymbol{X}^T\boldsymbol{W}\boldsymbol{X}. +$$ + +This defines what is called the Hessian matrix. + +

    +









    + +

    Solving using Newton-Raphson's method

    + +

    +If we can set up these equations, Newton-Raphson's iterative method is normally the method of choice. It requires however that we can compute in an efficient way the matrices that define the first and second derivatives. + +

    +Our iterative scheme is then given by + +$$ +\boldsymbol{\beta}^{\mathrm{new}} = \boldsymbol{\beta}^{\mathrm{old}}-\left(\frac{\partial^2 \mathcal{C}(\boldsymbol{\beta})}{\partial \boldsymbol{\beta}\partial \boldsymbol{\beta}^T}\right)^{-1}_{\boldsymbol{\beta}^{\mathrm{old}}}\times \left(\frac{\partial \mathcal{C}(\boldsymbol{\beta})}{\partial \boldsymbol{\beta}}\right)_{\boldsymbol{\beta}^{\mathrm{old}}}, +$$ + +or in matrix form as + +$$ +\boldsymbol{\beta}^{\mathrm{new}} = \boldsymbol{\beta}^{\mathrm{old}}-\left(\boldsymbol{X}^T\boldsymbol{W}\boldsymbol{X} \right)^{-1}\times \left(-\boldsymbol{X}^T(\boldsymbol{y}-\boldsymbol{p}) \right)_{\boldsymbol{\beta}^{\mathrm{old}}}. +$$ + +The right-hand side is computed with the old values of \( \beta \). + +

    +If we can compute these matrices, in particular the Hessian, the above is often the easiest method to implement. + +

    +









    + +

    Brief reminder on Newton-Raphson's method

    + +

    +Let us quickly remind ourselves how we derive the above method. + +

    +Perhaps the most celebrated of all one-dimensional root-finding +routines is Newton's method, also called the Newton-Raphson +method. This method requires the evaluation of both the +function \( f \) and its derivative \( f' \) at arbitrary points. +If you can only calculate the derivative +numerically and/or your function is not of the smooth type, we +normally discourage the use of this method. + +

    +









    + +

    The equations

    + +

    +The Newton-Raphson formula consists geometrically of extending the +tangent line at a current point until it crosses zero, then setting +the next guess to the abscissa of that zero-crossing. The mathematics +behind this method is rather simple. Employing a Taylor expansion for +\( x \) sufficiently close to the solution \( s \), we have + +$$ + f(s)=0=f(x)+(s-x)f'(x)+\frac{(s-x)^2}{2}f''(x) +\dots. + \label{eq:taylornr} +$$ + +

    +For small enough values of the function and for well-behaved +functions, the terms beyond linear are unimportant, hence we obtain + +$$ + f(x)+(s-x)f'(x)\approx 0, +$$ + +yielding +$$ + s\approx x-\frac{f(x)}{f'(x)}. +$$ + +

    +Having in mind an iterative procedure, it is natural to start iterating with +$$ + x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)}. +$$ + +

    +









    + +

    Simple geometric interpretation

    + +

    +The above is Newton-Raphson's method. It has a simple geometric +interpretation, namely \( x_{n+1} \) is the point where the tangent from +\( (x_n,f(x_n)) \) crosses the \( x \)-axis. Close to the solution, +Newton-Raphson converges fast to the desired result. However, if we +are far from a root, where the higher-order terms in the series are +important, the Newton-Raphson formula can give grossly inaccurate +results. For instance, the initial guess for the root might be so far +from the true root as to let the search interval include a local +maximum or minimum of the function. If an iteration places a trial +guess near such a local extremum, so that the first derivative nearly +vanishes, then Newton-Raphson may fail totally + +

    +









    + +

    Extending to more than one variable

    + +

    +Newton's method can be generalized to systems of several non-linear equations +and variables. Consider the case with two equations +$$ + \begin{array}{cc} f_1(x_1,x_2) &=0\\ + f_2(x_1,x_2) &=0,\end{array} +$$ + +which we Taylor expand to obtain + +$$ + \begin{array}{cc} 0=f_1(x_1+h_1,x_2+h_2)=&f_1(x_1,x_2)+h_1 + \partial f_1/\partial x_1+h_2 + \partial f_1/\partial x_2+\dots\\ + 0=f_2(x_1+h_1,x_2+h_2)=&f_2(x_1,x_2)+h_1 + \partial f_2/\partial x_1+h_2 + \partial f_2/\partial x_2+\dots + \end{array}. +$$ + +Defining the Jacobian matrix \( {\bf \boldsymbol{J}} \) we have +$$ + {\bf \boldsymbol{J}}=\left( \begin{array}{cc} + \partial f_1/\partial x_1 & \partial f_1/\partial x_2 \\ + \partial f_2/\partial x_1 &\partial f_2/\partial x_2 + \end{array} \right), +$$ + +we can rephrase Newton's method as +$$ +\left(\begin{array}{c} x_1^{n+1} \\ x_2^{n+1} \end{array} \right)= +\left(\begin{array}{c} x_1^{n} \\ x_2^{n} \end{array} \right)+ +\left(\begin{array}{c} h_1^{n} \\ h_2^{n} \end{array} \right), +$$ + +where we have defined +$$ + \left(\begin{array}{c} h_1^{n} \\ h_2^{n} \end{array} \right)= + -{\bf \boldsymbol{J}}^{-1} + \left(\begin{array}{c} f_1(x_1^{n},x_2^{n}) \\ f_2(x_1^{n},x_2^{n}) \end{array} \right). +$$ + +We need thus to compute the inverse of the Jacobian matrix and it +is to understand that difficulties may +arise in case \( {\bf \boldsymbol{J}} \) is nearly singular. + +

    +It is rather straightforward to extend the above scheme to systems of +more than two non-linear equations. In our case, the Jacobian matrix is given by the Hessian that represents the second derivative of cost function. + +

    +









    + +

    Steepest descent

    + +

    +The basic idea of gradient descent is +that a function \( F(\mathbf{x}) \), +\( \mathbf{x} \equiv (x_1,\cdots,x_n) \), decreases fastest if one goes from \( \bf {x} \) in the +direction of the negative gradient \( -\nabla F(\mathbf{x}) \). + +

    +It can be shown that if +$$ +\mathbf{x}_{k+1} = \mathbf{x}_k - \gamma_k \nabla F(\mathbf{x}_k), +$$ + +with \( \gamma_k > 0 \). + +

    +For \( \gamma_k \) small enough, then \( F(\mathbf{x}_{k+1}) \leq +F(\mathbf{x}_k) \). This means that for a sufficiently small \( \gamma_k \) +we are always moving towards smaller function values, i.e a minimum. + +

    + + +

    More on Steepest descent

    + +

    +The previous observation is the basis of the method of steepest +descent, which is also referred to as just gradient descent (GD). One +starts with an initial guess \( \mathbf{x}_0 \) for a minimum of \( F \) and +computes new approximations according to + +$$ +\mathbf{x}_{k+1} = \mathbf{x}_k - \gamma_k \nabla F(\mathbf{x}_k), \ \ k \geq 0. +$$ + +

    +The parameter \( \gamma_k \) is often referred to as the step length or +the learning rate within the context of Machine Learning. + +

    + + +

    The ideal

    + +

    +Ideally the sequence \( \{\mathbf{x}_k \}_{k=0} \) converges to a global +minimum of the function \( F \). In general we do not know if we are in a +global or local minimum. In the special case when \( F \) is a convex +function, all local minima are also global minima, so in this case +gradient descent can converge to the global solution. The advantage of +this scheme is that it is conceptually simple and straightforward to +implement. However the method in this form has some severe +limitations: + +

    +In machine learing we are often faced with non-convex high dimensional +cost functions with many local minima. Since GD is deterministic we +will get stuck in a local minimum, if the method converges, unless we +have a very good intial guess. This also implies that the scheme is +sensitive to the chosen initial condition. + +

    +Note that the gradient is a function of \( \mathbf{x} = +(x_1,\cdots,x_n) \) which makes it expensive to compute numerically. + +

    + + +

    The sensitiveness of the gradient descent

    + +

    +The gradient descent method +is sensitive to the choice of learning rate \( \gamma_k \). This is due +to the fact that we are only guaranteed that \( F(\mathbf{x}_{k+1}) \leq +F(\mathbf{x}_k) \) for sufficiently small \( \gamma_k \). The problem is to +determine an optimal learning rate. If the learning rate is chosen too +small the method will take a long time to converge and if it is too +large we can experience erratic behavior. + +

    +Many of these shortcomings can be alleviated by introducing +randomness. One such method is that of Stochastic Gradient Descent +(SGD), see below. + +

    + + +

    Convex functions

    + +

    +Ideally we want our cost/loss function to be convex(concave). + +

    +First we give the definition of a convex set: A set \( C \) in +\( \mathbb{R}^n \) is said to be convex if, for all \( x \) and \( y \) in \( C \) and +all \( t \in (0,1) \) , the point \( (1 − t)x + ty \) also belongs to +C. Geometrically this means that every point on the line segment +connecting \( x \) and \( y \) is in \( C \) as discussed below. + +

    +The convex subsets of \( \mathbb{R} \) are the intervals of +\( \mathbb{R} \). Examples of convex sets of \( \mathbb{R}^2 \) are the +regular polygons (triangles, rectangles, pentagons, etc...). + +

    +









    + +

    Convex function

    + +

    +Convex function: Let \( X \subset \mathbb{R}^n \) be a convex set. Assume that the function \( f: X \rightarrow \mathbb{R} \) is continuous, then \( f \) is said to be convex if $$f(tx_1 + (1-t)x_2) \leq tf(x_1) + (1-t)f(x_2) $$ for all \( x_1, x_2 \in X \) and for all \( t \in [0,1] \). If \( \leq \) is replaced with a strict inequaltiy in the definition, we demand \( x_1 \neq x_2 \) and \( t\in(0,1) \) then \( f \) is said to be strictly convex. For a single variable function, convexity means that if you draw a straight line connecting \( f(x_1) \) and \( f(x_2) \), the value of the function on the interval \( [x_1,x_2] \) is always below the line as illustrated below. + +

    +









    + +

    Conditions on convex functions

    + +

    +In the following we state first and second-order conditions which +ensures convexity of a function \( f \). We write \( D_f \) to denote the +domain of \( f \), i.e the subset of \( R^n \) where \( f \) is defined. For more +details and proofs we refer to: S. Boyd and L. Vandenberghe. Convex Optimization. Cambridge University Press. + +

    +

    +First order condition +

    +Suppose \( f \) is differentiable (i.e \( \nabla f(x) \) is well defined for +all \( x \) in the domain of \( f \)). Then \( f \) is convex if and only if \( D_f \) +is a convex set and $$f(y) \geq f(x) + \nabla f(x)^T (y-x) $$ holds +for all \( x,y \in D_f \). This condition means that for a convex function +the first order Taylor expansion (right hand side above) at any point +a global under estimator of the function. To convince yourself you can +make a drawing of \( f(x) = x^2+1 \) and draw the tangent line to \( f(x) \) and +note that it is always below the graph. +

    + + +

    +

    +Second order condition +

    +Assume that \( f \) is twice +differentiable, i.e the Hessian matrix exists at each point in +\( D_f \). Then \( f \) is convex if and only if \( D_f \) is a convex set and its +Hessian is positive semi-definite for all \( x\in D_f \). For a +single-variable function this reduces to \( f''(x) \geq 0 \). Geometrically this means that \( f \) has nonnegative curvature +everywhere. +

    + + +

    +This condition is particularly useful since it gives us an procedure for determining if the function under consideration is convex, apart from using the definition. + +

    +









    + +

    More on convex functions

    + +

    +The next result is of great importance to us and the reason why we are +going on about convex functions. In machine learning we frequently +have to minimize a loss/cost function in order to find the best +parameters for the model we are considering. + +

    +Ideally we want the +global minimum (for high-dimensional models it is hard to know +if we have local or global minimum). However, if the cost/loss function +is convex the following result provides invaluable information: + +

    +

    +Any minimum is global for convex functions +

    +Consider the problem of finding \( x \in \mathbb{R}^n \) such that \( f(x) \) +is minimal, where \( f \) is convex and differentiable. Then, any point +\( x^* \) that satisfies \( \nabla f(x^*) = 0 \) is a global minimum. +

    + + +

    +This result means that if we know that the cost/loss function is convex and we are able to find a minimum, we are guaranteed that it is a global minimum. + +

    +









    + +

    Some simple problems

    + +
      +
    1. Show that \( f(x)=x^2 \) is convex for \( x \in \mathbb{R} \) using the definition of convexity. Hint: If you re-write the definition, \( f \) is convex if the following holds for all \( x,y \in D_f \) and any \( \lambda \in [0,1] \) $\lambda f(x)+(1-\lambda)f(y)-f(\lambda x + (1-\lambda) y ) \geq 0$.
    2. +
    3. Using the second order condition show that the following functions are convex on the specified domain.
    4. + +
        +
      • \( f(x) = e^x \) is convex for \( x \in \mathbb{R} \).
      • +
      • \( g(x) = -\ln(x) \) is convex for \( x \in (0,\infty) \).
      • +
      + +
    5. Let \( f(x) = x^2 \) and \( g(x) = e^x \). Show that \( f(g(x)) \) and \( g(f(x)) \) is convex for \( x \in \mathbb{R} \). Also show that if \( f(x) \) is any convex function than \( h(x) = e^{f(x)} \) is convex.
    6. +
    7. A norm is any function that satisfy the following properties
    8. + +
        +
      • \( f(\alpha x) = |\alpha| f(x) \) for all \( \alpha \in \mathbb{R} \).
      • +
      • \( f(x+y) \leq f(x) + f(y) \)
      • +
      • \( f(x) \leq 0 \) for all \( x \in \mathbb{R}^n \) with equality if and only if \( x = 0 \)
      • +
      + +
    + +Using the definition of convexity, try to show that a function satisfying the properties above is convex (the third condition is not needed to show this). + +

    +









    + +

    Friday September 25

    + +

    +Video of Lecture and link to handwritten notes. + +

    +









    + +

    Standard steepest descent

    + +

    +Before we proceed, we would like to discuss the approach called the +standard Steepest descent (different from the above steepest descent discussion), which again leads to us having to be able +to compute a matrix. It belongs to the class of Conjugate Gradient methods (CG). + +

    +The success of the CG method +for finding solutions of non-linear problems is based on the theory +of conjugate gradients for linear systems of equations. It belongs to +the class of iterative methods for solving problems from linear +algebra of the type +$$ +\begin{equation*} +\boldsymbol{A}\boldsymbol{x} = \boldsymbol{b}. +\end{equation*} +$$ + +

    +In the iterative process we end up with a problem like + +$$ +\begin{equation*} + \boldsymbol{r}= \boldsymbol{b}-\boldsymbol{A}\boldsymbol{x}, +\end{equation*} +$$ + +where \( \boldsymbol{r} \) is the so-called residual or error in the iterative process. + +

    +When we have found the exact solution, \( \boldsymbol{r}=0 \). + +

    +









    + +

    Gradient method

    + +

    +The residual is zero when we reach the minimum of the quadratic equation +$$ +\begin{equation*} + P(\boldsymbol{x})=\frac{1}{2}\boldsymbol{x}^T\boldsymbol{A}\boldsymbol{x} - \boldsymbol{x}^T\boldsymbol{b}, +\end{equation*} +$$ + +

    +with the constraint that the matrix \( \boldsymbol{A} \) is positive definite and +symmetric. This defines also the Hessian and we want it to be positive definite. + +

    +









    + +

    Steepest descent method

    + +

    +We denote the initial guess for \( \boldsymbol{x} \) as \( \boldsymbol{x}_0 \). +We can assume without loss of generality that +$$ +\begin{equation*} +\boldsymbol{x}_0=0, +\end{equation*} +$$ + +or consider the system +$$ +\begin{equation*} +\boldsymbol{A}\boldsymbol{z} = \boldsymbol{b}-\boldsymbol{A}\boldsymbol{x}_0, +\end{equation*} +$$ + +instead. + +

    +









    + +

    Steepest descent method

    +
    + +

    +One can show that the solution \( \boldsymbol{x} \) is also the unique minimizer of the quadratic form +$$ +\begin{equation*} + f(\boldsymbol{x}) = \frac{1}{2}\boldsymbol{x}^T\boldsymbol{A}\boldsymbol{x} - \boldsymbol{x}^T \boldsymbol{x} , \quad \boldsymbol{x}\in\mathbf{R}^n. +\end{equation*} +$$ + +This suggests taking the first basis vector \( \boldsymbol{r}_1 \) (see below for definition) +to be the gradient of \( f \) at \( \boldsymbol{x}=\boldsymbol{x}_0 \), +which equals +$$ +\begin{equation*} +\boldsymbol{A}\boldsymbol{x}_0-\boldsymbol{b}, +\end{equation*} +$$ + +and +\( \boldsymbol{x}_0=0 \) it is equal \( -\boldsymbol{b} \). + + +

    + + +

    +









    + +

    Final expressions

    +
    + +

    +We can compute the residual iteratively as +$$ +\begin{equation*} +\boldsymbol{r}_{k+1}=\boldsymbol{b}-\boldsymbol{A}\boldsymbol{x}_{k+1}, + \end{equation*} +$$ + +which equals +$$ +\begin{equation*} +\boldsymbol{b}-\boldsymbol{A}(\boldsymbol{x}_k+\alpha_k\boldsymbol{r}_k), + \end{equation*} +$$ + +or +$$ +\begin{equation*} +(\boldsymbol{b}-\boldsymbol{A}\boldsymbol{x}_k)-\alpha_k\boldsymbol{A}\boldsymbol{r}_k, + \end{equation*} +$$ + +which gives + +$$ +\alpha_k = \frac{\boldsymbol{r}_k^T\boldsymbol{r}_k}{\boldsymbol{r}_k^T\boldsymbol{A}\boldsymbol{r}_k} +$$ + +leading to the iterative scheme +$$ +\begin{equation*} +\boldsymbol{x}_{k+1}=\boldsymbol{x}_k-\alpha_k\boldsymbol{r}_{k}, + \end{equation*} +$$ +

    + + +

    +









    + +

    Steepest descent example

    + +

    + + +

    import numpy as np
    +import numpy.linalg as la
    +
    +import scipy.optimize as sopt
    +
    +import matplotlib.pyplot as pt
    +from mpl_toolkits.mplot3d import axes3d
    +
    +def f(x):
    +    return 0.5*x[0]**2 + 2.5*x[1]**2
    +
    +def df(x):
    +    return np.array([x[0], 5*x[1]])
    +
    +fig = pt.figure()
    +ax = fig.gca(projection="3d")
    +
    +xmesh, ymesh = np.mgrid[-2:2:50j,-2:2:50j]
    +fmesh = f(np.array([xmesh, ymesh]))
    +ax.plot_surface(xmesh, ymesh, fmesh)
    +
    +

    +And then as countor plot +

    + + +

    pt.axis("equal")
    +pt.contour(xmesh, ymesh, fmesh)
    +guesses = [np.array([2, 2./5])]
    +
    +

    +Find guesses +

    + + +

    x = guesses[-1]
    +s = -df(x)
    +
    +

    +Run it! +

    + + +

    def f1d(alpha):
    +    return f(x + alpha*s)
    +
    +alpha_opt = sopt.golden(f1d)
    +next_guess = x + alpha_opt * s
    +guesses.append(next_guess)
    +print(next_guess)
    +
    +

    +What happened? +

    + + +

    pt.axis("equal")
    +pt.contour(xmesh, ymesh, fmesh, 50)
    +it_array = np.array(guesses)
    +pt.plot(it_array.T[0], it_array.T[1], "x-")
    +
    +

    +









    + +

    Conjugate gradient method

    +
    + +

    +In the CG method we define so-called conjugate directions and two vectors +\( \boldsymbol{s} \) and \( \boldsymbol{t} \) +are said to be +conjugate if +$$ +\begin{equation*} +\boldsymbol{s}^T\boldsymbol{A}\boldsymbol{t}= 0. +\end{equation*} +$$ + +The philosophy of the CG method is to perform searches in various conjugate directions +of our vectors \( \boldsymbol{x}_i \) obeying the above criterion, namely +$$ +\begin{equation*} +\boldsymbol{x}_i^T\boldsymbol{A}\boldsymbol{x}_j= 0. +\end{equation*} +$$ + +Two vectors are conjugate if they are orthogonal with respect to +this inner product. Being conjugate is a symmetric relation: if \( \boldsymbol{s} \) is conjugate to \( \boldsymbol{t} \), then \( \boldsymbol{t} \) is conjugate to \( \boldsymbol{s} \). +

    + + +

    +









    + +

    Conjugate gradient method

    +
    + +

    +An example is given by the eigenvectors of the matrix +$$ +\begin{equation*} +\boldsymbol{v}_i^T\boldsymbol{A}\boldsymbol{v}_j= \lambda\boldsymbol{v}_i^T\boldsymbol{v}_j, +\end{equation*} +$$ + +which is zero unless \( i=j \). +

    + + +

    +









    + +

    Conjugate gradient method

    +
    + +

    +Assume now that we have a symmetric positive-definite matrix \( \boldsymbol{A} \) of size +\( n\times n \). At each iteration \( i+1 \) we obtain the conjugate direction of a vector +$$ +\begin{equation*} +\boldsymbol{x}_{i+1}=\boldsymbol{x}_{i}+\alpha_i\boldsymbol{p}_{i}. +\end{equation*} +$$ + +We assume that \( \boldsymbol{p}_{i} \) is a sequence of \( n \) mutually conjugate directions. +Then the \( \boldsymbol{p}_{i} \) form a basis of \( R^n \) and we can expand the solution +$ \boldsymbol{A}\boldsymbol{x} = \boldsymbol{b}$ in this basis, namely + +$$ +\begin{equation*} + \boldsymbol{x} = \sum^{n}_{i=1} \alpha_i \boldsymbol{p}_i. +\end{equation*} +$$ +

    + + +

    +









    + +

    Conjugate gradient method

    +
    + +

    +The coefficients are given by +$$ +\begin{equation*} + \mathbf{A}\mathbf{x} = \sum^{n}_{i=1} \alpha_i \mathbf{A} \mathbf{p}_i = \mathbf{b}. +\end{equation*} +$$ + +Multiplying with \( \boldsymbol{p}_k^T \) from the left gives + +$$ +\begin{equation*} + \boldsymbol{p}_k^T \boldsymbol{A}\boldsymbol{x} = \sum^{n}_{i=1} \alpha_i\boldsymbol{p}_k^T \boldsymbol{A}\boldsymbol{p}_i= \boldsymbol{p}_k^T \boldsymbol{b}, +\end{equation*} +$$ + +and we can define the coefficients \( \alpha_k \) as + +$$ +\begin{equation*} + \alpha_k = \frac{\boldsymbol{p}_k^T \boldsymbol{b}}{\boldsymbol{p}_k^T \boldsymbol{A} \boldsymbol{p}_k} +\end{equation*} +$$ +

    + + +

    +









    + +

    Conjugate gradient method and iterations

    +
    + +

    + +

    +If we choose the conjugate vectors \( \boldsymbol{p}_k \) carefully, +then we may not need all of them to obtain a good approximation to the solution +\( \boldsymbol{x} \). +We want to regard the conjugate gradient method as an iterative method. +This will us to solve systems where \( n \) is so large that the direct +method would take too much time. + +

    +We denote the initial guess for \( \boldsymbol{x} \) as \( \boldsymbol{x}_0 \). +We can assume without loss of generality that +$$ +\begin{equation*} +\boldsymbol{x}_0=0, +\end{equation*} +$$ + +or consider the system +$$ +\begin{equation*} +\boldsymbol{A}\boldsymbol{z} = \boldsymbol{b}-\boldsymbol{A}\boldsymbol{x}_0, +\end{equation*} +$$ + +instead. +

    + + +

    +









    + +

    Conjugate gradient method

    +
    + +

    +One can show that the solution \( \boldsymbol{x} \) is also the unique minimizer of the quadratic form +$$ +\begin{equation*} + f(\boldsymbol{x}) = \frac{1}{2}\boldsymbol{x}^T\boldsymbol{A}\boldsymbol{x} - \boldsymbol{x}^T \boldsymbol{x} , \quad \boldsymbol{x}\in\mathbf{R}^n. +\end{equation*} +$$ + +This suggests taking the first basis vector \( \boldsymbol{p}_1 \) +to be the gradient of \( f \) at \( \boldsymbol{x}=\boldsymbol{x}_0 \), +which equals +$$ +\begin{equation*} +\boldsymbol{A}\boldsymbol{x}_0-\boldsymbol{b}, +\end{equation*} +$$ + +and +\( \boldsymbol{x}_0=0 \) it is equal \( -\boldsymbol{b} \). +The other vectors in the basis will be conjugate to the gradient, +hence the name conjugate gradient method. +

    + + +

    +









    + +

    Conjugate gradient method

    +
    + +

    +Let \( \boldsymbol{r}_k \) be the residual at the \( k \)-th step: +$$ +\begin{equation*} +\boldsymbol{r}_k=\boldsymbol{b}-\boldsymbol{A}\boldsymbol{x}_k. +\end{equation*} +$$ + +Note that \( \boldsymbol{r}_k \) is the negative gradient of \( f \) at +\( \boldsymbol{x}=\boldsymbol{x}_k \), +so the gradient descent method would be to move in the direction \( \boldsymbol{r}_k \). +Here, we insist that the directions \( \boldsymbol{p}_k \) are conjugate to each other, +so we take the direction closest to the gradient \( \boldsymbol{r}_k \) +under the conjugacy constraint. +This gives the following expression +$$ +\begin{equation*} +\boldsymbol{p}_{k+1}=\boldsymbol{r}_k-\frac{\boldsymbol{p}_k^T \boldsymbol{A}\boldsymbol{r}_k}{\boldsymbol{p}_k^T\boldsymbol{A}\boldsymbol{p}_k} \boldsymbol{p}_k. +\end{equation*} +$$ +

    + + +

    +









    + +

    Conjugate gradient method

    +
    + +

    +We can also compute the residual iteratively as +$$ +\begin{equation*} +\boldsymbol{r}_{k+1}=\boldsymbol{b}-\boldsymbol{A}\boldsymbol{x}_{k+1}, + \end{equation*} +$$ + +which equals +$$ +\begin{equation*} +\boldsymbol{b}-\boldsymbol{A}(\boldsymbol{x}_k+\alpha_k\boldsymbol{p}_k), + \end{equation*} +$$ + +or +$$ +\begin{equation*} +(\boldsymbol{b}-\boldsymbol{A}\boldsymbol{x}_k)-\alpha_k\boldsymbol{A}\boldsymbol{p}_k, + \end{equation*} +$$ + +which gives + +$$ +\begin{equation*} +\boldsymbol{r}_{k+1}=\boldsymbol{r}_k-\boldsymbol{A}\boldsymbol{p}_{k}, + \end{equation*} +$$ +

    + + +

    + + +

    Revisiting some of our first Linear Regression Encounters

    + +

    +We will use linear regression as a case study for the gradient descent +methods. Linear regression is a great test case for the gradient +descent methods discussed in the lectures since it has several +desirable properties such as: + +

      +
    1. An analytical solution (recall homework set 1).
    2. +
    3. The gradient can be computed analytically.
    4. +
    5. The cost function is convex which guarantees that gradient descent converges for small enough learning rates
    6. +
    + +We revisit an example similar to what we had in the first homework set. We had a function of the type + +

    + + +

    x = 2*np.random.rand(m,1)
    +y = 4+3*x+np.random.randn(m,1)
    +
    +

    +with \( x_i \in [0,1] \) is chosen randomly using a uniform distribution. Additionally we have a stochastic noise chosen according to a normal distribution \( \cal {N}(0,1) \). +The linear regression model is given by +$$ +h_\beta(x) = \boldsymbol{y} = \beta_0 + \beta_1 x, +$$ + +such that +$$ +\boldsymbol{y}_i = \beta_0 + \beta_1 x_i. +$$ + +

    + + +

    Gradient descent example

    + +

    +Let \( \mathbf{y} = (y_1,\cdots,y_n)^T \), \( \mathbf{\boldsymbol{y}} = (\boldsymbol{y}_1,\cdots,\boldsymbol{y}_n)^T \) and \( \beta = (\beta_0, \beta_1)^T \) + +

    +It is convenient to write \( \mathbf{\boldsymbol{y}} = X\beta \) where \( X \in \mathbb{R}^{100 \times 2} \) is the design matrix given by (we keep the intercept here) +$$ +X \equiv \begin{bmatrix} +1 & x_1 \\ +\vdots & \vdots \\ +1 & x_{100} & \\ +\end{bmatrix}. +$$ + +The cost/loss/risk function is given by ( +$$ +C(\beta) = \frac{1}{n}||X\beta-\mathbf{y}||_{2}^{2} = \frac{1}{n}\sum_{i=1}^{100}\left[ (\beta_0 + \beta_1 x_i)^2 - 2 y_i (\beta_0 + \beta_1 x_i) + y_i^2\right] +$$ + +and we want to find \( \beta \) such that \( C(\beta) \) is minimized. + +

    +









    + +

    The derivative of the cost/loss function

    + +

    +Computing \( \partial C(\beta) / \partial \beta_0 \) and \( \partial C(\beta) / \partial \beta_1 \) we can show that the gradient can be written as +$$ +\nabla_{\beta} C(\beta) = \frac{2}{n}\begin{bmatrix} \sum_{i=1}^{100} \left(\beta_0+\beta_1x_i-y_i\right) \\ +\sum_{i=1}^{100}\left( x_i (\beta_0+\beta_1x_i)-y_ix_i\right) \\ +\end{bmatrix} = \frac{2}{n}X^T(X\beta - \mathbf{y}), +$$ + +where \( X \) is the design matrix defined above. + +

    +









    + +

    The Hessian matrix

    +The Hessian matrix of \( C(\beta) \) is given by +$$ +\boldsymbol{H} \equiv \begin{bmatrix} +\frac{\partial^2 C(\beta)}{\partial \beta_0^2} & \frac{\partial^2 C(\beta)}{\partial \beta_0 \partial \beta_1} \\ +\frac{\partial^2 C(\beta)}{\partial \beta_0 \partial \beta_1} & \frac{\partial^2 C(\beta)}{\partial \beta_1^2} & \\ +\end{bmatrix} = \frac{2}{n}X^T X. +$$ + +This result implies that \( C(\beta) \) is a convex function since the matrix \( X^T X \) always is positive semi-definite. + +

    +









    + +

    Simple program

    + +

    +We can now write a program that minimizes \( C(\beta) \) using the gradient descent method with a constant learning rate \( \gamma \) according to +$$ +\beta_{k+1} = \beta_k - \gamma \nabla_\beta C(\beta_k), \ k=0,1,\cdots +$$ + +

    +We can use the expression we computed for the gradient and let use a +\( \beta_0 \) be chosen randomly and let \( \gamma = 0.001 \). Stop iterating +when \( ||\nabla_\beta C(\beta_k) || \leq \epsilon = 10^{-8} \). Note that the code below does not include the latter stop criterion. + +

    +And finally we can compare our solution for \( \beta \) with the analytic result given by +\( \beta= (X^TX)^{-1} X^T \mathbf{y} \). + +

    +









    + +

    Gradient Descent Example

    + +

    +Here our simple example +

    + + +

    # Importing various packages
    +from random import random, seed
    +import numpy as np
    +import matplotlib.pyplot as plt
    +from mpl_toolkits.mplot3d import Axes3D
    +from matplotlib import cm
    +from matplotlib.ticker import LinearLocator, FormatStrFormatter
    +import sys
    +
    +# the number of datapoints
    +n = 100
    +x = 2*np.random.rand(n,1)
    +y = 4+3*x+np.random.randn(n,1)
    +
    +X = np.c_[np.ones((n,1)), x]
    +# Hessian matrix
    +H = (2.0/n)* X.T @ X
    +# Get the eigenvalues
    +EigValues, EigVectors = np.linalg.eig(H)
    +print(EigValues)
    +
    +beta_linreg = np.linalg.inv(X.T @ X) @ X.T @ y
    +print(beta_linreg)
    +beta = np.random.randn(2,1)
    +
    +eta = 1.0/np.max(EigValues)
    +Niterations = 1000
    +
    +for iter in range(Niterations):
    +    gradient = (2.0/n)*X.T @ (X @ beta-y)
    +    beta -= eta*gradient
    +
    +print(beta)
    +xnew = np.array([[0],[2]])
    +xbnew = np.c_[np.ones((2,1)), xnew]
    +ypredict = xbnew.dot(beta)
    +ypredict2 = xbnew.dot(beta_linreg)
    +plt.plot(xnew, ypredict, "r-")
    +plt.plot(xnew, ypredict2, "b-")
    +plt.plot(x, y ,'ro')
    +plt.axis([0,2.0,0, 15.0])
    +plt.xlabel(r'$x$')
    +plt.ylabel(r'$y$')
    +plt.title(r'Gradient descent example')
    +plt.show()
    +
    +

    +









    + +

    And a corresponding example using scikit-learn

    + +

    + + +

    # Importing various packages
    +from random import random, seed
    +import numpy as np
    +import matplotlib.pyplot as plt
    +from sklearn.linear_model import SGDRegressor
    +
    +n = 100
    +x = 2*np.random.rand(n,1)
    +y = 4+3*x+np.random.randn(n,1)
    +
    +X = np.c_[np.ones((n,1)), x]
    +beta_linreg = np.linalg.inv(X.T @ X) @ (X.T @ y)
    +print(beta_linreg)
    +sgdreg = SGDRegressor(max_iter = 50, penalty=None, eta0=0.1)
    +sgdreg.fit(x,y.ravel())
    +print(sgdreg.intercept_, sgdreg.coef_)
    +
    +

    + + +

    Gradient descent and Ridge

    + +

    +We have also discussed Ridge regression where the loss function contains a regularized term given by the \( L_2 \) norm of \( \beta \), +$$ +C_{\text{ridge}}(\beta) = \frac{1}{n}||X\beta -\mathbf{y}||^2 + \lambda ||\beta||^2, \ \lambda \geq 0. +$$ + +

    +In order to minimize \( C_{\text{ridge}}(\beta) \) using GD we only have adjust the gradient as follows +$$ +\nabla_\beta C_{\text{ridge}}(\beta) = \frac{2}{n}\begin{bmatrix} \sum_{i=1}^{100} \left(\beta_0+\beta_1x_i-y_i\right) \\ +\sum_{i=1}^{100}\left( x_i (\beta_0+\beta_1x_i)-y_ix_i\right) \\ +\end{bmatrix} + 2\lambda\begin{bmatrix} \beta_0 \\ \beta_1\end{bmatrix} = 2 (X^T(X\beta - \mathbf{y})+\lambda \beta). +$$ + +

    +We can easily extend our program to minimize \( C_{\text{ridge}}(\beta) \) using gradient descent and compare with the analytical solution given by +$$ +\beta_{\text{ridge}} = \left(X^T X + \lambda I_{2 \times 2} \right)^{-1} X^T \mathbf{y}. +$$ + +

    +









    + +

    Program example for gradient descent with Ridge Regression

    +

    + + +

    from random import random, seed
    +import numpy as np
    +import matplotlib.pyplot as plt
    +from mpl_toolkits.mplot3d import Axes3D
    +from matplotlib import cm
    +from matplotlib.ticker import LinearLocator, FormatStrFormatter
    +import sys
    +
    +# the number of datapoints
    +n = 100
    +x = 2*np.random.rand(n,1)
    +y = 4+3*x+np.random.randn(n,1)
    +
    +X = np.c_[np.ones((n,1)), x]
    +XT_X = X.T @ X
    +
    +#Ridge parameter lambda
    +lmbda  = 0.001
    +Id = lmbda* np.eye(XT_X.shape[0])
    +
    +beta_linreg = np.linalg.inv(XT_X+Id) @ X.T @ y
    +print(beta_linreg)
    +# Start plain gradient descent
    +beta = np.random.randn(2,1)
    +
    +eta = 0.1
    +Niterations = 100
    +
    +for iter in range(Niterations):
    +    gradients = 2.0/n*X.T @ (X @ (beta)-y)+2*lmbda*beta
    +    beta -= eta*gradients
    +
    +print(beta)
    +ypredict = X @ beta
    +ypredict2 = X @ beta_linreg
    +plt.plot(x, ypredict, "r-")
    +plt.plot(x, ypredict2, "b-")
    +plt.plot(x, y ,'ro')
    +plt.axis([0,2.0,0, 15.0])
    +plt.xlabel(r'$x$')
    +plt.ylabel(r'$y$')
    +plt.title(r'Gradient descent example for Ridge')
    +plt.show()
    +
    +

    +









    + +

    Using gradient descent methods, limitations

    + +
      +
    • Gradient descent (GD) finds local minima of our function. Since the GD algorithm is deterministic, if it converges, it will converge to a local minimum of our cost/loss/risk function. Because in ML we are often dealing with extremely rugged landscapes with many local minima, this can lead to poor performance.
    • +
    • GD is sensitive to initial conditions. One consequence of the local nature of GD is that initial conditions matter. Depending on where one starts, one will end up at a different local minima. Therefore, it is very important to think about how one initializes the training process. This is true for GD as well as more complicated variants of GD.
    • +
    • Gradients are computationally expensive to calculate for large datasets. In many cases in statistics and ML, the cost/loss/risk function is a sum of terms, with one term for each data point. For example, in linear regression, \( E \propto \sum_{i=1}^n (y_i - \mathbf{w}^T\cdot\mathbf{x}_i)^2 \); for logistic regression, the square error is replaced by the cross entropy. To calculate the gradient we have to sum over all \( n \) data points. Doing this at every GD step becomes extremely computationally expensive. An ingenious solution to this, is to calculate the gradients using small subsets of the data called "mini batches". This has the added benefit of introducing stochasticity into our algorithm.
    • +
    • GD is very sensitive to choices of learning rates. GD is extremely sensitive to the choice of learning rates. If the learning rate is very small, the training process take an extremely long time. For larger learning rates, GD can diverge and give poor results. Furthermore, depending on what the local landscape looks like, we have to modify the learning rates to ensure convergence. Ideally, we would adaptively choose the learning rates to match the landscape.
    • +
    • GD treats all directions in parameter space uniformly. Another major drawback of GD is that unlike Newton's method, the learning rate for GD is the same in all directions in parameter space. For this reason, the maximum learning rate is set by the behavior of the steepest direction and this can significantly slow down training. Ideally, we would like to take large steps in flat directions and small steps in steep directions. Since we are exploring rugged landscapes where curvatures change, this requires us to keep track of not only the gradient but second derivatives. The ideal scenario would be to calculate the Hessian but this proves to be too computationally expensive.
    • +
    • GD can take exponential time to escape saddle points, even with random initialization. As we mentioned, GD is extremely sensitive to initial condition since it determines the particular local minimum GD would eventually reach. However, even with a good initialization scheme, through the introduction of randomness, GD can still take exponential time to escape saddle points. This leads us to our next topic, Stochastic Gradient Methods.
    • +
    + + + + + +
    + © 1999-2021, Morten Hjorth-Jensen. Released under CC Attribution-NonCommercial 4.0 license +
    + + + + + + diff --git a/doc/src/week38/week38.html b/doc/src/week38/week38.html new file mode 100644 index 000000000..f09aa8f50 --- /dev/null +++ b/doc/src/week38/week38.html @@ -0,0 +1,3573 @@ + + + + + + + + +Data Analysis and Machine Learning: Logistic Regression + + + + + + + + + + + + + + + + + + + + + + + +

    Data Analysis and Machine Learning: Logistic Regression

    + +

    + + +

    +Morten Hjorth-Jensen [1, 2] +
    + +

    + + +

    [1] Department of Physics, University of Oslo
    +
    [2] Department of Physics and Astronomy and National Superconducting Cyclotron Laboratory, Michigan State University
    +
    +

    +

    Sep 23, 2021

    +
    +

    +









    + +

    Plans for week 38

    + +
      +
    • Thursday: Summary of regression methods and discussion of project 1. Start Logistic Regression
    • +
    • Video of Lecture September 23
    • +
    • Friday: Logistic Regression and Optimization methods
    • +
    + +









    + +

    Thursday September 23

    + +

    +









    + +

    Ridge and LASSO Regression, reminder

    + +

    +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 +our optimization problem is +$$ +{\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\}. +$$ + +or we can state it as +$$ +{\displaystyle \min_{\boldsymbol{\beta}\in +{\mathbb{R}}^{p}}}\frac{1}{n}\sum_{i=0}^{n-1}\left(y_i-\tilde{y}_i\right)^2=\frac{1}{n}\vert\vert \boldsymbol{y}-\boldsymbol{X}\boldsymbol{\beta}\vert\vert_2^2, +$$ + +where we have used the definition of a norm-2 vector, that is +$$ +\vert\vert \boldsymbol{x}\vert\vert_2 = \sqrt{\sum_i x_i^2}. +$$ + +

    +By minimizing the above equation with respect to the parameters +\( \boldsymbol{\beta} \) we could then obtain an analytical expression for the +parameters \( \boldsymbol{\beta} \). We can add a regularization parameter \( \lambda \) by +defining a new cost function to be optimized, that is + +$$ +{\displaystyle \min_{\boldsymbol{\beta}\in +{\mathbb{R}}^{p}}}\frac{1}{n}\vert\vert \boldsymbol{y}-\boldsymbol{X}\boldsymbol{\beta}\vert\vert_2^2+\lambda\vert\vert \boldsymbol{\beta}\vert\vert_2^2 +$$ + +

    +which leads to the Ridge regression minimization problem where we +require that \( \vert\vert \boldsymbol{\beta}\vert\vert_2^2\le t \), where \( t \) is +a finite number larger than zero. By defining + +$$ +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, +$$ + +

    +we have a new optimization equation +$$ +{\displaystyle \min_{\boldsymbol{\beta}\in +{\mathbb{R}}^{p}}}\frac{1}{n}\vert\vert \boldsymbol{y}-\boldsymbol{X}\boldsymbol{\beta}\vert\vert_2^2+\lambda\vert\vert \boldsymbol{\beta}\vert\vert_1 +$$ + +which leads to Lasso regression. Lasso stands for least absolute shrinkage and selection operator. + +

    +Here we have defined the norm-1 as +$$ +\vert\vert \boldsymbol{x}\vert\vert_1 = \sum_i \vert x_i\vert. +$$ + +

    + + +

    Various steps in cross-validation

    + +

    +When the repetitive splitting of the data set is done randomly, +samples may accidently end up in a fast majority of the splits in +either training or test set. Such samples may have an unbalanced +influence on either model building or prediction evaluation. To avoid +this \( k \)-fold cross-validation structures the data splitting. The +samples are divided into \( k \) more or less equally sized exhaustive and +mutually exclusive subsets. In turn (at each split) one of these +subsets plays the role of the test set while the union of the +remaining subsets constitutes the training set. Such a splitting +warrants a balanced representation of each sample in both training and +test set over the splits. Still the division into the \( k \) subsets +involves a degree of randomness. This may be fully excluded when +choosing \( k=n \). This particular case is referred to as leave-one-out +cross-validation (LOOCV). + +

    + + +

    How to set up the cross-validation for Ridge and/or Lasso

    + +
      +
    • Define a range of interest for the penalty parameter.
    • +
    • Divide the data set into training and test set comprising samples \( \{1, \ldots, n\} \setminus i \) and \( \{ i \} \), respectively.
    • +
    • Fit the linear regression model by means of ridge estimation for each \( \lambda \) in the grid using the training set, and the corresponding estimate of the error variance \( \boldsymbol{\sigma}_{-i}^2(\lambda) \), as
    • +
    + +$$ +\begin{align*} +\boldsymbol{\beta}_{-i}(\lambda) & = ( \boldsymbol{X}_{-i, \ast}^{T} +\boldsymbol{X}_{-i, \ast} + \lambda \boldsymbol{I}_{pp})^{-1} +\boldsymbol{X}_{-i, \ast}^{T} \boldsymbol{y}_{-i} +\end{align*} +$$ + + +
      +
    • Evaluate the prediction performance of these models on the test set by \( C[y_i, \boldsymbol{X}_{i, \ast}; \boldsymbol{\beta}_{-i}(\lambda), \boldsymbol{\sigma}_{-i}^2(\lambda)] \). Or, by the prediction error \( |y_i - \boldsymbol{X}_{i, \ast} \boldsymbol{\beta}_{-i}(\lambda)| \), the relative error, the error squared or the R2 score function.
    • +
    • Repeat the first three steps such that each sample plays the role of the test set once.
    • +
    • Average the prediction performances of the test sets at each grid point of the penalty bias/parameter. It is an estimate of the prediction performance of the model corresponding to this value of the penalty parameter on novel data.
    • +
    + +









    + +

    Cross-validation in brief

    + +

    +For the various values of \( k \) + +

      +
    1. shuffle the dataset randomly.
    2. +
    3. Split the dataset into \( k \) groups.
    4. +
    5. For each unique group: + +
        +
      1. Decide which group to use as set for test data
      2. +
      3. Take the remaining groups as a training data set
      4. +
      5. Fit a model on the training set and evaluate it on the test set
      6. +
      7. Retain the evaluation score and discard the model
      8. +
      + +
    6. Summarize the model using the sample of model evaluation scores
    7. +
    + +









    + +

    Code Example for Cross-validation and \( k \)-fold Cross-validation

    + +

    +The code here uses Ridge regression with cross-validation (CV) resampling and \( k \)-fold CV in order to fit a specific polynomial. +

    + + +

    import numpy as np
    +import matplotlib.pyplot as plt
    +from sklearn.model_selection import KFold
    +from sklearn.linear_model import Ridge
    +from sklearn.model_selection import cross_val_score
    +from sklearn.preprocessing import PolynomialFeatures
    +
    +# A seed just to ensure that the random numbers are the same for every run.
    +# Useful for eventual debugging.
    +np.random.seed(3155)
    +
    +# Generate the data.
    +nsamples = 100
    +x = np.random.randn(nsamples)
    +y = 3*x**2 + np.random.randn(nsamples)
    +
    +## Cross-validation on Ridge regression using KFold only
    +
    +# Decide degree on polynomial to fit
    +poly = PolynomialFeatures(degree = 6)
    +
    +# Decide which values of lambda to use
    +nlambdas = 500
    +lambdas = np.logspace(-3, 5, nlambdas)
    +
    +# Initialize a KFold instance
    +k = 5
    +kfold = KFold(n_splits = k)
    +
    +# Perform the cross-validation to estimate MSE
    +scores_KFold = np.zeros((nlambdas, k))
    +
    +i = 0
    +for lmb in lambdas:
    +    ridge = Ridge(alpha = lmb)
    +    j = 0
    +    for train_inds, test_inds in kfold.split(x):
    +        xtrain = x[train_inds]
    +        ytrain = y[train_inds]
    +
    +        xtest = x[test_inds]
    +        ytest = y[test_inds]
    +
    +        Xtrain = poly.fit_transform(xtrain[:, np.newaxis])
    +        ridge.fit(Xtrain, ytrain[:, np.newaxis])
    +
    +        Xtest = poly.fit_transform(xtest[:, np.newaxis])
    +        ypred = ridge.predict(Xtest)
    +
    +        scores_KFold[i,j] = np.sum((ypred - ytest[:, np.newaxis])**2)/np.size(ypred)
    +
    +        j += 1
    +    i += 1
    +
    +
    +estimated_mse_KFold = np.mean(scores_KFold, axis = 1)
    +
    +## Cross-validation using cross_val_score from sklearn along with KFold
    +
    +# kfold is an instance initialized above as:
    +# kfold = KFold(n_splits = k)
    +
    +estimated_mse_sklearn = np.zeros(nlambdas)
    +i = 0
    +for lmb in lambdas:
    +    ridge = Ridge(alpha = lmb)
    +
    +    X = poly.fit_transform(x[:, np.newaxis])
    +    estimated_mse_folds = cross_val_score(ridge, X, y[:, np.newaxis], scoring='neg_mean_squared_error', cv=kfold)
    +
    +    # cross_val_score return an array containing the estimated negative mse for every fold.
    +    # we have to the the mean of every array in order to get an estimate of the mse of the model
    +    estimated_mse_sklearn[i] = np.mean(-estimated_mse_folds)
    +
    +    i += 1
    +
    +## Plot and compare the slightly different ways to perform cross-validation
    +
    +plt.figure()
    +
    +plt.plot(np.log10(lambdas), estimated_mse_sklearn, label = 'cross_val_score')
    +plt.plot(np.log10(lambdas), estimated_mse_KFold, 'r--', label = 'KFold')
    +
    +plt.xlabel('log10(lambda)')
    +plt.ylabel('mse')
    +
    +plt.legend()
    +
    +plt.show()
    +
    +

    +









    + +

    To think about, first part

    + +

    +When you are comparing your own code with for example Scikit-Learn's +library, there are some technicalities to keep in mind. The examples +here demonstrate some of these aspects with potential pitfalls. + +

    +The discussion here focuses on the role of the intercept, how we can +set up the design matrix, what scaling we should use and other topics +which tend confuse us. + +

    +The intercept can be interpreted as the expected value of our +target/output variables when all other predictors are set to zero. +Thus, if we cannot assume that the expected outputs/targets are zero +when all predictors are zero (the columns in the design matrix), it +may be a bad idea to implement a model which penalizes the intercept. +Furthermore, in for example Ridge and Lasso regression, the default solutions +from the library Scikit-Learn (when not shrinking \( \beta_0 \)) for the unknown parameters +\( \boldsymbol{\beta} \), are derived under the assumption that both \( \boldsymbol{y} \) and +\( \boldsymbol{X} \) are zero centered, that is we subtract the mean values. + +

    +









    + +

    More thinking

    + +

    +If our predictors represent different scales, then it is important to +standardize the design matrix \( \boldsymbol{X} \) by subtracting the mean of each +column from the corresponding column and dividing the column with its +standard deviation. Most machine learning libraries do this as a default. This means that if you compare your code with the results from a given library, +the results may differ. + +

    +The +Standadscaler +function in Scikit-Learn does this for us. For the data sets we +have been studying in our various examples, the data are in many cases +already scaled and there is no need to scale them. You as a user of different machine learning algorithms, should always perform a +survey of your data, with a critical assessment of them in case you need to scale the data. + +

    +If you need to scale the data, not doing so will give an unfair +penalization of the parameters since their magnitude depends on the +scale of their corresponding predictor. + +

    +Suppose as an example that you +you have an input variable given by the heights of different persons. +Human height might be measured in inches or meters or +kilometers. If measured in kilometers, a standard linear regression +model with this predictor would probably give a much bigger +coefficient term, than if measured in millimeters. +This can clearly lead to problems in evaluating the cost/loss functions. + +

    +









    + +

    Still thinking

    + +

    +Keep in mind that when you transform your data set before training a model, the same transformation needs to be done +on your eventual new data set before making a prediction. If we translate this into a Python code, it would could be implemented as follows + +

    + + +

    #Model training, we compute the mean value of y and X
    +y_train_mean = np.mean(y_train)
    +X_train_mean = np.mean(X_train,axis=0)
    +X_train = X_train - X_train_mean
    +y_train = y_train - y_train_mean
    +
    +# The we fit our model with the training data
    +trained_model = some_model.fit(X_train,y_train)
    +
    +
    +#Model prediction, we need also to transform our data set used for the prediction.
    +X_test = X_test - X_train_mean #Use mean from training data
    +y_pred = trained_model(X_test)
    +y_pred = y_pred + y_train_mean
    +
    +

    +









    + +

    What does centering (subtracting the mean values) mean mathematically?

    + +

    +Let us try to understand what this may imply mathematically when we +subtract the mean values, also known as zero centering. For +simplicity, we will focus on ordinary regression, as done in the above example. + +

    +The cost/loss function for regression is +$$ +C(\beta_0, \beta_1, ... , \beta_{p-1}) = \frac{1}{n}\sum_{i=0}^{n} \left(y_i - \beta_0 - \sum_{j=1}^{p-1} X_{ij}\beta_j\right)^2,. +$$ + +Recall also that we use the squared value since this leads to an increase of the penalty for higher differences between predicted and output/target values. + +

    +What we have done is to single out the \( \beta_0 \) term in the definition of the mean squared error (MSE). +The design matrix +\( X \) does in this case not contain any intercept column. +When we take the derivative with respect to \( \beta_0 \), we want the derivative to obey +$$ +\frac{\partial C}{\partial \beta_j} = 0, +$$ + +

    +for all \( j \). For \( \beta_0 \) we have + +$$ +\frac{\partial C}{\partial \beta_0} = -\frac{2}{n}\sum_{i=0}^{n-1} \left(y_i - \beta_0 - \sum_{j=1}^{p-1} X_{ij} \beta_j\right). +$$ + +Multiplying away the constant \( 2/n \), we obtain +$$ +\sum_{i=0}^{n-1} \beta_0 = \sum_{i=0}^{n-1}y_i - \sum_{i=0}^{n-1} \sum_{j=1}^{p-1} X_{ij} \beta_j. +$$ + +

    +









    + +

    Further Manipulations

    + +

    +We assume +that every column of \( \boldsymbol{X} \) is centered, which we can do by subtracting the mean, +

    + + +

    X = X - np.mean(X,axis=0)
    +
    +

    +This means that we need to rewrite \( X_{ij} \) as \( \tilde{X}_{ij}=X_{ij}-\mu_j \), where +$$ +\mu_j = \frac{1}{n}\sum_{i=0}^{n-1}X_{ij}. +$$ + +

    +Let us special first to the case where we have only two parameters \( \beta_0 \) and \( \beta_1 \). +Our result for \( \beta_0 \) simplifies then to +$$ +n\beta_0 = \sum_{i=0}^{n-1}y_i - \sum_{i=0}^{n-1} X_{i1} \beta_1. +$$ + +Assuming that the matrix elements \( X_{i1} \) are centered, what we have is +$$ +\beta_0 = \frac{1}{n}\sum_{i=0}^{n-1}y_i - \beta_1\frac{1}{n}\sum_{i=0}^{n-1} \left(X_{i1}-\mu_{1}\right), +$$ + +where +$$ +\mu_1=\frac{1}{n}\sum_{i=0}^{n-1} (X_{i1}, +$$ + +and if we define the mean value of the outputs as +$$ +\mu_y=\frac{1}{n}\sum_{i=0}^{n-1}y_i, +$$ + +we have +$$ +\beta_0 = \mu_y - \beta_1\frac{1}{n}\sum_{i=0}^{n-1} (X_{i1}-\mu_{1}), +$$ + +and it is easy to see that the last sum equals zero! This means that we have +$$ +\beta_0 = \mu_y, +$$ + +if the columns of the design matrix are centered. It is straight forward to generalize this results to more values of \( \beta \). +We have thus +$$ +\beta_0 = \frac{1}{n}\sum_{i=0}^{n-1} y_i = \overline{\boldsymbol{y}}, +$$ + +the average value of \( \boldsymbol{y} \). + +

    +Replacing \( y_i \) with \( y_i - \beta_0 = y_i - \overline{\boldsymbol{y}} \) and centering also our design matrix results in a cost function (in vector-matrix disguise) +$$ +C(\boldsymbol{\beta}) = (\boldsymbol{\tilde{y}} - \tilde{X}\boldsymbol{\beta})^T(\boldsymbol{\tilde{y}} - \tilde{X}\boldsymbol{\beta}). +$$ + +

    +









    + +

    Wrapping it up

    + +

    +If we minimize with respect to \( \boldsymbol{\beta} \) we have then + +$$ +\hat{\boldsymbol{\beta}} = (\tilde{X}^T\tilde{X})^{-1}\tilde{X}^T\boldsymbol{\tilde{y}}, +$$ + +

    +where \( \boldsymbol{\tilde{y}} = \boldsymbol{y} - \overline{\boldsymbol{y}} \) +and \( \tilde{X}_{ij} = X_{ij} - \frac{1}{n}\sum_{k=0}^{n-1}X_{kj} \). + +

    +For Ridge regression we need to add \( \lambda \boldsymbol{\beta}^T\boldsymbol{\beta} \) to the cost function and get then +$$ +\hat{\boldsymbol{\beta}} = (\tilde{X}^T\tilde{X} + \lambda I)^{-1}\tilde{X}^T\boldsymbol{\tilde{y}}. +$$ + +

    +What does this mean? And why do we insist on all this? Let us look at some examples. + +

    +









    + +

    Linear Regression code, Intercept handling first

    + +

    +This code shows a simple first-order fit to a data set using the above transformed data, where we consider the role of the intercept first, by either excluding it or including it (code example thanks to Øyvind Sigmundson Schøyen). Here our scaling of the data is done by subtracting the mean values only. +Note also that we do not split the data into training and test. + +

    + + +

    import numpy as np
    +import matplotlib.pyplot as plt
    +
    +from sklearn.linear_model import LinearRegression
    +
    +
    +np.random.seed(2021)
    +
    +def MSE(y_data,y_model):
    +    n = np.size(y_model)
    +    return np.sum((y_data-y_model)**2)/n
    +
    +
    +def fit_beta(X, y):
    +    return np.linalg.pinv(X.T @ X) @ X.T @ y
    +
    +
    +true_beta = [2, 0.5, 3.7]
    +
    +x = np.linspace(0, 1, 11)
    +y = np.sum(
    +    np.asarray([x ** p * b for p, b in enumerate(true_beta)]), axis=0
    +) + 0.1 * np.random.normal(size=len(x))
    +
    +degree = 3
    +X = np.zeros((len(x), degree))
    +
    +# Include the intercept in the design matrix
    +for p in range(degree):
    +    X[:, p] = x ** p
    +
    +beta = fit_beta(X, y)
    +
    +# Intercept is included in the design matrix
    +skl = LinearRegression(fit_intercept=False).fit(X, y)
    +
    +print(f"True beta: {true_beta}")
    +print(f"Fitted beta: {beta}")
    +print(f"Sklearn fitted beta: {skl.coef_}")
    +ypredictOwn = X @ beta
    +ypredictSKL = skl.predict(X)
    +print(f"MSE with intercept column")
    +print(MSE(y,ypredictOwn))
    +print(f"MSE with intercept column from SKL")
    +print(MSE(y,ypredictSKL))
    +
    +
    +plt.figure()
    +plt.scatter(x, y, label="Data")
    +plt.plot(x, X @ beta, label="Fit")
    +plt.plot(x, skl.predict(X), label="Sklearn (fit_intercept=False)")
    +
    +
    +# Do not include the intercept in the design matrix
    +X = np.zeros((len(x), degree - 1))
    +
    +for p in range(degree - 1):
    +    X[:, p] = x ** (p + 1)
    +
    +# Intercept is not included in the design matrix
    +skl = LinearRegression(fit_intercept=True).fit(X, y)
    +
    +# Use centered values for X and y when computing coefficients
    +y_offset = np.average(y, axis=0)
    +X_offset = np.average(X, axis=0)
    +
    +beta = fit_beta(X - X_offset, y - y_offset)
    +intercept = np.mean(y_offset - X_offset @ beta)
    +
    +print(f"Manual intercept: {intercept}")
    +print(f"Fitted beta (wiothout intercept): {beta}")
    +print(f"Sklearn intercept: {skl.intercept_}")
    +print(f"Sklearn fitted beta (without intercept): {skl.coef_}")
    +ypredictOwn = X @ beta
    +ypredictSKL = skl.predict(X)
    +print(f"MSE with Manual intercept")
    +print(MSE(y,ypredictOwn+intercept))
    +print(f"MSE with Sklearn intercept")
    +print(MSE(y,ypredictSKL))
    +
    +plt.plot(x, X @ beta + intercept, "--", label="Fit (manual intercept)")
    +plt.plot(x, skl.predict(X), "--", label="Sklearn (fit_intercept=True)")
    +plt.grid()
    +plt.legend()
    +
    +plt.show()
    +
    +

    +The intercept is the value of our output/target variable +when all our features are zero and our function crosses the \( y \)-axis (for a one-dimensional case). + +

    +Printing the MSE, we see first that both methods give the same MSE, as +they should. However, when we move to for example Ridge regression, +the way we treat the intercept may give a larger or smaller MSE, +meaning that the MSE can be penalized by the value of the +intercept. Not including the intercept in the fit, means that the +regularization term does not include \( \beta_0 \). For different values +of \( \lambda \), this may lead to differeing MSE values. + +

    +To remind the reader, the regularization term, with the intercept in Ridge regression is given by +$$ +\lambda \vert\vert \boldsymbol{\beta} \vert\vert_2^2 = \lambda \sum_{j=0}^{p-1}\beta_j^2, +$$ + +but when we take out the intercept, this equation becomes +$$ +\lambda \vert\vert \boldsymbol{\beta} \vert\vert_2^2 = \lambda \sum_{j=1}^{p-1}\beta_j^2. +$$ + +

    +For Lasso regression we have +$$ +\lambda \vert\vert \boldsymbol{\beta} \vert\vert_1 = \lambda \sum_{j=1}^{p-1}\vert\beta_j\vert. +$$ + +

    +It means that, when scaling the design matrix and the outputs/targets, by subtracting the mean values, we have an optimization problem which is not penalized by the intercept. The MSE value can then be smaller since it focuses only on the remaining quantities. If we however bring back the intercept, we will get a MSE which then contains the intercept. + +

    +









    + +

    Code Examples

    + +

    +Armed with this wisdom, we attempt first to simply set the intercept equal to False in our implementation of Ridge regression for our well-known vanilla data set. + +

    + + +

    import numpy as np
    +import pandas as pd
    +import matplotlib.pyplot as plt
    +from sklearn.model_selection import train_test_split
    +from sklearn import linear_model
    +
    +def MSE(y_data,y_model):
    +    n = np.size(y_model)
    +    return np.sum((y_data-y_model)**2)/n
    +
    +
    +# A seed just to ensure that the random numbers are the same for every run.
    +# Useful for eventual debugging.
    +np.random.seed(3155)
    +
    +n = 100
    +x = np.random.rand(n)
    +y = np.exp(-x**2) + 1.5 * np.exp(-(x-2)**2)
    +
    +Maxpolydegree = 20
    +X = np.zeros((n,Maxpolydegree))
    +#We include explicitely the intercept column
    +for degree in range(Maxpolydegree):
    +    X[:,degree] = x**degree
    +# We split the data in test and training data
    +X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)
    +
    +p = Maxpolydegree
    +I = np.eye(p,p)
    +# Decide which values of lambda to use
    +nlambdas = 6
    +MSEOwnRidgePredict = np.zeros(nlambdas)
    +MSERidgePredict = np.zeros(nlambdas)
    +lambdas = np.logspace(-4, 2, nlambdas)
    +for i in range(nlambdas):
    +    lmb = lambdas[i]
    +    OwnRidgeBeta = np.linalg.pinv(X_train.T @ X_train+lmb*I) @ X_train.T @ y_train
    +    # Note: we include the intercept column and no scaling
    +    RegRidge = linear_model.Ridge(lmb,fit_intercept=False)
    +    RegRidge.fit(X_train,y_train)
    +    # and then make the prediction
    +    ytildeOwnRidge = X_train @ OwnRidgeBeta
    +    ypredictOwnRidge = X_test @ OwnRidgeBeta
    +    ytildeRidge = RegRidge.predict(X_train)
    +    ypredictRidge = RegRidge.predict(X_test)
    +    MSEOwnRidgePredict[i] = MSE(y_test,ypredictOwnRidge)
    +    MSERidgePredict[i] = MSE(y_test,ypredictRidge)
    +    print("Beta values for own Ridge implementation")
    +    print(OwnRidgeBeta)
    +    print("Beta values for Scikit-Learn Ridge implementation")
    +    print(RegRidge.coef_)
    +    print("MSE values for own Ridge implementation")
    +    print(MSEOwnRidgePredict[i])
    +    print("MSE values for Scikit-Learn Ridge implementation")
    +    print(MSERidgePredict[i])
    +
    +# Now plot the results
    +plt.figure()
    +plt.plot(np.log10(lambdas), MSEOwnRidgePredict, 'r', label = 'MSE own Ridge Test')
    +plt.plot(np.log10(lambdas), MSERidgePredict, 'g', label = 'MSE Ridge Test')
    +
    +plt.xlabel('log10(lambda)')
    +plt.ylabel('MSE')
    +plt.legend()
    +plt.show()
    +
    +

    +The results here agree when we force Scikit-Learn's Ridge function to include the first column in our design matrix. +We see that the results agree very well. Here we have thus explicitely included the intercept column in the design matrix. +What happens if we do not include the intercept in our fit? +Let us see how we can change this code by zero centering (thanks to Stian Bilek for inpouts here). + +

    +









    + +

    Taking out the mean

    +

    + + +

    import numpy as np
    +import pandas as pd
    +import matplotlib.pyplot as plt
    +from sklearn.model_selection import train_test_split
    +from sklearn import linear_model
    +from sklearn.preprocessing import StandardScaler
    +
    +def MSE(y_data,y_model):
    +    n = np.size(y_model)
    +    return np.sum((y_data-y_model)**2)/n
    +# A seed just to ensure that the random numbers are the same for every run.
    +# Useful for eventual debugging.
    +np.random.seed(315)
    +
    +n = 100
    +x = np.random.rand(n)
    +y = np.exp(-x**2) + 1.5 * np.exp(-(x-2)**2)
    +
    +Maxpolydegree = 20
    +X = np.zeros((n,Maxpolydegree-1))
    +
    +for degree in range(1,Maxpolydegree): #No intercept column
    +    X[:,degree-1] = x**(degree)
    +
    +# We split the data in test and training data
    +X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)
    +
    +#For our own implementation, we will need to deal with the intercept by centering the design matrix and the target variable
    +X_train_mean = np.mean(X_train,axis=0)
    +#Center by removing mean from each feature
    +X_train_scaled = X_train - X_train_mean 
    +X_test_scaled = X_test - X_train_mean
    +#The model intercept (called y_scaler) is given by the mean of the target variable (IF X is centered)
    +#Remove the intercept from the training data.
    +y_scaler = np.mean(y_train)           
    +y_train_scaled = y_train - y_scaler   
    +
    +p = Maxpolydegree-1
    +I = np.eye(p,p)
    +# Decide which values of lambda to use
    +nlambdas = 6
    +MSEOwnRidgePredict = np.zeros(nlambdas)
    +MSERidgePredict = np.zeros(nlambdas)
    +
    +lambdas = np.logspace(-4, 2, nlambdas)
    +for i in range(nlambdas):
    +    lmb = lambdas[i]
    +    OwnRidgeBeta = np.linalg.pinv(X_train_scaled.T @ X_train_scaled+lmb*I) @ X_train_scaled.T @ (y_train_scaled)
    +    intercept_ = y_scaler - X_train_mean@OwnRidgeBeta #The intercept can be shifted so the model can predict on uncentered data
    +    #Add intercept to prediction
    +    ypredictOwnRidge = X_test @ OwnRidgeBeta + intercept_ 
    +    #Add intercept to prediction
    +    ypredictOwnRidge = X_test_scaled @ OwnRidgeBeta + y_scaler 
    +    RegRidge = linear_model.Ridge(lmb)
    +    RegRidge.fit(X_train,y_train)
    +    ypredictRidge = RegRidge.predict(X_test)
    +    MSEOwnRidgePredict[i] = MSE(y_test,ypredictOwnRidge)
    +    MSERidgePredict[i] = MSE(y_test,ypredictRidge)
    +    print("Beta values for own Ridge implementation")
    +    print(OwnRidgeBeta) #Intercept is given by mean of target variable
    +    print("Beta values for Scikit-Learn Ridge implementation")
    +    print(RegRidge.coef_)
    +    print('Intercept from own implementation:')
    +    print(intercept_)
    +    print('Intercept from Scikit-Learn Ridge implementation')
    +    print(RegRidge.intercept_)
    +    print("MSE values for own Ridge implementation")
    +    print(MSEOwnRidgePredict[i])
    +    print("MSE values for Scikit-Learn Ridge implementation")
    +    print(MSERidgePredict[i])
    +
    +
    +# Now plot the results
    +plt.figure()
    +plt.plot(np.log10(lambdas), MSEOwnRidgePredict, 'b--', label = 'MSE own Ridge Test')
    +plt.plot(np.log10(lambdas), MSERidgePredict, 'g--', label = 'MSE SL Ridge Test')
    +plt.xlabel('log10(lambda)')
    +plt.ylabel('MSE')
    +plt.legend()
    +plt.show()
    +
    +

    +We see here, when compared to the code which includes explicitely the +intercept column, that our MSE value is actually smaller. This is +because the regularization term does not include the intercept value +\( \beta_0 \) in the fitting. This applies to Lasso regularization as +well. It means that our optimization is now done only with the +centered matrix and/or vector that enter the fitting procedure. Note +also that the problem with the intercept occurs mainly in these type +of polynomial fitting problem. + +

    +The next example is indeed an example where all these discussions about the role of intercept are not present. + +

    +









    + +

    More complicated Example: The Ising model

    + +

    +The one-dimensional Ising model with nearest neighbor interaction, no +external field and a constant coupling constant \( J \) is given by + +$$ +\begin{align} + H = -J \sum_{k}^L s_k s_{k + 1}, +\label{_auto1} +\end{align} +$$ + +

    +where \( s_i \in \{-1, 1\} \) and \( s_{N + 1} = s_1 \). The number of spins +in the system is determined by \( L \). For the one-dimensional system +there is no phase transition. + +

    +We will look at a system of \( L = 40 \) spins with a coupling constant of +\( J = 1 \). To get enough training data we will generate 10000 states +with their respective energies. + +

    + + +

    import numpy as np
    +import matplotlib.pyplot as plt
    +from mpl_toolkits.axes_grid1 import make_axes_locatable
    +import seaborn as sns
    +import scipy.linalg as scl
    +from sklearn.model_selection import train_test_split
    +import tqdm
    +sns.set(color_codes=True)
    +cmap_args=dict(vmin=-1., vmax=1., cmap='seismic')
    +
    +L = 40
    +n = int(1e4)
    +
    +spins = np.random.choice([-1, 1], size=(n, L))
    +J = 1.0
    +
    +energies = np.zeros(n)
    +
    +for i in range(n):
    +    energies[i] = - J * np.dot(spins[i], np.roll(spins[i], 1))
    +
    +

    +Here we use ordinary least squares +regression to predict the energy for the nearest neighbor +one-dimensional Ising model on a ring, i.e., the endpoints wrap +around. We will use linear regression to fit a value for +the coupling constant to achieve this. + +

    +









    + +

    Reformulating the problem to suit regression

    + +

    +A more general form for the one-dimensional Ising model is + +$$ +\begin{align} + H = - \sum_j^L \sum_k^L s_j s_k J_{jk}. +\label{_auto2} +\end{align} +$$ + +

    +Here we allow for interactions beyond the nearest neighbors and a state dependent +coupling constant. This latter expression can be formulated as +a matrix-product +$$ +\begin{align} + \boldsymbol{H} = \boldsymbol{X} J, +\label{_auto3} +\end{align} +$$ + +

    +where \( X_{jk} = s_j s_k \) and \( J \) is a matrix which consists of the +elements \( -J_{jk} \). This form of writing the energy fits perfectly +with the form utilized in linear regression, that is + +$$ +\begin{align} + \boldsymbol{y} = \boldsymbol{X}\boldsymbol{\beta} + \boldsymbol{\epsilon}, +\label{_auto4} +\end{align} +$$ + +

    +We split the data in training and test data as discussed in the previous example + +

    + + +

    X = np.zeros((n, L ** 2))
    +for i in range(n):
    +    X[i] = np.outer(spins[i], spins[i]).ravel()
    +y = energies
    +X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)
    +
    +

    +









    + +

    Linear regression

    + +

    +In the ordinary least squares method we choose the cost function + +$$ +\begin{align} + C(\boldsymbol{X}, \boldsymbol{\beta})= \frac{1}{n}\left\{(\boldsymbol{X}\boldsymbol{\beta} - \boldsymbol{y})^T(\boldsymbol{X}\boldsymbol{\beta} - \boldsymbol{y})\right\}. +\label{_auto5} +\end{align} +$$ + +

    +We then find the extremal point of \( C \) by taking the derivative with respect to \( \boldsymbol{\beta} \) as discussed above. +This yields the expression for \( \boldsymbol{\beta} \) to be + +$$ + \boldsymbol{\beta} = \frac{\boldsymbol{X}^T \boldsymbol{y}}{\boldsymbol{X}^T \boldsymbol{X}}, +$$ + +

    +which immediately imposes some requirements on \( \boldsymbol{X} \) as there must exist +an inverse of \( \boldsymbol{X}^T \boldsymbol{X} \). If the expression we are modeling contains an +intercept, i.e., a constant term, we must make sure that the +first column of \( \boldsymbol{X} \) consists of \( 1 \). We do this here + +

    + + +

    X_train_own = np.concatenate(
    +    (np.ones(len(X_train))[:, np.newaxis], X_train),
    +    axis=1
    +)
    +X_test_own = np.concatenate(
    +    (np.ones(len(X_test))[:, np.newaxis], X_test),
    +    axis=1
    +)
    +
    +

    + + +

    def ols_inv(x: np.ndarray, y: np.ndarray) -> np.ndarray:
    +    return scl.inv(x.T @ x) @ (x.T @ y)
    +beta = ols_inv(X_train_own, y_train)
    +
    +

    +









    + +

    Singular Value decomposition

    + +

    +Doing the inversion directly turns out to be a bad idea since the matrix +\( \boldsymbol{X}^T\boldsymbol{X} \) is singular. An alternative approach is to use the singular +value decomposition. Using the definition of the Moore-Penrose +pseudoinverse we can write the equation for \( \boldsymbol{\beta} \) as + +$$ + \boldsymbol{\beta} = \boldsymbol{X}^{+}\boldsymbol{y}, +$$ + +

    +where the pseudoinverse of \( \boldsymbol{X} \) is given by + +$$ + \boldsymbol{X}^{+} = \frac{\boldsymbol{X}^T}{\boldsymbol{X}^T\boldsymbol{X}}. +$$ + +

    +Using singular value decomposition we can decompose the matrix \( \boldsymbol{X} = \boldsymbol{U}\boldsymbol{\Sigma} \boldsymbol{V}^T \), +where \( \boldsymbol{U} \) and \( \boldsymbol{V} \) are orthogonal(unitary) matrices and \( \boldsymbol{\Sigma} \) contains the singular values (more details below). +where \( X^{+} = V\Sigma^{+} U^T \). This reduces the equation for +\( \omega \) to +$$ +\begin{align} + \boldsymbol{\beta} = \boldsymbol{V}\boldsymbol{\Sigma}^{+} \boldsymbol{U}^T \boldsymbol{y}. +\label{_auto6} +\end{align} +$$ + +

    +Note that solving this equation by actually doing the pseudoinverse +(which is what we will do) is not a good idea as this operation scales +as \( \mathcal{O}(n^3) \), where \( n \) is the number of elements in a +general matrix. Instead, doing \( QR \)-factorization and solving the +linear system as an equation would reduce this down to +\( \mathcal{O}(n^2) \) operations. + +

    + + +

    def ols_svd(x: np.ndarray, y: np.ndarray) -> np.ndarray:
    +    u, s, v = scl.svd(x)
    +    return v.T @ scl.pinv(scl.diagsvd(s, u.shape[0], v.shape[0])) @ u.T @ y
    +
    +

    + + +

    beta = ols_svd(X_train_own,y_train)
    +
    +

    +When extracting the \( J \)-matrix we need to make sure that we remove the intercept, as is done here + +

    + + +

    J = beta[1:].reshape(L, L)
    +
    +

    +A way of looking at the coefficients in \( J \) is to plot the matrices as images. + +

    + + +

    fig = plt.figure(figsize=(20, 14))
    +im = plt.imshow(J, **cmap_args)
    +plt.title("OLS", fontsize=18)
    +plt.xticks(fontsize=18)
    +plt.yticks(fontsize=18)
    +cb = fig.colorbar(im)
    +cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)
    +plt.show()
    +
    +

    +It is interesting to note that OLS +considers both \( J_{j, j + 1} = -0.5 \) and \( J_{j, j - 1} = -0.5 \) as +valid matrix elements for \( J \). +In our discussion below on hyperparameters and Ridge and Lasso regression we will see that +this problem can be removed, partly and only with Lasso regression. + +

    +In this case our matrix inversion was actually possible. The obvious question now is what is the mathematics behind the SVD? + +

    +









    + +

    The one-dimensional Ising model

    + +

    +Let us bring back the Ising model again, but now with an additional +focus on Ridge and Lasso regression as well. We repeat some of the +basic parts of the Ising model and the setup of the training and test +data. The one-dimensional Ising model with nearest neighbor +interaction, no external field and a constant coupling constant \( J \) is +given by + +$$ +\begin{align} + H = -J \sum_{k}^L s_k s_{k + 1}, +\label{_auto7} +\end{align} +$$ + +where \( s_i \in \{-1, 1\} \) and \( s_{N + 1} = s_1 \). The number of spins in the system is determined by \( L \). For the one-dimensional system there is no phase transition. + +

    +We will look at a system of \( L = 40 \) spins with a coupling constant of \( J = 1 \). To get enough training data we will generate 10000 states with their respective energies. + +

    + + +

    import numpy as np
    +import matplotlib.pyplot as plt
    +from mpl_toolkits.axes_grid1 import make_axes_locatable
    +import seaborn as sns
    +import scipy.linalg as scl
    +from sklearn.model_selection import train_test_split
    +import sklearn.linear_model as skl
    +import tqdm
    +sns.set(color_codes=True)
    +cmap_args=dict(vmin=-1., vmax=1., cmap='seismic')
    +
    +L = 40
    +n = int(1e4)
    +
    +spins = np.random.choice([-1, 1], size=(n, L))
    +J = 1.0
    +
    +energies = np.zeros(n)
    +
    +for i in range(n):
    +    energies[i] = - J * np.dot(spins[i], np.roll(spins[i], 1))
    +
    +

    +A more general form for the one-dimensional Ising model is + +$$ +\begin{align} + H = - \sum_j^L \sum_k^L s_j s_k J_{jk}. +\label{_auto8} +\end{align} +$$ + +

    +Here we allow for interactions beyond the nearest neighbors and a more +adaptive coupling matrix. This latter expression can be formulated as +a matrix-product on the form +$$ +\begin{align} + H = X J, +\label{_auto9} +\end{align} +$$ + +

    +where \( X_{jk} = s_j s_k \) and \( J \) is the matrix consisting of the +elements \( -J_{jk} \). This form of writing the energy fits perfectly +with the form utilized in linear regression, viz. +$$ +\begin{align} + \boldsymbol{y} = \boldsymbol{X}\boldsymbol{\beta} + \boldsymbol{\epsilon}. +\label{_auto10} +\end{align} +$$ + +We organize the data as we did above +

    + + +

    X = np.zeros((n, L ** 2))
    +for i in range(n):
    +    X[i] = np.outer(spins[i], spins[i]).ravel()
    +y = energies
    +X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.96)
    +
    +X_train_own = np.concatenate(
    +    (np.ones(len(X_train))[:, np.newaxis], X_train),
    +    axis=1
    +)
    +
    +X_test_own = np.concatenate(
    +    (np.ones(len(X_test))[:, np.newaxis], X_test),
    +    axis=1
    +)
    +
    +

    +We will do all fitting with Scikit-Learn, + +

    + + +

    clf = skl.LinearRegression().fit(X_train, y_train)
    +
    +

    +When extracting the \( J \)-matrix we make sure to remove the intercept +

    + + +

    J_sk = clf.coef_.reshape(L, L)
    +
    +

    +And then we plot the results +

    + + +

    fig = plt.figure(figsize=(20, 14))
    +im = plt.imshow(J_sk, **cmap_args)
    +plt.title("LinearRegression from Scikit-learn", fontsize=18)
    +plt.xticks(fontsize=18)
    +plt.yticks(fontsize=18)
    +cb = fig.colorbar(im)
    +cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)
    +plt.show()
    +
    +

    +The results perfectly with our previous discussion where we used our own code. + +

    +









    + +

    Ridge regression

    + +

    +Having explored the ordinary least squares we move on to ridge +regression. In ridge regression we include a regularizer. This +involves a new cost function which leads to a new estimate for the +weights \( \boldsymbol{\beta} \). This results in a penalized regression problem. The +cost function is given by + +$$ +\begin{align} + C(\boldsymbol{X}, \boldsymbol{\beta}; \lambda) = (\boldsymbol{X}\boldsymbol{\beta} - \boldsymbol{y})^T(\boldsymbol{X}\boldsymbol{\beta} - \boldsymbol{y}) + \lambda \boldsymbol{\beta}^T\boldsymbol{\beta}. +\label{_auto11} +\end{align} +$$ + +

    + + +

    _lambda = 0.1
    +clf_ridge = skl.Ridge(alpha=_lambda).fit(X_train, y_train)
    +J_ridge_sk = clf_ridge.coef_.reshape(L, L)
    +fig = plt.figure(figsize=(20, 14))
    +im = plt.imshow(J_ridge_sk, **cmap_args)
    +plt.title("Ridge from Scikit-learn", fontsize=18)
    +plt.xticks(fontsize=18)
    +plt.yticks(fontsize=18)
    +cb = fig.colorbar(im)
    +cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)
    +
    +plt.show()
    +
    +

    +









    + +

    LASSO regression

    + +

    +In the Least Absolute Shrinkage and Selection Operator (LASSO)-method we get a third cost function. + +$$ +\begin{align} + C(\boldsymbol{X}, \boldsymbol{\beta}; \lambda) = (\boldsymbol{X}\boldsymbol{\beta} - \boldsymbol{y})^T(\boldsymbol{X}\boldsymbol{\beta} - \boldsymbol{y}) + \lambda \sqrt{\boldsymbol{\beta}^T\boldsymbol{\beta}}. +\label{_auto12} +\end{align} +$$ + +

    +Finding the extremal point of this cost function is not so straight-forward as in least squares and ridge. We will therefore rely solely on the function ``Lasso`` from Scikit-Learn. + +

    + + +

    clf_lasso = skl.Lasso(alpha=_lambda).fit(X_train, y_train)
    +J_lasso_sk = clf_lasso.coef_.reshape(L, L)
    +fig = plt.figure(figsize=(20, 14))
    +im = plt.imshow(J_lasso_sk, **cmap_args)
    +plt.title("Lasso from Scikit-learn", fontsize=18)
    +plt.xticks(fontsize=18)
    +plt.yticks(fontsize=18)
    +cb = fig.colorbar(im)
    +cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)
    +
    +plt.show()
    +
    +

    +It is quite striking how LASSO breaks the symmetry of the coupling +constant as opposed to ridge and OLS. We get a sparse solution with +\( J_{j, j + 1} = -1 \). + +

    +









    + +

    Performance as function of the regularization parameter

    + +

    +We see how the different models perform for a different set of values for \( \lambda \). + +

    + + +

    lambdas = np.logspace(-4, 5, 10)
    +
    +train_errors = {
    +    "ols_sk": np.zeros(lambdas.size),
    +    "ridge_sk": np.zeros(lambdas.size),
    +    "lasso_sk": np.zeros(lambdas.size)
    +}
    +
    +test_errors = {
    +    "ols_sk": np.zeros(lambdas.size),
    +    "ridge_sk": np.zeros(lambdas.size),
    +    "lasso_sk": np.zeros(lambdas.size)
    +}
    +
    +plot_counter = 1
    +
    +fig = plt.figure(figsize=(32, 54))
    +
    +for i, _lambda in enumerate(tqdm.tqdm(lambdas)):
    +    for key, method in zip(
    +        ["ols_sk", "ridge_sk", "lasso_sk"],
    +        [skl.LinearRegression(), skl.Ridge(alpha=_lambda), skl.Lasso(alpha=_lambda)]
    +    ):
    +        method = method.fit(X_train, y_train)
    +
    +        train_errors[key][i] = method.score(X_train, y_train)
    +        test_errors[key][i] = method.score(X_test, y_test)
    +
    +        omega = method.coef_.reshape(L, L)
    +
    +        plt.subplot(10, 5, plot_counter)
    +        plt.imshow(omega, **cmap_args)
    +        plt.title(r"%s, $\lambda = %.4f$" % (key, _lambda))
    +        plot_counter += 1
    +
    +plt.show()
    +
    +

    +We see that LASSO reaches a good solution for low +values of \( \lambda \), but will "wither" when we increase \( \lambda \) too +much. Ridge is more stable over a larger range of values for +\( \lambda \), but eventually also fades away. + +

    +









    + +

    Finding the optimal value of \( \lambda \)

    + +

    +To determine which value of \( \lambda \) is best we plot the accuracy of +the models when predicting the training and the testing set. We expect +the accuracy of the training set to be quite good, but if the accuracy +of the testing set is much lower this tells us that we might be +subject to an overfit model. The ideal scenario is an accuracy on the +testing set that is close to the accuracy of the training set. + +

    + + +

    fig = plt.figure(figsize=(20, 14))
    +
    +colors = {
    +    "ols_sk": "r",
    +    "ridge_sk": "y",
    +    "lasso_sk": "c"
    +}
    +
    +for key in train_errors:
    +    plt.semilogx(
    +        lambdas,
    +        train_errors[key],
    +        colors[key],
    +        label="Train {0}".format(key),
    +        linewidth=4.0
    +    )
    +
    +for key in test_errors:
    +    plt.semilogx(
    +        lambdas,
    +        test_errors[key],
    +        colors[key] + "--",
    +        label="Test {0}".format(key),
    +        linewidth=4.0
    +    )
    +plt.legend(loc="best", fontsize=18)
    +plt.xlabel(r"$\lambda$", fontsize=18)
    +plt.ylabel(r"$R^2$", fontsize=18)
    +plt.tick_params(labelsize=18)
    +plt.show()
    +
    +

    +From the above figure we can see that LASSO with \( \lambda = 10^{-2} \) +achieves a very good accuracy on the test set. This by far surpasses the +other models for all values of \( \lambda \). + +

    + + +

    Logistic Regression

    + +

    +In linear regression our main interest was centered on learning the +coefficients of a functional fit (say a polynomial) in order to be +able to predict the response of a continuous variable on some unseen +data. The fit to the continuous variable \( y_i \) is based on some +independent variables \( \boldsymbol{x}_i \). Linear regression resulted in +analytical expressions for standard ordinary Least Squares or Ridge +regression (in terms of matrices to invert) for several quantities, +ranging from the variance and thereby the confidence intervals of the +parameters \( \boldsymbol{\beta} \) to the mean squared error. If we can invert +the product of the design matrices, linear regression gives then a +simple recipe for fitting our data. + +

    + + +

    Classification problems

    + +

    +Classification problems, however, are concerned with outcomes taking +the form of discrete variables (i.e. categories). We may for example, +on the basis of DNA sequencing for a number of patients, like to find +out which mutations are important for a certain disease; or based on +scans of various patients' brains, figure out if there is a tumor or +not; or given a specific physical system, we'd like to identify its +state, say whether it is an ordered or disordered system (typical +situation in solid state physics); or classify the status of a +patient, whether she/he has a stroke or not and many other similar +situations. + +

    +The most common situation we encounter when we apply logistic +regression is that of two possible outcomes, normally denoted as a +binary outcome, true or false, positive or negative, success or +failure etc. + +

    +









    + +

    Optimization and Deep learning

    + +

    +Logistic regression will also serve as our stepping stone towards +neural network algorithms and supervised deep learning. For logistic +learning, the minimization of the cost function leads to a non-linear +equation in the parameters \( \boldsymbol{\beta} \). The optimization of the +problem calls therefore for minimization algorithms. This forms the +bottle neck of all machine learning algorithms, namely how to find +reliable minima of a multi-variable function. This leads us to the +family of gradient descent methods. The latter are the working horses +of basically all modern machine learning algorithms. + +

    +We note also that many of the topics discussed here on logistic +regression are also commonly used in modern supervised Deep Learning +models, as we will see later. + +

    + + +

    Basics

    + +

    +We consider the case where the dependent variables, also called the +responses or the outcomes, \( y_i \) are discrete and only take values +from \( k=0,\dots,K-1 \) (i.e. \( K \) classes). + +

    +The goal is to predict the +output classes from the design matrix \( \boldsymbol{X}\in\mathbb{R}^{n\times p} \) +made of \( n \) samples, each of which carries \( p \) features or predictors. The +primary goal is to identify the classes to which new unseen samples +belong. + +

    +Let us specialize to the case of two classes only, with outputs +\( y_i=0 \) and \( y_i=1 \). Our outcomes could represent the status of a +credit card user that could default or not on her/his credit card +debt. That is + +$$ +y_i = \begin{bmatrix} 0 & \mathrm{no}\\ 1 & \mathrm{yes} \end{bmatrix}. +$$ + +

    +









    + +

    Linear classifier

    + +

    +Before moving to the logistic model, let us try to use our linear +regression model to classify these two outcomes. We could for example +fit a linear model to the default case if \( y_i > 0.5 \) and the no +default case \( y_i \leq 0.5 \). + +

    +We would then have our +weighted linear combination, namely +$$ +\begin{equation} +\boldsymbol{y} = \boldsymbol{X}^T\boldsymbol{\beta} + \boldsymbol{\epsilon}, +\label{_auto13} +\end{equation} +$$ + +where \( \boldsymbol{y} \) is a vector representing the possible outcomes, \( \boldsymbol{X} \) is our +\( n\times p \) design matrix and \( \boldsymbol{\beta} \) represents our estimators/predictors. + +

    +









    + +

    Some selected properties

    + +

    +The main problem with our function is that it takes values on the +entire real axis. In the case of logistic regression, however, the +labels \( y_i \) are discrete variables. A typical example is the credit +card data discussed below here, where we can set the state of +defaulting the debt to \( y_i=1 \) and not to \( y_i=0 \) for one the persons +in the data set (see the full example below). + +

    +One simple way to get a discrete output is to have sign +functions that map the output of a linear regressor to values \( \{0,1\} \), +\( f(s_i)=sign(s_i)=1 \) if \( s_i\ge 0 \) and 0 if otherwise. +We will encounter this model in our first demonstration of neural networks. Historically it is called the ``perceptron" model in the machine learning +literature. This model is extremely simple. However, in many cases it is more +favorable to use a ``soft" classifier that outputs +the probability of a given category. This leads us to the logistic function. + +

    +









    + +

    Simple example

    + +

    +The following example on data for coronary heart disease (CHD) as function of age may serve as an illustration. In the code here we read and plot whether a person has had CHD (output = 1) or not (output = 0). This ouput is plotted the person's against age. Clearly, the figure shows that attempting to make a standard linear regression fit may not be very meaningful. + +

    + + +

    # Common imports
    +import os
    +import numpy as np
    +import pandas as pd
    +import matplotlib.pyplot as plt
    +from sklearn.linear_model import LinearRegression, Ridge, Lasso
    +from sklearn.model_selection import train_test_split
    +from sklearn.utils import resample
    +from sklearn.metrics import mean_squared_error
    +from IPython.display import display
    +from pylab import plt, mpl
    +plt.style.use('seaborn')
    +mpl.rcParams['font.family'] = 'serif'
    +
    +# Where to save the figures and data files
    +PROJECT_ROOT_DIR = "Results"
    +FIGURE_ID = "Results/FigureFiles"
    +DATA_ID = "DataFiles/"
    +
    +if not os.path.exists(PROJECT_ROOT_DIR):
    +    os.mkdir(PROJECT_ROOT_DIR)
    +
    +if not os.path.exists(FIGURE_ID):
    +    os.makedirs(FIGURE_ID)
    +
    +if not os.path.exists(DATA_ID):
    +    os.makedirs(DATA_ID)
    +
    +def image_path(fig_id):
    +    return os.path.join(FIGURE_ID, fig_id)
    +
    +def data_path(dat_id):
    +    return os.path.join(DATA_ID, dat_id)
    +
    +def save_fig(fig_id):
    +    plt.savefig(image_path(fig_id) + ".png", format='png')
    +
    +infile = open(data_path("chddata.csv"),'r')
    +
    +# Read the chd data as  csv file and organize the data into arrays with age group, age, and chd
    +chd = pd.read_csv(infile, names=('ID', 'Age', 'Agegroup', 'CHD'))
    +chd.columns = ['ID', 'Age', 'Agegroup', 'CHD']
    +output = chd['CHD']
    +age = chd['Age']
    +agegroup = chd['Agegroup']
    +numberID  = chd['ID'] 
    +display(chd)
    +
    +plt.scatter(age, output, marker='o')
    +plt.axis([18,70.0,-0.1, 1.2])
    +plt.xlabel(r'Age')
    +plt.ylabel(r'CHD')
    +plt.title(r'Age distribution and Coronary heart disease')
    +plt.show()
    +
    +

    +









    + +

    Plotting the mean value for each group

    + +

    +What we could attempt however is to plot the mean value for each group. + +

    + + +

    agegroupmean = np.array([0.1, 0.133, 0.250, 0.333, 0.462, 0.625, 0.765, 0.800])
    +group = np.array([1, 2, 3, 4, 5, 6, 7, 8])
    +plt.plot(group, agegroupmean, "r-")
    +plt.axis([0,9,0, 1.0])
    +plt.xlabel(r'Age group')
    +plt.ylabel(r'CHD mean values')
    +plt.title(r'Mean values for each age group')
    +plt.show()
    +
    +

    +We are now trying to find a function \( f(y\vert x) \), that is a function which gives us an expected value for the output \( y \) with a given input \( x \). +In standard linear regression with a linear dependence on \( x \), we would write this in terms of our model +$$ +f(y_i\vert x_i)=\beta_0+\beta_1 x_i. +$$ + +

    +This expression implies however that \( f(y_i\vert x_i) \) could take any +value from minus infinity to plus infinity. If we however let +\( f(y\vert y) \) be represented by the mean value, the above example +shows us that we can constrain the function to take values between +zero and one, that is we have \( 0 \le f(y_i\vert x_i) \le 1 \). Looking +at our last curve we see also that it has an S-shaped form. This leads +us to a very popular model for the function \( f \), namely the so-called +Sigmoid function or logistic model. We will consider this function as +representing the probability for finding a value of \( y_i \) with a given +\( x_i \). + +

    +









    + +

    The logistic function

    + +

    +Another widely studied model, is the so-called +perceptron model, which is an example of a "hard classification" model. We +will encounter this model when we discuss neural networks as +well. Each datapoint is deterministically assigned to a category (i.e +\( y_i=0 \) or \( y_i=1 \)). In many cases, and the coronary heart disease data forms one of many such examples, it is favorable to have a "soft" +classifier that outputs the probability of a given category rather +than a single value. For example, given \( x_i \), the classifier +outputs the probability of being in a category \( k \). Logistic regression +is the most common example of a so-called soft classifier. In logistic +regression, the probability that a data point \( x_i \) +belongs to a category \( y_i=\{0,1\} \) is given by the so-called logit function (or Sigmoid) which is meant to represent the likelihood for a given event, +$$ +p(t) = \frac{1}{1+\mathrm \exp{-t}}=\frac{\exp{t}}{1+\mathrm \exp{t}}. +$$ + +Note that \( 1-p(t)= p(-t) \). + +

    +









    + +

    Examples of likelihood functions used in logistic regression and nueral networks

    + +

    +The following code plots the logistic function, the step function and other functions we will encounter from here and on. + +

    + + +

    """The sigmoid function (or the logistic curve) is a
    +function that takes any real number, z, and outputs a number (0,1).
    +It is useful in neural networks for assigning weights on a relative scale.
    +The value z is the weighted sum of parameters involved in the learning algorithm."""
    +
    +import numpy
    +import matplotlib.pyplot as plt
    +import math as mt
    +
    +z = numpy.arange(-5, 5, .1)
    +sigma_fn = numpy.vectorize(lambda z: 1/(1+numpy.exp(-z)))
    +sigma = sigma_fn(z)
    +
    +fig = plt.figure()
    +ax = fig.add_subplot(111)
    +ax.plot(z, sigma)
    +ax.set_ylim([-0.1, 1.1])
    +ax.set_xlim([-5,5])
    +ax.grid(True)
    +ax.set_xlabel('z')
    +ax.set_title('sigmoid function')
    +
    +plt.show()
    +
    +"""Step Function"""
    +z = numpy.arange(-5, 5, .02)
    +step_fn = numpy.vectorize(lambda z: 1.0 if z >= 0.0 else 0.0)
    +step = step_fn(z)
    +
    +fig = plt.figure()
    +ax = fig.add_subplot(111)
    +ax.plot(z, step)
    +ax.set_ylim([-0.5, 1.5])
    +ax.set_xlim([-5,5])
    +ax.grid(True)
    +ax.set_xlabel('z')
    +ax.set_title('step function')
    +
    +plt.show()
    +
    +"""tanh Function"""
    +z = numpy.arange(-2*mt.pi, 2*mt.pi, 0.1)
    +t = numpy.tanh(z)
    +
    +fig = plt.figure()
    +ax = fig.add_subplot(111)
    +ax.plot(z, t)
    +ax.set_ylim([-1.0, 1.0])
    +ax.set_xlim([-2*mt.pi,2*mt.pi])
    +ax.grid(True)
    +ax.set_xlabel('z')
    +ax.set_title('tanh function')
    +
    +plt.show()
    +
    +

    +









    + +

    Two parameters

    + +

    +We assume now that we have two classes with \( y_i \) either \( 0 \) or \( 1 \). Furthermore we assume also that we have only two parameters \( \beta \) in our fitting of the Sigmoid function, that is we define probabilities +$$ +\begin{align*} +p(y_i=1|x_i,\boldsymbol{\beta}) &= \frac{\exp{(\beta_0+\beta_1x_i)}}{1+\exp{(\beta_0+\beta_1x_i)}},\nonumber\\ +p(y_i=0|x_i,\boldsymbol{\beta}) &= 1 - p(y_i=1|x_i,\boldsymbol{\beta}), +\end{align*} +$$ + +where \( \boldsymbol{\beta} \) are the weights we wish to extract from data, in our case \( \beta_0 \) and \( \beta_1 \). + +

    +Note that we used +$$ +p(y_i=0\vert x_i, \boldsymbol{\beta}) = 1-p(y_i=1\vert x_i, \boldsymbol{\beta}). +$$ + +

    + + +

    Maximum likelihood

    + +

    +In order to define the total likelihood for all possible outcomes from a +dataset \( \mathcal{D}=\{(y_i,x_i)\} \), with the binary labels +\( y_i\in\{0,1\} \) and where the data points are drawn independently, we use the so-called Maximum Likelihood Estimation (MLE) principle. +We aim thus at maximizing +the probability of seeing the observed data. We can then approximate the +likelihood in terms of the product of the individual probabilities of a specific outcome \( y_i \), that is +$$ +\begin{align*} +P(\mathcal{D}|\boldsymbol{\beta})& = \prod_{i=1}^n \left[p(y_i=1|x_i,\boldsymbol{\beta})\right]^{y_i}\left[1-p(y_i=1|x_i,\boldsymbol{\beta}))\right]^{1-y_i}\nonumber \\ +\end{align*} +$$ + +from which we obtain the log-likelihood and our cost/loss function +$$ +\mathcal{C}(\boldsymbol{\beta}) = \sum_{i=1}^n \left( y_i\log{p(y_i=1|x_i,\boldsymbol{\beta})} + (1-y_i)\log\left[1-p(y_i=1|x_i,\boldsymbol{\beta}))\right]\right). +$$ + +

    +









    + +

    The cost function rewritten

    + +

    +Reordering the logarithms, we can rewrite the cost/loss function as +$$ +\mathcal{C}(\boldsymbol{\beta}) = \sum_{i=1}^n \left(y_i(\beta_0+\beta_1x_i) -\log{(1+\exp{(\beta_0+\beta_1x_i)})}\right). +$$ + +

    +The maximum likelihood estimator is defined as the set of parameters that maximize the log-likelihood where we maximize with respect to \( \beta \). +Since the cost (error) function is just the negative log-likelihood, for logistic regression we have that +$$ +\mathcal{C}(\boldsymbol{\beta})=-\sum_{i=1}^n \left(y_i(\beta_0+\beta_1x_i) -\log{(1+\exp{(\beta_0+\beta_1x_i)})}\right). +$$ + +This equation is known in statistics as the cross entropy. Finally, we note that just as in linear regression, +in practice we often supplement the cross-entropy with additional regularization terms, usually \( L_1 \) and \( L_2 \) regularization as we did for Ridge and Lasso regression. + +

    +









    + +

    Minimizing the cross entropy

    + +

    +The cross entropy is a convex function of the weights \( \boldsymbol{\beta} \) and, +therefore, any local minimizer is a global minimizer. + +

    +Minimizing this +cost function with respect to the two parameters \( \beta_0 \) and \( \beta_1 \) we obtain + +$$ +\frac{\partial \mathcal{C}(\boldsymbol{\beta})}{\partial \beta_0} = -\sum_{i=1}^n \left(y_i -\frac{\exp{(\beta_0+\beta_1x_i)}}{1+\exp{(\beta_0+\beta_1x_i)}}\right), +$$ + +and +$$ +\frac{\partial \mathcal{C}(\boldsymbol{\beta})}{\partial \beta_1} = -\sum_{i=1}^n \left(y_ix_i -x_i\frac{\exp{(\beta_0+\beta_1x_i)}}{1+\exp{(\beta_0+\beta_1x_i)}}\right). +$$ + +

    +









    + +

    A more compact expression

    + +

    +Let us now define a vector \( \boldsymbol{y} \) with \( n \) elements \( y_i \), an +\( n\times p \) matrix \( \boldsymbol{X} \) which contains the \( x_i \) values and a +vector \( \boldsymbol{p} \) of fitted probabilities \( p(y_i\vert x_i,\boldsymbol{\beta}) \). We can rewrite in a more compact form the first +derivative of cost function as + +$$ +\frac{\partial \mathcal{C}(\boldsymbol{\beta})}{\partial \boldsymbol{\beta}} = -\boldsymbol{X}^T\left(\boldsymbol{y}-\boldsymbol{p}\right). +$$ + +

    +If we in addition define a diagonal matrix \( \boldsymbol{W} \) with elements +\( p(y_i\vert x_i,\boldsymbol{\beta})(1-p(y_i\vert x_i,\boldsymbol{\beta}) \), we can obtain a compact expression of the second derivative as + +$$ +\frac{\partial^2 \mathcal{C}(\boldsymbol{\beta})}{\partial \boldsymbol{\beta}\partial \boldsymbol{\beta}^T} = \boldsymbol{X}^T\boldsymbol{W}\boldsymbol{X}. +$$ + +

    +









    + +

    Extending to more predictors

    + +

    +Within a binary classification problem, we can easily expand our model to include multiple predictors. Our ratio between likelihoods is then with \( p \) predictors +$$ +\log{ \frac{p(\boldsymbol{\beta}\boldsymbol{x})}{1-p(\boldsymbol{\beta}\boldsymbol{x})}} = \beta_0+\beta_1x_1+\beta_2x_2+\dots+\beta_px_p. +$$ + +Here we defined \( \boldsymbol{x}=[1,x_1,x_2,\dots,x_p] \) and \( \boldsymbol{\beta}=[\beta_0, \beta_1, \dots, \beta_p] \) leading to +$$ +p(\boldsymbol{\beta}\boldsymbol{x})=\frac{ \exp{(\beta_0+\beta_1x_1+\beta_2x_2+\dots+\beta_px_p)}}{1+\exp{(\beta_0+\beta_1x_1+\beta_2x_2+\dots+\beta_px_p)}}. +$$ + +

    +









    + +

    Including more classes

    + +

    +Till now we have mainly focused on two classes, the so-called binary +system. Suppose we wish to extend to \( K \) classes. Let us for the sake +of simplicity assume we have only two predictors. We have then following model + +$$ +\log{\frac{p(C=1\vert x)}{p(K\vert x)}} = \beta_{10}+\beta_{11}x_1, +$$ + +and +$$ +\log{\frac{p(C=2\vert x)}{p(K\vert x)}} = \beta_{20}+\beta_{21}x_1, +$$ + +and so on till the class \( C=K-1 \) class +$$ +\log{\frac{p(C=K-1\vert x)}{p(K\vert x)}} = \beta_{(K-1)0}+\beta_{(K-1)1}x_1, +$$ + +

    +and the model is specified in term of \( K-1 \) so-called log-odds or +logit transformations. + +

    +









    + +

    More classes

    + +

    +In our discussion of neural networks we will encounter the above again +in terms of a slightly modified function, the so-called Softmax function. + +

    +The softmax function is used in various multiclass classification +methods, such as multinomial logistic regression (also known as +softmax regression), multiclass linear discriminant analysis, naive +Bayes classifiers, and artificial neural networks. Specifically, in +multinomial logistic regression and linear discriminant analysis, the +input to the function is the result of \( K \) distinct linear functions, +and the predicted probability for the \( k \)-th class given a sample +vector \( \boldsymbol{x} \) and a weighting vector \( \boldsymbol{\beta} \) is (with two +predictors): + +$$ +p(C=k\vert \mathbf {x} )=\frac{\exp{(\beta_{k0}+\beta_{k1}x_1)}}{1+\sum_{l=1}^{K-1}\exp{(\beta_{l0}+\beta_{l1}x_1)}}. +$$ + +It is easy to extend to more predictors. The final class is +$$ +p(C=K\vert \mathbf {x} )=\frac{1}{1+\sum_{l=1}^{K-1}\exp{(\beta_{l0}+\beta_{l1}x_1)}}, +$$ + +

    +and they sum to one. Our earlier discussions were all specialized to +the case with two classes only. It is easy to see from the above that +what we derived earlier is compatible with these equations. + +

    +To find the optimal parameters we would typically use a gradient +descent method. Newton's method and gradient descent methods are +discussed in the material on optimization +methods. + +

    +









    + +

    Friday September 24

    + +

    +









    + +

    Wisconsin Cancer Data

    + +

    +We show here how we can use a simple regression case on the breast +cancer data using Logistic regression as our algorithm for +classification. + +

    + + +

    import matplotlib.pyplot as plt
    +import numpy as np
    +from sklearn.model_selection import  train_test_split 
    +from sklearn.datasets import load_breast_cancer
    +from sklearn.linear_model import LogisticRegression
    +
    +# Load the data
    +cancer = load_breast_cancer()
    +
    +X_train, X_test, y_train, y_test = train_test_split(cancer.data,cancer.target,random_state=0)
    +print(X_train.shape)
    +print(X_test.shape)
    +# Logistic Regression
    +logreg = LogisticRegression(solver='lbfgs')
    +logreg.fit(X_train, y_train)
    +print("Test set accuracy with Logistic Regression: {:.2f}".format(logreg.score(X_test,y_test)))
    +#now scale the data
    +from sklearn.preprocessing import StandardScaler
    +scaler = StandardScaler()
    +scaler.fit(X_train)
    +X_train_scaled = scaler.transform(X_train)
    +X_test_scaled = scaler.transform(X_test)
    +# Logistic Regression
    +logreg.fit(X_train_scaled, y_train)
    +print("Test set accuracy Logistic Regression with scaled data: {:.2f}".format(logreg.score(X_test_scaled,y_test)))
    +
    +

    +









    + +

    Using the correlation matrix

    + +

    +In addition to the above scores, we could also study the covariance (and the correlation matrix). +We use Pandas to compute the correlation matrix. +

    + + +

    import matplotlib.pyplot as plt
    +import numpy as np
    +from sklearn.model_selection import  train_test_split 
    +from sklearn.datasets import load_breast_cancer
    +from sklearn.linear_model import LogisticRegression
    +cancer = load_breast_cancer()
    +import pandas as pd
    +# Making a data frame
    +cancerpd = pd.DataFrame(cancer.data, columns=cancer.feature_names)
    +
    +fig, axes = plt.subplots(15,2,figsize=(10,20))
    +malignant = cancer.data[cancer.target == 0]
    +benign = cancer.data[cancer.target == 1]
    +ax = axes.ravel()
    +
    +for i in range(30):
    +    _, bins = np.histogram(cancer.data[:,i], bins =50)
    +    ax[i].hist(malignant[:,i], bins = bins, alpha = 0.5)
    +    ax[i].hist(benign[:,i], bins = bins, alpha = 0.5)
    +    ax[i].set_title(cancer.feature_names[i])
    +    ax[i].set_yticks(())
    +ax[0].set_xlabel("Feature magnitude")
    +ax[0].set_ylabel("Frequency")
    +ax[0].legend(["Malignant", "Benign"], loc ="best")
    +fig.tight_layout()
    +plt.show()
    +
    +import seaborn as sns
    +correlation_matrix = cancerpd.corr().round(1)
    +# use the heatmap function from seaborn to plot the correlation matrix
    +# annot = True to print the values inside the square
    +plt.figure(figsize=(15,8))
    +sns.heatmap(data=correlation_matrix, annot=True)
    +plt.show()
    +
    +

    +









    + +

    Discussing the correlation data

    + +

    +In the above example we note two things. In the first plot we display +the overlap of benign and malignant tumors as functions of the various +features in the Wisconsing breast cancer data set. We see that for +some of the features we can distinguish clearly the benign and +malignant cases while for other features we cannot. This can point to +us which features may be of greater interest when we wish to classify +a benign or not benign tumour. + +

    +In the second figure we have computed the so-called correlation +matrix, which in our case with thirty features becomes a \( 30\times 30 \) +matrix. + +

    +We constructed this matrix using pandas via the statements +

    + + +

    cancerpd = pd.DataFrame(cancer.data, columns=cancer.feature_names)
    +
    +

    +and then +

    + + +

    correlation_matrix = cancerpd.corr().round(1)
    +
    +

    +Diagonalizing this matrix we can in turn say something about which +features are of relevance and which are not. This leads us to +the classical Principal Component Analysis (PCA) theorem with +applications. This will be discussed later this semester (week 43). + +

    +









    + +

    Other measures in classification studies: Cancer Data again

    +

    + + +

    import matplotlib.pyplot as plt
    +import numpy as np
    +from sklearn.model_selection import  train_test_split 
    +from sklearn.datasets import load_breast_cancer
    +from sklearn.linear_model import LogisticRegression
    +
    +# Load the data
    +cancer = load_breast_cancer()
    +
    +X_train, X_test, y_train, y_test = train_test_split(cancer.data,cancer.target,random_state=0)
    +print(X_train.shape)
    +print(X_test.shape)
    +# Logistic Regression
    +logreg = LogisticRegression(solver='lbfgs')
    +logreg.fit(X_train, y_train)
    +print("Test set accuracy with Logistic Regression: {:.2f}".format(logreg.score(X_test,y_test)))
    +#now scale the data
    +from sklearn.preprocessing import StandardScaler
    +scaler = StandardScaler()
    +scaler.fit(X_train)
    +X_train_scaled = scaler.transform(X_train)
    +X_test_scaled = scaler.transform(X_test)
    +# Logistic Regression
    +logreg.fit(X_train_scaled, y_train)
    +print("Test set accuracy Logistic Regression with scaled data: {:.2f}".format(logreg.score(X_test_scaled,y_test)))
    +
    +
    +from sklearn.preprocessing import LabelEncoder
    +from sklearn.model_selection import cross_validate
    +#Cross validation
    +accuracy = cross_validate(logreg,X_test_scaled,y_test,cv=10)['test_score']
    +print(accuracy)
    +print("Test set accuracy with Logistic Regression  and scaled data: {:.2f}".format(logreg.score(X_test_scaled,y_test)))
    +
    +
    +import scikitplot as skplt
    +y_pred = logreg.predict(X_test_scaled)
    +skplt.metrics.plot_confusion_matrix(y_test, y_pred, normalize=True)
    +plt.show()
    +y_probas = logreg.predict_proba(X_test_scaled)
    +skplt.metrics.plot_roc(y_test, y_probas)
    +plt.show()
    +skplt.metrics.plot_cumulative_gain(y_test, y_probas)
    +plt.show()
    +
    +

    +









    + +

    Optimization, the central part of any Machine Learning algortithm

    + +

    +Overview Video, why do we care about gradient methods? + +

    +Almost every problem in machine learning and data science starts with +a dataset \( X \), a model \( g(\beta) \), which is a function of the +parameters \( \beta \) and a cost function \( C(X, g(\beta)) \) that allows +us to judge how well the model \( g(\beta) \) explains the observations +\( X \). The model is fit by finding the values of \( \beta \) that minimize +the cost function. Ideally we would be able to solve for \( \beta \) +analytically, however this is not possible in general and we must use +some approximative/numerical method to compute the minimum. + +

    +









    + +

    Revisiting our Logistic Regression case

    + +

    +In our discussion on Logistic Regression we studied the +case of +two classes, with \( y_i \) either +\( 0 \) or \( 1 \). Furthermore we assumed also that we have only two +parameters \( \beta \) in our fitting, that is we +defined probabilities + +$$ +\begin{align*} +p(y_i=1|x_i,\boldsymbol{\beta}) &= \frac{\exp{(\beta_0+\beta_1x_i)}}{1+\exp{(\beta_0+\beta_1x_i)}},\nonumber\\ +p(y_i=0|x_i,\boldsymbol{\beta}) &= 1 - p(y_i=1|x_i,\boldsymbol{\beta}), +\end{align*} +$$ + +where \( \boldsymbol{\beta} \) are the weights we wish to extract from data, in our case \( \beta_0 \) and \( \beta_1 \). + +

    +









    + +

    The equations to solve

    + +

    +Our compact equations used a definition of a vector \( \boldsymbol{y} \) with \( n \) +elements \( y_i \), an \( n\times p \) matrix \( \boldsymbol{X} \) which contains the +\( x_i \) values and a vector \( \boldsymbol{p} \) of fitted probabilities +\( p(y_i\vert x_i,\boldsymbol{\beta}) \). We rewrote in a more compact form +the first derivative of the cost function as + +$$ +\frac{\partial \mathcal{C}(\boldsymbol{\beta})}{\partial \boldsymbol{\beta}} = -\boldsymbol{X}^T\left(\boldsymbol{y}-\boldsymbol{p}\right). +$$ + +

    +If we in addition define a diagonal matrix \( \boldsymbol{W} \) with elements +\( p(y_i\vert x_i,\boldsymbol{\beta})(1-p(y_i\vert x_i,\boldsymbol{\beta}) \), we can obtain a compact expression of the second derivative as + +$$ +\frac{\partial^2 \mathcal{C}(\boldsymbol{\beta})}{\partial \boldsymbol{\beta}\partial \boldsymbol{\beta}^T} = \boldsymbol{X}^T\boldsymbol{W}\boldsymbol{X}. +$$ + +This defines what is called the Hessian matrix. + +

    +









    + +

    Solving using Newton-Raphson's method

    + +

    +If we can set up these equations, Newton-Raphson's iterative method is normally the method of choice. It requires however that we can compute in an efficient way the matrices that define the first and second derivatives. + +

    +Our iterative scheme is then given by + +$$ +\boldsymbol{\beta}^{\mathrm{new}} = \boldsymbol{\beta}^{\mathrm{old}}-\left(\frac{\partial^2 \mathcal{C}(\boldsymbol{\beta})}{\partial \boldsymbol{\beta}\partial \boldsymbol{\beta}^T}\right)^{-1}_{\boldsymbol{\beta}^{\mathrm{old}}}\times \left(\frac{\partial \mathcal{C}(\boldsymbol{\beta})}{\partial \boldsymbol{\beta}}\right)_{\boldsymbol{\beta}^{\mathrm{old}}}, +$$ + +or in matrix form as + +$$ +\boldsymbol{\beta}^{\mathrm{new}} = \boldsymbol{\beta}^{\mathrm{old}}-\left(\boldsymbol{X}^T\boldsymbol{W}\boldsymbol{X} \right)^{-1}\times \left(-\boldsymbol{X}^T(\boldsymbol{y}-\boldsymbol{p}) \right)_{\boldsymbol{\beta}^{\mathrm{old}}}. +$$ + +The right-hand side is computed with the old values of \( \beta \). + +

    +If we can compute these matrices, in particular the Hessian, the above is often the easiest method to implement. + +

    +









    + +

    Brief reminder on Newton-Raphson's method

    + +

    +Let us quickly remind ourselves how we derive the above method. + +

    +Perhaps the most celebrated of all one-dimensional root-finding +routines is Newton's method, also called the Newton-Raphson +method. This method requires the evaluation of both the +function \( f \) and its derivative \( f' \) at arbitrary points. +If you can only calculate the derivative +numerically and/or your function is not of the smooth type, we +normally discourage the use of this method. + +

    +









    + +

    The equations

    + +

    +The Newton-Raphson formula consists geometrically of extending the +tangent line at a current point until it crosses zero, then setting +the next guess to the abscissa of that zero-crossing. The mathematics +behind this method is rather simple. Employing a Taylor expansion for +\( x \) sufficiently close to the solution \( s \), we have + +$$ + f(s)=0=f(x)+(s-x)f'(x)+\frac{(s-x)^2}{2}f''(x) +\dots. + \label{eq:taylornr} +$$ + +

    +For small enough values of the function and for well-behaved +functions, the terms beyond linear are unimportant, hence we obtain + +$$ + f(x)+(s-x)f'(x)\approx 0, +$$ + +yielding +$$ + s\approx x-\frac{f(x)}{f'(x)}. +$$ + +

    +Having in mind an iterative procedure, it is natural to start iterating with +$$ + x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)}. +$$ + +

    +









    + +

    Simple geometric interpretation

    + +

    +The above is Newton-Raphson's method. It has a simple geometric +interpretation, namely \( x_{n+1} \) is the point where the tangent from +\( (x_n,f(x_n)) \) crosses the \( x \)-axis. Close to the solution, +Newton-Raphson converges fast to the desired result. However, if we +are far from a root, where the higher-order terms in the series are +important, the Newton-Raphson formula can give grossly inaccurate +results. For instance, the initial guess for the root might be so far +from the true root as to let the search interval include a local +maximum or minimum of the function. If an iteration places a trial +guess near such a local extremum, so that the first derivative nearly +vanishes, then Newton-Raphson may fail totally + +

    +









    + +

    Extending to more than one variable

    + +

    +Newton's method can be generalized to systems of several non-linear equations +and variables. Consider the case with two equations +$$ + \begin{array}{cc} f_1(x_1,x_2) &=0\\ + f_2(x_1,x_2) &=0,\end{array} +$$ + +which we Taylor expand to obtain + +$$ + \begin{array}{cc} 0=f_1(x_1+h_1,x_2+h_2)=&f_1(x_1,x_2)+h_1 + \partial f_1/\partial x_1+h_2 + \partial f_1/\partial x_2+\dots\\ + 0=f_2(x_1+h_1,x_2+h_2)=&f_2(x_1,x_2)+h_1 + \partial f_2/\partial x_1+h_2 + \partial f_2/\partial x_2+\dots + \end{array}. +$$ + +Defining the Jacobian matrix \( {\bf \boldsymbol{J}} \) we have +$$ + {\bf \boldsymbol{J}}=\left( \begin{array}{cc} + \partial f_1/\partial x_1 & \partial f_1/\partial x_2 \\ + \partial f_2/\partial x_1 &\partial f_2/\partial x_2 + \end{array} \right), +$$ + +we can rephrase Newton's method as +$$ +\left(\begin{array}{c} x_1^{n+1} \\ x_2^{n+1} \end{array} \right)= +\left(\begin{array}{c} x_1^{n} \\ x_2^{n} \end{array} \right)+ +\left(\begin{array}{c} h_1^{n} \\ h_2^{n} \end{array} \right), +$$ + +where we have defined +$$ + \left(\begin{array}{c} h_1^{n} \\ h_2^{n} \end{array} \right)= + -{\bf \boldsymbol{J}}^{-1} + \left(\begin{array}{c} f_1(x_1^{n},x_2^{n}) \\ f_2(x_1^{n},x_2^{n}) \end{array} \right). +$$ + +We need thus to compute the inverse of the Jacobian matrix and it +is to understand that difficulties may +arise in case \( {\bf \boldsymbol{J}} \) is nearly singular. + +

    +It is rather straightforward to extend the above scheme to systems of +more than two non-linear equations. In our case, the Jacobian matrix is given by the Hessian that represents the second derivative of cost function. + +

    +









    + +

    Steepest descent

    + +

    +The basic idea of gradient descent is +that a function \( F(\mathbf{x}) \), +\( \mathbf{x} \equiv (x_1,\cdots,x_n) \), decreases fastest if one goes from \( \bf {x} \) in the +direction of the negative gradient \( -\nabla F(\mathbf{x}) \). + +

    +It can be shown that if +$$ +\mathbf{x}_{k+1} = \mathbf{x}_k - \gamma_k \nabla F(\mathbf{x}_k), +$$ + +with \( \gamma_k > 0 \). + +

    +For \( \gamma_k \) small enough, then \( F(\mathbf{x}_{k+1}) \leq +F(\mathbf{x}_k) \). This means that for a sufficiently small \( \gamma_k \) +we are always moving towards smaller function values, i.e a minimum. + +

    + + +

    More on Steepest descent

    + +

    +The previous observation is the basis of the method of steepest +descent, which is also referred to as just gradient descent (GD). One +starts with an initial guess \( \mathbf{x}_0 \) for a minimum of \( F \) and +computes new approximations according to + +$$ +\mathbf{x}_{k+1} = \mathbf{x}_k - \gamma_k \nabla F(\mathbf{x}_k), \ \ k \geq 0. +$$ + +

    +The parameter \( \gamma_k \) is often referred to as the step length or +the learning rate within the context of Machine Learning. + +

    + + +

    The ideal

    + +

    +Ideally the sequence \( \{\mathbf{x}_k \}_{k=0} \) converges to a global +minimum of the function \( F \). In general we do not know if we are in a +global or local minimum. In the special case when \( F \) is a convex +function, all local minima are also global minima, so in this case +gradient descent can converge to the global solution. The advantage of +this scheme is that it is conceptually simple and straightforward to +implement. However the method in this form has some severe +limitations: + +

    +In machine learing we are often faced with non-convex high dimensional +cost functions with many local minima. Since GD is deterministic we +will get stuck in a local minimum, if the method converges, unless we +have a very good intial guess. This also implies that the scheme is +sensitive to the chosen initial condition. + +

    +Note that the gradient is a function of \( \mathbf{x} = +(x_1,\cdots,x_n) \) which makes it expensive to compute numerically. + +

    + + +

    The sensitiveness of the gradient descent

    + +

    +The gradient descent method +is sensitive to the choice of learning rate \( \gamma_k \). This is due +to the fact that we are only guaranteed that \( F(\mathbf{x}_{k+1}) \leq +F(\mathbf{x}_k) \) for sufficiently small \( \gamma_k \). The problem is to +determine an optimal learning rate. If the learning rate is chosen too +small the method will take a long time to converge and if it is too +large we can experience erratic behavior. + +

    +Many of these shortcomings can be alleviated by introducing +randomness. One such method is that of Stochastic Gradient Descent +(SGD), see below. + +

    + + +

    Convex functions

    + +

    +Ideally we want our cost/loss function to be convex(concave). + +

    +First we give the definition of a convex set: A set \( C \) in +\( \mathbb{R}^n \) is said to be convex if, for all \( x \) and \( y \) in \( C \) and +all \( t \in (0,1) \) , the point \( (1 − t)x + ty \) also belongs to +C. Geometrically this means that every point on the line segment +connecting \( x \) and \( y \) is in \( C \) as discussed below. + +

    +The convex subsets of \( \mathbb{R} \) are the intervals of +\( \mathbb{R} \). Examples of convex sets of \( \mathbb{R}^2 \) are the +regular polygons (triangles, rectangles, pentagons, etc...). + +

    +









    + +

    Convex function

    + +

    +Convex function: Let \( X \subset \mathbb{R}^n \) be a convex set. Assume that the function \( f: X \rightarrow \mathbb{R} \) is continuous, then \( f \) is said to be convex if $$f(tx_1 + (1-t)x_2) \leq tf(x_1) + (1-t)f(x_2) $$ for all \( x_1, x_2 \in X \) and for all \( t \in [0,1] \). If \( \leq \) is replaced with a strict inequaltiy in the definition, we demand \( x_1 \neq x_2 \) and \( t\in(0,1) \) then \( f \) is said to be strictly convex. For a single variable function, convexity means that if you draw a straight line connecting \( f(x_1) \) and \( f(x_2) \), the value of the function on the interval \( [x_1,x_2] \) is always below the line as illustrated below. + +

    +









    + +

    Conditions on convex functions

    + +

    +In the following we state first and second-order conditions which +ensures convexity of a function \( f \). We write \( D_f \) to denote the +domain of \( f \), i.e the subset of \( R^n \) where \( f \) is defined. For more +details and proofs we refer to: S. Boyd and L. Vandenberghe. Convex Optimization. Cambridge University Press. + +

    +

    +First order condition +

    +Suppose \( f \) is differentiable (i.e \( \nabla f(x) \) is well defined for +all \( x \) in the domain of \( f \)). Then \( f \) is convex if and only if \( D_f \) +is a convex set and $$f(y) \geq f(x) + \nabla f(x)^T (y-x) $$ holds +for all \( x,y \in D_f \). This condition means that for a convex function +the first order Taylor expansion (right hand side above) at any point +a global under estimator of the function. To convince yourself you can +make a drawing of \( f(x) = x^2+1 \) and draw the tangent line to \( f(x) \) and +note that it is always below the graph. +

    + + +

    +

    +Second order condition +

    +Assume that \( f \) is twice +differentiable, i.e the Hessian matrix exists at each point in +\( D_f \). Then \( f \) is convex if and only if \( D_f \) is a convex set and its +Hessian is positive semi-definite for all \( x\in D_f \). For a +single-variable function this reduces to \( f''(x) \geq 0 \). Geometrically this means that \( f \) has nonnegative curvature +everywhere. +

    + + +

    +This condition is particularly useful since it gives us an procedure for determining if the function under consideration is convex, apart from using the definition. + +

    +









    + +

    More on convex functions

    + +

    +The next result is of great importance to us and the reason why we are +going on about convex functions. In machine learning we frequently +have to minimize a loss/cost function in order to find the best +parameters for the model we are considering. + +

    +Ideally we want the +global minimum (for high-dimensional models it is hard to know +if we have local or global minimum). However, if the cost/loss function +is convex the following result provides invaluable information: + +

    +

    +Any minimum is global for convex functions +

    +Consider the problem of finding \( x \in \mathbb{R}^n \) such that \( f(x) \) +is minimal, where \( f \) is convex and differentiable. Then, any point +\( x^* \) that satisfies \( \nabla f(x^*) = 0 \) is a global minimum. +

    + + +

    +This result means that if we know that the cost/loss function is convex and we are able to find a minimum, we are guaranteed that it is a global minimum. + +

    +









    + +

    Some simple problems

    + +
      +
    1. Show that \( f(x)=x^2 \) is convex for \( x \in \mathbb{R} \) using the definition of convexity. Hint: If you re-write the definition, \( f \) is convex if the following holds for all \( x,y \in D_f \) and any \( \lambda \in [0,1] \) $\lambda f(x)+(1-\lambda)f(y)-f(\lambda x + (1-\lambda) y ) \geq 0$.
    2. +
    3. Using the second order condition show that the following functions are convex on the specified domain.
    4. + +
        +
      • \( f(x) = e^x \) is convex for \( x \in \mathbb{R} \).
      • +
      • \( g(x) = -\ln(x) \) is convex for \( x \in (0,\infty) \).
      • +
      + +
    5. Let \( f(x) = x^2 \) and \( g(x) = e^x \). Show that \( f(g(x)) \) and \( g(f(x)) \) is convex for \( x \in \mathbb{R} \). Also show that if \( f(x) \) is any convex function than \( h(x) = e^{f(x)} \) is convex.
    6. +
    7. A norm is any function that satisfy the following properties
    8. + +
        +
      • \( f(\alpha x) = |\alpha| f(x) \) for all \( \alpha \in \mathbb{R} \).
      • +
      • \( f(x+y) \leq f(x) + f(y) \)
      • +
      • \( f(x) \leq 0 \) for all \( x \in \mathbb{R}^n \) with equality if and only if \( x = 0 \)
      • +
      + +
    + +Using the definition of convexity, try to show that a function satisfying the properties above is convex (the third condition is not needed to show this). + +

    +









    + +

    Friday September 25

    + +

    +Video of Lecture and link to handwritten notes. + +

    +









    + +

    Standard steepest descent

    + +

    +Before we proceed, we would like to discuss the approach called the +standard Steepest descent (different from the above steepest descent discussion), which again leads to us having to be able +to compute a matrix. It belongs to the class of Conjugate Gradient methods (CG). + +

    +The success of the CG method +for finding solutions of non-linear problems is based on the theory +of conjugate gradients for linear systems of equations. It belongs to +the class of iterative methods for solving problems from linear +algebra of the type +$$ +\begin{equation*} +\boldsymbol{A}\boldsymbol{x} = \boldsymbol{b}. +\end{equation*} +$$ + +

    +In the iterative process we end up with a problem like + +$$ +\begin{equation*} + \boldsymbol{r}= \boldsymbol{b}-\boldsymbol{A}\boldsymbol{x}, +\end{equation*} +$$ + +where \( \boldsymbol{r} \) is the so-called residual or error in the iterative process. + +

    +When we have found the exact solution, \( \boldsymbol{r}=0 \). + +

    +









    + +

    Gradient method

    + +

    +The residual is zero when we reach the minimum of the quadratic equation +$$ +\begin{equation*} + P(\boldsymbol{x})=\frac{1}{2}\boldsymbol{x}^T\boldsymbol{A}\boldsymbol{x} - \boldsymbol{x}^T\boldsymbol{b}, +\end{equation*} +$$ + +

    +with the constraint that the matrix \( \boldsymbol{A} \) is positive definite and +symmetric. This defines also the Hessian and we want it to be positive definite. + +

    +









    + +

    Steepest descent method

    + +

    +We denote the initial guess for \( \boldsymbol{x} \) as \( \boldsymbol{x}_0 \). +We can assume without loss of generality that +$$ +\begin{equation*} +\boldsymbol{x}_0=0, +\end{equation*} +$$ + +or consider the system +$$ +\begin{equation*} +\boldsymbol{A}\boldsymbol{z} = \boldsymbol{b}-\boldsymbol{A}\boldsymbol{x}_0, +\end{equation*} +$$ + +instead. + +

    +









    + +

    Steepest descent method

    +
    + +

    +One can show that the solution \( \boldsymbol{x} \) is also the unique minimizer of the quadratic form +$$ +\begin{equation*} + f(\boldsymbol{x}) = \frac{1}{2}\boldsymbol{x}^T\boldsymbol{A}\boldsymbol{x} - \boldsymbol{x}^T \boldsymbol{x} , \quad \boldsymbol{x}\in\mathbf{R}^n. +\end{equation*} +$$ + +This suggests taking the first basis vector \( \boldsymbol{r}_1 \) (see below for definition) +to be the gradient of \( f \) at \( \boldsymbol{x}=\boldsymbol{x}_0 \), +which equals +$$ +\begin{equation*} +\boldsymbol{A}\boldsymbol{x}_0-\boldsymbol{b}, +\end{equation*} +$$ + +and +\( \boldsymbol{x}_0=0 \) it is equal \( -\boldsymbol{b} \). + + +

    + + +

    +









    + +

    Final expressions

    +
    + +

    +We can compute the residual iteratively as +$$ +\begin{equation*} +\boldsymbol{r}_{k+1}=\boldsymbol{b}-\boldsymbol{A}\boldsymbol{x}_{k+1}, + \end{equation*} +$$ + +which equals +$$ +\begin{equation*} +\boldsymbol{b}-\boldsymbol{A}(\boldsymbol{x}_k+\alpha_k\boldsymbol{r}_k), + \end{equation*} +$$ + +or +$$ +\begin{equation*} +(\boldsymbol{b}-\boldsymbol{A}\boldsymbol{x}_k)-\alpha_k\boldsymbol{A}\boldsymbol{r}_k, + \end{equation*} +$$ + +which gives + +$$ +\alpha_k = \frac{\boldsymbol{r}_k^T\boldsymbol{r}_k}{\boldsymbol{r}_k^T\boldsymbol{A}\boldsymbol{r}_k} +$$ + +leading to the iterative scheme +$$ +\begin{equation*} +\boldsymbol{x}_{k+1}=\boldsymbol{x}_k-\alpha_k\boldsymbol{r}_{k}, + \end{equation*} +$$ +

    + + +

    +









    + +

    Steepest descent example

    + +

    + + +

    import numpy as np
    +import numpy.linalg as la
    +
    +import scipy.optimize as sopt
    +
    +import matplotlib.pyplot as pt
    +from mpl_toolkits.mplot3d import axes3d
    +
    +def f(x):
    +    return 0.5*x[0]**2 + 2.5*x[1]**2
    +
    +def df(x):
    +    return np.array([x[0], 5*x[1]])
    +
    +fig = pt.figure()
    +ax = fig.gca(projection="3d")
    +
    +xmesh, ymesh = np.mgrid[-2:2:50j,-2:2:50j]
    +fmesh = f(np.array([xmesh, ymesh]))
    +ax.plot_surface(xmesh, ymesh, fmesh)
    +
    +

    +And then as countor plot +

    + + +

    pt.axis("equal")
    +pt.contour(xmesh, ymesh, fmesh)
    +guesses = [np.array([2, 2./5])]
    +
    +

    +Find guesses +

    + + +

    x = guesses[-1]
    +s = -df(x)
    +
    +

    +Run it! +

    + + +

    def f1d(alpha):
    +    return f(x + alpha*s)
    +
    +alpha_opt = sopt.golden(f1d)
    +next_guess = x + alpha_opt * s
    +guesses.append(next_guess)
    +print(next_guess)
    +
    +

    +What happened? +

    + + +

    pt.axis("equal")
    +pt.contour(xmesh, ymesh, fmesh, 50)
    +it_array = np.array(guesses)
    +pt.plot(it_array.T[0], it_array.T[1], "x-")
    +
    +

    +









    + +

    Conjugate gradient method

    +
    + +

    +In the CG method we define so-called conjugate directions and two vectors +\( \boldsymbol{s} \) and \( \boldsymbol{t} \) +are said to be +conjugate if +$$ +\begin{equation*} +\boldsymbol{s}^T\boldsymbol{A}\boldsymbol{t}= 0. +\end{equation*} +$$ + +The philosophy of the CG method is to perform searches in various conjugate directions +of our vectors \( \boldsymbol{x}_i \) obeying the above criterion, namely +$$ +\begin{equation*} +\boldsymbol{x}_i^T\boldsymbol{A}\boldsymbol{x}_j= 0. +\end{equation*} +$$ + +Two vectors are conjugate if they are orthogonal with respect to +this inner product. Being conjugate is a symmetric relation: if \( \boldsymbol{s} \) is conjugate to \( \boldsymbol{t} \), then \( \boldsymbol{t} \) is conjugate to \( \boldsymbol{s} \). +

    + + +

    +









    + +

    Conjugate gradient method

    +
    + +

    +An example is given by the eigenvectors of the matrix +$$ +\begin{equation*} +\boldsymbol{v}_i^T\boldsymbol{A}\boldsymbol{v}_j= \lambda\boldsymbol{v}_i^T\boldsymbol{v}_j, +\end{equation*} +$$ + +which is zero unless \( i=j \). +

    + + +

    +









    + +

    Conjugate gradient method

    +
    + +

    +Assume now that we have a symmetric positive-definite matrix \( \boldsymbol{A} \) of size +\( n\times n \). At each iteration \( i+1 \) we obtain the conjugate direction of a vector +$$ +\begin{equation*} +\boldsymbol{x}_{i+1}=\boldsymbol{x}_{i}+\alpha_i\boldsymbol{p}_{i}. +\end{equation*} +$$ + +We assume that \( \boldsymbol{p}_{i} \) is a sequence of \( n \) mutually conjugate directions. +Then the \( \boldsymbol{p}_{i} \) form a basis of \( R^n \) and we can expand the solution +$ \boldsymbol{A}\boldsymbol{x} = \boldsymbol{b}$ in this basis, namely + +$$ +\begin{equation*} + \boldsymbol{x} = \sum^{n}_{i=1} \alpha_i \boldsymbol{p}_i. +\end{equation*} +$$ +

    + + +

    +









    + +

    Conjugate gradient method

    +
    + +

    +The coefficients are given by +$$ +\begin{equation*} + \mathbf{A}\mathbf{x} = \sum^{n}_{i=1} \alpha_i \mathbf{A} \mathbf{p}_i = \mathbf{b}. +\end{equation*} +$$ + +Multiplying with \( \boldsymbol{p}_k^T \) from the left gives + +$$ +\begin{equation*} + \boldsymbol{p}_k^T \boldsymbol{A}\boldsymbol{x} = \sum^{n}_{i=1} \alpha_i\boldsymbol{p}_k^T \boldsymbol{A}\boldsymbol{p}_i= \boldsymbol{p}_k^T \boldsymbol{b}, +\end{equation*} +$$ + +and we can define the coefficients \( \alpha_k \) as + +$$ +\begin{equation*} + \alpha_k = \frac{\boldsymbol{p}_k^T \boldsymbol{b}}{\boldsymbol{p}_k^T \boldsymbol{A} \boldsymbol{p}_k} +\end{equation*} +$$ +

    + + +

    +









    + +

    Conjugate gradient method and iterations

    +
    + +

    + +

    +If we choose the conjugate vectors \( \boldsymbol{p}_k \) carefully, +then we may not need all of them to obtain a good approximation to the solution +\( \boldsymbol{x} \). +We want to regard the conjugate gradient method as an iterative method. +This will us to solve systems where \( n \) is so large that the direct +method would take too much time. + +

    +We denote the initial guess for \( \boldsymbol{x} \) as \( \boldsymbol{x}_0 \). +We can assume without loss of generality that +$$ +\begin{equation*} +\boldsymbol{x}_0=0, +\end{equation*} +$$ + +or consider the system +$$ +\begin{equation*} +\boldsymbol{A}\boldsymbol{z} = \boldsymbol{b}-\boldsymbol{A}\boldsymbol{x}_0, +\end{equation*} +$$ + +instead. +

    + + +

    +









    + +

    Conjugate gradient method

    +
    + +

    +One can show that the solution \( \boldsymbol{x} \) is also the unique minimizer of the quadratic form +$$ +\begin{equation*} + f(\boldsymbol{x}) = \frac{1}{2}\boldsymbol{x}^T\boldsymbol{A}\boldsymbol{x} - \boldsymbol{x}^T \boldsymbol{x} , \quad \boldsymbol{x}\in\mathbf{R}^n. +\end{equation*} +$$ + +This suggests taking the first basis vector \( \boldsymbol{p}_1 \) +to be the gradient of \( f \) at \( \boldsymbol{x}=\boldsymbol{x}_0 \), +which equals +$$ +\begin{equation*} +\boldsymbol{A}\boldsymbol{x}_0-\boldsymbol{b}, +\end{equation*} +$$ + +and +\( \boldsymbol{x}_0=0 \) it is equal \( -\boldsymbol{b} \). +The other vectors in the basis will be conjugate to the gradient, +hence the name conjugate gradient method. +

    + + +

    +









    + +

    Conjugate gradient method

    +
    + +

    +Let \( \boldsymbol{r}_k \) be the residual at the \( k \)-th step: +$$ +\begin{equation*} +\boldsymbol{r}_k=\boldsymbol{b}-\boldsymbol{A}\boldsymbol{x}_k. +\end{equation*} +$$ + +Note that \( \boldsymbol{r}_k \) is the negative gradient of \( f \) at +\( \boldsymbol{x}=\boldsymbol{x}_k \), +so the gradient descent method would be to move in the direction \( \boldsymbol{r}_k \). +Here, we insist that the directions \( \boldsymbol{p}_k \) are conjugate to each other, +so we take the direction closest to the gradient \( \boldsymbol{r}_k \) +under the conjugacy constraint. +This gives the following expression +$$ +\begin{equation*} +\boldsymbol{p}_{k+1}=\boldsymbol{r}_k-\frac{\boldsymbol{p}_k^T \boldsymbol{A}\boldsymbol{r}_k}{\boldsymbol{p}_k^T\boldsymbol{A}\boldsymbol{p}_k} \boldsymbol{p}_k. +\end{equation*} +$$ +

    + + +

    +









    + +

    Conjugate gradient method

    +
    + +

    +We can also compute the residual iteratively as +$$ +\begin{equation*} +\boldsymbol{r}_{k+1}=\boldsymbol{b}-\boldsymbol{A}\boldsymbol{x}_{k+1}, + \end{equation*} +$$ + +which equals +$$ +\begin{equation*} +\boldsymbol{b}-\boldsymbol{A}(\boldsymbol{x}_k+\alpha_k\boldsymbol{p}_k), + \end{equation*} +$$ + +or +$$ +\begin{equation*} +(\boldsymbol{b}-\boldsymbol{A}\boldsymbol{x}_k)-\alpha_k\boldsymbol{A}\boldsymbol{p}_k, + \end{equation*} +$$ + +which gives + +$$ +\begin{equation*} +\boldsymbol{r}_{k+1}=\boldsymbol{r}_k-\boldsymbol{A}\boldsymbol{p}_{k}, + \end{equation*} +$$ +

    + + +

    + + +

    Revisiting some of our first Linear Regression Encounters

    + +

    +We will use linear regression as a case study for the gradient descent +methods. Linear regression is a great test case for the gradient +descent methods discussed in the lectures since it has several +desirable properties such as: + +

      +
    1. An analytical solution (recall homework set 1).
    2. +
    3. The gradient can be computed analytically.
    4. +
    5. The cost function is convex which guarantees that gradient descent converges for small enough learning rates
    6. +
    + +We revisit an example similar to what we had in the first homework set. We had a function of the type + +

    + + +

    x = 2*np.random.rand(m,1)
    +y = 4+3*x+np.random.randn(m,1)
    +
    +

    +with \( x_i \in [0,1] \) is chosen randomly using a uniform distribution. Additionally we have a stochastic noise chosen according to a normal distribution \( \cal {N}(0,1) \). +The linear regression model is given by +$$ +h_\beta(x) = \boldsymbol{y} = \beta_0 + \beta_1 x, +$$ + +such that +$$ +\boldsymbol{y}_i = \beta_0 + \beta_1 x_i. +$$ + +

    + + +

    Gradient descent example

    + +

    +Let \( \mathbf{y} = (y_1,\cdots,y_n)^T \), \( \mathbf{\boldsymbol{y}} = (\boldsymbol{y}_1,\cdots,\boldsymbol{y}_n)^T \) and \( \beta = (\beta_0, \beta_1)^T \) + +

    +It is convenient to write \( \mathbf{\boldsymbol{y}} = X\beta \) where \( X \in \mathbb{R}^{100 \times 2} \) is the design matrix given by (we keep the intercept here) +$$ +X \equiv \begin{bmatrix} +1 & x_1 \\ +\vdots & \vdots \\ +1 & x_{100} & \\ +\end{bmatrix}. +$$ + +The cost/loss/risk function is given by ( +$$ +C(\beta) = \frac{1}{n}||X\beta-\mathbf{y}||_{2}^{2} = \frac{1}{n}\sum_{i=1}^{100}\left[ (\beta_0 + \beta_1 x_i)^2 - 2 y_i (\beta_0 + \beta_1 x_i) + y_i^2\right] +$$ + +and we want to find \( \beta \) such that \( C(\beta) \) is minimized. + +

    +









    + +

    The derivative of the cost/loss function

    + +

    +Computing \( \partial C(\beta) / \partial \beta_0 \) and \( \partial C(\beta) / \partial \beta_1 \) we can show that the gradient can be written as +$$ +\nabla_{\beta} C(\beta) = \frac{2}{n}\begin{bmatrix} \sum_{i=1}^{100} \left(\beta_0+\beta_1x_i-y_i\right) \\ +\sum_{i=1}^{100}\left( x_i (\beta_0+\beta_1x_i)-y_ix_i\right) \\ +\end{bmatrix} = \frac{2}{n}X^T(X\beta - \mathbf{y}), +$$ + +where \( X \) is the design matrix defined above. + +

    +









    + +

    The Hessian matrix

    +The Hessian matrix of \( C(\beta) \) is given by +$$ +\boldsymbol{H} \equiv \begin{bmatrix} +\frac{\partial^2 C(\beta)}{\partial \beta_0^2} & \frac{\partial^2 C(\beta)}{\partial \beta_0 \partial \beta_1} \\ +\frac{\partial^2 C(\beta)}{\partial \beta_0 \partial \beta_1} & \frac{\partial^2 C(\beta)}{\partial \beta_1^2} & \\ +\end{bmatrix} = \frac{2}{n}X^T X. +$$ + +This result implies that \( C(\beta) \) is a convex function since the matrix \( X^T X \) always is positive semi-definite. + +

    +









    + +

    Simple program

    + +

    +We can now write a program that minimizes \( C(\beta) \) using the gradient descent method with a constant learning rate \( \gamma \) according to +$$ +\beta_{k+1} = \beta_k - \gamma \nabla_\beta C(\beta_k), \ k=0,1,\cdots +$$ + +

    +We can use the expression we computed for the gradient and let use a +\( \beta_0 \) be chosen randomly and let \( \gamma = 0.001 \). Stop iterating +when \( ||\nabla_\beta C(\beta_k) || \leq \epsilon = 10^{-8} \). Note that the code below does not include the latter stop criterion. + +

    +And finally we can compare our solution for \( \beta \) with the analytic result given by +\( \beta= (X^TX)^{-1} X^T \mathbf{y} \). + +

    +









    + +

    Gradient Descent Example

    + +

    +Here our simple example +

    + + +

    # Importing various packages
    +from random import random, seed
    +import numpy as np
    +import matplotlib.pyplot as plt
    +from mpl_toolkits.mplot3d import Axes3D
    +from matplotlib import cm
    +from matplotlib.ticker import LinearLocator, FormatStrFormatter
    +import sys
    +
    +# the number of datapoints
    +n = 100
    +x = 2*np.random.rand(n,1)
    +y = 4+3*x+np.random.randn(n,1)
    +
    +X = np.c_[np.ones((n,1)), x]
    +# Hessian matrix
    +H = (2.0/n)* X.T @ X
    +# Get the eigenvalues
    +EigValues, EigVectors = np.linalg.eig(H)
    +print(EigValues)
    +
    +beta_linreg = np.linalg.inv(X.T @ X) @ X.T @ y
    +print(beta_linreg)
    +beta = np.random.randn(2,1)
    +
    +eta = 1.0/np.max(EigValues)
    +Niterations = 1000
    +
    +for iter in range(Niterations):
    +    gradient = (2.0/n)*X.T @ (X @ beta-y)
    +    beta -= eta*gradient
    +
    +print(beta)
    +xnew = np.array([[0],[2]])
    +xbnew = np.c_[np.ones((2,1)), xnew]
    +ypredict = xbnew.dot(beta)
    +ypredict2 = xbnew.dot(beta_linreg)
    +plt.plot(xnew, ypredict, "r-")
    +plt.plot(xnew, ypredict2, "b-")
    +plt.plot(x, y ,'ro')
    +plt.axis([0,2.0,0, 15.0])
    +plt.xlabel(r'$x$')
    +plt.ylabel(r'$y$')
    +plt.title(r'Gradient descent example')
    +plt.show()
    +
    +

    +









    + +

    And a corresponding example using scikit-learn

    + +

    + + +

    # Importing various packages
    +from random import random, seed
    +import numpy as np
    +import matplotlib.pyplot as plt
    +from sklearn.linear_model import SGDRegressor
    +
    +n = 100
    +x = 2*np.random.rand(n,1)
    +y = 4+3*x+np.random.randn(n,1)
    +
    +X = np.c_[np.ones((n,1)), x]
    +beta_linreg = np.linalg.inv(X.T @ X) @ (X.T @ y)
    +print(beta_linreg)
    +sgdreg = SGDRegressor(max_iter = 50, penalty=None, eta0=0.1)
    +sgdreg.fit(x,y.ravel())
    +print(sgdreg.intercept_, sgdreg.coef_)
    +
    +

    + + +

    Gradient descent and Ridge

    + +

    +We have also discussed Ridge regression where the loss function contains a regularized term given by the \( L_2 \) norm of \( \beta \), +$$ +C_{\text{ridge}}(\beta) = \frac{1}{n}||X\beta -\mathbf{y}||^2 + \lambda ||\beta||^2, \ \lambda \geq 0. +$$ + +

    +In order to minimize \( C_{\text{ridge}}(\beta) \) using GD we only have adjust the gradient as follows +$$ +\nabla_\beta C_{\text{ridge}}(\beta) = \frac{2}{n}\begin{bmatrix} \sum_{i=1}^{100} \left(\beta_0+\beta_1x_i-y_i\right) \\ +\sum_{i=1}^{100}\left( x_i (\beta_0+\beta_1x_i)-y_ix_i\right) \\ +\end{bmatrix} + 2\lambda\begin{bmatrix} \beta_0 \\ \beta_1\end{bmatrix} = 2 (X^T(X\beta - \mathbf{y})+\lambda \beta). +$$ + +

    +We can easily extend our program to minimize \( C_{\text{ridge}}(\beta) \) using gradient descent and compare with the analytical solution given by +$$ +\beta_{\text{ridge}} = \left(X^T X + \lambda I_{2 \times 2} \right)^{-1} X^T \mathbf{y}. +$$ + +

    +









    + +

    Program example for gradient descent with Ridge Regression

    +

    + + +

    from random import random, seed
    +import numpy as np
    +import matplotlib.pyplot as plt
    +from mpl_toolkits.mplot3d import Axes3D
    +from matplotlib import cm
    +from matplotlib.ticker import LinearLocator, FormatStrFormatter
    +import sys
    +
    +# the number of datapoints
    +n = 100
    +x = 2*np.random.rand(n,1)
    +y = 4+3*x+np.random.randn(n,1)
    +
    +X = np.c_[np.ones((n,1)), x]
    +XT_X = X.T @ X
    +
    +#Ridge parameter lambda
    +lmbda  = 0.001
    +Id = lmbda* np.eye(XT_X.shape[0])
    +
    +beta_linreg = np.linalg.inv(XT_X+Id) @ X.T @ y
    +print(beta_linreg)
    +# Start plain gradient descent
    +beta = np.random.randn(2,1)
    +
    +eta = 0.1
    +Niterations = 100
    +
    +for iter in range(Niterations):
    +    gradients = 2.0/n*X.T @ (X @ (beta)-y)+2*lmbda*beta
    +    beta -= eta*gradients
    +
    +print(beta)
    +ypredict = X @ beta
    +ypredict2 = X @ beta_linreg
    +plt.plot(x, ypredict, "r-")
    +plt.plot(x, ypredict2, "b-")
    +plt.plot(x, y ,'ro')
    +plt.axis([0,2.0,0, 15.0])
    +plt.xlabel(r'$x$')
    +plt.ylabel(r'$y$')
    +plt.title(r'Gradient descent example for Ridge')
    +plt.show()
    +
    +

    +









    + +

    Using gradient descent methods, limitations

    + +
      +
    • Gradient descent (GD) finds local minima of our function. Since the GD algorithm is deterministic, if it converges, it will converge to a local minimum of our cost/loss/risk function. Because in ML we are often dealing with extremely rugged landscapes with many local minima, this can lead to poor performance.
    • +
    • GD is sensitive to initial conditions. One consequence of the local nature of GD is that initial conditions matter. Depending on where one starts, one will end up at a different local minima. Therefore, it is very important to think about how one initializes the training process. This is true for GD as well as more complicated variants of GD.
    • +
    • Gradients are computationally expensive to calculate for large datasets. In many cases in statistics and ML, the cost/loss/risk function is a sum of terms, with one term for each data point. For example, in linear regression, \( E \propto \sum_{i=1}^n (y_i - \mathbf{w}^T\cdot\mathbf{x}_i)^2 \); for logistic regression, the square error is replaced by the cross entropy. To calculate the gradient we have to sum over all \( n \) data points. Doing this at every GD step becomes extremely computationally expensive. An ingenious solution to this, is to calculate the gradients using small subsets of the data called "mini batches". This has the added benefit of introducing stochasticity into our algorithm.
    • +
    • GD is very sensitive to choices of learning rates. GD is extremely sensitive to the choice of learning rates. If the learning rate is very small, the training process take an extremely long time. For larger learning rates, GD can diverge and give poor results. Furthermore, depending on what the local landscape looks like, we have to modify the learning rates to ensure convergence. Ideally, we would adaptively choose the learning rates to match the landscape.
    • +
    • GD treats all directions in parameter space uniformly. Another major drawback of GD is that unlike Newton's method, the learning rate for GD is the same in all directions in parameter space. For this reason, the maximum learning rate is set by the behavior of the steepest direction and this can significantly slow down training. Ideally, we would like to take large steps in flat directions and small steps in steep directions. Since we are exploring rugged landscapes where curvatures change, this requires us to keep track of not only the gradient but second derivatives. The ideal scenario would be to calculate the Hessian but this proves to be too computationally expensive.
    • +
    • GD can take exponential time to escape saddle points, even with random initialization. As we mentioned, GD is extremely sensitive to initial condition since it determines the particular local minimum GD would eventually reach. However, even with a good initialization scheme, through the introduction of randomness, GD can still take exponential time to escape saddle points. This leads us to our next topic, Stochastic Gradient Methods.
    • +
    + + + + + +
    + © 1999-2021, Morten Hjorth-Jensen. Released under CC Attribution-NonCommercial 4.0 license +
    + + + + + + diff --git a/doc/src/week38/week38.ipynb b/doc/src/week38/week38.ipynb new file mode 100644 index 000000000..d836998bd --- /dev/null +++ b/doc/src/week38/week38.ipynb @@ -0,0 +1,4559 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "# Data Analysis and Machine Learning: Logistic Regression\n", + "\n", + " \n", + "**Morten Hjorth-Jensen**, Department of Physics, University of Oslo and Department of Physics and Astronomy and National Superconducting Cyclotron Laboratory, Michigan State University\n", + "\n", + "Date: **Sep 23, 2021**\n", + "\n", + "Copyright 1999-2021, Morten Hjorth-Jensen. Released under CC Attribution-NonCommercial 4.0 license\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "## Plans for week 38\n", + "\n", + "* Thursday: Summary of regression methods and discussion of project 1. Start Logistic Regression\n", + "\n", + "* [Video of Lecture September 23](https://www.uio.no/studier/emner/matnat/fys/FYS-STK4155/h21/forelesningsvideoer/LectureSeptember23.mp4?vrtx=view-as-webpage)\n", + "\n", + "* Friday: Logistic Regression and Optimization methods\n", + "\n", + "## Thursday September 23\n", + "\n", + "\n", + "## Ridge and LASSO Regression, reminder\n", + "\n", + "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", + "our optimization problem is" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "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", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "or we can state it as" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "{\\displaystyle \\min_{\\boldsymbol{\\beta}\\in\n", + "{\\mathbb{R}}^{p}}}\\frac{1}{n}\\sum_{i=0}^{n-1}\\left(y_i-\\tilde{y}_i\\right)^2=\\frac{1}{n}\\vert\\vert \\boldsymbol{y}-\\boldsymbol{X}\\boldsymbol{\\beta}\\vert\\vert_2^2,\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "where we have used the definition of a norm-2 vector, that is" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\vert\\vert \\boldsymbol{x}\\vert\\vert_2 = \\sqrt{\\sum_i x_i^2}.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "By minimizing the above equation with respect to the parameters\n", + "$\\boldsymbol{\\beta}$ we could then obtain an analytical expression for the\n", + "parameters $\\boldsymbol{\\beta}$. We can add a regularization parameter $\\lambda$ by\n", + "defining a new cost function to be optimized, that is" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "{\\displaystyle \\min_{\\boldsymbol{\\beta}\\in\n", + "{\\mathbb{R}}^{p}}}\\frac{1}{n}\\vert\\vert \\boldsymbol{y}-\\boldsymbol{X}\\boldsymbol{\\beta}\\vert\\vert_2^2+\\lambda\\vert\\vert \\boldsymbol{\\beta}\\vert\\vert_2^2\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "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", + "a finite number larger than zero. By defining" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "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", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "we have a new optimization equation" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "{\\displaystyle \\min_{\\boldsymbol{\\beta}\\in\n", + "{\\mathbb{R}}^{p}}}\\frac{1}{n}\\vert\\vert \\boldsymbol{y}-\\boldsymbol{X}\\boldsymbol{\\beta}\\vert\\vert_2^2+\\lambda\\vert\\vert \\boldsymbol{\\beta}\\vert\\vert_1\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "which leads to Lasso regression. Lasso stands for least absolute shrinkage and selection operator. \n", + "\n", + "Here we have defined the norm-1 as" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\vert\\vert \\boldsymbol{x}\\vert\\vert_1 = \\sum_i \\vert x_i\\vert.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "## Various steps in cross-validation\n", + "\n", + "When the repetitive splitting of the data set is done randomly,\n", + "samples may accidently end up in a fast majority of the splits in\n", + "either training or test set. Such samples may have an unbalanced\n", + "influence on either model building or prediction evaluation. To avoid\n", + "this $k$-fold cross-validation structures the data splitting. The\n", + "samples are divided into $k$ more or less equally sized exhaustive and\n", + "mutually exclusive subsets. In turn (at each split) one of these\n", + "subsets plays the role of the test set while the union of the\n", + "remaining subsets constitutes the training set. Such a splitting\n", + "warrants a balanced representation of each sample in both training and\n", + "test set over the splits. Still the division into the $k$ subsets\n", + "involves a degree of randomness. This may be fully excluded when\n", + "choosing $k=n$. This particular case is referred to as leave-one-out\n", + "cross-validation (LOOCV). \n", + "\n", + "\n", + "## How to set up the cross-validation for Ridge and/or Lasso\n", + "\n", + "* Define a range of interest for the penalty parameter.\n", + "\n", + "* Divide the data set into training and test set comprising samples $\\{1, \\ldots, n\\} \\setminus i$ and $\\{ i \\}$, respectively.\n", + "\n", + "* Fit the linear regression model by means of ridge estimation for each $\\lambda$ in the grid using the training set, and the corresponding estimate of the error variance $\\boldsymbol{\\sigma}_{-i}^2(\\lambda)$, as" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\begin{align*}\n", + "\\boldsymbol{\\beta}_{-i}(\\lambda) & = ( \\boldsymbol{X}_{-i, \\ast}^{T}\n", + "\\boldsymbol{X}_{-i, \\ast} + \\lambda \\boldsymbol{I}_{pp})^{-1}\n", + "\\boldsymbol{X}_{-i, \\ast}^{T} \\boldsymbol{y}_{-i}\n", + "\\end{align*}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "* Evaluate the prediction performance of these models on the test set by $C[y_i, \\boldsymbol{X}_{i, \\ast}; \\boldsymbol{\\beta}_{-i}(\\lambda), \\boldsymbol{\\sigma}_{-i}^2(\\lambda)]$. Or, by the prediction error $|y_i - \\boldsymbol{X}_{i, \\ast} \\boldsymbol{\\beta}_{-i}(\\lambda)|$, the relative error, the error squared or the R2 score function.\n", + "\n", + "* Repeat the first three steps such that each sample plays the role of the test set once.\n", + "\n", + "* Average the prediction performances of the test sets at each grid point of the penalty bias/parameter. It is an estimate of the prediction performance of the model corresponding to this value of the penalty parameter on novel data. \n", + "\n", + "## Cross-validation in brief\n", + "\n", + "For the various values of $k$\n", + "\n", + "1. shuffle the dataset randomly.\n", + "\n", + "2. Split the dataset into $k$ groups.\n", + "\n", + "3. For each unique group:\n", + "\n", + "a. Decide which group to use as set for test data\n", + "\n", + "b. Take the remaining groups as a training data set\n", + "\n", + "c. Fit a model on the training set and evaluate it on the test set\n", + "\n", + "d. Retain the evaluation score and discard the model\n", + "\n", + "\n", + "5. Summarize the model using the sample of model evaluation scores\n", + "\n", + "## Code Example for Cross-validation and $k$-fold Cross-validation\n", + "\n", + "The code here uses Ridge regression with cross-validation (CV) resampling and $k$-fold CV in order to fit a specific polynomial." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "%matplotlib inline\n", + "\n", + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "from sklearn.model_selection import KFold\n", + "from sklearn.linear_model import Ridge\n", + "from sklearn.model_selection import cross_val_score\n", + "from sklearn.preprocessing import PolynomialFeatures\n", + "\n", + "# A seed just to ensure that the random numbers are the same for every run.\n", + "# Useful for eventual debugging.\n", + "np.random.seed(3155)\n", + "\n", + "# Generate the data.\n", + "nsamples = 100\n", + "x = np.random.randn(nsamples)\n", + "y = 3*x**2 + np.random.randn(nsamples)\n", + "\n", + "## Cross-validation on Ridge regression using KFold only\n", + "\n", + "# Decide degree on polynomial to fit\n", + "poly = PolynomialFeatures(degree = 6)\n", + "\n", + "# Decide which values of lambda to use\n", + "nlambdas = 500\n", + "lambdas = np.logspace(-3, 5, nlambdas)\n", + "\n", + "# Initialize a KFold instance\n", + "k = 5\n", + "kfold = KFold(n_splits = k)\n", + "\n", + "# Perform the cross-validation to estimate MSE\n", + "scores_KFold = np.zeros((nlambdas, k))\n", + "\n", + "i = 0\n", + "for lmb in lambdas:\n", + " ridge = Ridge(alpha = lmb)\n", + " j = 0\n", + " for train_inds, test_inds in kfold.split(x):\n", + " xtrain = x[train_inds]\n", + " ytrain = y[train_inds]\n", + "\n", + " xtest = x[test_inds]\n", + " ytest = y[test_inds]\n", + "\n", + " Xtrain = poly.fit_transform(xtrain[:, np.newaxis])\n", + " ridge.fit(Xtrain, ytrain[:, np.newaxis])\n", + "\n", + " Xtest = poly.fit_transform(xtest[:, np.newaxis])\n", + " ypred = ridge.predict(Xtest)\n", + "\n", + " scores_KFold[i,j] = np.sum((ypred - ytest[:, np.newaxis])**2)/np.size(ypred)\n", + "\n", + " j += 1\n", + " i += 1\n", + "\n", + "\n", + "estimated_mse_KFold = np.mean(scores_KFold, axis = 1)\n", + "\n", + "## Cross-validation using cross_val_score from sklearn along with KFold\n", + "\n", + "# kfold is an instance initialized above as:\n", + "# kfold = KFold(n_splits = k)\n", + "\n", + "estimated_mse_sklearn = np.zeros(nlambdas)\n", + "i = 0\n", + "for lmb in lambdas:\n", + " ridge = Ridge(alpha = lmb)\n", + "\n", + " X = poly.fit_transform(x[:, np.newaxis])\n", + " estimated_mse_folds = cross_val_score(ridge, X, y[:, np.newaxis], scoring='neg_mean_squared_error', cv=kfold)\n", + "\n", + " # cross_val_score return an array containing the estimated negative mse for every fold.\n", + " # we have to the the mean of every array in order to get an estimate of the mse of the model\n", + " estimated_mse_sklearn[i] = np.mean(-estimated_mse_folds)\n", + "\n", + " i += 1\n", + "\n", + "## Plot and compare the slightly different ways to perform cross-validation\n", + "\n", + "plt.figure()\n", + "\n", + "plt.plot(np.log10(lambdas), estimated_mse_sklearn, label = 'cross_val_score')\n", + "plt.plot(np.log10(lambdas), estimated_mse_KFold, 'r--', label = 'KFold')\n", + "\n", + "plt.xlabel('log10(lambda)')\n", + "plt.ylabel('mse')\n", + "\n", + "plt.legend()\n", + "\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## To think about, first part\n", + "\n", + "When you are comparing your own code with for example **Scikit-Learn**'s\n", + "library, there are some technicalities to keep in mind. The examples\n", + "here demonstrate some of these aspects with potential pitfalls.\n", + "\n", + "The discussion here focuses on the role of the intercept, how we can\n", + "set up the design matrix, what scaling we should use and other topics\n", + "which tend confuse us.\n", + "\n", + "\n", + "\n", + "The intercept can be interpreted as the expected value of our\n", + "target/output variables when all other predictors are set to zero.\n", + "Thus, if we cannot assume that the expected outputs/targets are zero\n", + "when all predictors are zero (the columns in the design matrix), it\n", + "may be a bad idea to implement a model which penalizes the intercept.\n", + "Furthermore, in for example Ridge and Lasso regression, the default solutions\n", + "from the library **Scikit-Learn** (when not shrinking $\\beta_0$) for the unknown parameters\n", + "$\\boldsymbol{\\beta}$, are derived under the assumption that both $\\boldsymbol{y}$ and\n", + "$\\boldsymbol{X}$ are zero centered, that is we subtract the mean values.\n", + "\n", + "\n", + "## More thinking\n", + "\n", + "\n", + "If our predictors represent different scales, then it is important to\n", + "standardize the design matrix $\\boldsymbol{X}$ by subtracting the mean of each\n", + "column from the corresponding column and dividing the column with its\n", + "standard deviation. Most machine learning libraries do this as a default. This means that if you compare your code with the results from a given library,\n", + "the results may differ. \n", + "\n", + "The\n", + "[Standadscaler](https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.StandardScaler.html)\n", + "function in **Scikit-Learn** does this for us. For the data sets we\n", + "have been studying in our various examples, the data are in many cases\n", + "already scaled and there is no need to scale them. You as a user of different machine learning algorithms, should always perform a\n", + "survey of your data, with a critical assessment of them in case you need to scale the data.\n", + "\n", + "If you need to scale the data, not doing so will give an *unfair*\n", + "penalization of the parameters since their magnitude depends on the\n", + "scale of their corresponding predictor.\n", + "\n", + "Suppose as an example that you \n", + "you have an input variable given by the heights of different persons.\n", + "Human height might be measured in inches or meters or\n", + "kilometers. If measured in kilometers, a standard linear regression\n", + "model with this predictor would probably give a much bigger\n", + "coefficient term, than if measured in millimeters.\n", + "This can clearly lead to problems in evaluating the cost/loss functions.\n", + "\n", + "\n", + "## Still thinking\n", + "\n", + "Keep in mind that when you transform your data set before training a model, the same transformation needs to be done\n", + "on your eventual new data set before making a prediction. If we translate this into a Python code, it would could be implemented as follows" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "#Model training, we compute the mean value of y and X\n", + "y_train_mean = np.mean(y_train)\n", + "X_train_mean = np.mean(X_train,axis=0)\n", + "X_train = X_train - X_train_mean\n", + "y_train = y_train - y_train_mean\n", + "\n", + "# The we fit our model with the training data\n", + "trained_model = some_model.fit(X_train,y_train)\n", + "\n", + "\n", + "#Model prediction, we need also to transform our data set used for the prediction.\n", + "X_test = X_test - X_train_mean #Use mean from training data\n", + "y_pred = trained_model(X_test)\n", + "y_pred = y_pred + y_train_mean" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## What does centering (subtracting the mean values) mean mathematically?\n", + "\n", + "\n", + "Let us try to understand what this may imply mathematically when we\n", + "subtract the mean values, also known as *zero centering*. For\n", + "simplicity, we will focus on ordinary regression, as done in the above example.\n", + "\n", + "The cost/loss function for regression is" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "C(\\beta_0, \\beta_1, ... , \\beta_{p-1}) = \\frac{1}{n}\\sum_{i=0}^{n} \\left(y_i - \\beta_0 - \\sum_{j=1}^{p-1} X_{ij}\\beta_j\\right)^2,.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Recall also that we use the squared value since this leads to an increase of the penalty for higher differences between predicted and output/target values.\n", + "\n", + "What we have done is to single out the $\\beta_0$ term in the definition of the mean squared error (MSE).\n", + "The design matrix\n", + "$X$ does in this case not contain any intercept column.\n", + "When we take the derivative with respect to $\\beta_0$, we want the derivative to obey" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\frac{\\partial C}{\\partial \\beta_j} = 0,\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "for all $j$. For $\\beta_0$ we have" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\frac{\\partial C}{\\partial \\beta_0} = -\\frac{2}{n}\\sum_{i=0}^{n-1} \\left(y_i - \\beta_0 - \\sum_{j=1}^{p-1} X_{ij} \\beta_j\\right).\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Multiplying away the constant $2/n$, we obtain" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\sum_{i=0}^{n-1} \\beta_0 = \\sum_{i=0}^{n-1}y_i - \\sum_{i=0}^{n-1} \\sum_{j=1}^{p-1} X_{ij} \\beta_j.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Further Manipulations\n", + "\n", + "We assume \n", + "that every column of $\\boldsymbol{X}$ is centered, which we can do by subtracting the mean," + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "X = X - np.mean(X,axis=0)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This means that we need to rewrite $X_{ij}$ as $\\tilde{X}_{ij}=X_{ij}-\\mu_j$, where" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\mu_j = \\frac{1}{n}\\sum_{i=0}^{n-1}X_{ij}.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Let us special first to the case where we have only two parameters $\\beta_0$ and $\\beta_1$.\n", + "Our result for $\\beta_0$ simplifies then to" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "n\\beta_0 = \\sum_{i=0}^{n-1}y_i - \\sum_{i=0}^{n-1} X_{i1} \\beta_1.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Assuming that the matrix elements $X_{i1}$ are centered, what we have is" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\beta_0 = \\frac{1}{n}\\sum_{i=0}^{n-1}y_i - \\beta_1\\frac{1}{n}\\sum_{i=0}^{n-1} \\left(X_{i1}-\\mu_{1}\\right),\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "where" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\mu_1=\\frac{1}{n}\\sum_{i=0}^{n-1} (X_{i1},\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "and if we define the mean value of the outputs as" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\mu_y=\\frac{1}{n}\\sum_{i=0}^{n-1}y_i,\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "we have" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\beta_0 = \\mu_y - \\beta_1\\frac{1}{n}\\sum_{i=0}^{n-1} (X_{i1}-\\mu_{1}),\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "and it is easy to see that the last sum equals zero! This means that we have" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\beta_0 = \\mu_y,\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "if the columns of the design matrix are centered. It is straight forward to generalize this results to more values of $\\beta$.\n", + "We have thus" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\beta_0 = \\frac{1}{n}\\sum_{i=0}^{n-1} y_i = \\overline{\\boldsymbol{y}},\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "the average value of $\\boldsymbol{y}$.\n", + "\n", + "Replacing $y_i$ with $y_i - \\beta_0 = y_i - \\overline{\\boldsymbol{y}}$ and centering also our design matrix results in a cost function (in vector-matrix disguise)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "C(\\boldsymbol{\\beta}) = (\\boldsymbol{\\tilde{y}} - \\tilde{X}\\boldsymbol{\\beta})^T(\\boldsymbol{\\tilde{y}} - \\tilde{X}\\boldsymbol{\\beta}).\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Wrapping it up\n", + "\n", + "If we minimize with respect to $\\boldsymbol{\\beta}$ we have then" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\hat{\\boldsymbol{\\beta}} = (\\tilde{X}^T\\tilde{X})^{-1}\\tilde{X}^T\\boldsymbol{\\tilde{y}},\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "where $\\boldsymbol{\\tilde{y}} = \\boldsymbol{y} - \\overline{\\boldsymbol{y}}$\n", + "and $\\tilde{X}_{ij} = X_{ij} - \\frac{1}{n}\\sum_{k=0}^{n-1}X_{kj}$.\n", + "\n", + "For Ridge regression we need to add $\\lambda \\boldsymbol{\\beta}^T\\boldsymbol{\\beta}$ to the cost function and get then" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\hat{\\boldsymbol{\\beta}} = (\\tilde{X}^T\\tilde{X} + \\lambda I)^{-1}\\tilde{X}^T\\boldsymbol{\\tilde{y}}.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "What does this mean? And why do we insist on all this? Let us look at some examples.\n", + "\n", + "\n", + "\n", + "## Linear Regression code, Intercept handling first\n", + "\n", + "This code shows a simple first-order fit to a data set using the above transformed data, where we consider the role of the intercept first, by either excluding it or including it (*code example thanks to Øyvind Sigmundson Schøyen*). Here our scaling of the data is done by subtracting the mean values only.\n", + "Note also that we do not split the data into training and test." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "\n", + "from sklearn.linear_model import LinearRegression\n", + "\n", + "\n", + "np.random.seed(2021)\n", + "\n", + "def MSE(y_data,y_model):\n", + " n = np.size(y_model)\n", + " return np.sum((y_data-y_model)**2)/n\n", + "\n", + "\n", + "def fit_beta(X, y):\n", + " return np.linalg.pinv(X.T @ X) @ X.T @ y\n", + "\n", + "\n", + "true_beta = [2, 0.5, 3.7]\n", + "\n", + "x = np.linspace(0, 1, 11)\n", + "y = np.sum(\n", + " np.asarray([x ** p * b for p, b in enumerate(true_beta)]), axis=0\n", + ") + 0.1 * np.random.normal(size=len(x))\n", + "\n", + "degree = 3\n", + "X = np.zeros((len(x), degree))\n", + "\n", + "# Include the intercept in the design matrix\n", + "for p in range(degree):\n", + " X[:, p] = x ** p\n", + "\n", + "beta = fit_beta(X, y)\n", + "\n", + "# Intercept is included in the design matrix\n", + "skl = LinearRegression(fit_intercept=False).fit(X, y)\n", + "\n", + "print(f\"True beta: {true_beta}\")\n", + "print(f\"Fitted beta: {beta}\")\n", + "print(f\"Sklearn fitted beta: {skl.coef_}\")\n", + "ypredictOwn = X @ beta\n", + "ypredictSKL = skl.predict(X)\n", + "print(f\"MSE with intercept column\")\n", + "print(MSE(y,ypredictOwn))\n", + "print(f\"MSE with intercept column from SKL\")\n", + "print(MSE(y,ypredictSKL))\n", + "\n", + "\n", + "plt.figure()\n", + "plt.scatter(x, y, label=\"Data\")\n", + "plt.plot(x, X @ beta, label=\"Fit\")\n", + "plt.plot(x, skl.predict(X), label=\"Sklearn (fit_intercept=False)\")\n", + "\n", + "\n", + "# Do not include the intercept in the design matrix\n", + "X = np.zeros((len(x), degree - 1))\n", + "\n", + "for p in range(degree - 1):\n", + " X[:, p] = x ** (p + 1)\n", + "\n", + "# Intercept is not included in the design matrix\n", + "skl = LinearRegression(fit_intercept=True).fit(X, y)\n", + "\n", + "# Use centered values for X and y when computing coefficients\n", + "y_offset = np.average(y, axis=0)\n", + "X_offset = np.average(X, axis=0)\n", + "\n", + "beta = fit_beta(X - X_offset, y - y_offset)\n", + "intercept = np.mean(y_offset - X_offset @ beta)\n", + "\n", + "print(f\"Manual intercept: {intercept}\")\n", + "print(f\"Fitted beta (wiothout intercept): {beta}\")\n", + "print(f\"Sklearn intercept: {skl.intercept_}\")\n", + "print(f\"Sklearn fitted beta (without intercept): {skl.coef_}\")\n", + "ypredictOwn = X @ beta\n", + "ypredictSKL = skl.predict(X)\n", + "print(f\"MSE with Manual intercept\")\n", + "print(MSE(y,ypredictOwn+intercept))\n", + "print(f\"MSE with Sklearn intercept\")\n", + "print(MSE(y,ypredictSKL))\n", + "\n", + "plt.plot(x, X @ beta + intercept, \"--\", label=\"Fit (manual intercept)\")\n", + "plt.plot(x, skl.predict(X), \"--\", label=\"Sklearn (fit_intercept=True)\")\n", + "plt.grid()\n", + "plt.legend()\n", + "\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The intercept is the value of our output/target variable\n", + "when all our features are zero and our function crosses the $y$-axis (for a one-dimensional case). \n", + "\n", + "Printing the MSE, we see first that both methods give the same MSE, as\n", + "they should. However, when we move to for example Ridge regression,\n", + "the way we treat the intercept may give a larger or smaller MSE,\n", + "meaning that the MSE can be penalized by the value of the\n", + "intercept. Not including the intercept in the fit, means that the\n", + "regularization term does not include $\\beta_0$. For different values\n", + "of $\\lambda$, this may lead to differeing MSE values. \n", + "\n", + "To remind the reader, the regularization term, with the intercept in Ridge regression is given by" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\lambda \\vert\\vert \\boldsymbol{\\beta} \\vert\\vert_2^2 = \\lambda \\sum_{j=0}^{p-1}\\beta_j^2,\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "but when we take out the intercept, this equation becomes" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\lambda \\vert\\vert \\boldsymbol{\\beta} \\vert\\vert_2^2 = \\lambda \\sum_{j=1}^{p-1}\\beta_j^2.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "For Lasso regression we have" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\lambda \\vert\\vert \\boldsymbol{\\beta} \\vert\\vert_1 = \\lambda \\sum_{j=1}^{p-1}\\vert\\beta_j\\vert.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "It means that, when scaling the design matrix and the outputs/targets, by subtracting the mean values, we have an optimization problem which is not penalized by the intercept. The MSE value can then be smaller since it focuses only on the remaining quantities. If we however bring back the intercept, we will get a MSE which then contains the intercept. \n", + "\n", + "## Code Examples\n", + "\n", + "Armed with this wisdom, we attempt first to simply set the intercept equal to **False** in our implementation of Ridge regression for our well-known vanilla data set." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "import numpy as np\n", + "import pandas as pd\n", + "import matplotlib.pyplot as plt\n", + "from sklearn.model_selection import train_test_split\n", + "from sklearn import linear_model\n", + "\n", + "def MSE(y_data,y_model):\n", + " n = np.size(y_model)\n", + " return np.sum((y_data-y_model)**2)/n\n", + "\n", + "\n", + "# A seed just to ensure that the random numbers are the same for every run.\n", + "# Useful for eventual debugging.\n", + "np.random.seed(3155)\n", + "\n", + "n = 100\n", + "x = np.random.rand(n)\n", + "y = np.exp(-x**2) + 1.5 * np.exp(-(x-2)**2)\n", + "\n", + "Maxpolydegree = 20\n", + "X = np.zeros((n,Maxpolydegree))\n", + "#We include explicitely the intercept column\n", + "for degree in range(Maxpolydegree):\n", + " X[:,degree] = x**degree\n", + "# We split the data in test and training data\n", + "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)\n", + "\n", + "p = Maxpolydegree\n", + "I = np.eye(p,p)\n", + "# Decide which values of lambda to use\n", + "nlambdas = 6\n", + "MSEOwnRidgePredict = np.zeros(nlambdas)\n", + "MSERidgePredict = np.zeros(nlambdas)\n", + "lambdas = np.logspace(-4, 2, nlambdas)\n", + "for i in range(nlambdas):\n", + " lmb = lambdas[i]\n", + " OwnRidgeBeta = np.linalg.pinv(X_train.T @ X_train+lmb*I) @ X_train.T @ y_train\n", + " # Note: we include the intercept column and no scaling\n", + " RegRidge = linear_model.Ridge(lmb,fit_intercept=False)\n", + " RegRidge.fit(X_train,y_train)\n", + " # and then make the prediction\n", + " ytildeOwnRidge = X_train @ OwnRidgeBeta\n", + " ypredictOwnRidge = X_test @ OwnRidgeBeta\n", + " ytildeRidge = RegRidge.predict(X_train)\n", + " ypredictRidge = RegRidge.predict(X_test)\n", + " MSEOwnRidgePredict[i] = MSE(y_test,ypredictOwnRidge)\n", + " MSERidgePredict[i] = MSE(y_test,ypredictRidge)\n", + " print(\"Beta values for own Ridge implementation\")\n", + " print(OwnRidgeBeta)\n", + " print(\"Beta values for Scikit-Learn Ridge implementation\")\n", + " print(RegRidge.coef_)\n", + " print(\"MSE values for own Ridge implementation\")\n", + " print(MSEOwnRidgePredict[i])\n", + " print(\"MSE values for Scikit-Learn Ridge implementation\")\n", + " print(MSERidgePredict[i])\n", + "\n", + "# Now plot the results\n", + "plt.figure()\n", + "plt.plot(np.log10(lambdas), MSEOwnRidgePredict, 'r', label = 'MSE own Ridge Test')\n", + "plt.plot(np.log10(lambdas), MSERidgePredict, 'g', label = 'MSE Ridge Test')\n", + "\n", + "plt.xlabel('log10(lambda)')\n", + "plt.ylabel('MSE')\n", + "plt.legend()\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The results here agree when we force **Scikit-Learn**'s Ridge function to include the first column in our design matrix.\n", + "We see that the results agree very well. Here we have thus explicitely included the intercept column in the design matrix.\n", + "What happens if we do not include the intercept in our fit?\n", + "Let us see how we can change this code by zero centering (thanks to Stian Bilek for inpouts here).\n", + "\n", + "## Taking out the mean" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "import numpy as np\n", + "import pandas as pd\n", + "import matplotlib.pyplot as plt\n", + "from sklearn.model_selection import train_test_split\n", + "from sklearn import linear_model\n", + "from sklearn.preprocessing import StandardScaler\n", + "\n", + "def MSE(y_data,y_model):\n", + " n = np.size(y_model)\n", + " return np.sum((y_data-y_model)**2)/n\n", + "# A seed just to ensure that the random numbers are the same for every run.\n", + "# Useful for eventual debugging.\n", + "np.random.seed(315)\n", + "\n", + "n = 100\n", + "x = np.random.rand(n)\n", + "y = np.exp(-x**2) + 1.5 * np.exp(-(x-2)**2)\n", + "\n", + "Maxpolydegree = 20\n", + "X = np.zeros((n,Maxpolydegree-1))\n", + "\n", + "for degree in range(1,Maxpolydegree): #No intercept column\n", + " X[:,degree-1] = x**(degree)\n", + "\n", + "# We split the data in test and training data\n", + "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)\n", + "\n", + "#For our own implementation, we will need to deal with the intercept by centering the design matrix and the target variable\n", + "X_train_mean = np.mean(X_train,axis=0)\n", + "#Center by removing mean from each feature\n", + "X_train_scaled = X_train - X_train_mean \n", + "X_test_scaled = X_test - X_train_mean\n", + "#The model intercept (called y_scaler) is given by the mean of the target variable (IF X is centered)\n", + "#Remove the intercept from the training data.\n", + "y_scaler = np.mean(y_train) \n", + "y_train_scaled = y_train - y_scaler \n", + "\n", + "p = Maxpolydegree-1\n", + "I = np.eye(p,p)\n", + "# Decide which values of lambda to use\n", + "nlambdas = 6\n", + "MSEOwnRidgePredict = np.zeros(nlambdas)\n", + "MSERidgePredict = np.zeros(nlambdas)\n", + "\n", + "lambdas = np.logspace(-4, 2, nlambdas)\n", + "for i in range(nlambdas):\n", + " lmb = lambdas[i]\n", + " OwnRidgeBeta = np.linalg.pinv(X_train_scaled.T @ X_train_scaled+lmb*I) @ X_train_scaled.T @ (y_train_scaled)\n", + " intercept_ = y_scaler - X_train_mean@OwnRidgeBeta #The intercept can be shifted so the model can predict on uncentered data\n", + " #Add intercept to prediction\n", + " ypredictOwnRidge = X_test @ OwnRidgeBeta + intercept_ \n", + " #Add intercept to prediction\n", + " ypredictOwnRidge = X_test_scaled @ OwnRidgeBeta + y_scaler \n", + " RegRidge = linear_model.Ridge(lmb)\n", + " RegRidge.fit(X_train,y_train)\n", + " ypredictRidge = RegRidge.predict(X_test)\n", + " MSEOwnRidgePredict[i] = MSE(y_test,ypredictOwnRidge)\n", + " MSERidgePredict[i] = MSE(y_test,ypredictRidge)\n", + " print(\"Beta values for own Ridge implementation\")\n", + " print(OwnRidgeBeta) #Intercept is given by mean of target variable\n", + " print(\"Beta values for Scikit-Learn Ridge implementation\")\n", + " print(RegRidge.coef_)\n", + " print('Intercept from own implementation:')\n", + " print(intercept_)\n", + " print('Intercept from Scikit-Learn Ridge implementation')\n", + " print(RegRidge.intercept_)\n", + " print(\"MSE values for own Ridge implementation\")\n", + " print(MSEOwnRidgePredict[i])\n", + " print(\"MSE values for Scikit-Learn Ridge implementation\")\n", + " print(MSERidgePredict[i])\n", + "\n", + "\n", + "# Now plot the results\n", + "plt.figure()\n", + "plt.plot(np.log10(lambdas), MSEOwnRidgePredict, 'b--', label = 'MSE own Ridge Test')\n", + "plt.plot(np.log10(lambdas), MSERidgePredict, 'g--', label = 'MSE SL Ridge Test')\n", + "plt.xlabel('log10(lambda)')\n", + "plt.ylabel('MSE')\n", + "plt.legend()\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We see here, when compared to the code which includes explicitely the\n", + "intercept column, that our MSE value is actually smaller. This is\n", + "because the regularization term does not include the intercept value\n", + "$\\beta_0$ in the fitting. This applies to Lasso regularization as\n", + "well. It means that our optimization is now done only with the\n", + "centered matrix and/or vector that enter the fitting procedure. Note\n", + "also that the problem with the intercept occurs mainly in these type\n", + "of polynomial fitting problem.\n", + "\n", + "The next example is indeed an example where all these discussions about the role of intercept are not present.\n", + "\n", + "\n", + "## More complicated Example: The Ising model\n", + "\n", + "The one-dimensional Ising model with nearest neighbor interaction, no\n", + "external field and a constant coupling constant $J$ is given by" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
    \n", + "\n", + "$$\n", + "\\begin{equation}\n", + " H = -J \\sum_{k}^L s_k s_{k + 1},\n", + "\\label{_auto1} \\tag{1}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "where $s_i \\in \\{-1, 1\\}$ and $s_{N + 1} = s_1$. The number of spins\n", + "in the system is determined by $L$. For the one-dimensional system\n", + "there is no phase transition.\n", + "\n", + "We will look at a system of $L = 40$ spins with a coupling constant of\n", + "$J = 1$. To get enough training data we will generate 10000 states\n", + "with their respective energies." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "from mpl_toolkits.axes_grid1 import make_axes_locatable\n", + "import seaborn as sns\n", + "import scipy.linalg as scl\n", + "from sklearn.model_selection import train_test_split\n", + "import tqdm\n", + "sns.set(color_codes=True)\n", + "cmap_args=dict(vmin=-1., vmax=1., cmap='seismic')\n", + "\n", + "L = 40\n", + "n = int(1e4)\n", + "\n", + "spins = np.random.choice([-1, 1], size=(n, L))\n", + "J = 1.0\n", + "\n", + "energies = np.zeros(n)\n", + "\n", + "for i in range(n):\n", + " energies[i] = - J * np.dot(spins[i], np.roll(spins[i], 1))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Here we use ordinary least squares\n", + "regression to predict the energy for the nearest neighbor\n", + "one-dimensional Ising model on a ring, i.e., the endpoints wrap\n", + "around. We will use linear regression to fit a value for\n", + "the coupling constant to achieve this.\n", + "\n", + "## Reformulating the problem to suit regression\n", + "\n", + "A more general form for the one-dimensional Ising model is" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
    \n", + "\n", + "$$\n", + "\\begin{equation}\n", + " H = - \\sum_j^L \\sum_k^L s_j s_k J_{jk}.\n", + "\\label{_auto2} \\tag{2}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Here we allow for interactions beyond the nearest neighbors and a state dependent\n", + "coupling constant. This latter expression can be formulated as\n", + "a matrix-product" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
    \n", + "\n", + "$$\n", + "\\begin{equation}\n", + " \\boldsymbol{H} = \\boldsymbol{X} J,\n", + "\\label{_auto3} \\tag{3}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "where $X_{jk} = s_j s_k$ and $J$ is a matrix which consists of the\n", + "elements $-J_{jk}$. This form of writing the energy fits perfectly\n", + "with the form utilized in linear regression, that is" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
    \n", + "\n", + "$$\n", + "\\begin{equation}\n", + " \\boldsymbol{y} = \\boldsymbol{X}\\boldsymbol{\\beta} + \\boldsymbol{\\epsilon},\n", + "\\label{_auto4} \\tag{4}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We split the data in training and test data as discussed in the previous example" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "X = np.zeros((n, L ** 2))\n", + "for i in range(n):\n", + " X[i] = np.outer(spins[i], spins[i]).ravel()\n", + "y = energies\n", + "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Linear regression\n", + "\n", + "In the ordinary least squares method we choose the cost function" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
    \n", + "\n", + "$$\n", + "\\begin{equation}\n", + " C(\\boldsymbol{X}, \\boldsymbol{\\beta})= \\frac{1}{n}\\left\\{(\\boldsymbol{X}\\boldsymbol{\\beta} - \\boldsymbol{y})^T(\\boldsymbol{X}\\boldsymbol{\\beta} - \\boldsymbol{y})\\right\\}.\n", + "\\label{_auto5} \\tag{5}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We then find the extremal point of $C$ by taking the derivative with respect to $\\boldsymbol{\\beta}$ as discussed above.\n", + "This yields the expression for $\\boldsymbol{\\beta}$ to be" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\boldsymbol{\\beta} = \\frac{\\boldsymbol{X}^T \\boldsymbol{y}}{\\boldsymbol{X}^T \\boldsymbol{X}},\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "which immediately imposes some requirements on $\\boldsymbol{X}$ as there must exist\n", + "an inverse of $\\boldsymbol{X}^T \\boldsymbol{X}$. If the expression we are modeling contains an\n", + "intercept, i.e., a constant term, we must make sure that the\n", + "first column of $\\boldsymbol{X}$ consists of $1$. We do this here" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "X_train_own = np.concatenate(\n", + " (np.ones(len(X_train))[:, np.newaxis], X_train),\n", + " axis=1\n", + ")\n", + "X_test_own = np.concatenate(\n", + " (np.ones(len(X_test))[:, np.newaxis], X_test),\n", + " axis=1\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "def ols_inv(x: np.ndarray, y: np.ndarray) -> np.ndarray:\n", + " return scl.inv(x.T @ x) @ (x.T @ y)\n", + "beta = ols_inv(X_train_own, y_train)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Singular Value decomposition\n", + "\n", + "Doing the inversion directly turns out to be a bad idea since the matrix\n", + "$\\boldsymbol{X}^T\\boldsymbol{X}$ is singular. An alternative approach is to use the **singular\n", + "value decomposition**. Using the definition of the Moore-Penrose\n", + "pseudoinverse we can write the equation for $\\boldsymbol{\\beta}$ as" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\boldsymbol{\\beta} = \\boldsymbol{X}^{+}\\boldsymbol{y},\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "where the pseudoinverse of $\\boldsymbol{X}$ is given by" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\boldsymbol{X}^{+} = \\frac{\\boldsymbol{X}^T}{\\boldsymbol{X}^T\\boldsymbol{X}}.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Using singular value decomposition we can decompose the matrix $\\boldsymbol{X} = \\boldsymbol{U}\\boldsymbol{\\Sigma} \\boldsymbol{V}^T$,\n", + "where $\\boldsymbol{U}$ and $\\boldsymbol{V}$ are orthogonal(unitary) matrices and $\\boldsymbol{\\Sigma}$ contains the singular values (more details below).\n", + "where $X^{+} = V\\Sigma^{+} U^T$. This reduces the equation for\n", + "$\\omega$ to" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
    \n", + "\n", + "$$\n", + "\\begin{equation}\n", + " \\boldsymbol{\\beta} = \\boldsymbol{V}\\boldsymbol{\\Sigma}^{+} \\boldsymbol{U}^T \\boldsymbol{y}.\n", + "\\label{_auto6} \\tag{6}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Note that solving this equation by actually doing the pseudoinverse\n", + "(which is what we will do) is not a good idea as this operation scales\n", + "as $\\mathcal{O}(n^3)$, where $n$ is the number of elements in a\n", + "general matrix. Instead, doing $QR$-factorization and solving the\n", + "linear system as an equation would reduce this down to\n", + "$\\mathcal{O}(n^2)$ operations." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "def ols_svd(x: np.ndarray, y: np.ndarray) -> np.ndarray:\n", + " u, s, v = scl.svd(x)\n", + " return v.T @ scl.pinv(scl.diagsvd(s, u.shape[0], v.shape[0])) @ u.T @ y" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "beta = ols_svd(X_train_own,y_train)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "When extracting the $J$-matrix we need to make sure that we remove the intercept, as is done here" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "J = beta[1:].reshape(L, L)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "A way of looking at the coefficients in $J$ is to plot the matrices as images." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "fig = plt.figure(figsize=(20, 14))\n", + "im = plt.imshow(J, **cmap_args)\n", + "plt.title(\"OLS\", fontsize=18)\n", + "plt.xticks(fontsize=18)\n", + "plt.yticks(fontsize=18)\n", + "cb = fig.colorbar(im)\n", + "cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "It is interesting to note that OLS\n", + "considers both $J_{j, j + 1} = -0.5$ and $J_{j, j - 1} = -0.5$ as\n", + "valid matrix elements for $J$.\n", + "In our discussion below on hyperparameters and Ridge and Lasso regression we will see that\n", + "this problem can be removed, partly and only with Lasso regression. \n", + "\n", + "In this case our matrix inversion was actually possible. The obvious question now is what is the mathematics behind the SVD?\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "## The one-dimensional Ising model\n", + "\n", + "Let us bring back the Ising model again, but now with an additional\n", + "focus on Ridge and Lasso regression as well. We repeat some of the\n", + "basic parts of the Ising model and the setup of the training and test\n", + "data. The one-dimensional Ising model with nearest neighbor\n", + "interaction, no external field and a constant coupling constant $J$ is\n", + "given by" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
    \n", + "\n", + "$$\n", + "\\begin{equation}\n", + " H = -J \\sum_{k}^L s_k s_{k + 1},\n", + "\\label{_auto7} \\tag{7}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "where $s_i \\in \\{-1, 1\\}$ and $s_{N + 1} = s_1$. The number of spins in the system is determined by $L$. For the one-dimensional system there is no phase transition.\n", + "\n", + "We will look at a system of $L = 40$ spins with a coupling constant of $J = 1$. To get enough training data we will generate 10000 states with their respective energies." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "from mpl_toolkits.axes_grid1 import make_axes_locatable\n", + "import seaborn as sns\n", + "import scipy.linalg as scl\n", + "from sklearn.model_selection import train_test_split\n", + "import sklearn.linear_model as skl\n", + "import tqdm\n", + "sns.set(color_codes=True)\n", + "cmap_args=dict(vmin=-1., vmax=1., cmap='seismic')\n", + "\n", + "L = 40\n", + "n = int(1e4)\n", + "\n", + "spins = np.random.choice([-1, 1], size=(n, L))\n", + "J = 1.0\n", + "\n", + "energies = np.zeros(n)\n", + "\n", + "for i in range(n):\n", + " energies[i] = - J * np.dot(spins[i], np.roll(spins[i], 1))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "A more general form for the one-dimensional Ising model is" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
    \n", + "\n", + "$$\n", + "\\begin{equation}\n", + " H = - \\sum_j^L \\sum_k^L s_j s_k J_{jk}.\n", + "\\label{_auto8} \\tag{8}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Here we allow for interactions beyond the nearest neighbors and a more\n", + "adaptive coupling matrix. This latter expression can be formulated as\n", + "a matrix-product on the form" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
    \n", + "\n", + "$$\n", + "\\begin{equation}\n", + " H = X J,\n", + "\\label{_auto9} \\tag{9}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "where $X_{jk} = s_j s_k$ and $J$ is the matrix consisting of the\n", + "elements $-J_{jk}$. This form of writing the energy fits perfectly\n", + "with the form utilized in linear regression, viz." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
    \n", + "\n", + "$$\n", + "\\begin{equation}\n", + " \\boldsymbol{y} = \\boldsymbol{X}\\boldsymbol{\\beta} + \\boldsymbol{\\epsilon}.\n", + "\\label{_auto10} \\tag{10}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We organize the data as we did above" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "X = np.zeros((n, L ** 2))\n", + "for i in range(n):\n", + " X[i] = np.outer(spins[i], spins[i]).ravel()\n", + "y = energies\n", + "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.96)\n", + "\n", + "X_train_own = np.concatenate(\n", + " (np.ones(len(X_train))[:, np.newaxis], X_train),\n", + " axis=1\n", + ")\n", + "\n", + "X_test_own = np.concatenate(\n", + " (np.ones(len(X_test))[:, np.newaxis], X_test),\n", + " axis=1\n", + ")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We will do all fitting with **Scikit-Learn**," + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "clf = skl.LinearRegression().fit(X_train, y_train)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "When extracting the $J$-matrix we make sure to remove the intercept" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "J_sk = clf.coef_.reshape(L, L)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "And then we plot the results" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "fig = plt.figure(figsize=(20, 14))\n", + "im = plt.imshow(J_sk, **cmap_args)\n", + "plt.title(\"LinearRegression from Scikit-learn\", fontsize=18)\n", + "plt.xticks(fontsize=18)\n", + "plt.yticks(fontsize=18)\n", + "cb = fig.colorbar(im)\n", + "cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The results perfectly with our previous discussion where we used our own code.\n", + "\n", + "## Ridge regression\n", + "\n", + "Having explored the ordinary least squares we move on to ridge\n", + "regression. In ridge regression we include a **regularizer**. This\n", + "involves a new cost function which leads to a new estimate for the\n", + "weights $\\boldsymbol{\\beta}$. This results in a penalized regression problem. The\n", + "cost function is given by" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "3\n", + "9\n", + " \n", + "<\n", + "<\n", + "<\n", + "!\n", + "!\n", + "M\n", + "A\n", + "T\n", + "H\n", + "_\n", + "B\n", + "L\n", + "O\n", + "C\n", + "K" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "_lambda = 0.1\n", + "clf_ridge = skl.Ridge(alpha=_lambda).fit(X_train, y_train)\n", + "J_ridge_sk = clf_ridge.coef_.reshape(L, L)\n", + "fig = plt.figure(figsize=(20, 14))\n", + "im = plt.imshow(J_ridge_sk, **cmap_args)\n", + "plt.title(\"Ridge from Scikit-learn\", fontsize=18)\n", + "plt.xticks(fontsize=18)\n", + "plt.yticks(fontsize=18)\n", + "cb = fig.colorbar(im)\n", + "cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)\n", + "\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## LASSO regression\n", + "\n", + "In the **Least Absolute Shrinkage and Selection Operator** (LASSO)-method we get a third cost function." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
    \n", + "\n", + "$$\n", + "\\begin{equation}\n", + " C(\\boldsymbol{X}, \\boldsymbol{\\beta}; \\lambda) = (\\boldsymbol{X}\\boldsymbol{\\beta} - \\boldsymbol{y})^T(\\boldsymbol{X}\\boldsymbol{\\beta} - \\boldsymbol{y}) + \\lambda \\sqrt{\\boldsymbol{\\beta}^T\\boldsymbol{\\beta}}.\n", + "\\label{_auto12} \\tag{12}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Finding the extremal point of this cost function is not so straight-forward as in least squares and ridge. We will therefore rely solely on the function ``Lasso`` from **Scikit-Learn**." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "clf_lasso = skl.Lasso(alpha=_lambda).fit(X_train, y_train)\n", + "J_lasso_sk = clf_lasso.coef_.reshape(L, L)\n", + "fig = plt.figure(figsize=(20, 14))\n", + "im = plt.imshow(J_lasso_sk, **cmap_args)\n", + "plt.title(\"Lasso from Scikit-learn\", fontsize=18)\n", + "plt.xticks(fontsize=18)\n", + "plt.yticks(fontsize=18)\n", + "cb = fig.colorbar(im)\n", + "cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=18)\n", + "\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "It is quite striking how LASSO breaks the symmetry of the coupling\n", + "constant as opposed to ridge and OLS. We get a sparse solution with\n", + "$J_{j, j + 1} = -1$.\n", + "\n", + "\n", + "\n", + "## Performance as function of the regularization parameter\n", + "\n", + "We see how the different models perform for a different set of values for $\\lambda$." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "lambdas = np.logspace(-4, 5, 10)\n", + "\n", + "train_errors = {\n", + " \"ols_sk\": np.zeros(lambdas.size),\n", + " \"ridge_sk\": np.zeros(lambdas.size),\n", + " \"lasso_sk\": np.zeros(lambdas.size)\n", + "}\n", + "\n", + "test_errors = {\n", + " \"ols_sk\": np.zeros(lambdas.size),\n", + " \"ridge_sk\": np.zeros(lambdas.size),\n", + " \"lasso_sk\": np.zeros(lambdas.size)\n", + "}\n", + "\n", + "plot_counter = 1\n", + "\n", + "fig = plt.figure(figsize=(32, 54))\n", + "\n", + "for i, _lambda in enumerate(tqdm.tqdm(lambdas)):\n", + " for key, method in zip(\n", + " [\"ols_sk\", \"ridge_sk\", \"lasso_sk\"],\n", + " [skl.LinearRegression(), skl.Ridge(alpha=_lambda), skl.Lasso(alpha=_lambda)]\n", + " ):\n", + " method = method.fit(X_train, y_train)\n", + "\n", + " train_errors[key][i] = method.score(X_train, y_train)\n", + " test_errors[key][i] = method.score(X_test, y_test)\n", + "\n", + " omega = method.coef_.reshape(L, L)\n", + "\n", + " plt.subplot(10, 5, plot_counter)\n", + " plt.imshow(omega, **cmap_args)\n", + " plt.title(r\"%s, $\\lambda = %.4f$\" % (key, _lambda))\n", + " plot_counter += 1\n", + "\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We see that LASSO reaches a good solution for low\n", + "values of $\\lambda$, but will \"wither\" when we increase $\\lambda$ too\n", + "much. Ridge is more stable over a larger range of values for\n", + "$\\lambda$, but eventually also fades away.\n", + "\n", + "## Finding the optimal value of $\\lambda$\n", + "\n", + "To determine which value of $\\lambda$ is best we plot the accuracy of\n", + "the models when predicting the training and the testing set. We expect\n", + "the accuracy of the training set to be quite good, but if the accuracy\n", + "of the testing set is much lower this tells us that we might be\n", + "subject to an overfit model. The ideal scenario is an accuracy on the\n", + "testing set that is close to the accuracy of the training set." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "fig = plt.figure(figsize=(20, 14))\n", + "\n", + "colors = {\n", + " \"ols_sk\": \"r\",\n", + " \"ridge_sk\": \"y\",\n", + " \"lasso_sk\": \"c\"\n", + "}\n", + "\n", + "for key in train_errors:\n", + " plt.semilogx(\n", + " lambdas,\n", + " train_errors[key],\n", + " colors[key],\n", + " label=\"Train {0}\".format(key),\n", + " linewidth=4.0\n", + " )\n", + "\n", + "for key in test_errors:\n", + " plt.semilogx(\n", + " lambdas,\n", + " test_errors[key],\n", + " colors[key] + \"--\",\n", + " label=\"Test {0}\".format(key),\n", + " linewidth=4.0\n", + " )\n", + "plt.legend(loc=\"best\", fontsize=18)\n", + "plt.xlabel(r\"$\\lambda$\", fontsize=18)\n", + "plt.ylabel(r\"$R^2$\", fontsize=18)\n", + "plt.tick_params(labelsize=18)\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "From the above figure we can see that LASSO with $\\lambda = 10^{-2}$\n", + "achieves a very good accuracy on the test set. This by far surpasses the\n", + "other models for all values of $\\lambda$.\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "## Logistic Regression\n", + "\n", + "In linear regression our main interest was centered on learning the\n", + "coefficients of a functional fit (say a polynomial) in order to be\n", + "able to predict the response of a continuous variable on some unseen\n", + "data. The fit to the continuous variable $y_i$ is based on some\n", + "independent variables $\\boldsymbol{x}_i$. Linear regression resulted in\n", + "analytical expressions for standard ordinary Least Squares or Ridge\n", + "regression (in terms of matrices to invert) for several quantities,\n", + "ranging from the variance and thereby the confidence intervals of the\n", + "parameters $\\boldsymbol{\\beta}$ to the mean squared error. If we can invert\n", + "the product of the design matrices, linear regression gives then a\n", + "simple recipe for fitting our data.\n", + "\n", + "\n", + "## Classification problems\n", + "\n", + "\n", + "Classification problems, however, are concerned with outcomes taking\n", + "the form of discrete variables (i.e. categories). We may for example,\n", + "on the basis of DNA sequencing for a number of patients, like to find\n", + "out which mutations are important for a certain disease; or based on\n", + "scans of various patients' brains, figure out if there is a tumor or\n", + "not; or given a specific physical system, we'd like to identify its\n", + "state, say whether it is an ordered or disordered system (typical\n", + "situation in solid state physics); or classify the status of a\n", + "patient, whether she/he has a stroke or not and many other similar\n", + "situations.\n", + "\n", + "The most common situation we encounter when we apply logistic\n", + "regression is that of two possible outcomes, normally denoted as a\n", + "binary outcome, true or false, positive or negative, success or\n", + "failure etc.\n", + "\n", + "## Optimization and Deep learning\n", + "\n", + "Logistic regression will also serve as our stepping stone towards\n", + "neural network algorithms and supervised deep learning. For logistic\n", + "learning, the minimization of the cost function leads to a non-linear\n", + "equation in the parameters $\\boldsymbol{\\beta}$. The optimization of the\n", + "problem calls therefore for minimization algorithms. This forms the\n", + "bottle neck of all machine learning algorithms, namely how to find\n", + "reliable minima of a multi-variable function. This leads us to the\n", + "family of gradient descent methods. The latter are the working horses\n", + "of basically all modern machine learning algorithms.\n", + "\n", + "We note also that many of the topics discussed here on logistic \n", + "regression are also commonly used in modern supervised Deep Learning\n", + "models, as we will see later.\n", + "\n", + "\n", + "\n", + "## Basics\n", + "\n", + "We consider the case where the dependent variables, also called the\n", + "responses or the outcomes, $y_i$ are discrete and only take values\n", + "from $k=0,\\dots,K-1$ (i.e. $K$ classes).\n", + "\n", + "The goal is to predict the\n", + "output classes from the design matrix $\\boldsymbol{X}\\in\\mathbb{R}^{n\\times p}$\n", + "made of $n$ samples, each of which carries $p$ features or predictors. The\n", + "primary goal is to identify the classes to which new unseen samples\n", + "belong.\n", + "\n", + "Let us specialize to the case of two classes only, with outputs\n", + "$y_i=0$ and $y_i=1$. Our outcomes could represent the status of a\n", + "credit card user that could default or not on her/his credit card\n", + "debt. That is" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "y_i = \\begin{bmatrix} 0 & \\mathrm{no}\\\\ 1 & \\mathrm{yes} \\end{bmatrix}.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Linear classifier\n", + "\n", + "Before moving to the logistic model, let us try to use our linear\n", + "regression model to classify these two outcomes. We could for example\n", + "fit a linear model to the default case if $y_i > 0.5$ and the no\n", + "default case $y_i \\leq 0.5$.\n", + "\n", + "We would then have our \n", + "weighted linear combination, namely" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
    \n", + "\n", + "$$\n", + "\\begin{equation}\n", + "\\boldsymbol{y} = \\boldsymbol{X}^T\\boldsymbol{\\beta} + \\boldsymbol{\\epsilon},\n", + "\\label{_auto13} \\tag{13}\n", + "\\end{equation}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "where $\\boldsymbol{y}$ is a vector representing the possible outcomes, $\\boldsymbol{X}$ is our\n", + "$n\\times p$ design matrix and $\\boldsymbol{\\beta}$ represents our estimators/predictors.\n", + "\n", + "## Some selected properties\n", + "\n", + "The main problem with our function is that it takes values on the\n", + "entire real axis. In the case of logistic regression, however, the\n", + "labels $y_i$ are discrete variables. A typical example is the credit\n", + "card data discussed below here, where we can set the state of\n", + "defaulting the debt to $y_i=1$ and not to $y_i=0$ for one the persons\n", + "in the data set (see the full example below).\n", + "\n", + "One simple way to get a discrete output is to have sign\n", + "functions that map the output of a linear regressor to values $\\{0,1\\}$,\n", + "$f(s_i)=sign(s_i)=1$ if $s_i\\ge 0$ and 0 if otherwise. \n", + "We will encounter this model in our first demonstration of neural networks. Historically it is called the ``perceptron\" model in the machine learning\n", + "literature. This model is extremely simple. However, in many cases it is more\n", + "favorable to use a ``soft\" classifier that outputs\n", + "the probability of a given category. This leads us to the logistic function.\n", + "\n", + "## Simple example\n", + "\n", + "The following example on data for coronary heart disease (CHD) as function of age may serve as an illustration. In the code here we read and plot whether a person has had CHD (output = 1) or not (output = 0). This ouput is plotted the person's against age. Clearly, the figure shows that attempting to make a standard linear regression fit may not be very meaningful." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "# Common imports\n", + "import os\n", + "import numpy as np\n", + "import pandas as pd\n", + "import matplotlib.pyplot as plt\n", + "from sklearn.linear_model import LinearRegression, Ridge, Lasso\n", + "from sklearn.model_selection import train_test_split\n", + "from sklearn.utils import resample\n", + "from sklearn.metrics import mean_squared_error\n", + "from IPython.display import display\n", + "from pylab import plt, mpl\n", + "plt.style.use('seaborn')\n", + "mpl.rcParams['font.family'] = 'serif'\n", + "\n", + "# Where to save the figures and data files\n", + "PROJECT_ROOT_DIR = \"Results\"\n", + "FIGURE_ID = \"Results/FigureFiles\"\n", + "DATA_ID = \"DataFiles/\"\n", + "\n", + "if not os.path.exists(PROJECT_ROOT_DIR):\n", + " os.mkdir(PROJECT_ROOT_DIR)\n", + "\n", + "if not os.path.exists(FIGURE_ID):\n", + " os.makedirs(FIGURE_ID)\n", + "\n", + "if not os.path.exists(DATA_ID):\n", + " os.makedirs(DATA_ID)\n", + "\n", + "def image_path(fig_id):\n", + " return os.path.join(FIGURE_ID, fig_id)\n", + "\n", + "def data_path(dat_id):\n", + " return os.path.join(DATA_ID, dat_id)\n", + "\n", + "def save_fig(fig_id):\n", + " plt.savefig(image_path(fig_id) + \".png\", format='png')\n", + "\n", + "infile = open(data_path(\"chddata.csv\"),'r')\n", + "\n", + "# Read the chd data as csv file and organize the data into arrays with age group, age, and chd\n", + "chd = pd.read_csv(infile, names=('ID', 'Age', 'Agegroup', 'CHD'))\n", + "chd.columns = ['ID', 'Age', 'Agegroup', 'CHD']\n", + "output = chd['CHD']\n", + "age = chd['Age']\n", + "agegroup = chd['Agegroup']\n", + "numberID = chd['ID'] \n", + "display(chd)\n", + "\n", + "plt.scatter(age, output, marker='o')\n", + "plt.axis([18,70.0,-0.1, 1.2])\n", + "plt.xlabel(r'Age')\n", + "plt.ylabel(r'CHD')\n", + "plt.title(r'Age distribution and Coronary heart disease')\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Plotting the mean value for each group\n", + "\n", + "What we could attempt however is to plot the mean value for each group." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "agegroupmean = np.array([0.1, 0.133, 0.250, 0.333, 0.462, 0.625, 0.765, 0.800])\n", + "group = np.array([1, 2, 3, 4, 5, 6, 7, 8])\n", + "plt.plot(group, agegroupmean, \"r-\")\n", + "plt.axis([0,9,0, 1.0])\n", + "plt.xlabel(r'Age group')\n", + "plt.ylabel(r'CHD mean values')\n", + "plt.title(r'Mean values for each age group')\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We are now trying to find a function $f(y\\vert x)$, that is a function which gives us an expected value for the output $y$ with a given input $x$.\n", + "In standard linear regression with a linear dependence on $x$, we would write this in terms of our model" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "f(y_i\\vert x_i)=\\beta_0+\\beta_1 x_i.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This expression implies however that $f(y_i\\vert x_i)$ could take any\n", + "value from minus infinity to plus infinity. If we however let\n", + "$f(y\\vert y)$ be represented by the mean value, the above example\n", + "shows us that we can constrain the function to take values between\n", + "zero and one, that is we have $0 \\le f(y_i\\vert x_i) \\le 1$. Looking\n", + "at our last curve we see also that it has an S-shaped form. This leads\n", + "us to a very popular model for the function $f$, namely the so-called\n", + "Sigmoid function or logistic model. We will consider this function as\n", + "representing the probability for finding a value of $y_i$ with a given\n", + "$x_i$.\n", + "\n", + "## The logistic function\n", + "\n", + "Another widely studied model, is the so-called \n", + "perceptron model, which is an example of a \"hard classification\" model. We\n", + "will encounter this model when we discuss neural networks as\n", + "well. Each datapoint is deterministically assigned to a category (i.e\n", + "$y_i=0$ or $y_i=1$). In many cases, and the coronary heart disease data forms one of many such examples, it is favorable to have a \"soft\"\n", + "classifier that outputs the probability of a given category rather\n", + "than a single value. For example, given $x_i$, the classifier\n", + "outputs the probability of being in a category $k$. Logistic regression\n", + "is the most common example of a so-called soft classifier. In logistic\n", + "regression, the probability that a data point $x_i$\n", + "belongs to a category $y_i=\\{0,1\\}$ is given by the so-called logit function (or Sigmoid) which is meant to represent the likelihood for a given event," + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "p(t) = \\frac{1}{1+\\mathrm \\exp{-t}}=\\frac{\\exp{t}}{1+\\mathrm \\exp{t}}.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Note that $1-p(t)= p(-t)$.\n", + "\n", + "## Examples of likelihood functions used in logistic regression and nueral networks\n", + "\n", + "\n", + "The following code plots the logistic function, the step function and other functions we will encounter from here and on." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "\"\"\"The sigmoid function (or the logistic curve) is a\n", + "function that takes any real number, z, and outputs a number (0,1).\n", + "It is useful in neural networks for assigning weights on a relative scale.\n", + "The value z is the weighted sum of parameters involved in the learning algorithm.\"\"\"\n", + "\n", + "import numpy\n", + "import matplotlib.pyplot as plt\n", + "import math as mt\n", + "\n", + "z = numpy.arange(-5, 5, .1)\n", + "sigma_fn = numpy.vectorize(lambda z: 1/(1+numpy.exp(-z)))\n", + "sigma = sigma_fn(z)\n", + "\n", + "fig = plt.figure()\n", + "ax = fig.add_subplot(111)\n", + "ax.plot(z, sigma)\n", + "ax.set_ylim([-0.1, 1.1])\n", + "ax.set_xlim([-5,5])\n", + "ax.grid(True)\n", + "ax.set_xlabel('z')\n", + "ax.set_title('sigmoid function')\n", + "\n", + "plt.show()\n", + "\n", + "\"\"\"Step Function\"\"\"\n", + "z = numpy.arange(-5, 5, .02)\n", + "step_fn = numpy.vectorize(lambda z: 1.0 if z >= 0.0 else 0.0)\n", + "step = step_fn(z)\n", + "\n", + "fig = plt.figure()\n", + "ax = fig.add_subplot(111)\n", + "ax.plot(z, step)\n", + "ax.set_ylim([-0.5, 1.5])\n", + "ax.set_xlim([-5,5])\n", + "ax.grid(True)\n", + "ax.set_xlabel('z')\n", + "ax.set_title('step function')\n", + "\n", + "plt.show()\n", + "\n", + "\"\"\"tanh Function\"\"\"\n", + "z = numpy.arange(-2*mt.pi, 2*mt.pi, 0.1)\n", + "t = numpy.tanh(z)\n", + "\n", + "fig = plt.figure()\n", + "ax = fig.add_subplot(111)\n", + "ax.plot(z, t)\n", + "ax.set_ylim([-1.0, 1.0])\n", + "ax.set_xlim([-2*mt.pi,2*mt.pi])\n", + "ax.grid(True)\n", + "ax.set_xlabel('z')\n", + "ax.set_title('tanh function')\n", + "\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Two parameters\n", + "\n", + "We assume now that we have two classes with $y_i$ either $0$ or $1$. Furthermore we assume also that we have only two parameters $\\beta$ in our fitting of the Sigmoid function, that is we define probabilities" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\begin{align*}\n", + "p(y_i=1|x_i,\\boldsymbol{\\beta}) &= \\frac{\\exp{(\\beta_0+\\beta_1x_i)}}{1+\\exp{(\\beta_0+\\beta_1x_i)}},\\nonumber\\\\\n", + "p(y_i=0|x_i,\\boldsymbol{\\beta}) &= 1 - p(y_i=1|x_i,\\boldsymbol{\\beta}),\n", + "\\end{align*}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "where $\\boldsymbol{\\beta}$ are the weights we wish to extract from data, in our case $\\beta_0$ and $\\beta_1$. \n", + "\n", + "Note that we used" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "p(y_i=0\\vert x_i, \\boldsymbol{\\beta}) = 1-p(y_i=1\\vert x_i, \\boldsymbol{\\beta}).\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "## Maximum likelihood\n", + "\n", + "In order to define the total likelihood for all possible outcomes from a \n", + "dataset $\\mathcal{D}=\\{(y_i,x_i)\\}$, with the binary labels\n", + "$y_i\\in\\{0,1\\}$ and where the data points are drawn independently, we use the so-called [Maximum Likelihood Estimation](https://en.wikipedia.org/wiki/Maximum_likelihood_estimation) (MLE) principle. \n", + "We aim thus at maximizing \n", + "the probability of seeing the observed data. We can then approximate the \n", + "likelihood in terms of the product of the individual probabilities of a specific outcome $y_i$, that is" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\begin{align*}\n", + "P(\\mathcal{D}|\\boldsymbol{\\beta})& = \\prod_{i=1}^n \\left[p(y_i=1|x_i,\\boldsymbol{\\beta})\\right]^{y_i}\\left[1-p(y_i=1|x_i,\\boldsymbol{\\beta}))\\right]^{1-y_i}\\nonumber \\\\\n", + "\\end{align*}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "from which we obtain the log-likelihood and our **cost/loss** function" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\mathcal{C}(\\boldsymbol{\\beta}) = \\sum_{i=1}^n \\left( y_i\\log{p(y_i=1|x_i,\\boldsymbol{\\beta})} + (1-y_i)\\log\\left[1-p(y_i=1|x_i,\\boldsymbol{\\beta}))\\right]\\right).\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## The cost function rewritten\n", + "\n", + "Reordering the logarithms, we can rewrite the **cost/loss** function as" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\mathcal{C}(\\boldsymbol{\\beta}) = \\sum_{i=1}^n \\left(y_i(\\beta_0+\\beta_1x_i) -\\log{(1+\\exp{(\\beta_0+\\beta_1x_i)})}\\right).\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The maximum likelihood estimator is defined as the set of parameters that maximize the log-likelihood where we maximize with respect to $\\beta$.\n", + "Since the cost (error) function is just the negative log-likelihood, for logistic regression we have that" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\mathcal{C}(\\boldsymbol{\\beta})=-\\sum_{i=1}^n \\left(y_i(\\beta_0+\\beta_1x_i) -\\log{(1+\\exp{(\\beta_0+\\beta_1x_i)})}\\right).\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This equation is known in statistics as the **cross entropy**. Finally, we note that just as in linear regression, \n", + "in practice we often supplement the cross-entropy with additional regularization terms, usually $L_1$ and $L_2$ regularization as we did for Ridge and Lasso regression.\n", + "\n", + "## Minimizing the cross entropy\n", + "\n", + "The cross entropy is a convex function of the weights $\\boldsymbol{\\beta}$ and,\n", + "therefore, any local minimizer is a global minimizer. \n", + "\n", + "\n", + "Minimizing this\n", + "cost function with respect to the two parameters $\\beta_0$ and $\\beta_1$ we obtain" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\frac{\\partial \\mathcal{C}(\\boldsymbol{\\beta})}{\\partial \\beta_0} = -\\sum_{i=1}^n \\left(y_i -\\frac{\\exp{(\\beta_0+\\beta_1x_i)}}{1+\\exp{(\\beta_0+\\beta_1x_i)}}\\right),\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "and" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\frac{\\partial \\mathcal{C}(\\boldsymbol{\\beta})}{\\partial \\beta_1} = -\\sum_{i=1}^n \\left(y_ix_i -x_i\\frac{\\exp{(\\beta_0+\\beta_1x_i)}}{1+\\exp{(\\beta_0+\\beta_1x_i)}}\\right).\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## A more compact expression\n", + "\n", + "Let us now define a vector $\\boldsymbol{y}$ with $n$ elements $y_i$, an\n", + "$n\\times p$ matrix $\\boldsymbol{X}$ which contains the $x_i$ values and a\n", + "vector $\\boldsymbol{p}$ of fitted probabilities $p(y_i\\vert x_i,\\boldsymbol{\\beta})$. We can rewrite in a more compact form the first\n", + "derivative of cost function as" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\frac{\\partial \\mathcal{C}(\\boldsymbol{\\beta})}{\\partial \\boldsymbol{\\beta}} = -\\boldsymbol{X}^T\\left(\\boldsymbol{y}-\\boldsymbol{p}\\right).\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "If we in addition define a diagonal matrix $\\boldsymbol{W}$ with elements \n", + "$p(y_i\\vert x_i,\\boldsymbol{\\beta})(1-p(y_i\\vert x_i,\\boldsymbol{\\beta})$, we can obtain a compact expression of the second derivative as" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\frac{\\partial^2 \\mathcal{C}(\\boldsymbol{\\beta})}{\\partial \\boldsymbol{\\beta}\\partial \\boldsymbol{\\beta}^T} = \\boldsymbol{X}^T\\boldsymbol{W}\\boldsymbol{X}.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Extending to more predictors\n", + "\n", + "Within a binary classification problem, we can easily expand our model to include multiple predictors. Our ratio between likelihoods is then with $p$ predictors" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\log{ \\frac{p(\\boldsymbol{\\beta}\\boldsymbol{x})}{1-p(\\boldsymbol{\\beta}\\boldsymbol{x})}} = \\beta_0+\\beta_1x_1+\\beta_2x_2+\\dots+\\beta_px_p.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Here we defined $\\boldsymbol{x}=[1,x_1,x_2,\\dots,x_p]$ and $\\boldsymbol{\\beta}=[\\beta_0, \\beta_1, \\dots, \\beta_p]$ leading to" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "p(\\boldsymbol{\\beta}\\boldsymbol{x})=\\frac{ \\exp{(\\beta_0+\\beta_1x_1+\\beta_2x_2+\\dots+\\beta_px_p)}}{1+\\exp{(\\beta_0+\\beta_1x_1+\\beta_2x_2+\\dots+\\beta_px_p)}}.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Including more classes\n", + "\n", + "Till now we have mainly focused on two classes, the so-called binary\n", + "system. Suppose we wish to extend to $K$ classes. Let us for the sake\n", + "of simplicity assume we have only two predictors. We have then following model" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\log{\\frac{p(C=1\\vert x)}{p(K\\vert x)}} = \\beta_{10}+\\beta_{11}x_1,\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "and" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\log{\\frac{p(C=2\\vert x)}{p(K\\vert x)}} = \\beta_{20}+\\beta_{21}x_1,\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "and so on till the class $C=K-1$ class" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\log{\\frac{p(C=K-1\\vert x)}{p(K\\vert x)}} = \\beta_{(K-1)0}+\\beta_{(K-1)1}x_1,\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "and the model is specified in term of $K-1$ so-called log-odds or\n", + "**logit** transformations.\n", + "\n", + "\n", + "## More classes\n", + "\n", + "In our discussion of neural networks we will encounter the above again\n", + "in terms of a slightly modified function, the so-called **Softmax** function.\n", + "\n", + "The softmax function is used in various multiclass classification\n", + "methods, such as multinomial logistic regression (also known as\n", + "softmax regression), multiclass linear discriminant analysis, naive\n", + "Bayes classifiers, and artificial neural networks. Specifically, in\n", + "multinomial logistic regression and linear discriminant analysis, the\n", + "input to the function is the result of $K$ distinct linear functions,\n", + "and the predicted probability for the $k$-th class given a sample\n", + "vector $\\boldsymbol{x}$ and a weighting vector $\\boldsymbol{\\beta}$ is (with two\n", + "predictors):" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "p(C=k\\vert \\mathbf {x} )=\\frac{\\exp{(\\beta_{k0}+\\beta_{k1}x_1)}}{1+\\sum_{l=1}^{K-1}\\exp{(\\beta_{l0}+\\beta_{l1}x_1)}}.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "It is easy to extend to more predictors. The final class is" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "p(C=K\\vert \\mathbf {x} )=\\frac{1}{1+\\sum_{l=1}^{K-1}\\exp{(\\beta_{l0}+\\beta_{l1}x_1)}},\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "and they sum to one. Our earlier discussions were all specialized to\n", + "the case with two classes only. It is easy to see from the above that\n", + "what we derived earlier is compatible with these equations.\n", + "\n", + "To find the optimal parameters we would typically use a gradient\n", + "descent method. Newton's method and gradient descent methods are\n", + "discussed in the material on [optimization\n", + "methods](https://compphysics.github.io/MachineLearning/doc/pub/Splines/html/Splines-bs.html).\n", + "\n", + "\n", + "## Friday September 24\n", + "\n", + "\n", + "\n", + "\n", + "## Wisconsin Cancer Data\n", + "\n", + "We show here how we can use a simple regression case on the breast\n", + "cancer data using Logistic regression as our algorithm for\n", + "classification." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "import matplotlib.pyplot as plt\n", + "import numpy as np\n", + "from sklearn.model_selection import train_test_split \n", + "from sklearn.datasets import load_breast_cancer\n", + "from sklearn.linear_model import LogisticRegression\n", + "\n", + "# Load the data\n", + "cancer = load_breast_cancer()\n", + "\n", + "X_train, X_test, y_train, y_test = train_test_split(cancer.data,cancer.target,random_state=0)\n", + "print(X_train.shape)\n", + "print(X_test.shape)\n", + "# Logistic Regression\n", + "logreg = LogisticRegression(solver='lbfgs')\n", + "logreg.fit(X_train, y_train)\n", + "print(\"Test set accuracy with Logistic Regression: {:.2f}\".format(logreg.score(X_test,y_test)))\n", + "#now scale the data\n", + "from sklearn.preprocessing import StandardScaler\n", + "scaler = StandardScaler()\n", + "scaler.fit(X_train)\n", + "X_train_scaled = scaler.transform(X_train)\n", + "X_test_scaled = scaler.transform(X_test)\n", + "# Logistic Regression\n", + "logreg.fit(X_train_scaled, y_train)\n", + "print(\"Test set accuracy Logistic Regression with scaled data: {:.2f}\".format(logreg.score(X_test_scaled,y_test)))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Using the correlation matrix\n", + "\n", + "In addition to the above scores, we could also study the covariance (and the correlation matrix).\n", + "We use **Pandas** to compute the correlation matrix." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "import matplotlib.pyplot as plt\n", + "import numpy as np\n", + "from sklearn.model_selection import train_test_split \n", + "from sklearn.datasets import load_breast_cancer\n", + "from sklearn.linear_model import LogisticRegression\n", + "cancer = load_breast_cancer()\n", + "import pandas as pd\n", + "# Making a data frame\n", + "cancerpd = pd.DataFrame(cancer.data, columns=cancer.feature_names)\n", + "\n", + "fig, axes = plt.subplots(15,2,figsize=(10,20))\n", + "malignant = cancer.data[cancer.target == 0]\n", + "benign = cancer.data[cancer.target == 1]\n", + "ax = axes.ravel()\n", + "\n", + "for i in range(30):\n", + " _, bins = np.histogram(cancer.data[:,i], bins =50)\n", + " ax[i].hist(malignant[:,i], bins = bins, alpha = 0.5)\n", + " ax[i].hist(benign[:,i], bins = bins, alpha = 0.5)\n", + " ax[i].set_title(cancer.feature_names[i])\n", + " ax[i].set_yticks(())\n", + "ax[0].set_xlabel(\"Feature magnitude\")\n", + "ax[0].set_ylabel(\"Frequency\")\n", + "ax[0].legend([\"Malignant\", \"Benign\"], loc =\"best\")\n", + "fig.tight_layout()\n", + "plt.show()\n", + "\n", + "import seaborn as sns\n", + "correlation_matrix = cancerpd.corr().round(1)\n", + "# use the heatmap function from seaborn to plot the correlation matrix\n", + "# annot = True to print the values inside the square\n", + "plt.figure(figsize=(15,8))\n", + "sns.heatmap(data=correlation_matrix, annot=True)\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Discussing the correlation data\n", + "\n", + "In the above example we note two things. In the first plot we display\n", + "the overlap of benign and malignant tumors as functions of the various\n", + "features in the Wisconsing breast cancer data set. We see that for\n", + "some of the features we can distinguish clearly the benign and\n", + "malignant cases while for other features we cannot. This can point to\n", + "us which features may be of greater interest when we wish to classify\n", + "a benign or not benign tumour.\n", + "\n", + "In the second figure we have computed the so-called correlation\n", + "matrix, which in our case with thirty features becomes a $30\\times 30$\n", + "matrix.\n", + "\n", + "We constructed this matrix using **pandas** via the statements" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "cancerpd = pd.DataFrame(cancer.data, columns=cancer.feature_names)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "and then" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "correlation_matrix = cancerpd.corr().round(1)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Diagonalizing this matrix we can in turn say something about which\n", + "features are of relevance and which are not. This leads us to\n", + "the classical Principal Component Analysis (PCA) theorem with\n", + "applications. This will be discussed later this semester ([week 43](https://compphysics.github.io/MachineLearning/doc/pub/week43/html/week43-bs.html)).\n", + "\n", + "\n", + "\n", + "## Other measures in classification studies: Cancer Data again" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "import matplotlib.pyplot as plt\n", + "import numpy as np\n", + "from sklearn.model_selection import train_test_split \n", + "from sklearn.datasets import load_breast_cancer\n", + "from sklearn.linear_model import LogisticRegression\n", + "\n", + "# Load the data\n", + "cancer = load_breast_cancer()\n", + "\n", + "X_train, X_test, y_train, y_test = train_test_split(cancer.data,cancer.target,random_state=0)\n", + "print(X_train.shape)\n", + "print(X_test.shape)\n", + "# Logistic Regression\n", + "logreg = LogisticRegression(solver='lbfgs')\n", + "logreg.fit(X_train, y_train)\n", + "print(\"Test set accuracy with Logistic Regression: {:.2f}\".format(logreg.score(X_test,y_test)))\n", + "#now scale the data\n", + "from sklearn.preprocessing import StandardScaler\n", + "scaler = StandardScaler()\n", + "scaler.fit(X_train)\n", + "X_train_scaled = scaler.transform(X_train)\n", + "X_test_scaled = scaler.transform(X_test)\n", + "# Logistic Regression\n", + "logreg.fit(X_train_scaled, y_train)\n", + "print(\"Test set accuracy Logistic Regression with scaled data: {:.2f}\".format(logreg.score(X_test_scaled,y_test)))\n", + "\n", + "\n", + "from sklearn.preprocessing import LabelEncoder\n", + "from sklearn.model_selection import cross_validate\n", + "#Cross validation\n", + "accuracy = cross_validate(logreg,X_test_scaled,y_test,cv=10)['test_score']\n", + "print(accuracy)\n", + "print(\"Test set accuracy with Logistic Regression and scaled data: {:.2f}\".format(logreg.score(X_test_scaled,y_test)))\n", + "\n", + "\n", + "import scikitplot as skplt\n", + "y_pred = logreg.predict(X_test_scaled)\n", + "skplt.metrics.plot_confusion_matrix(y_test, y_pred, normalize=True)\n", + "plt.show()\n", + "y_probas = logreg.predict_proba(X_test_scaled)\n", + "skplt.metrics.plot_roc(y_test, y_probas)\n", + "plt.show()\n", + "skplt.metrics.plot_cumulative_gain(y_test, y_probas)\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Optimization, the central part of any Machine Learning algortithm\n", + "\n", + "[Overview Video, why do we care about gradient methods?](https://www.uio.no/studier/emner/matnat/fys/FYS-STK3155/h20/forelesningsvideoer/OverarchingAimsWeek39.mp4?vrtx=view-as-webpage)\n", + "\n", + "\n", + "\n", + "Almost every problem in machine learning and data science starts with\n", + "a dataset $X$, a model $g(\\beta)$, which is a function of the\n", + "parameters $\\beta$ and a cost function $C(X, g(\\beta))$ that allows\n", + "us to judge how well the model $g(\\beta)$ explains the observations\n", + "$X$. The model is fit by finding the values of $\\beta$ that minimize\n", + "the cost function. Ideally we would be able to solve for $\\beta$\n", + "analytically, however this is not possible in general and we must use\n", + "some approximative/numerical method to compute the minimum.\n", + "\n", + "\n", + "## Revisiting our Logistic Regression case\n", + "\n", + "In our discussion on Logistic Regression we studied the \n", + "case of\n", + "two classes, with $y_i$ either\n", + "$0$ or $1$. Furthermore we assumed also that we have only two\n", + "parameters $\\beta$ in our fitting, that is we\n", + "defined probabilities" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\begin{align*}\n", + "p(y_i=1|x_i,\\boldsymbol{\\beta}) &= \\frac{\\exp{(\\beta_0+\\beta_1x_i)}}{1+\\exp{(\\beta_0+\\beta_1x_i)}},\\nonumber\\\\\n", + "p(y_i=0|x_i,\\boldsymbol{\\beta}) &= 1 - p(y_i=1|x_i,\\boldsymbol{\\beta}),\n", + "\\end{align*}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "where $\\boldsymbol{\\beta}$ are the weights we wish to extract from data, in our case $\\beta_0$ and $\\beta_1$. \n", + "\n", + "## The equations to solve\n", + "\n", + "Our compact equations used a definition of a vector $\\boldsymbol{y}$ with $n$\n", + "elements $y_i$, an $n\\times p$ matrix $\\boldsymbol{X}$ which contains the\n", + "$x_i$ values and a vector $\\boldsymbol{p}$ of fitted probabilities\n", + "$p(y_i\\vert x_i,\\boldsymbol{\\beta})$. We rewrote in a more compact form\n", + "the first derivative of the cost function as" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\frac{\\partial \\mathcal{C}(\\boldsymbol{\\beta})}{\\partial \\boldsymbol{\\beta}} = -\\boldsymbol{X}^T\\left(\\boldsymbol{y}-\\boldsymbol{p}\\right).\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "If we in addition define a diagonal matrix $\\boldsymbol{W}$ with elements \n", + "$p(y_i\\vert x_i,\\boldsymbol{\\beta})(1-p(y_i\\vert x_i,\\boldsymbol{\\beta})$, we can obtain a compact expression of the second derivative as" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\frac{\\partial^2 \\mathcal{C}(\\boldsymbol{\\beta})}{\\partial \\boldsymbol{\\beta}\\partial \\boldsymbol{\\beta}^T} = \\boldsymbol{X}^T\\boldsymbol{W}\\boldsymbol{X}.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This defines what is called the Hessian matrix.\n", + "\n", + "## Solving using Newton-Raphson's method\n", + "\n", + "If we can set up these equations, Newton-Raphson's iterative method is normally the method of choice. It requires however that we can compute in an efficient way the matrices that define the first and second derivatives. \n", + "\n", + "Our iterative scheme is then given by" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\boldsymbol{\\beta}^{\\mathrm{new}} = \\boldsymbol{\\beta}^{\\mathrm{old}}-\\left(\\frac{\\partial^2 \\mathcal{C}(\\boldsymbol{\\beta})}{\\partial \\boldsymbol{\\beta}\\partial \\boldsymbol{\\beta}^T}\\right)^{-1}_{\\boldsymbol{\\beta}^{\\mathrm{old}}}\\times \\left(\\frac{\\partial \\mathcal{C}(\\boldsymbol{\\beta})}{\\partial \\boldsymbol{\\beta}}\\right)_{\\boldsymbol{\\beta}^{\\mathrm{old}}},\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "or in matrix form as" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\boldsymbol{\\beta}^{\\mathrm{new}} = \\boldsymbol{\\beta}^{\\mathrm{old}}-\\left(\\boldsymbol{X}^T\\boldsymbol{W}\\boldsymbol{X} \\right)^{-1}\\times \\left(-\\boldsymbol{X}^T(\\boldsymbol{y}-\\boldsymbol{p}) \\right)_{\\boldsymbol{\\beta}^{\\mathrm{old}}}.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The right-hand side is computed with the old values of $\\beta$. \n", + "\n", + "If we can compute these matrices, in particular the Hessian, the above is often the easiest method to implement. \n", + "\n", + "\n", + "## Brief reminder on Newton-Raphson's method\n", + "\n", + "Let us quickly remind ourselves how we derive the above method.\n", + "\n", + "Perhaps the most celebrated of all one-dimensional root-finding\n", + "routines is Newton's method, also called the Newton-Raphson\n", + "method. This method requires the evaluation of both the\n", + "function $f$ and its derivative $f'$ at arbitrary points. \n", + "If you can only calculate the derivative\n", + "numerically and/or your function is not of the smooth type, we\n", + "normally discourage the use of this method.\n", + "\n", + "## The equations\n", + "\n", + "The Newton-Raphson formula consists geometrically of extending the\n", + "tangent line at a current point until it crosses zero, then setting\n", + "the next guess to the abscissa of that zero-crossing. The mathematics\n", + "behind this method is rather simple. Employing a Taylor expansion for\n", + "$x$ sufficiently close to the solution $s$, we have" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "
    \n", + "\n", + "$$\n", + "f(s)=0=f(x)+(s-x)f'(x)+\\frac{(s-x)^2}{2}f''(x) +\\dots.\n", + " \\label{eq:taylornr} \\tag{14}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "For small enough values of the function and for well-behaved\n", + "functions, the terms beyond linear are unimportant, hence we obtain" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "f(x)+(s-x)f'(x)\\approx 0,\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "yielding" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "s\\approx x-\\frac{f(x)}{f'(x)}.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Having in mind an iterative procedure, it is natural to start iterating with" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "x_{n+1}=x_n-\\frac{f(x_n)}{f'(x_n)}.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Simple geometric interpretation\n", + "\n", + "The above is Newton-Raphson's method. It has a simple geometric\n", + "interpretation, namely $x_{n+1}$ is the point where the tangent from\n", + "$(x_n,f(x_n))$ crosses the $x$-axis. Close to the solution,\n", + "Newton-Raphson converges fast to the desired result. However, if we\n", + "are far from a root, where the higher-order terms in the series are\n", + "important, the Newton-Raphson formula can give grossly inaccurate\n", + "results. For instance, the initial guess for the root might be so far\n", + "from the true root as to let the search interval include a local\n", + "maximum or minimum of the function. If an iteration places a trial\n", + "guess near such a local extremum, so that the first derivative nearly\n", + "vanishes, then Newton-Raphson may fail totally\n", + "\n", + "\n", + "## Extending to more than one variable\n", + "\n", + "Newton's method can be generalized to systems of several non-linear equations\n", + "and variables. Consider the case with two equations" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\begin{array}{cc} f_1(x_1,x_2) &=0\\\\\n", + " f_2(x_1,x_2) &=0,\\end{array}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "which we Taylor expand to obtain" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\begin{array}{cc} 0=f_1(x_1+h_1,x_2+h_2)=&f_1(x_1,x_2)+h_1\n", + " \\partial f_1/\\partial x_1+h_2\n", + " \\partial f_1/\\partial x_2+\\dots\\\\\n", + " 0=f_2(x_1+h_1,x_2+h_2)=&f_2(x_1,x_2)+h_1\n", + " \\partial f_2/\\partial x_1+h_2\n", + " \\partial f_2/\\partial x_2+\\dots\n", + " \\end{array}.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Defining the Jacobian matrix ${\\bf \\boldsymbol{J}}$ we have" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "{\\bf \\boldsymbol{J}}=\\left( \\begin{array}{cc}\n", + " \\partial f_1/\\partial x_1 & \\partial f_1/\\partial x_2 \\\\\n", + " \\partial f_2/\\partial x_1 &\\partial f_2/\\partial x_2\n", + " \\end{array} \\right),\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "we can rephrase Newton's method as" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\left(\\begin{array}{c} x_1^{n+1} \\\\ x_2^{n+1} \\end{array} \\right)=\n", + "\\left(\\begin{array}{c} x_1^{n} \\\\ x_2^{n} \\end{array} \\right)+\n", + "\\left(\\begin{array}{c} h_1^{n} \\\\ h_2^{n} \\end{array} \\right),\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "where we have defined" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\left(\\begin{array}{c} h_1^{n} \\\\ h_2^{n} \\end{array} \\right)=\n", + " -{\\bf \\boldsymbol{J}}^{-1}\n", + " \\left(\\begin{array}{c} f_1(x_1^{n},x_2^{n}) \\\\ f_2(x_1^{n},x_2^{n}) \\end{array} \\right).\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We need thus to compute the inverse of the Jacobian matrix and it\n", + "is to understand that difficulties may\n", + "arise in case ${\\bf \\boldsymbol{J}}$ is nearly singular.\n", + "\n", + "It is rather straightforward to extend the above scheme to systems of\n", + "more than two non-linear equations. In our case, the Jacobian matrix is given by the Hessian that represents the second derivative of cost function. \n", + "\n", + "\n", + "\n", + "## Steepest descent\n", + "\n", + "The basic idea of gradient descent is\n", + "that a function $F(\\mathbf{x})$, \n", + "$\\mathbf{x} \\equiv (x_1,\\cdots,x_n)$, decreases fastest if one goes from $\\bf {x}$ in the\n", + "direction of the negative gradient $-\\nabla F(\\mathbf{x})$.\n", + "\n", + "It can be shown that if" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\mathbf{x}_{k+1} = \\mathbf{x}_k - \\gamma_k \\nabla F(\\mathbf{x}_k),\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "with $\\gamma_k > 0$.\n", + "\n", + "For $\\gamma_k$ small enough, then $F(\\mathbf{x}_{k+1}) \\leq\n", + "F(\\mathbf{x}_k)$. This means that for a sufficiently small $\\gamma_k$\n", + "we are always moving towards smaller function values, i.e a minimum.\n", + "\n", + "\n", + "## More on Steepest descent\n", + "\n", + "The previous observation is the basis of the method of steepest\n", + "descent, which is also referred to as just gradient descent (GD). One\n", + "starts with an initial guess $\\mathbf{x}_0$ for a minimum of $F$ and\n", + "computes new approximations according to" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\mathbf{x}_{k+1} = \\mathbf{x}_k - \\gamma_k \\nabla F(\\mathbf{x}_k), \\ \\ k \\geq 0.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The parameter $\\gamma_k$ is often referred to as the step length or\n", + "the learning rate within the context of Machine Learning.\n", + "\n", + "\n", + "## The ideal\n", + "\n", + "Ideally the sequence $\\{\\mathbf{x}_k \\}_{k=0}$ converges to a global\n", + "minimum of the function $F$. In general we do not know if we are in a\n", + "global or local minimum. In the special case when $F$ is a convex\n", + "function, all local minima are also global minima, so in this case\n", + "gradient descent can converge to the global solution. The advantage of\n", + "this scheme is that it is conceptually simple and straightforward to\n", + "implement. However the method in this form has some severe\n", + "limitations:\n", + "\n", + "In machine learing we are often faced with non-convex high dimensional\n", + "cost functions with many local minima. Since GD is deterministic we\n", + "will get stuck in a local minimum, if the method converges, unless we\n", + "have a very good intial guess. This also implies that the scheme is\n", + "sensitive to the chosen initial condition.\n", + "\n", + "Note that the gradient is a function of $\\mathbf{x} =\n", + "(x_1,\\cdots,x_n)$ which makes it expensive to compute numerically.\n", + "\n", + "\n", + "\n", + "## The sensitiveness of the gradient descent\n", + "\n", + "The gradient descent method \n", + "is sensitive to the choice of learning rate $\\gamma_k$. This is due\n", + "to the fact that we are only guaranteed that $F(\\mathbf{x}_{k+1}) \\leq\n", + "F(\\mathbf{x}_k)$ for sufficiently small $\\gamma_k$. The problem is to\n", + "determine an optimal learning rate. If the learning rate is chosen too\n", + "small the method will take a long time to converge and if it is too\n", + "large we can experience erratic behavior.\n", + "\n", + "Many of these shortcomings can be alleviated by introducing\n", + "randomness. One such method is that of Stochastic Gradient Descent\n", + "(SGD), see below.\n", + "\n", + "\n", + "\n", + "## Convex functions\n", + "\n", + "Ideally we want our cost/loss function to be convex(concave).\n", + "\n", + "First we give the definition of a convex set: A set $C$ in\n", + "$\\mathbb{R}^n$ is said to be convex if, for all $x$ and $y$ in $C$ and\n", + "all $t \\in (0,1)$ , the point $(1 − t)x + ty$ also belongs to\n", + "C. Geometrically this means that every point on the line segment\n", + "connecting $x$ and $y$ is in $C$ as discussed below.\n", + "\n", + "The convex subsets of $\\mathbb{R}$ are the intervals of\n", + "$\\mathbb{R}$. Examples of convex sets of $\\mathbb{R}^2$ are the\n", + "regular polygons (triangles, rectangles, pentagons, etc...).\n", + "\n", + "## Convex function\n", + "\n", + "**Convex function**: Let $X \\subset \\mathbb{R}^n$ be a convex set. Assume that the function $f: X \\rightarrow \\mathbb{R}$ is continuous, then $f$ is said to be convex if $$f(tx_1 + (1-t)x_2) \\leq tf(x_1) + (1-t)f(x_2) $$ for all $x_1, x_2 \\in X$ and for all $t \\in [0,1]$. If $\\leq$ is replaced with a strict inequaltiy in the definition, we demand $x_1 \\neq x_2$ and $t\\in(0,1)$ then $f$ is said to be strictly convex. For a single variable function, convexity means that if you draw a straight line connecting $f(x_1)$ and $f(x_2)$, the value of the function on the interval $[x_1,x_2]$ is always below the line as illustrated below.\n", + "\n", + "## Conditions on convex functions\n", + "\n", + "In the following we state first and second-order conditions which\n", + "ensures convexity of a function $f$. We write $D_f$ to denote the\n", + "domain of $f$, i.e the subset of $R^n$ where $f$ is defined. For more\n", + "details and proofs we refer to: [S. Boyd and L. Vandenberghe. Convex Optimization. Cambridge University Press](http://stanford.edu/boyd/cvxbook/, 2004).\n", + "\n", + "**First order condition.**\n", + "\n", + "Suppose $f$ is differentiable (i.e $\\nabla f(x)$ is well defined for\n", + "all $x$ in the domain of $f$). Then $f$ is convex if and only if $D_f$\n", + "is a convex set and $$f(y) \\geq f(x) + \\nabla f(x)^T (y-x) $$ holds\n", + "for all $x,y \\in D_f$. This condition means that for a convex function\n", + "the first order Taylor expansion (right hand side above) at any point\n", + "a global under estimator of the function. To convince yourself you can\n", + "make a drawing of $f(x) = x^2+1$ and draw the tangent line to $f(x)$ and\n", + "note that it is always below the graph.\n", + "\n", + "\n", + "\n", + "**Second order condition.**\n", + "\n", + "Assume that $f$ is twice\n", + "differentiable, i.e the Hessian matrix exists at each point in\n", + "$D_f$. Then $f$ is convex if and only if $D_f$ is a convex set and its\n", + "Hessian is positive semi-definite for all $x\\in D_f$. For a\n", + "single-variable function this reduces to $f''(x) \\geq 0$. Geometrically this means that $f$ has nonnegative curvature\n", + "everywhere.\n", + "\n", + "\n", + "\n", + "This condition is particularly useful since it gives us an procedure for determining if the function under consideration is convex, apart from using the definition.\n", + "\n", + "## More on convex functions\n", + "\n", + "The next result is of great importance to us and the reason why we are\n", + "going on about convex functions. In machine learning we frequently\n", + "have to minimize a loss/cost function in order to find the best\n", + "parameters for the model we are considering. \n", + "\n", + "Ideally we want the\n", + "global minimum (for high-dimensional models it is hard to know\n", + "if we have local or global minimum). However, if the cost/loss function\n", + "is convex the following result provides invaluable information:\n", + "\n", + "**Any minimum is global for convex functions.**\n", + "\n", + "Consider the problem of finding $x \\in \\mathbb{R}^n$ such that $f(x)$\n", + "is minimal, where $f$ is convex and differentiable. Then, any point\n", + "$x^*$ that satisfies $\\nabla f(x^*) = 0$ is a global minimum.\n", + "\n", + "\n", + "\n", + "This result means that if we know that the cost/loss function is convex and we are able to find a minimum, we are guaranteed that it is a global minimum.\n", + "\n", + "## Some simple problems\n", + "\n", + "1. Show that $f(x)=x^2$ is convex for $x \\in \\mathbb{R}$ using the definition of convexity. Hint: If you re-write the definition, $f$ is convex if the following holds for all $x,y \\in D_f$ and any $\\lambda \\in [0,1]$ $\\lambda f(x)+(1-\\lambda)f(y)-f(\\lambda x + (1-\\lambda) y ) \\geq 0$.\n", + "\n", + "2. Using the second order condition show that the following functions are convex on the specified domain.\n", + "\n", + " * $f(x) = e^x$ is convex for $x \\in \\mathbb{R}$.\n", + "\n", + " * $g(x) = -\\ln(x)$ is convex for $x \\in (0,\\infty)$.\n", + "\n", + "\n", + "3. Let $f(x) = x^2$ and $g(x) = e^x$. Show that $f(g(x))$ and $g(f(x))$ is convex for $x \\in \\mathbb{R}$. Also show that if $f(x)$ is any convex function than $h(x) = e^{f(x)}$ is convex.\n", + "\n", + "4. A norm is any function that satisfy the following properties\n", + "\n", + " * $f(\\alpha x) = |\\alpha| f(x)$ for all $\\alpha \\in \\mathbb{R}$.\n", + "\n", + " * $f(x+y) \\leq f(x) + f(y)$\n", + "\n", + " * $f(x) \\leq 0$ for all $x \\in \\mathbb{R}^n$ with equality if and only if $x = 0$\n", + "\n", + "\n", + "Using the definition of convexity, try to show that a function satisfying the properties above is convex (the third condition is not needed to show this).\n", + "\n", + "\n", + "## Friday September 25\n", + "\n", + "[Video of Lecture](https://www.uio.no/studier/emner/matnat/fys/FYS-STK4155/h20/forelesningsvideoer/LectureSeptember25.mp4?vrtx=view-as-webpage) and [link to handwritten notes](https://github.com/CompPhysics/MachineLearning/blob/master/doc/HandWrittenNotes/NotesSeptember25.pdf).\n", + "\n", + "\n", + "## Standard steepest descent\n", + "\n", + "\n", + "Before we proceed, we would like to discuss the approach called the\n", + "**standard Steepest descent** (different from the above steepest descent discussion), which again leads to us having to be able\n", + "to compute a matrix. It belongs to the class of Conjugate Gradient methods (CG).\n", + "\n", + "[The success of the CG method](https://www.cs.cmu.edu/~quake-papers/painless-conjugate-gradient.pdf)\n", + "for finding solutions of non-linear problems is based on the theory\n", + "of conjugate gradients for linear systems of equations. It belongs to\n", + "the class of iterative methods for solving problems from linear\n", + "algebra of the type" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\boldsymbol{A}\\boldsymbol{x} = \\boldsymbol{b}.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In the iterative process we end up with a problem like" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\boldsymbol{r}= \\boldsymbol{b}-\\boldsymbol{A}\\boldsymbol{x},\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "where $\\boldsymbol{r}$ is the so-called residual or error in the iterative process.\n", + "\n", + "When we have found the exact solution, $\\boldsymbol{r}=0$.\n", + "\n", + "## Gradient method\n", + "\n", + "The residual is zero when we reach the minimum of the quadratic equation" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "P(\\boldsymbol{x})=\\frac{1}{2}\\boldsymbol{x}^T\\boldsymbol{A}\\boldsymbol{x} - \\boldsymbol{x}^T\\boldsymbol{b},\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "with the constraint that the matrix $\\boldsymbol{A}$ is positive definite and\n", + "symmetric. This defines also the Hessian and we want it to be positive definite. \n", + "\n", + "\n", + "## Steepest descent method\n", + "\n", + "We denote the initial guess for $\\boldsymbol{x}$ as $\\boldsymbol{x}_0$. \n", + "We can assume without loss of generality that" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\boldsymbol{x}_0=0,\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "or consider the system" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\boldsymbol{A}\\boldsymbol{z} = \\boldsymbol{b}-\\boldsymbol{A}\\boldsymbol{x}_0,\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "instead.\n", + "\n", + "\n", + "## Steepest descent method\n", + "One can show that the solution $\\boldsymbol{x}$ is also the unique minimizer of the quadratic form" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "f(\\boldsymbol{x}) = \\frac{1}{2}\\boldsymbol{x}^T\\boldsymbol{A}\\boldsymbol{x} - \\boldsymbol{x}^T \\boldsymbol{x} , \\quad \\boldsymbol{x}\\in\\mathbf{R}^n.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This suggests taking the first basis vector $\\boldsymbol{r}_1$ (see below for definition) \n", + "to be the gradient of $f$ at $\\boldsymbol{x}=\\boldsymbol{x}_0$, \n", + "which equals" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\boldsymbol{A}\\boldsymbol{x}_0-\\boldsymbol{b},\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "and \n", + "$\\boldsymbol{x}_0=0$ it is equal $-\\boldsymbol{b}$.\n", + "\n", + "\n", + "\n", + "## Final expressions\n", + "We can compute the residual iteratively as" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\boldsymbol{r}_{k+1}=\\boldsymbol{b}-\\boldsymbol{A}\\boldsymbol{x}_{k+1},\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "which equals" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\boldsymbol{b}-\\boldsymbol{A}(\\boldsymbol{x}_k+\\alpha_k\\boldsymbol{r}_k),\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "or" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "(\\boldsymbol{b}-\\boldsymbol{A}\\boldsymbol{x}_k)-\\alpha_k\\boldsymbol{A}\\boldsymbol{r}_k,\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "which gives" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\alpha_k = \\frac{\\boldsymbol{r}_k^T\\boldsymbol{r}_k}{\\boldsymbol{r}_k^T\\boldsymbol{A}\\boldsymbol{r}_k}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "leading to the iterative scheme" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\boldsymbol{x}_{k+1}=\\boldsymbol{x}_k-\\alpha_k\\boldsymbol{r}_{k},\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Steepest descent example" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "import numpy as np\n", + "import numpy.linalg as la\n", + "\n", + "import scipy.optimize as sopt\n", + "\n", + "import matplotlib.pyplot as pt\n", + "from mpl_toolkits.mplot3d import axes3d\n", + "\n", + "def f(x):\n", + " return 0.5*x[0]**2 + 2.5*x[1]**2\n", + "\n", + "def df(x):\n", + " return np.array([x[0], 5*x[1]])\n", + "\n", + "fig = pt.figure()\n", + "ax = fig.gca(projection=\"3d\")\n", + "\n", + "xmesh, ymesh = np.mgrid[-2:2:50j,-2:2:50j]\n", + "fmesh = f(np.array([xmesh, ymesh]))\n", + "ax.plot_surface(xmesh, ymesh, fmesh)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "And then as countor plot" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "pt.axis(\"equal\")\n", + "pt.contour(xmesh, ymesh, fmesh)\n", + "guesses = [np.array([2, 2./5])]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Find guesses" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "x = guesses[-1]\n", + "s = -df(x)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Run it!" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "def f1d(alpha):\n", + " return f(x + alpha*s)\n", + "\n", + "alpha_opt = sopt.golden(f1d)\n", + "next_guess = x + alpha_opt * s\n", + "guesses.append(next_guess)\n", + "print(next_guess)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "What happened?" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "pt.axis(\"equal\")\n", + "pt.contour(xmesh, ymesh, fmesh, 50)\n", + "it_array = np.array(guesses)\n", + "pt.plot(it_array.T[0], it_array.T[1], \"x-\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Conjugate gradient method\n", + "In the CG method we define so-called conjugate directions and two vectors \n", + "$\\boldsymbol{s}$ and $\\boldsymbol{t}$\n", + "are said to be\n", + "conjugate if" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\boldsymbol{s}^T\\boldsymbol{A}\\boldsymbol{t}= 0.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The philosophy of the CG method is to perform searches in various conjugate directions\n", + "of our vectors $\\boldsymbol{x}_i$ obeying the above criterion, namely" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\boldsymbol{x}_i^T\\boldsymbol{A}\\boldsymbol{x}_j= 0.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Two vectors are conjugate if they are orthogonal with respect to \n", + "this inner product. Being conjugate is a symmetric relation: if $\\boldsymbol{s}$ is conjugate to $\\boldsymbol{t}$, then $\\boldsymbol{t}$ is conjugate to $\\boldsymbol{s}$.\n", + "\n", + "\n", + "\n", + "## Conjugate gradient method\n", + "An example is given by the eigenvectors of the matrix" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\boldsymbol{v}_i^T\\boldsymbol{A}\\boldsymbol{v}_j= \\lambda\\boldsymbol{v}_i^T\\boldsymbol{v}_j,\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "which is zero unless $i=j$.\n", + "\n", + "\n", + "\n", + "\n", + "## Conjugate gradient method\n", + "Assume now that we have a symmetric positive-definite matrix $\\boldsymbol{A}$ of size\n", + "$n\\times n$. At each iteration $i+1$ we obtain the conjugate direction of a vector" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\boldsymbol{x}_{i+1}=\\boldsymbol{x}_{i}+\\alpha_i\\boldsymbol{p}_{i}.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We assume that $\\boldsymbol{p}_{i}$ is a sequence of $n$ mutually conjugate directions. \n", + "Then the $\\boldsymbol{p}_{i}$ form a basis of $R^n$ and we can expand the solution \n", + "$ \\boldsymbol{A}\\boldsymbol{x} = \\boldsymbol{b}$ in this basis, namely" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\boldsymbol{x} = \\sum^{n}_{i=1} \\alpha_i \\boldsymbol{p}_i.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Conjugate gradient method\n", + "The coefficients are given by" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\mathbf{A}\\mathbf{x} = \\sum^{n}_{i=1} \\alpha_i \\mathbf{A} \\mathbf{p}_i = \\mathbf{b}.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Multiplying with $\\boldsymbol{p}_k^T$ from the left gives" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\boldsymbol{p}_k^T \\boldsymbol{A}\\boldsymbol{x} = \\sum^{n}_{i=1} \\alpha_i\\boldsymbol{p}_k^T \\boldsymbol{A}\\boldsymbol{p}_i= \\boldsymbol{p}_k^T \\boldsymbol{b},\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "and we can define the coefficients $\\alpha_k$ as" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\alpha_k = \\frac{\\boldsymbol{p}_k^T \\boldsymbol{b}}{\\boldsymbol{p}_k^T \\boldsymbol{A} \\boldsymbol{p}_k}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Conjugate gradient method and iterations\n", + "\n", + "If we choose the conjugate vectors $\\boldsymbol{p}_k$ carefully, \n", + "then we may not need all of them to obtain a good approximation to the solution \n", + "$\\boldsymbol{x}$. \n", + "We want to regard the conjugate gradient method as an iterative method. \n", + "This will us to solve systems where $n$ is so large that the direct \n", + "method would take too much time.\n", + "\n", + "We denote the initial guess for $\\boldsymbol{x}$ as $\\boldsymbol{x}_0$. \n", + "We can assume without loss of generality that" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\boldsymbol{x}_0=0,\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "or consider the system" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\boldsymbol{A}\\boldsymbol{z} = \\boldsymbol{b}-\\boldsymbol{A}\\boldsymbol{x}_0,\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "instead.\n", + "\n", + "\n", + "\n", + "\n", + "## Conjugate gradient method\n", + "One can show that the solution $\\boldsymbol{x}$ is also the unique minimizer of the quadratic form" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "f(\\boldsymbol{x}) = \\frac{1}{2}\\boldsymbol{x}^T\\boldsymbol{A}\\boldsymbol{x} - \\boldsymbol{x}^T \\boldsymbol{x} , \\quad \\boldsymbol{x}\\in\\mathbf{R}^n.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This suggests taking the first basis vector $\\boldsymbol{p}_1$ \n", + "to be the gradient of $f$ at $\\boldsymbol{x}=\\boldsymbol{x}_0$, \n", + "which equals" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\boldsymbol{A}\\boldsymbol{x}_0-\\boldsymbol{b},\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "and \n", + "$\\boldsymbol{x}_0=0$ it is equal $-\\boldsymbol{b}$.\n", + "The other vectors in the basis will be conjugate to the gradient, \n", + "hence the name conjugate gradient method.\n", + "\n", + "\n", + "\n", + "\n", + "## Conjugate gradient method\n", + "Let $\\boldsymbol{r}_k$ be the residual at the $k$-th step:" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\boldsymbol{r}_k=\\boldsymbol{b}-\\boldsymbol{A}\\boldsymbol{x}_k.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Note that $\\boldsymbol{r}_k$ is the negative gradient of $f$ at \n", + "$\\boldsymbol{x}=\\boldsymbol{x}_k$, \n", + "so the gradient descent method would be to move in the direction $\\boldsymbol{r}_k$. \n", + "Here, we insist that the directions $\\boldsymbol{p}_k$ are conjugate to each other, \n", + "so we take the direction closest to the gradient $\\boldsymbol{r}_k$ \n", + "under the conjugacy constraint. \n", + "This gives the following expression" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\boldsymbol{p}_{k+1}=\\boldsymbol{r}_k-\\frac{\\boldsymbol{p}_k^T \\boldsymbol{A}\\boldsymbol{r}_k}{\\boldsymbol{p}_k^T\\boldsymbol{A}\\boldsymbol{p}_k} \\boldsymbol{p}_k.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Conjugate gradient method\n", + "We can also compute the residual iteratively as" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\boldsymbol{r}_{k+1}=\\boldsymbol{b}-\\boldsymbol{A}\\boldsymbol{x}_{k+1},\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "which equals" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\boldsymbol{b}-\\boldsymbol{A}(\\boldsymbol{x}_k+\\alpha_k\\boldsymbol{p}_k),\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "or" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "(\\boldsymbol{b}-\\boldsymbol{A}\\boldsymbol{x}_k)-\\alpha_k\\boldsymbol{A}\\boldsymbol{p}_k,\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "which gives" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\boldsymbol{r}_{k+1}=\\boldsymbol{r}_k-\\boldsymbol{A}\\boldsymbol{p}_{k},\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "## Revisiting some of our first Linear Regression Encounters\n", + "\n", + "We will use linear regression as a case study for the gradient descent\n", + "methods. Linear regression is a great test case for the gradient\n", + "descent methods discussed in the lectures since it has several\n", + "desirable properties such as:\n", + "\n", + "1. An analytical solution (recall homework set 1).\n", + "\n", + "2. The gradient can be computed analytically.\n", + "\n", + "3. The cost function is convex which guarantees that gradient descent converges for small enough learning rates\n", + "\n", + "We revisit an example similar to what we had in the first homework set. We had a function of the type" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "x = 2*np.random.rand(m,1)\n", + "y = 4+3*x+np.random.randn(m,1)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "with $x_i \\in [0,1] $ is chosen randomly using a uniform distribution. Additionally we have a stochastic noise chosen according to a normal distribution $\\cal {N}(0,1)$. \n", + "The linear regression model is given by" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "h_\\beta(x) = \\boldsymbol{y} = \\beta_0 + \\beta_1 x,\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "such that" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\boldsymbol{y}_i = \\beta_0 + \\beta_1 x_i.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "## Gradient descent example\n", + "\n", + "Let $\\mathbf{y} = (y_1,\\cdots,y_n)^T$, $\\mathbf{\\boldsymbol{y}} = (\\boldsymbol{y}_1,\\cdots,\\boldsymbol{y}_n)^T$ and $\\beta = (\\beta_0, \\beta_1)^T$\n", + "\n", + "It is convenient to write $\\mathbf{\\boldsymbol{y}} = X\\beta$ where $X \\in \\mathbb{R}^{100 \\times 2} $ is the design matrix given by (we keep the intercept here)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "X \\equiv \\begin{bmatrix}\n", + "1 & x_1 \\\\\n", + "\\vdots & \\vdots \\\\\n", + "1 & x_{100} & \\\\\n", + "\\end{bmatrix}.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The cost/loss/risk function is given by (" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "C(\\beta) = \\frac{1}{n}||X\\beta-\\mathbf{y}||_{2}^{2} = \\frac{1}{n}\\sum_{i=1}^{100}\\left[ (\\beta_0 + \\beta_1 x_i)^2 - 2 y_i (\\beta_0 + \\beta_1 x_i) + y_i^2\\right]\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "and we want to find $\\beta$ such that $C(\\beta)$ is minimized.\n", + "\n", + "## The derivative of the cost/loss function\n", + "\n", + "Computing $\\partial C(\\beta) / \\partial \\beta_0$ and $\\partial C(\\beta) / \\partial \\beta_1$ we can show that the gradient can be written as" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\nabla_{\\beta} C(\\beta) = \\frac{2}{n}\\begin{bmatrix} \\sum_{i=1}^{100} \\left(\\beta_0+\\beta_1x_i-y_i\\right) \\\\\n", + "\\sum_{i=1}^{100}\\left( x_i (\\beta_0+\\beta_1x_i)-y_ix_i\\right) \\\\\n", + "\\end{bmatrix} = \\frac{2}{n}X^T(X\\beta - \\mathbf{y}),\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "where $X$ is the design matrix defined above.\n", + "\n", + "## The Hessian matrix\n", + "The Hessian matrix of $C(\\beta)$ is given by" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\boldsymbol{H} \\equiv \\begin{bmatrix}\n", + "\\frac{\\partial^2 C(\\beta)}{\\partial \\beta_0^2} & \\frac{\\partial^2 C(\\beta)}{\\partial \\beta_0 \\partial \\beta_1} \\\\\n", + "\\frac{\\partial^2 C(\\beta)}{\\partial \\beta_0 \\partial \\beta_1} & \\frac{\\partial^2 C(\\beta)}{\\partial \\beta_1^2} & \\\\\n", + "\\end{bmatrix} = \\frac{2}{n}X^T X.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This result implies that $C(\\beta)$ is a convex function since the matrix $X^T X$ always is positive semi-definite.\n", + "\n", + "\n", + "\n", + "\n", + "## Simple program\n", + "\n", + "We can now write a program that minimizes $C(\\beta)$ using the gradient descent method with a constant learning rate $\\gamma$ according to" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\beta_{k+1} = \\beta_k - \\gamma \\nabla_\\beta C(\\beta_k), \\ k=0,1,\\cdots\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can use the expression we computed for the gradient and let use a\n", + "$\\beta_0$ be chosen randomly and let $\\gamma = 0.001$. Stop iterating\n", + "when $||\\nabla_\\beta C(\\beta_k) || \\leq \\epsilon = 10^{-8}$. **Note that the code below does not include the latter stop criterion**.\n", + "\n", + "And finally we can compare our solution for $\\beta$ with the analytic result given by \n", + "$\\beta= (X^TX)^{-1} X^T \\mathbf{y}$.\n", + "\n", + "## Gradient Descent Example\n", + "\n", + "Here our simple example" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "\n", + "# Importing various packages\n", + "from random import random, seed\n", + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "from mpl_toolkits.mplot3d import Axes3D\n", + "from matplotlib import cm\n", + "from matplotlib.ticker import LinearLocator, FormatStrFormatter\n", + "import sys\n", + "\n", + "# the number of datapoints\n", + "n = 100\n", + "x = 2*np.random.rand(n,1)\n", + "y = 4+3*x+np.random.randn(n,1)\n", + "\n", + "X = np.c_[np.ones((n,1)), x]\n", + "# Hessian matrix\n", + "H = (2.0/n)* X.T @ X\n", + "# Get the eigenvalues\n", + "EigValues, EigVectors = np.linalg.eig(H)\n", + "print(EigValues)\n", + "\n", + "beta_linreg = np.linalg.inv(X.T @ X) @ X.T @ y\n", + "print(beta_linreg)\n", + "beta = np.random.randn(2,1)\n", + "\n", + "eta = 1.0/np.max(EigValues)\n", + "Niterations = 1000\n", + "\n", + "for iter in range(Niterations):\n", + " gradient = (2.0/n)*X.T @ (X @ beta-y)\n", + " beta -= eta*gradient\n", + "\n", + "print(beta)\n", + "xnew = np.array([[0],[2]])\n", + "xbnew = np.c_[np.ones((2,1)), xnew]\n", + "ypredict = xbnew.dot(beta)\n", + "ypredict2 = xbnew.dot(beta_linreg)\n", + "plt.plot(xnew, ypredict, \"r-\")\n", + "plt.plot(xnew, ypredict2, \"b-\")\n", + "plt.plot(x, y ,'ro')\n", + "plt.axis([0,2.0,0, 15.0])\n", + "plt.xlabel(r'$x$')\n", + "plt.ylabel(r'$y$')\n", + "plt.title(r'Gradient descent example')\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## And a corresponding example using **scikit-learn**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "# Importing various packages\n", + "from random import random, seed\n", + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "from sklearn.linear_model import SGDRegressor\n", + "\n", + "n = 100\n", + "x = 2*np.random.rand(n,1)\n", + "y = 4+3*x+np.random.randn(n,1)\n", + "\n", + "X = np.c_[np.ones((n,1)), x]\n", + "beta_linreg = np.linalg.inv(X.T @ X) @ (X.T @ y)\n", + "print(beta_linreg)\n", + "sgdreg = SGDRegressor(max_iter = 50, penalty=None, eta0=0.1)\n", + "sgdreg.fit(x,y.ravel())\n", + "print(sgdreg.intercept_, sgdreg.coef_)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "## Gradient descent and Ridge\n", + "\n", + "We have also discussed Ridge regression where the loss function contains a regularized term given by the $L_2$ norm of $\\beta$," + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "C_{\\text{ridge}}(\\beta) = \\frac{1}{n}||X\\beta -\\mathbf{y}||^2 + \\lambda ||\\beta||^2, \\ \\lambda \\geq 0.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In order to minimize $C_{\\text{ridge}}(\\beta)$ using GD we only have adjust the gradient as follows" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\nabla_\\beta C_{\\text{ridge}}(\\beta) = \\frac{2}{n}\\begin{bmatrix} \\sum_{i=1}^{100} \\left(\\beta_0+\\beta_1x_i-y_i\\right) \\\\\n", + "\\sum_{i=1}^{100}\\left( x_i (\\beta_0+\\beta_1x_i)-y_ix_i\\right) \\\\\n", + "\\end{bmatrix} + 2\\lambda\\begin{bmatrix} \\beta_0 \\\\ \\beta_1\\end{bmatrix} = 2 (X^T(X\\beta - \\mathbf{y})+\\lambda \\beta).\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can easily extend our program to minimize $C_{\\text{ridge}}(\\beta)$ using gradient descent and compare with the analytical solution given by" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\beta_{\\text{ridge}} = \\left(X^T X + \\lambda I_{2 \\times 2} \\right)^{-1} X^T \\mathbf{y}.\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Program example for gradient descent with Ridge Regression" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "editable": true + }, + "outputs": [], + "source": [ + "from random import random, seed\n", + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "from mpl_toolkits.mplot3d import Axes3D\n", + "from matplotlib import cm\n", + "from matplotlib.ticker import LinearLocator, FormatStrFormatter\n", + "import sys\n", + "\n", + "# the number of datapoints\n", + "n = 100\n", + "x = 2*np.random.rand(n,1)\n", + "y = 4+3*x+np.random.randn(n,1)\n", + "\n", + "X = np.c_[np.ones((n,1)), x]\n", + "XT_X = X.T @ X\n", + "\n", + "#Ridge parameter lambda\n", + "lmbda = 0.001\n", + "Id = lmbda* np.eye(XT_X.shape[0])\n", + "\n", + "beta_linreg = np.linalg.inv(XT_X+Id) @ X.T @ y\n", + "print(beta_linreg)\n", + "# Start plain gradient descent\n", + "beta = np.random.randn(2,1)\n", + "\n", + "eta = 0.1\n", + "Niterations = 100\n", + "\n", + "for iter in range(Niterations):\n", + " gradients = 2.0/n*X.T @ (X @ (beta)-y)+2*lmbda*beta\n", + " beta -= eta*gradients\n", + "\n", + "print(beta)\n", + "ypredict = X @ beta\n", + "ypredict2 = X @ beta_linreg\n", + "plt.plot(x, ypredict, \"r-\")\n", + "plt.plot(x, ypredict2, \"b-\")\n", + "plt.plot(x, y ,'ro')\n", + "plt.axis([0,2.0,0, 15.0])\n", + "plt.xlabel(r'$x$')\n", + "plt.ylabel(r'$y$')\n", + "plt.title(r'Gradient descent example for Ridge')\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Using gradient descent methods, limitations\n", + "\n", + "* **Gradient descent (GD) finds local minima of our function**. Since the GD algorithm is deterministic, if it converges, it will converge to a local minimum of our cost/loss/risk function. Because in ML we are often dealing with extremely rugged landscapes with many local minima, this can lead to poor performance.\n", + "\n", + "* **GD is sensitive to initial conditions**. One consequence of the local nature of GD is that initial conditions matter. Depending on where one starts, one will end up at a different local minima. Therefore, it is very important to think about how one initializes the training process. This is true for GD as well as more complicated variants of GD.\n", + "\n", + "* **Gradients are computationally expensive to calculate for large datasets**. In many cases in statistics and ML, the cost/loss/risk function is a sum of terms, with one term for each data point. For example, in linear regression, $E \\propto \\sum_{i=1}^n (y_i - \\mathbf{w}^T\\cdot\\mathbf{x}_i)^2$; for logistic regression, the square error is replaced by the cross entropy. To calculate the gradient we have to sum over *all* $n$ data points. Doing this at every GD step becomes extremely computationally expensive. An ingenious solution to this, is to calculate the gradients using small subsets of the data called \"mini batches\". This has the added benefit of introducing stochasticity into our algorithm.\n", + "\n", + "* **GD is very sensitive to choices of learning rates**. GD is extremely sensitive to the choice of learning rates. If the learning rate is very small, the training process take an extremely long time. For larger learning rates, GD can diverge and give poor results. Furthermore, depending on what the local landscape looks like, we have to modify the learning rates to ensure convergence. Ideally, we would *adaptively* choose the learning rates to match the landscape.\n", + "\n", + "* **GD treats all directions in parameter space uniformly.** Another major drawback of GD is that unlike Newton's method, the learning rate for GD is the same in all directions in parameter space. For this reason, the maximum learning rate is set by the behavior of the steepest direction and this can significantly slow down training. Ideally, we would like to take large steps in flat directions and small steps in steep directions. Since we are exploring rugged landscapes where curvatures change, this requires us to keep track of not only the gradient but second derivatives. The ideal scenario would be to calculate the Hessian but this proves to be too computationally expensive. \n", + "\n", + "* GD can take exponential time to escape saddle points, even with random initialization. As we mentioned, GD is extremely sensitive to initial condition since it determines the particular local minimum GD would eventually reach. However, even with a good initialization scheme, through the introduction of randomness, GD can still take exponential time to escape saddle points. This leads us to our next topic, Stochastic Gradient Methods." + ] + } + ], + "metadata": {}, + "nbformat": 4, + "nbformat_minor": 4 +}