LECTURE 02: EVALUATING MODELS January 27, 2016 SDS 293 Machine Learning.

Slides:



Advertisements
Similar presentations
Design of Experiments Lecture I
Advertisements

Data Mining Methodology 1. Why have a Methodology  Don’t want to learn things that aren’t true May not represent any underlying reality ○ Spurious correlation.
Model Assessment and Selection
Model Assessment, Selection and Averaging
Regression. So far, we've been looking at classification problems, in which the y values are either 0 or 1. Now we'll briefly consider the case where.
LECTURE 7 SEP 27, 2010 Building computational pipelines.
Statistics for the Social Sciences
Class 5: Thurs., Sep. 23 Example of using regression to make predictions and understand the likely errors in the predictions: salaries of teachers and.
Lecture 19: Tues., Nov. 11th R-squared (8.6.1) Review
Statistics 350 Lecture 23. Today Today: Exam next day Good Chapter 7 questions: 7.1, 7.2, 7.3, 7.28, 7.29.
Statistics 350 Lecture 1. Today Course outline Stuff Section
Multivariate Analyses & Programmatic Research Re-introduction to Multivariate research Re-introduction to Programmatic research Factorial designs  “It.
Chapter 2 – Tools of Positive Analysis
1 MF-852 Financial Econometrics Lecture 6 Linear Regression I Roy J. Epstein Fall 2003.
Lecture 16 – Thurs, Oct. 30 Inference for Regression (Sections ): –Hypothesis Tests and Confidence Intervals for Intercept and Slope –Confidence.
Comparison of Regularization Penalties Pt.2 NCSU Statistical Learning Group Will Burton Oct
1 Introduction to Policy Processes Dan Laitsch. 2 Overview (Class meeting 4) Sign in Agenda –Cohort break outs –Review last class –Mid term assessment.
Part I: Classification and Bayesian Learning
Lecture 3 Properties of Summary Statistics: Sampling Distribution.
Classification and Prediction: Regression Analysis
GS/PPAL Section N Research Methods and Information Systems A QUANTITATIVE RESEARCH PROJECT - (1)DATA COLLECTION (2)DATA DESCRIPTION (3)DATA ANALYSIS.
Elec471 Embedded Computer Systems Chapter 4, Probability and Statistics By Prof. Tim Johnson, PE Wentworth Institute of Technology Boston, MA Theory and.
Spreadsheet Modeling & Decision Analysis A Practical Introduction to Management Science 5 th edition Cliff T. Ragsdale.
M. Sulaiman Khan Dept. of Computer Science University of Liverpool 2009 COMP527: Data Mining Classification: Evaluation February 23,
Chapter 13: Inference in Regression
David Corne, and Nick Taylor, Heriot-Watt University - These slides and related resources:
9/15/ Lecture 11 STATS 330: Lecture 1. 9/15/ Lecture 12 Today’s agenda: Introductory Comments: –Housekeeping –Computer details –Plan of.
STA Lecture 161 STA 291 Lecture 16 Normal distributions: ( mean and SD ) use table or web page. The sampling distribution of and are both (approximately)
EE 3561_Unit_1(c)Al-Dhaifallah EE 3561 : - Computational Methods in Electrical Engineering Unit 1: Introduction to Computational Methods and Taylor.
Linear Functions 2 Sociology 5811 Lecture 18 Copyright © 2004 by Evan Schofer Do not copy or distribute without permission.
Statistics for the Social Sciences Psychology 340 Fall 2013 Correlation and Regression.
LOGISTIC REGRESSION David Kauchak CS451 – Fall 2013.
This material is approved for public release. Distribution is limited by the Software Engineering Institute to attendees. Sponsored by the U.S. Department.
ISCG8025 Machine Learning for Intelligent Data and Information Processing Week 3 Practical Notes Application Advice *Courtesy of Associate Professor Andrew.
Christoph Eick: Learning Models to Predict and Classify 1 Learning from Examples Example of Learning from Examples  Classification: Is car x a family.
Bias and Variance of the Estimator PRML 3.2 Ethem Chp. 4.
Chapter1: Introduction Chapter2: Overview of Supervised Learning
LESSON 6: REGRESSION 2/21/12 EDUC 502: Introduction to Statistics.
Bias and Variance of the Estimator PRML 3.2 Ethem Chp. 4.
Machine Learning 5. Parametric Methods.
CS 2750: Machine Learning The Bias-Variance Tradeoff Prof. Adriana Kovashka University of Pittsburgh January 13, 2016.
LECTURE 06: CLASSIFICATION PT. 2 February 10, 2016 SDS 293 Machine Learning.
LECTURE 07: CLASSIFICATION PT. 3 February 15, 2016 SDS 293 Machine Learning.
LECTURE 03: LINEAR REGRESSION PT. 1 February 1, 2016 SDS 293 Machine Learning.
LECTURE 04: LINEAR REGRESSION PT. 2 February 3, 2016 SDS 293 Machine Learning.
LECTURE 05: CLASSIFICATION PT. 1 February 8, 2016 SDS 293 Machine Learning.
Data Mining Practical Machine Learning Tools and Techniques By I. H. Witten, E. Frank and M. A. Hall Chapter 5: Credibility: Evaluating What’s Been Learned.
LECTURE 16: BEYOND LINEARITY PT. 1 March 28, 2016 SDS 293 Machine Learning.
LECTURE 17: BEYOND LINEARITY PT. 2 March 30, 2016 SDS 293 Machine Learning.
LECTURE 20: SUPPORT VECTOR MACHINES PT. 1 April 11, 2016 SDS 293 Machine Learning.
LECTURE 11: LINEAR MODEL SELECTION PT. 1 March SDS 293 Machine Learning.
LECTURE 12: LINEAR MODEL SELECTION PT. 2 March 7, 2016 SDS 293 Machine Learning.
Statistics 350 Lecture 2. Today Last Day: Section Today: Section 1.6 Homework #1: Chapter 1 Problems (page 33-38): 2, 5, 6, 7, 22, 26, 33, 34,
LECTURE 13: LINEAR MODEL SELECTION PT. 3 March 9, 2016 SDS 293 Machine Learning.
LECTURE 21: SUPPORT VECTOR MACHINES PT. 2 April 13, 2016 SDS 293 Machine Learning.
Machine Learning in Practice Lecture 9 Carolyn Penstein Rosé Language Technologies Institute/ Human-Computer Interaction Institute.
ECE 5984: Introduction to Machine Learning Dhruv Batra Virginia Tech Topics: –(Finish) Model selection –Error decomposition –Bias-Variance Tradeoff –Classification:
LECTURE 15: PARTIAL LEAST SQUARES AND DEALING WITH HIGH DIMENSIONS March 23, 2016 SDS 293 Machine Learning.
Computational Intelligence: Methods and Applications Lecture 14 Bias-variance tradeoff – model selection. Włodzisław Duch Dept. of Informatics, UMK Google:
Lecture 6 Feb. 2, 2015 ANNOUNCEMENT: Lab session will go from 4:20-5:20 based on the poll. (The majority indicated that it would not be a problem to chance,
Statistics 350 Lecture 3.
Matt Gormley Lecture 11 October 5, 2016
Introduction to Statistics for the Social Sciences SBS200 - Lecture Section 001, Spring 2017 Room 150 Harvill Building 9:00 - 9:50 Mondays, Wednesdays.
3.5 General feeling that knowledge of hydrology has improved … but more is needed.
Bias and Variance of the Estimator
Logistic Regression Classification Machine Learning.
Stat 112 Notes 4 Today: Review of p-values for one-sided tests
Bias-variance Trade-off
Machine learning overview
Mathematical Explorations
Presentation transcript:

LECTURE 02: EVALUATING MODELS January 27, 2016 SDS 293 Machine Learning

Announcements / Questions Life Sciences and Technology Fair is tomorrow: 3:30-6pm in the Carroll Room Office hours: does anyone have a conflict?

Outline Evaluating Models Lab pt. 1 – Introduction to R: - Basic Commands - Graphics Overview - Indexing Data - Loading Data - Additional Graphical/Numerical Summaries Lab pt. 2 - Exploring other datasets (time permitting)

Beyond LR Stated goal of this course: explore methods that go beyond standard linear regression

One tool to rule them all…? Question: why not just teach you the best one first?

Answer: it depends No single method dominates over all On a particular data set, for a particular question, one specific method may work well; on a related but not identical dataset or question, another might be better Choosing the right approach is arguably the most challenging aspect of doing statistics in practice So how do we do it?

Measuring “Quality of Fit” One question we might ask: how well do my model’s predictions actually match the observations? What we need: a way to measure how close the predicted response is to the true response Flashback to your stats training: what do we use in regression?

Mean Squared Error True response for the i th observation Prediction our model gives for the i th observation We take the average over all observations Of the squared difference

“Training” MSE This version of MSE is computed using the training data that was used to fit the model Reality check: is this what we care about?

Test MSE Better plan: see how well the model does on observations we didn’t train on Given some never-before-seen examples, we can just calculate the MSE on those using the same method But what if we don’t have any new observations to test? - Can we just use the training MSE? - Why or why not?

Example Avg. training MSE Test MSE

Training vs. Test MSE As the flexibility of the statistical learning method increases, we observe: - a monotone decrease in the training MSE - a U-shape in the test MSE Fun fact: occurs regardless of the data set and statistical method being used As flexibility increases, training MSE will decrease, but the test MSE may not Overfitting

Trade-off between bias and variance The U-shaped curve in the Test MSE is the result of two competing properties: bias and variance Variance refers to the amount by which the model would change if we estimated it using different training data Bias refers to the error that is introduced by approximating a real-life problem (which may be extremely complicated) using a much simpler model

Relationship between bias and variance In general, more flexible methods have higher variance

Relationship between bias and variance In general, more flexible methods have lower bias

Trade-off between bias and variance It is possible to show that the expected test MSE for a given value can be decomposed into three terms: The bias of our model on the test value The variance of our model on the test value The variance of the error terms

Balancing bias and variance We know variance and squared bias are always nonnegative (why?) There’s nothing we can do about the variance of the irreducible error inherent in the model So we’re looking for a method that minimizes the sum of the first two terms… which are (in some sense) competing

Balancing bias and variance It’s easy to build a model with low variance but high bias (how?) Just as easy to build one with low bias but high variance (how?) The challenge: finding a method for which both the variance and the squared bias are low This trade-off is one of the most important recurring themes in this course

What about classification? So far, we’ve only talked about how to evaluate the accuracy of a regression model The idea of a bias-variance trade-off also translates to the classification setting, but we need some minor modifications to deal with qualitative responses For example: we can’t really compute MSE without numerical values, so what can we do instead?

We tally up all the times Where the model’s classification was different from the actual class Training error rate One common approach is to use the training error rate, where we measure the proportion of the times our model incorrectly classifies a training data point: Using an indicator function And take the average

Takeaways Choosing the “right” level of flexibility is critical for success in both the regression and classification settings The bias-variance tradeoff can make this a difficult task In Chapter 5, we’ll return to this topic and explore various methods for estimating test error rates We’ll then use these estimates to find the optimal level of flexibility for a given ML method

Questions?

Lab pt. 1: Introduction to R Basic Commands Graphics Indexing data Loading external data Generating summaries Playing with real data (time permitting!)

Lab pt. 1: Introduction to R

Today’s walkthrough (and likely many others) will be run using: which allows me to build “notebooks” which run live R code (python, too!) in the browser Hint: this is also a nice way to format your homework!

Lab pt. 2: Exploring Other Datasets More datasets from the book - ISLR package - Already installed on Smith Rstudio server  Working locally? > install.packages(‘ISLR’) - Details available at: cran.r-project.org/web/packages/ISLRcran.r-project.org/web/packages/ISLR - Dataset descriptions: Real world data: - Olympic Athletes: goo.gl/1aUnJWgoo.gl/1aUnJW - World Bank Indicators: goo.gl/0QdN9Ugoo.gl/0QdN9U - Airplane Bird Strikes: goo.gl/lFl5ldgoo.gl/lFl5ld - …and a whole bunch more: goo.gl/kcbqfcgoo.gl/kcbqfc

Coming Up Next class: Linear Regression 1: Simple and Multiple LR For planning purposes: Assignment 1 will be posted next week, and will be due the following Weds (Feb. 10 th )