Time and LocaBon CS 6140: Machine Learning Spring 2017 Time: Thursdays from 6:00 pm 9:00 pm Loca)on: Forsyth Building 129 Instructor: Lu Wang College of Computer and InformaBon Science Northeastern University Webpage: www.ccs.neu.edu/home/luwang Email: luwang@ccs.neu.edu Course Webpage hqp://www.ccs.neu.edu/home/luwang/ courses/cs6140_sp2017.html Prerequisites Programming Being able to write code in some programming languages (e.g. Python, Java, C/C++, Matlab) proficiently Courses Algorithms Probability and stabsbcs Linear algebra Courses Algorithms Probability and stabsbcs Linear algebra Prerequisites A quiz: 22 simple quesbons, 20 of them as True or False quesbons (relevant to probability, stabsbcs, and linear algebra) The purpose of this quiz is to indicate the expected background of students. 80% of the quesbons should be easy to answer. Not counted in your final score! Textbook and References Main Textbook Kevin Murphy, "Machine Learning - a ProbabilisBc PerspecBve", MIT Press, 2012. Christopher M. Bishop, "PaQern RecogniBon and Machine Learning", Springer, 2006. Other textbooks Tom Mitchell, "Machine Learning", McGraw Hill, 1997. Machine learning lectures 1
Content of the Course Regression: linear regression, logisbc regression Dimensionality Reduc)on: Principal Component Analysis (PCA), Independent Component Analysis (ICA), Linear Discriminant Analysis Probabilis)c Models: Naive Bayes, maximum likelihood esbmabon Sta)s)cal Learning Theory: VC dimension Kernels: Support Vector Machines (SVMs), kernel tricks, duality Sequen)al Models and Structural Models: Hidden Markov Model (HMM), CondiBonal Random Fields (CRFs) Clustering: spectral clustering, hierarchical clustering Latent Variable Models: K-means, mixture models, expectabon-maximizabon (EM) algorithms, Latent Dirichlet AllocaBon (LDA), representabon learning Deep Learning: feedforward neural network, restricted Boltzmann machine, autoencoders, recurrent neural network, convolubonal neural network Reinforcement Learning: Markov decision processes, Q-learning and others, including advanced topics for machine learning in natural language processing and text analysis The Goal ScienBfic understanding of machine learning models How to apply and design learning methods for novel problems The Goal Not only what, but also why! Assignment 3 assignments, 10% for each Grading Quiz 10 in-class tests, 1% for each Exam 1 exam, 30% Project 1 project, 27% ParBcipaBon 3% Classes Piazza Exam Course Project Open book April 20, 2017 A machine learning relevant research project 2-3 students as a team 2
Topics Machine learning relevant Natural language processing Computer vision RoboBcs BioinformaBcs Health informabcs Course Project Grading We want to see novel and interesbng projects! The problem needs to be well-defined, novel, useful, and pracbcal machine learning techniques Reasonable results and observabons Project from Last Year Project from Last Year PredicBng Follow-back Behavior in Instagram Users Project from Last Year PredicBng Grasp Points Using ConvoluBonal Neural Networks Project from Last Year ArBficial Neural Networks for Drug Response PredicBon in Tailored Therapy 3
Project from Last Year Threat DetecBon from TwiQer Project from Last Year Player Ranking in Popular Games Course Project Grading Three reports Proposal (2%) Progress, with code (10%) Final, with code (10%) One presentabon In class (5%) Submission and Late Policy Each assignment or report, both electronic copy and hard copy, is due at the beginning of class on the corresponding due date. Programming language Python, Java, C/C++, Matlab Electronic version On blackboard Hard copy In class Submission and Late Policy Assignment or report turned in late will be charged 10 points (out of 100 points) off for each late day (i.e. 24 hours). Each student has a budget of 5 days throughout the semester before a late penalty is applied. How to find us? Course webpage: hqp://www.ccs.neu.edu/home/luwang/courses/ cs6140_sp2017.html Office hours Lu Wang: Thursdays from 4:30pm to 5:30pm, or by appointment, 448 WVH Rui Dong (TA), Tuesdays from 4:00pm to 5:00pm, or by appointment, 466B WVH Piazza hqp://piazza.com/northeastern/spring2017/cs614002 All course relevant quesbons go here 4
What is Machine Learning? A set of methods that can automabcally detect paqerns in data, and then use the uncovered paqerns to predict future data, or to perform other kinds of decisions making under certainty. 5
1/13/17 RelaBons with Other Areas Natural Language Processing Computer Vision RoboBcs A lot of other areas 6
Today s Outline Supervised vs. Unsupervised Learning Basic concepts in machine learning K-nearest neighbors Linear regression Ridge regression Supervised Learning Supervised vs. Unsupervised Learning Supervised learning Training set Training sample Gold-standard label - Classifica)on, if categorical - Regression, if numerical Supervised Learning Supervised Learning 7
1/13/17 Supervised Learning Supervised Learning Goal: Generalizable to new input samples Overfivng vs. underfivng One solubon: we use probabilisbc models Typical setup: Step 1: Features Step 2: Training set, test set, development set Step 3: EvaluaBon Supervised Learning Supervised Learning Supervised Learning Supervised vs. Unsupervised Learning Regression PredicBng stock price PredicBng temperature PredicBng revenue Unsupervised Learning More about knowledge discovery 8
Unsupervised Learning Dimension reducbon Principal component analysis Unsupervised Learning Clustering (e.g. graph mining) RolX: Role Extrac.on and Mining in Large Networks, by Henderson et al, 2011 Unsupervised Learning Topic modeling Parametric vs. Non-parametric model Fixed number of parameters? If yes, parametric model Number of parameters grow with the amount of training data? If yes, non-parametric model ComputaBonal tractability Today s Outline Basic concepts in machine learning A non-parametric classifier: K-nearest neighbors (KNN) K-nearest neighbors Supervised learning A non-parametric classifier Linear regression Ridge regression 9
A non-parametric classifier: K-nearest neighbors (KNN) Basic idea: memorize all the training samples The more you have in training data, the more the model has to remember A non-parametric classifier: K-nearest neighbors (KNN) Basic idea: memorize all the training samples The more you have in training data, the more the model has to remember Nearest neighbor (or 1-nearest neighbor): TesBng phase: find closet sample, and return corresponding label A non-parametric classifier: K-nearest neighbors (KNN) Basic idea: memorize all the training samples The more you have in training data, the more the model has to remember K-Nearest neighbor: TesBng phase: find the K nearest neighbors, and return the majority vote of their labels 10
About K K=1: just piecewise constant labeling K=N: global majority vote (class) Problems of knn Can be slow when training data is big Searching for the neighbors takes Bme Needs lots of memory to store training data Needs to tune k and distance funcbon Not a probability distribubon Distance funcbon Euclidean distance Problems of knn Problems of knn Distance funcbon Mahalanobis distance: weights on components ProbabilisBc knn ProbabilisBc knn We prefer a probabilisbc output because somebmes we may get an uncertain result 1 samples as yes, 199 samples as no à? 99 samples as yes, 101 samples as no à? ProbabilisBc knn: 3-class synthebc training data 11
Smoothing Class 1: 3, class 2: 0, class 3: 1 Original probability: P(y=1)=3/4, p(y=2)=0/4, p(y=3)=1/4 Smoothing Class 1: 3, class 2: 0, class 3: 1 Original probability: P(y=1)=3/4, p(y=2)=0/4, p(y=3)=1/4 Add-1 smoothing: Class 1: 3+1, class 2: 0+1, class 3: 1+1 P(y=1)=4/7, p(y=2)=1/7, p(y=3)=2/7 Soxmax Class 1: 3, class 2: 0, class 3: 1 Original probability: P(y=1)=3/4, p(y=2)=0/4, p(y=3)=1/4 Redistribute probability mass into different classes Define a soxmax as Today s Outline Basic concepts in machine learning K-nearest neighbors Linear regression Supervised learning A parametric classifier Ridge regression A parametric classifier: linear regression AssumpBon: the response is a linear funcbon of the inputs A parametric classifier: linear regression Inner product between input sample X and weight vector W Residual error: difference between predicbon and true label Inner product between input sample X and weight vector W Residual error: difference between predicbon and true label Assume residual error has a normal distribubon 12
A parametric classifier: linear regression A parametric classifier: linear regression We can further assume Basic funcbon expansion VerBcal: temperature Horizontal: locabon within a room A parametric classifier: linear regression Learning with Maximum Likelihood EsBmaBon (MLE) Maximum Likelihood EsBmaBon (MLE) Learning with Maximum Likelihood EsBmaBon (MLE) Log-likelihood Learning with Maximum Likelihood EsBmaBon (MLE) With our normal distribubon assumpbon Maximize log-likelihood is equivalent to minimize negabve log-likelihood (NLL) Residual sum of squares (RSS) à We want to minimize it! 13
DerivaBon of MLE for Linear Regression Rewrite our objecbve funcbon as DerivaBon of MLE for Linear Regression Rewrite our objecbve funcbon as Get the derivabve (or gradient) DerivaBon of MLE for Linear Regression Rewrite our objecbve funcbon as Get the derivabve (or gradient) Set our derivabve to 0 Ordinary least squares solu)on Overfivng A Prior on the Weight Zero-mean Gaussian prior Feature weights w: 14
A Prior on the Weight Zero-mean Gaussian prior A Prior on the Weight Zero-mean Gaussian prior New objecbve funcbon New objecbve funcbon Today s Outline Basic concepts in machine learning We want to minimize Ridge Regression K-nearest neighbors Linear regression Ridge regression Ridge Regression Ridge Regression We want to minimize We want to minimize L2 regulariza)on New esbmabon for the weight New esbmabon for the weight 15
Ridge Regression What we learned We want to minimize L2 regulariza)on Basic concepts in machine learning K-nearest neighbors New esbmabon for the weight Linear regression Leave the proof in Assignment 1! Ridge regression Homework Homework Reading Murphy ch1, ch2, and ch7 (only the secbons covered in the lecture) Sign up at Piazza hqp://piazza.com/northeastern/spring2017/cs614002 Start thinking about course project and find a team! Project proposal due Jan 26 Reading Murphy ch1, ch2, and ch7 Sign up at Piazza hqp://piazza.com/northeastern/spring2017/cs614002 Start thinking about course project and find a team! Project proposal due Jan 26 Next Time: LogisBc Regression, Decision Tree, GeneraBve Models (Naive Bayes) Reading: Murphy Ch 3, 8.1-8.3, 8.6, 16.2 16