ECLT 5810 Linear Regression and Logistic Regression for Classification. Prof. Wai Lam

Similar documents
ECLT 5810 Linear Regression and Logistic Regression for Classification. Prof. Wai Lam

MS&E 226: Small Data

Machine Learning Linear Classification. Prof. Matteo Matteucci

MS&E 226: Small Data

Lecture 4: Newton s method and gradient descent

MATH 829: Introduction to Data Mining and Analysis Logistic regression

STA 450/4000 S: January

Probabilistic classification CE-717: Machine Learning Sharif University of Technology. M. Soleymani Fall 2016

Intro. ANN & Fuzzy Systems. Lecture 15. Pattern Classification (I): Statistical Formulation

Administration. Homework 1 on web page, due Feb 11 NSERC summer undergraduate award applications due Feb 5 Some helpful books

2/26/2017. PSY 512: Advanced Statistics for Psychological and Behavioral Research 2

Linear Classification: Probabilistic Generative Models

Lecture 5: LDA and Logistic Regression

Classification. Chapter Introduction. 6.2 The Bayes classifier

Logistic Regression and Generalized Linear Models

Beyond GLM and likelihood

Linear Regression Models P8111

Data Mining 2018 Logistic Regression Text Classification

Stat 642, Lecture notes for 04/12/05 96

22s:152 Applied Linear Regression. Example: Study on lead levels in children. Ch. 14 (sec. 1) and Ch. 15 (sec. 1 & 4): Logistic Regression

University of Cambridge Engineering Part IIB Module 3F3: Signal and Pattern Processing Handout 2:. The Multivariate Gaussian & Decision Boundaries

Section IX. Introduction to Logistic Regression for binary outcomes. Poisson regression

PubH 7470: STATISTICS FOR TRANSLATIONAL & CLINICAL RESEARCH

Problem #1 #2 #3 #4 #5 #6 Total Points /6 /8 /14 /10 /8 /10 /56

LINEAR MODELS FOR CLASSIFICATION. J. Elder CSE 6390/PSYC 6225 Computational Modeling of Visual Perception

Universität Potsdam Institut für Informatik Lehrstuhl Maschinelles Lernen. Linear Classifiers. Blaine Nelson, Tobias Scheffer

Logistic Regression Review Fall 2012 Recitation. September 25, 2012 TA: Selen Uguroglu

Mark your answers ON THE EXAM ITSELF. If you are not sure of your answer you may wish to provide a brief explanation.

Bayesian Learning (II)

Linear Classification. CSE 6363 Machine Learning Vassilis Athitsos Computer Science and Engineering Department University of Texas at Arlington

Data Mining Stat 588

> DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE GRAVIS 2016 BASEL. Logistic Regression. Pattern Recognition 2016 Sandro Schönborn University of Basel

COMS 4771 Regression. Nakul Verma

σ(a) = a N (x; 0, 1 2 ) dx. σ(a) = Φ(a) =

Introduction to Statistical Analysis

Classification CE-717: Machine Learning Sharif University of Technology. M. Soleymani Fall 2012

Multivariate statistical methods and data mining in particle physics

BIOSTATS Intermediate Biostatistics Spring 2017 Exam 2 (Units 3, 4 & 5) Practice Problems SOLUTIONS

Logistic Regression. Machine Learning Fall 2018

7/28/15. Review Homework. Overview. Lecture 6: Logistic Regression Analysis

Support Vector Machines

Generative Learning. INFO-4604, Applied Machine Learning University of Colorado Boulder. November 29, 2018 Prof. Michael Paul

UNIVERSITY OF MASSACHUSETTS Department of Mathematics and Statistics Applied Statistics Friday, January 15, 2016

LDA, QDA, Naive Bayes

Class Notes: Week 8. Probit versus Logit Link Functions and Count Data

Simple logistic regression

Classification: Linear Discriminant Analysis

NATIONAL UNIVERSITY OF SINGAPORE EXAMINATION. ST3241 Categorical Data Analysis. (Semester II: ) April/May, 2011 Time Allowed : 2 Hours

ST3241 Categorical Data Analysis I Multicategory Logit Models. Logit Models For Nominal Responses

Sparse Linear Models (10/7/13)

Modern Methods of Statistical Learning sf2935 Lecture 5: Logistic Regression T.K

Machine Learning Lecture 7

Classification 1: Linear regression of indicators, linear discriminant analysis

Bayesian Decision Theory

Kernel Logistic Regression and the Import Vector Machine

Data-analysis and Retrieval Ordinal Classification

STA 4504/5503 Sample Exam 1 Spring 2011 Categorical Data Analysis. 1. Indicate whether each of the following is true (T) or false (F).

Age 55 (x = 1) Age < 55 (x = 0)

Logistic Regression. Interpretation of linear regression. Other types of outcomes. 0-1 response variable: Wound infection. Usual linear regression

Cheng Soon Ong & Christian Walder. Canberra February June 2018

Linear Models for Classification

Logistic Regression. Sargur N. Srihari. University at Buffalo, State University of New York USA

PubHlth Intermediate Biostatistics Spring 2015 Exam 2 (Units 3, 4 & 5) Study Guide

Classification Based on Probability

THE UNIVERSITY OF CHICAGO Graduate School of Business Business 41912, Spring Quarter 2012, Mr. Ruey S. Tsay

7. Assumes that there is little or no multicollinearity (however, SPSS will not assess this in the [binary] Logistic Regression procedure).

You can specify the response in the form of a single variable or in the form of a ratio of two variables denoted events/trials.

Probabilistic modeling. The slides are closely adapted from Subhransu Maji s slides

ECE521 Lecture7. Logistic Regression

LOGISTIC REGRESSION Joseph M. Hilbe

Logistic Regression. Advanced Methods for Data Analysis (36-402/36-608) Spring 2014

STA 4504/5503 Sample Exam 1 Spring 2011 Categorical Data Analysis. 1. Indicate whether each of the following is true (T) or false (F).

8 Nominal and Ordinal Logistic Regression

Gaussian discriminant analysis Naive Bayes

Stat 5101 Lecture Notes

Review. Timothy Hanson. Department of Statistics, University of South Carolina. Stat 770: Categorical Data Analysis

Theorems. Least squares regression

Models for Count and Binary Data. Poisson and Logistic GWR Models. 24/07/2008 GWR Workshop 1

Consider Table 1 (Note connection to start-stop process).

Class 4: Classification. Quaid Morris February 11 th, 2011 ML4Bio

R Hints for Chapter 10

Unit 5 Logistic Regression Practice Problems

LINEAR CLASSIFICATION, PERCEPTRON, LOGISTIC REGRESSION, SVC, NAÏVE BAYES. Supervised Learning

Hypothesis Testing, Power, Sample Size and Confidence Intervals (Part 2)

Statistics in medicine

Chapter 10 Logistic Regression

The exam is closed book, closed notes except your one-page (two sides) or two-page (one side) crib sheet.

Machine Learning, Midterm Exam: Spring 2009 SOLUTION

Lecture 2. Judging the Performance of Classifiers. Nitin R. Patel

Binary Logistic Regression

Multinomial Logistic Regression Models

CS 340 Lec. 16: Logistic Regression

Non-Bayesian Classifiers Part II: Linear Discriminants and Support Vector Machines

Randomized Decision Trees

ECE521 week 3: 23/26 January 2017

Stat 587: Key points and formulae Week 15

Logistic Regression. Continued Psy 524 Ainsworth

Unit 9: Inferences for Proportions and Count Data

Classification Methods II: Linear and Quadratic Discrimminant Analysis

Generalized Linear Models for Non-Normal Data

Transcription:

ECLT 5810 Linear Regression and Logistic Regression for Classification Prof. Wai Lam

Linear Regression Models Least Squares Input vectors is an attribute / feature / predictor (independent variable) The linear regression model: The output is called response (dependent variable) s are unknown parameters (coefficients) 2

Linear Regression Models Least Squares A set of training data Each corresponding to attributes Each is a class attribute value / a label Wish to estimate the parameters 3

Linear Regression Models Least Squares One common approach the method of least squares: Pick the coefficients minimize the residual sum of squares: to 4

Linear Regression Models Least Squares This criterion is reasonable if the training observations represent independent draws. Even if the s were not drawn randomly, the criterion is still valid if the s are conditionally independent given the inputs. 5

Linear Regression Models Least Squares Make no assumption about the validity of the model Simply finds the best linear fit to the data 6

Linear Regression Models Finding Residual Sum of Squares Denote by the matrix with each row an input vector (with a 1 in the first position) Let be the N vector of outputs in the training set Quadratic function in the parameters: 7

Linear Regression Models Finding Residual Sum of Squares Set the first derivation to zero: Obtain the unique solution: 8

Linear Regression Models Orthogonal Projection The fitted values at the training inputs are: The matrix appearing in the above equation, called hat matrix because it puts the hat on 9

Linear Regression Models Example Training Data: x y (1, 2, 1) 22 (2, 0, 4) 49 (3, 4, 2) 39 (4, 2, 3) 52 (5, 4, 1) 38 10

Linear Regression Models Example 1 1 2 1 1 2 0 4 1 3 4 2 1 1 4 5 2 4 3 1 22 49 39 52 38 4.04 0.51 8.43 8.13 11

Linear Regression Models Example 4.04 0.51 8.43 8.13 21.61 0.39 residual vector 49.91 0.91 39.13 0.13 50.57 1.4 38.78 0.78 12

Discriminant Functions Suppose there are classes, labeled 1,2,, A class of methods that model for each class. Then, classify to the class with the largest value for its discriminant function Decision boundary between class and is that set of points for which l 13

Suppose is the class conditional density of in class, i.e., Let be the prior probability of class, with A simple application of Bayes theorem: l l l l 14

Desire to model the posterior probabilities of the classes via linear functions in (p dimensional vector) Ensuring they sum to one and remain in Model: 15

Specified in terms of log odds or logit transformations Choice of denominator is arbitrary estimates are equivariant under this choice l l l Sum to 1 l l l 16

Two class Classification For two class classification, we can model two classes as 0 and 1. Treating the class 1 as the concept of interest, the posterior probability can be regarded as the class membership probability: Pr 1 exp 1exp logistic function As a result, it maps in p dimensional space to a value in [0,1] 17

Shape of sigmoid curve Consider 1 dimensional Pr 18

An Example of One dimension We wish to predict death from baseline APACHE II score of patients. Let Pr be the probability that a patient with score will die. Note that linear regression would not work well since it could produce probabilities less than 0 or greater than 1 19

An Example of One dimension Data that has a sharp survival cut off point between patients who live or die will lead to a large value of 20

An Example of One dimension One the other hand, if the data has a lengthy transition from survival to death, it will lead to a low value of 21

Model Fitting for General Cases (K classes, p Dimension) Logistic regression models fit by maximum likelihood using the conditional likelihood of given completely specifies the conditional distribution the multinomial distribution is appropriate 22

Model Fitting for General Cases (K classes, p Dimension) Let entire parameter set be, then Log likelihood for observations of input data and class labels: where Find the model that maximizes the log likelihood. 23

Example The subset of the Coronary Risk Factor Study (CORIS) baseline survey, carried out in three rural areas of the Western Cape, South Africa Aim: establish the intensity of ischemic heart disease risk factors in that high incidence region Response variable is the presence or absence of myocardial infraction (MI) at the time of survey 160 cases in data set, sample of 302 controls 24

Example 25

Example Fit a logistic regression model by maximum likelihood, giving the results shown in the next slide z scores for each coefficients in the model (coefficients divided by their standard errors) 26

Example Results from a logistic regression fit to the South African heart disease data: Coefficient Std. Error Z Score (Intercept) 4.130 0.964 4.285 sbp 0.006 0.006 1.023 tobacco 0.080 0.026 3.034 ldl 0.185 0.057 3.219 famhist 0.939 0.225 4.178 obesity 0.035 0.029 1.187 alcohol 0.001 0.004 0.136 age 0.043 0.010 4.184 27

Example z scores greater than approximately 2 in absolute value is significant at the 5% level Some surprises in the table of coefficients sbp and obesity appear to be not significant On their own, both sbp and obesity are significant, with positive sign Presence of many other correlated variables no longer needed (can even get a negative sign) 28

3 common transformation/ link function (provided by SAS): Logit : ln(p/1-p) (We call this log of odd ratio) Probit: Normal inverse of p (Recall: normal table s mapping scheme) Complementary log-log: ln(-ln(1-p)) The choice of link function depends on your purpose rather than performance. They all perform equally good but the implications is a bit different. 29

Related Measures 30

Related Measures Wald s Chi-square We could treat an effect as significant if the tail probability is small enough (< 5%). If we are using the model for predicting the outcome rather than the probability for that outcome (the case when the criterion is set to minimize loss), the interpretation for misclassification rate/ profit and loss/ ROC curve/ lift chart is similar to those for decision tree. 31