# Lecture Notes On CS725 : Machine Learning - IIT Bombay

1y ago
15 Views
2.64 MB
116 Pages
Last View : 1d ago
Transcription

Lecture notes on CS725 : Machine learningContents1 Lecture 1 : Introdcution to Machine Learning62 Lecture 22.1 Solving Least Squares in General (for Linear models) . . . . . . . . . . . . . . . . . .773 Lecture 3 : Regression3.1 Regression . . . . . . . . .3.2 Linear regression . . . . .3.3 Least square solution . . .3.4 Geometrical interpretation.10101010114 Lecture 4 : Least Squares Linear Regression4.1 Least Square Linear Regression Model . . . .4.2 Level Curves and Surfaces . . . . . . . . . . .4.3 Gradient Vector . . . . . . . . . . . . . . . . .4.4 Directional Derivative . . . . . . . . . . . . .4.5 Hyperplane . . . . . . . . . . . . . . . . . . .4.6 Tangential Hyperplane . . . . . . . . . . . . .4.7 Gradient Descent Algorithm . . . . . . . . . .4.8 Local Minimum and Local Maximum . . . . .1313141515161616175 Lecture 5 : Convex functions5.1 Recap . . . . . . . . . . . .5.2 Point 1 . . . . . . . . . . . .5.3 Point 2 . . . . . . . . . . . .5.4 Point 3 . . . . . . . . . . . .5.5 Point 4 . . . . . . . . . . . .5.5.1 Overfitting . . . . .5.5.2 Next problem . . . .5.6 Point 5 . . . . . . . . . . . .191919192021222222. . . . . . . . . . . . . . . . . . . . . . . . .of least squares.6 Lecture 6 : Regularized Solution to Regression Problem246.1 Problem formulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246.2 Duality and KKT conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246.3 Bound on λ in the regularized least square solution . . . . . . . . . . . . . . . . . . . 261

CONTENTS6.46.56.6RMS Error variation . . . . . . . . . .Alternative objective function . . . . .A review of probability theory . . . . .6.6.1 The three axioms of probability6.6.2 Bayes’ theorem . . . . . . . . .6.6.3 Independent events . . . . . . .2.7 Lecture 7 : Probability7.1 Note . . . . . . . . . . . . . . . . . . . . . . . .7.2 Part of speech(pos) example . . . . . . . . . . .7.3 Probability mass function(pmf) and probability7.3.1 Joint distribution function . . . . . . . .7.3.2 Marginalization . . . . . . . . . . . . . .7.4 Example . . . . . . . . . . . . . . . . . . . . . .7.5 Conditional Density . . . . . . . . . . . . . . .7.6 Expectation . . . . . . . . . . . . . . . . . . . .7.6.1 Properties of E(x) . . . . . . . . . . . .7.7 Variance . . . . . . . . . . . . . . . . . . . . . .7.8 Covariance . . . . . . . . . . . . . . . . . . . .7.8.1 Properties of Covariance . . . . . . . . .7.9 Chebyshev’s Inequality . . . . . . . . . . . . . .7.10 Bernoulli Random Variable . . . . . . . . . . .7.11 Binomial Random Variable . . . . . . . . . . .7.12 Central Limit Theorem . . . . . . . . . . . . .7.13 Maximum Likelihood and Estimator . . . . . .7.14 Bayesian estimator . . . . . . . . . . . . . . . .272728292930. . . . . . . . . . . . . . . . . . . . . . . . .density function(pdf). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .313131313232323333343434343435353536378 Lecture 8388.1 Bernoulli Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388.2 Bayesian Estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399 Lecture 9 : Multinomial Distribution9.0.1 Posterior probability . . . . . . . . . . . . . .9.0.2 Summary . . . . . . . . . . . . . . . . . . . .9.1 Gaussian Distribution . . . . . . . . . . . . . . . . .9.1.1 Information Theory . . . . . . . . . . . . . .9.1.2 Expectation for I(X x): . . . . . . . . . . . .9.1.3 Observations: . . . . . . . . . . . . . . . . . .9.1.4 Properties of gaussian univariate distribution.424242434344444510 Lecture 10 : Multivariate Gaussian Distribution4710.1 Multivariate Gaussian Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4810.1.1 Unbiased Estimator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4910.2 Dealing with Conjugate Priors for Multivariate Gaussian . . . . . . . . . . . . . . . . 50

CONTENTS11 Lecture 1111.1 Recall . . . . . . . . . . . .11.2 Bayes Linear Regression . .11.3 Pure Bayesian - Regression11.4 Sufficient Statistic . . . . .11.5 Lasso . . . . . . . . . . . . .3.52525254545412 Lecture 12 : Bias-Variance tradeoff5612.1 Expected Loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5613 Lecture 1313.1 Conclude Bias-Variance . . . . . . . . . . . . . . . .13.1.1 Summary . . . . . . . . . . . . . . . . . . . .13.1.2 Bayesian Linear Regression(BLR) . . . . . .13.1.3 General Problems with Standard Distribution13.2 Emperical Bayes . . . . . . . . . . . . . . . . . . . .13.2.1 First Approach: Approximate the posterior .13.2.2 Second Approach: Emperical Bayes . . . . .13.2.3 Sove the eigenvalue equation . . . . . . . . .14 Lecture 14 : Introduction to Classification5959595961646465656615 Lecture 15: Linear Models for Classification15.1 Generalized linear models . . . . . . . . . . .15.2 Three broad types of classifiers . . . . . . . .15.2.1 Examples . . . . . . . . . . . . . . . .15.3 Handling Multiclasses . . . . . . . . . . . . .15.3.1 Avoiding ambiguities . . . . . . . . . .15.4 Least Squares approach for classification . . .15.4.1 Limitations of Least Squares . . . . .676767686870707116 Lecture 1616.1 Introduction . . . . . . . . . .16.2 Problems of linear regression16.2.1 Sensitivity to outliers16.2.2 Masking . . . . . . . .16.3 Possible solutions . . . . . . .16.4 Summary . . . . . . . . . . .7272727272737617 Lecture 17.7718 Lecture 18:Perceptron7818.1 Fisher’s discriminant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7818.2 Perceptron training . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7818.2.1 Intuition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79

CONTENTS419 Lecture 1919.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19.2 Margin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19.3 Support Vector Machines . . . . . . . . . . . . . . . . . . . . . . . . . . . .19.4 Support Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19.5 Objective Design in SVM . . . . . . . . . . . . . . . . . . . . . . . . . . . .19.5.1 Step 1:Perfect Separability . . . . . . . . . . . . . . . . . . . . . . .19.5.2 Step 2:Optimal Separating Hyperplane For Perfectly Separable19.5.3 Step 2:Separating Hyperplane For Overlapping Data . . . . . . . . . . . . . . . . . .Data. . .82828283838484848520 Lecture 20: Support Vector Machines (SVM)20.1 Recap . . . . . . . . . . . . . . . . . . . . . . .20.2 Distance between the points . . . . . . . . . . .20.3 Formulation of the optimization problem . . . .20.4 Soft Margin SVM . . . . . . . . . . . . . . . . .20.4.1 Three types of g points . . . . . . . . .20.5 Primal and Dual Formulation . . . . . . . . . .20.5.1 Primal formulation . . . . . . . . . . . .20.5.2 Dual Formulation . . . . . . . . . . . . .20.6 Duality theory applied to KKT . . . . . . . . .8888888990909191919221 Lecture 21:The SVM dual21.1 SVM dual . . . . . . . . . . . .21.2 Kernel Matrix . . . . . . . . . .21.2.1 Generation of φ space .21.3 Requirements of Kernel . . . .21.3.1 Examples of Kernels . .21.4 Properties of Kernel Functions.94949495969697Techniques. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .98. 98. 98. 99. 102. 103.22 Lecture 22: SVR and Optimization22.1 Other occurance of kernel . . . . .22.1.1 Some variants of SVM’s . .22.2 Support Vector Regression . . . . .22.3 L1 SVM . . . . . . . . . . . . . . .22.4 Kernel Adatron . . . . . . . . . . .23 Lecture 2310423.1 Sequential minimization algorithm - SMO . . . . . . . . . . . . . . . . . . . . . . . . 10523.2 Probablistic models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10624 Lecture 24: Prob. Classifiers10724.1 Non Parametric Density Estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . 10724.2 Parametric Density Estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109

CONTENTS25 Lecture 2525.1 Exponential Family Distribution . . . . . .25.2 Discrete Feature Space . . . . . . . . . . . .25.3 Naive Bayes Assumption . . . . . . . . . .25.4 Graphical Models . . . . . . . . . . . . . . .25.5 Graphical Representation of Naive Bayes25.6 Graph Factorisation . . . . . . . . . . . . . .25.7 Naive Bayes Text Classification . . . . . .5.112112112113114114115115

11LECTURE 1 : INTRODCUTION TO MACHINE LEARNINGLecture 1 : Introdcution to Machine LearningThis lecture was an introduction to machine learning. .6

2LECTURE 227Lecture 22.1Solving Least Squares in General (for Linear models)Xplot [0, 0.1, ., 2] Curve Why noise ?– Since observations are not perfect– Owing to quantization / precision / roundingCurve FittingLearn f : X Y such that E(f, X, Y1 ) is minimized. Here the error function E and form of thefunction to learn f is chosen by the modeler.Consider one such form of f ,f (x) w0 w1 x w2 x2 . wt xtThe sum of squares error is given by,mE 1X(f (xi ) yi )22 i 1So the expression is,K1X[(w0 w1 x w2 x2 . wt xt ) y1 (i)]2w [w1 ,w2 ,.wt ] 2 i 1argminIf there are m data points, then a polynomial of degree m 1 can exactly fit the data, since thepolynomial has m degrees of freedom (where degrees of freedom no. of coefficients)As the degree of the polynomial increases beyond m, the curve becomes more and more wobbly,while still passing through the points. Contrast the degree 10 fit in Figure 2.1 against the degree 5fit in Figure 2.1. This is due to the problem of overfitting (overspecification)Now E is a convex function. To optimize it, we need to set w E 0. The operator is alsocalled gradient.Solution is given by,X (φt φ) 1 φt YIf m t then φ becomes singular and the solution cannot be found OR The column vectors in φ become nearly linearly dependentRMS (root mean sqare) error is given by :rRM S 2Ek

2LECTURE 28Figure 1: Fit for degree 5 polynomial.Generally, some test data (which potentially could have been part of the training data) is heldout for evaluating the generalized performance of the model. Another held out fraction of thetraining data, called the validation dataset is typically used to find the most appropriate degreetbest for f .

2LECTURE 2Figure 2: Fit for degree 10 polynomial. Note how wobbly this fit is.9

3LECTURE 3 : REGRESSION310Lecture 3 : RegressionThis lecture was about regression. It started with formally defining a regression problem. Then asimple regression model called linear regression was discussed. Different methods for learning theparameters in the model were next discussed. It also covered least square solution for the problemand its geometrical interpretation.3.1RegressionSuppose there are two sets of variables x n and y k such that x is independent and yis dependant. The regression problem is concerned with determining y in terms of x. Let usassume that we are given m data points D hx1 , y1 i, hx2 , y2 i, ., hxm , ym i. Then the problem isto determine a function f such that f (x) is the best predictor for y, with respect to D. Supposeε(f, D) is an error function, designed to reflect the discrepancy between the predicted value f (x0 )of y0 and the actual value y0 for any hx0 , y0 i D, thenf argmin ε(f, D)(1)f Fwhere, F denotes the class of functions over which the optimization is performed.3.2Linear regressionDepending on the function class we consider, there are many types of regression problems. In Linearregression we considerPp only linear functions, functions that are linear in the basis function. HereF is of the form { i 1 wi φi (x)}. φi : Rn Rk Here, the φi ’s are called the basis functions (forexample, we can consider φi (x) xi , i.e., polynomial basis functions) .Any function in F is characterized by its parameters, the wi ’s. Thus, in (1) we have to findf (w ) wherew argminε(w, D)w3.3Least square solutionThe error function ε plays a major role in the accuracy and tractability of the optimization problem.The error function is also called the loss function. The squared loss is a commonly used lossfunction. It is the sum of squares of the differences between the actual value and the predictedvalue.Xε(f, D) (f (xi ) yi )2hxi ,yi i DSo the least square solution for linear regression is given by w argminwpmXXj 1(wi φi (xj ) yj 2i 1The minimum value of the squared loss is zero. Is it possible to achieve this value ? In otherpXwords is j,wi φi (xj ) yj possible ?i 1

3LECTURE 3 : REGRESSION11C(φ)ŷyFigure 3: Least square solution ŷ is the orthogonal projection of y onto column space of φThe above equality can be written as u, φT (xu )w yuor equivalentlyφw y where φ1 (x1 ) · · · φp (x1 )y1 . and y . φ . . φ1 (xm ) · · · φp (xm )ymIt has a solution if y is in the column space (the subspace of Rn formed by the column vectors)of φ. It is possible that there exists no w which satisfies the conditions? In such situations we cansolve the least square problem.3.4Geometrical interpretation of least squaresLet ŷ be a solution in the column space of φ. The least squares solution is such that the distancebetween ŷ and y is minimized. From the diagram it is clear that for the distance to be minimized,the line joining ŷ to y should be orthogonal to the column space. This can be summarized as1. φw ŷ2. v {1, .p}, (y ŷ)T φv 0 or (ŷ y)T φ 0ŷT φ yT φie, (φw)T φ yT φie, wT φT φ yT φTie, φ φw w φT y (φT φ) 1 yIn the last step, please note that, φT φ is invertible only if φ has full column rank.

3LECTURE 3 : REGRESSION12Theorem: If φ has full column rank, φT φ is invertible. A matrix is said to have full column rankif all its columnPvectors are linearly independent. A set of vectors vi is said to be linearlyindependent if i αi vi 0 αi 0.Proof: Given that φ has full column rank and hence columns are linearly independent, we havethat φx 0 x 0.Assume on the contrary that φT φ is non invertible. Then x 6 0 3 φT φx 0. xT φT φx 0 (φx)T φx φx 2 0 φx 0. This is a contradiction. Hence the theorem is proved.

4LECTURE 4 : LEAST SQUARES LINEAR REGRESSION413Lecture 4 : Least Squares Linear RegressionIn this lecture we discussed how to minimize the error function ε(w, D) that we used for theleast square linear regression model in the last lecture. To do this, some basic concepts regardingminimization of a function were discussed and we applied these to our error function.4.1Least Square Linear Regression ModelIn the least squares regression model, we determine the value of w for which our error function εattains the minimum value. Here, D x1 , y1 , x2 , y2 , ., xm , ym is the training dataset, and φi ’s are the basis functions.w X m2argmin(f (xj , w) yj )w j 1!2 XpmXwi φi (xj ) yjargminw φ j 1φ1 (x1 )i 1φ2 (x1 ).φp (x1 ) .φ1 (xm ) φ2 (xm ) y1 y2 y . . φp (xm ) ym w1 w2 w . . wpε minwmXφT (xj )w yj 2j 12 min φw y min (φw y) (φw y) min wT φT φw 2yT φw yT ywTww (2)

4LECTURE 4 : LEAST SQUARES LINEAR REGRESSION14How to minimize a function?Following are some basic concepts which help in minimizing or maximizing a function:4.2Level Curves and SurfacesA level curve of a function f (x) is defined as a curve along which the value of the function remainsunchanged while we change the value of it’s argument x. Note that there can be as many levelcurves for any function as the number of different values it can attain.Figure 4: 10 level curves for the function f (x1 , x2 ) x1 ex2 (Figure 4.12 from [1])Level surfaces are similarly defined for any n-dimensional function f (x1 , x2 , ., xn ) as a collectionof points in the argument space on which the value of the function is same at all points while wechange the argument values.Formally we can define a level curve as : Lc (f ) where c is a constant.Refer to Fig. 4.15 in class notes [1] for example. x f (x) c

4LECTURE 4 : LEAST SQUARES LINEAR REGRESSION15Figure 5: 3 level surfaces for the function f (x1 , x2 , x3 ) x21 x22 x23 with c 1, 3, 5. The gradientat (1, 1, 1) is orthogonal to the level surface f (x1 , x2 , x3 ) x21 x22 x23 3 at (1, 1, 1) (Fig. 4.14from [1]).4.3Gradient VectorThe gradient vector of a function f at a point x is defined as follows: f (x) fx x1 f (x) x2. f (x) xn n R The direction of the gradient vector gives the direction of maximum rate of change of the value ofthe function at a point. Also the magnitude of the gradient vector gives that maximum value ofrate of change.Refer to Definition 23 in the class notes [1] for more details.4.4Directional DerivativeDirectional Derivative gives the rate of change of the function value in a given direction at a point.The directional derivative of a function f in the direction of a unit vector v at a point x can bedefined as :Dv (f ) limh 0f (x hv) f (x)h v 1Note: The maximum value of directional derivative of a function f at any point is always themagnitude of it’s gradient vector at that point.

4LECTURE 4 : LEAST SQUARES LINEAR REGRESSION16Figure 6: The level curves from Figure 4 along with the gradient vector at (2, 0). Note that thegradient vector is perpenducular to the level curve x1 ex2 2 at (2, 0) (Figure 4.13 from [1])Refer to Definition 22 and Theorem 58 in the class notes [1] for more details.4.5HyperplaneA Hyperplane is a set of points whose direction w.r.t. a point p is orthogonal to a vector v. It canbe formally defined as : THv,p q (p q) v 04.6Tangential HyperplaneThere are two definitions of tangential hyperplane (T Hx ) to level surface (Lf (x ) (f )) of f at x :1. Plane consisting of all tangent lines at x to any parametric curve c(t) on level surface.2. Plane orthogonal to the gradient vector at x . T Hx Tp (p x ) f (x ) 0Note: By definition, T Hx is n 1 dimensional.Refer to Definition 24 and Theorem 59 in class notes [1] for more details.4.7Gradient Descent AlgorithmGradient Descent Algorithm is used to find minimum value attained by a real valued function f (x).We first start at an intial point x(0) and make a sequence of steps proportional to negative ofgradient of the function at the point. Finally we stop at a point x( ) where a desired convergence

4LECTURE 4 : LEAST SQUARES LINEAR REGRESSION17criterion (see notes on Convex Optimization) will be attained.The idea of gradient descent algorithm is based on the fact that if a real-valued function f (x) isdefined and differentiable at a point xk , then f (x) decreases fastest when you move in the directionof the negative gradient of the function at that point, which is f (x).Here we describe the method of Gradient Descent Algorithm to find the parameter vector wwhich minimizes the error function, ε(w, D) w(k) ε(w(k) )Tfrom equation (2)T (w φ φw 2yT φw yT y) (2φT φw 2yT φ 0)2(φT y φT φw) so we gotw(k 1) w(k) 2t(k) (φT y φT φw(k) )Gradient Descent Algorithm :Find starting point w(0) Drepeat1. wk ε(w(k) )2. Choose a step size t(k) 0 using exact or backtracking ray search.3. Obtain w(k 1) w(k) t(k) w(k) .4. Set k k 1.until stopping criterion (such as ε(x(k 1) ) ) is satisfiedExact Line Search Algorithm : t(k) argminε w(k) 2t φT y φT φw(k)tIn general t(k) argminf w(k 1)tRefer to section 4.5.1 in the class notes [1] for more details.4.8Local Minimum and Local MaximumCritical Point : x is a called a critical point w.r.t to a function f , if f (x) 0 i.e. the gradientvanishes at x or the gradient fails to exist at x.Local Minimum (or Maximum):

4LECTURE 4 : LEAST SQUARES LINEAR REGRESSION18If f (x ) 0 then x can be a point of local minimum (or maximum). [Neccessary Condition]If 2 f (x ) is positive (negative) definite then x is a point of local minimum (maximum). [Sufficient Condition]Note: 2 f (x ) is positive definite means : x 6 0xT 2 f (x )x 0ORλi ( 2 f (x )) 0i.e. matrix eigen values are positive.Refer to definition 27, theorem 61 and fig. 4.23, 4.24 in the class notes [1] for more details.Figure 7: Plot of f (x1 , x2 ) 3x21 x31 2x22 x42 , showing the various local maxima and minimaof the function (fig. 4.16 from [1])

5LECTURE 5 : CONVEX FUNCTIONS519Lecture 5 : Convex functionsIn this lecture the concepts of convex sets and functions were introduced.5.1RecapWe recall that the problem was to find w such thatw 2argmin φw y (3)w 5.2argminw (wT φT φw 2wT φy yT y)(4)Point 1If f (x ) is defined & x is local minimum/maximum, then f (x ) 0(A necessary condition) (Cite : Theorem 60)[2]Given thatf (w) f (w) argmin(wT φT φw 2wT φy yT y)wT2φ φw 2φT y(5)(6)we would have f (w )T T 2φ φw 2φ y w5.3 0 0 (7)(8)T(φ φ) 1 Tφ y(9)Point 2Is f (w ) positive definite ?i.e. x 6 0, is xT f (w )x 0? (A sufficient condition for local minimum)2(Note : Any positive definite matrix is also positive semi-definite)(Cite : Section 3.12 & 3.12.1)[3] 2 f (w )T2 x f (w )x 2φT φ(10) 2xT φT φx(11) 2(φx)T φx(12) 22 φx 0(13)And if φ has full column rank ,φx 0 if fx 0(14)

5LECTURE 5 : CONVEX FUNCTIONS20 If x 6 0, xT 2 f (w )x 0Example where φ doesn’t have a full column rank,x1x21x21x31 x2φ . .x22.x22. x32 . . xnx2nx2nx3n (15)This is the simplest form of linear correlation of features, and it is not at all desirable.5.4Point 3Definition of convex sets and convex functions (Cite :Definition 32 and 35)[2]Figure 8: A sample convex function f (θx (1 θ)y) θf (x) (1 θ)f (y)Some convex functions : (Cite :Table 4.1, pg-54)[2]To prove : Verify that a hyperplane is a convex set.Proof :(16)

5LECTURE 5 : CONVEX FUNCTIONS21A Hyperplane H is defined as {x aT x b, a 6 0}. Let x and y be vectors that belong to thehyperplane. Since they belong to the hyperplane, aT x b and aT y b. In order to prove theconvexity of the set we must show that :θx (1 θ)y H, where θ [0, 1](17)In particular, it will belong to the hyperplane if it’s true that :aT (θx (1 θ)y) b(18)T b(19) b(20)T a θx a (1 θ)yTT θa x (1 θ)a y(21)And, we also have aT x b and aT y b. Hence θb (1 θ)b b. [Hence Proved]So a hyperplane is a convex set.Q. Is φw y 2 convex?A. To check this, we have (Cite : Theorem 75)[2] but it is not very practical. We would use(Cite : Theorem 79)[2] to check for the convexity of our function. So the condition that hasour focus is 2 f (w ) is positive semi def inite, if x 6 0, xT 2 f (w )x 0(22) 2 f (w) 2φT φ(23)We have,2So, φw y is convex, since the domain for w is Rn and is convex.2Q. Is φw y strictly convex?A. Iff φ has full column rank.(Side note : Weka1 )5.5Point 4To prove: If a function is convex, any point of local minima point of global minimaProof - (Cite : Theorem 69)[2]To prove : If a function is strictly convex, it has a unique point of global minimaProof - (Cite : Theorem 70)[2]2Since φw y is strictly convex for linearly independent φ, f (w ) 0 f or w (φT φ) 1 φT y1 http://www.cs.waikato.ac.nz/ml/weka/(24)

5LECTURE 5 : CONVEX FUNCTIONS22Thus, w is a point of global minimum. One can also find a solution to (φT φw φT y) by Gausselimination.5.5.1OverfittingFigure 9: train-RMS and test-RMS values vs t(degree of polynomial) graph Too many bends (t 9 onwards) in curve high values of some wi0 s Train and test errors differ significantly5.5.2Next problemFind2w argminw φw y s.t. w p ζ,where w p n X wi p p1(25)(26)i 15.6Point 5Q. How to solve constrained problems of the above-mentioned type?A. General problem format :M inimize f (w) s.t. g(w) 0(27)

5LECTURE 5 : CONVEX FUNCTIONS23Figure 10: p-Norm curves for constant norm value and different pFigure 11: Level curves and constraint regionsAt the point of optimality,Either g(w ) 0 Or g(w ) 0& f (w ) 0 (28) & f (w ) α g(w )(29)If w is on the border of g, i.e., g(w ) 0, f (w ) α g(w )(Duality Theory) (Cite :(30)Section 4.4, pg-72)[2]Intuition: If the above didn’t hold, then we would have f (w ) α1 g(w ) α2 g(w ), whereby moving in direction g(w ), we remain on boundary g(w ) 0, while decreasing/increasingvalue of f, which is not possible at the point of optimality.

6LECTURE 6 : REGULARIZED SOLUTION TO REGRESSION PROBLEM624Lecture 6 : Regularized Solution to Regression ProblemIn last lecture, we derived solution for the regression problem formulated in least-squares sensewhich was aimed at minimizing rms error over observed data points. We also analysed conditionsunder which the obtained solution was guaranteed to be a global minima. However, as we observed,increasing the order of the model yielded larger rms error over test data, which was due to largefluctuations in model learnt and consequently due to very high values of model coefficients (weights).In this lecture, we discuss how the optimization problem can be modified to counter very largemagnitudes of coefficients. Subsequently, solution of this problem is provided through lagrangedual formulation followed by discussion over obtained solution and impact over test data. Towardsthe end of the lecture, a very gentle introduction to axiomatic probability is provided.6.1Problem formulationIn order to cease coefficients from becoming too large in magnitude, we may modify the problemto be a constrained optimization problem. Intuitively, for achieving this criterion, we may imposeconstraint on magnitude of coefficients. Any norm for this purpose might give good working solution. However, for mathematical convenience, we start with the euclidean (L2 ) norm. The overallproblem with objective function and constraint goes as follows:minimize(Φw Y )T (Φw Y )such that w 22 ξw(31)As observed in last lecture, the objective function, namely f (w) (Φw Y )T (Φw Y ) is strictlyconvex. Further to this, the constraint function, g(w) k w k22 ξ, is also a convex function. Forconvex g(w), the set S {w g(w) 0}, can be proved to be a convex set by taking two elementsw1 S and w2 S such that g(w1 ) 0 and g(w2 ) 0. Since g(w) is a convex function, we havethe following inequality:g(θw1 (1 θ)w2 ) θg(w1 ) (1 θ)g(w2 )(32) 0; θ [0, 1], w1 , w2 SAs g(θw1 (1 θ)w2 ) 0; θ S, w1 , w2 S, θw1 (1 θ)w2 S, which is both sufficientand necessary for S to be a convex set. Hence, function g(w) imposes a convex constraint over thesolution space.6.2Duality and KKT conditionsGiven convex objective and constraint functions, minima, w , can occur in one of the following twoways:1. g(w ) 0 and Of (w ) αOg(w )2. g(w ) 0 and Of (w ) 0This fact might be easily visualized from Figure 1. As we can see, the first condition occurs whenminima lies on the boundary of function g. In this case, gradient vectors corresponding to function

6LECTURE 6 : REGULARIZED SOLUTION TO REGRESSION PROBLEM25Figure 12: Two plausible scenario for minima to occur: a) When minima is on constraint functionboundary, in which case gradients point in the same direction upto constant and b) When minimais inside the constraint space (shown in yellow shade), in which case Of (w ) 0.f and function g, at w , point in the same direction barring multiplication by a constant α R.Second condition d

3 LECTURE 3 : REGRESSION 10 3 Lecture 3 : Regression This lecture was about regression. It started with formally de ning a regression problem. Then a simple regression model called linear regression was discussed. Di erent methods for learning the parameters in the model were next discussed. It also covered least square solution for the problem

Related Documents:

Introduction of Chemical Reaction Engineering Introduction about Chemical Engineering 0:31:15 0:31:09. Lecture 14 Lecture 15 Lecture 16 Lecture 17 Lecture 18 Lecture 19 Lecture 20 Lecture 21 Lecture 22 Lecture 23 Lecture 24 Lecture 25 Lecture 26 Lecture 27 Lecture 28 Lecture

GEOMETRY NOTES Lecture 1 Notes GEO001-01 GEO001-02 . 2 Lecture 2 Notes GEO002-01 GEO002-02 GEO002-03 GEO002-04 . 3 Lecture 3 Notes GEO003-01 GEO003-02 GEO003-03 GEO003-04 . 4 Lecture 4 Notes GEO004-01 GEO004-02 GEO004-03 GEO004-04 . 5 Lecture 4 Notes, Continued GEO004-05 . 6

en blanco y negro o a color. La velocidad es importante para la impresión de grandes volúmenes, pero la mayoría de los trabajos son cortos—menos de tres páginas. Pero afortunadamente, la serie CS720/CS725 tiene un tiempo de impresión de la primera página en blanco y negro que no supera lo

Lecture 1: A Beginner's Guide Lecture 2: Introduction to Programming Lecture 3: Introduction to C, structure of C programming Lecture 4: Elements of C Lecture 5: Variables, Statements, Expressions Lecture 6: Input-Output in C Lecture 7: Formatted Input-Output Lecture 8: Operators Lecture 9: Operators continued

Artificial Intelligence COMP-424 Lecture notes by Alexandre Tomberg Prof. Joelle Pineau McGill University Winter 2009 Lecture notes Page 1 . I. History of AI 1. Uninformed Search Methods . Lecture notes Page 58 . Lecture notes Page 59 . Soft EM for a general Bayes net: Lecture notes Page 60 . Machine Learning: Clustering March-19-09

2 Lecture 1 Notes, Continued ALG2001-05 ALG2001-06 ALG2001-07 ALG2001-08 . 3 Lecture 1 Notes, Continued ALG2001-09 . 4 Lecture 2 Notes ALG2002-01 ALG2002-02 ALG2002-03 . 5 Lecture 3 Notes ALG2003-01 ALG2003-02 ALG

Lecture 2: Introduction Instructor: Ganesh Ramakrishnan Date: 26/07/2011 Computer Science & Engineering Indian Institute of Technology, Bombay 1 Basic notions and Version Space 1.1 ML : De nition De nition (from Tom Mitchell's book): A computer program is said to learn from experience E

Double Concept Modal Modal Concept Examples Shall (1) Educated expression Offer Excuse me, I shall go now Shall I clean it? Shall (2) Contractual obligation The company shall pay on January 1st Could (1) Unreal Ability I could go if I had time Could (2) Past Ability She could play the piano(but she can’t anymore) Can (1) Present Ability We can speak English Can (2) Permission Can I have a candy?