LECTURE 02: EVALUATING MODELS. September 13, 2017 SDS 293: Machine Learning

Similar documents
Python Machine Learning

Lecture 1: Machine Learning Basics

Machine Learning and Data Mining. Ensembles of Learners. Prof. Alexander Ihler

STUDENT MOODLE ORIENTATION

CS Machine Learning

Spring 2014 SYLLABUS Michigan State University STT 430: Probability and Statistics for Engineering

(Sub)Gradient Descent

CS 1103 Computer Science I Honors. Fall Instructor Muller. Syllabus

Assignment 1: Predicting Amazon Review Ratings

MGT/MGP/MGB 261: Investment Analysis

Business Analytics and Information Tech COURSE NUMBER: 33:136:494 COURSE TITLE: Data Mining and Business Intelligence

Course Content Concepts

M55205-Mastering Microsoft Project 2016

Lahore University of Management Sciences. FINN 321 Econometrics Fall Semester 2017

LEARNER VARIABILITY AND UNIVERSAL DESIGN FOR LEARNING

CSL465/603 - Machine Learning

CS4491/CS 7265 BIG DATA ANALYTICS INTRODUCTION TO THE COURSE. Mingon Kang, PhD Computer Science, Kennesaw State University

STA 225: Introductory Statistics (CT)

Introduction to Ensemble Learning Featuring Successes in the Netflix Prize Competition

Detailed course syllabus

Ryerson University Sociology SOC 483: Advanced Research and Statistics

Evening and Weekend College. College on YOUR time!

P-4: Differentiate your plans to fit your students

Discovering Statistics

THE VIRTUAL WELDING REVOLUTION HAS ARRIVED... AND IT S ON THE MOVE!

CS 101 Computer Science I Fall Instructor Muller. Syllabus

Page 1 of 8 REQUIRED MATERIALS:

Tour. English Discoveries Online

EDCI 699 Statistics: Content, Process, Application COURSE SYLLABUS: SPRING 2016

Sociology 521: Social Statistics and Quantitative Methods I Spring 2013 Mondays 2 5pm Kap 305 Computer Lab. Course Website

Introduction to Causal Inference. Problem Set 1. Required Problems

EGRHS Course Fair. Science & Math AP & IB Courses

Learning From the Past with Experiment Databases

ALL-IN-ONE MEETING GUIDE THE ECONOMICS OF WELL-BEING

Biology 1 General Biology, Lecture Sections: 47231, and Fall 2017

DOCTORAL SCHOOL TRAINING AND DEVELOPMENT PROGRAMME

CS 100: Principles of Computing

Module 12. Machine Learning. Version 2 CSE IIT, Kharagpur

Quantitative analysis with statistics (and ponies) (Some slides, pony-based examples from Blase Ur)

Laboratorio di Intelligenza Artificiale e Robotica

B. How to write a research paper

GIS 5049: GIS for Non Majors Department of Environmental Science, Policy and Geography University of South Florida St. Petersburg Spring 2011

Spring 2015 IET4451 Systems Simulation Course Syllabus for Traditional, Hybrid, and Online Classes

Twitter Sentiment Classification on Sanders Data using Hybrid Approach

Introduction, Organization Overview of NLP, Main Issues

Foothill College Summer 2016

Instructor: Mario D. Garrett, Ph.D. Phone: Office: Hepner Hall (HH) 100

The 9 th International Scientific Conference elearning and software for Education Bucharest, April 25-26, / X

A Pumpkin Grows. Written by Linda D. Bullock and illustrated by Debby Fisher

GRADUATE STUDENT HANDBOOK Master of Science Programs in Biostatistics

Research computing Results

Machine Learning and Development Policy

Probability and Statistics Curriculum Pacing Guide

Getting Started with Deliberate Practice

CHMB16H3 TECHNIQUES IN ANALYTICAL CHEMISTRY

GRADUATE PROGRAM Department of Materials Science and Engineering, Drexel University Graduate Advisor: Prof. Caroline Schauer, Ph.D.

Office of Planning and Budgets. Provost Market for Fiscal Year Resource Guide

Probabilistic Latent Semantic Analysis

Managerial Decision Making

University of Groningen. Systemen, planning, netwerken Bosman, Aart

Intel-powered Classmate PC. SMART Response* Training Foils. Version 2.0

Laboratorio di Intelligenza Artificiale e Robotica

Using NVivo to Organize Literature Reviews J.J. Roth April 20, Goals of Literature Reviews

Computer Software Evaluation Form

Answers To Hawkes Learning Systems Intermediate Algebra

MATH 1A: Calculus I Sec 01 Winter 2017 Room E31 MTWThF 8:30-9:20AM

Android App Development for Beginners

ENEE 302h: Digital Electronics, Fall 2005 Prof. Bruce Jacob

One Hour of Code 10 million students, A foundation for success

TU-E2090 Research Assignment in Operations Management and Services

LEARN TO PROGRAM, SECOND EDITION (THE FACETS OF RUBY SERIES) BY CHRIS PINE

Reducing Features to Improve Bug Prediction

On Human Computer Interaction, HCI. Dr. Saif al Zahir Electrical and Computer Engineering Department UBC

CIS 121 INTRODUCTION TO COMPUTER INFORMATION SYSTEMS - SYLLABUS

Lecture 1: Basic Concepts of Machine Learning

FINN FINANCIAL MANAGEMENT Spring 2014

Houghton Mifflin Online Assessment System Walkthrough Guide

Edexcel GCSE. Statistics 1389 Paper 1H. June Mark Scheme. Statistics Edexcel GCSE

Carnegie Mellon University Department of Computer Science /615 - Database Applications C. Faloutsos & A. Pavlo, Spring 2014.

MTH 141 Calculus 1 Syllabus Spring 2017

Discovering Statistics

November 17, 2017 ARIZONA STATE UNIVERSITY. ADDENDUM 3 RFP Digital Integrated Enrollment Support for Students

Protocol for using the Classroom Walkthrough Observation Instrument

Algorithms and Data Structures (NWI-IBC027)

What to Do When Conflict Happens

KOMAR UNIVERSITY OF SCIENCE AND TECHNOLOGY (KUST)

content First Introductory book to cover CAPM First to differentiate expected and required returns First to discuss the intrinsic value of stocks

Physics 270: Experimental Physics

COMMUNICATION & NETWORKING. How can I use the phone and to communicate effectively with adults?

success. It will place emphasis on:

How to make an A in Physics 101/102. Submitted by students who earned an A in PHYS 101 and PHYS 102.

ACTL5103 Stochastic Modelling For Actuaries. Course Outline Semester 2, 2014

San José State University Department of Marketing and Decision Sciences BUS 90-06/ Business Statistics Spring 2017 January 26 to May 16, 2017

UNDERSTANDING DECISION-MAKING IN RUGBY By. Dave Hadfield Sport Psychologist & Coaching Consultant Wellington and Hurricanes Rugby.

Emporia State University Degree Works Training User Guide Advisor

EDIT 576 (2 credits) Mobile Learning and Applications Fall Semester 2015 August 31 October 18, 2015 Fully Online Course

BIOL 2421 Microbiology Course Syllabus:

NATIONAL CENTER FOR EDUCATION STATISTICS RESPONSE TO RECOMMENDATIONS OF THE NATIONAL ASSESSMENT GOVERNING BOARD AD HOC COMMITTEE ON.

Get Instant Access to ebook Palatine PDF at Our Huge Library PALATINE PDF. ==> Download: PALATINE PDF

Penn State University - University Park MATH 140 Instructor Syllabus, Calculus with Analytic Geometry I Fall 2010

Transcription:

LECTURE 02: EVALUATING MODELS September 13, 2017 SDS 293: Machine Learning

Announcements / Questions Jordan s office hours: Monday 10:30am noon - does anyone have a permanent conflict? Textbook If you like to read ahead, pages are posted on the course website for each lecture

Outline Finish course overview - General info - Topics - Textbook - Grading - Expectations Evaluating models - Regression - Classification - Bias-variance trade off Quick R demo (time permitting)

General information Course website: cs.smith.edu/~jcrouser/sds293 Slack Channel is live: sds293.slack.com Syllabus (with slides before each lecture) Textbook download Assignments Grading Accommodations

What we ll cover in this class Ch. 2: Statistical Learning Overview (today) Ch. 3: Linear Regression Ch. 4: Classification Ch. 5: Resampling Methods Ch. 6: Linear Model Selection Ch. 7: Beyond Linearity Ch. 8: Tree-Based Methods Ch. 9: Support Vector Machines Ch. 10: Unsupervised Learning

About the textbook Digital edition available for free at: www.statlearning.com Lots of useful R source code (including labs) The ISLR package includes all the datasets referenced in the book: > install.packages( ISLR ) Many excellent GitHub repositories of solution sets available...wait, what?

Disclaimer this class is an experiment in constructionism (the idea that people learn most effectively when they re building personally-meaningful things) My job as the instructor:

Assignments and grading Labs (20%): run during regular class time, help you get a hands-on look at how various ML techniques work 8 (short) Assignments (40%): built to help you become comfortable with applying the techniques Engagement (20%): - Show up, ask questions, engage on Slack - Take DataCamp courses - Go to bonus lectures - etc. Course project (20%)

Preparing for labs in R Two options available for using R: 1. You can install R Studio on your own machine: rstudio.com 2. You can use Smith s RStudio Server: rstudio.smith.edu:8787 If you re unfamiliar with R, you might want to take a look at Smith s Getting Started with R tutorial: www.math.smith.edu/tutorial/r.html

Preparing for labs in python I like the Anaconda distribution from continuum.io, but you re welcome to use whatever you like You ll need to know how to install packages Either 2.7 or 3.6 is fine we ll run into bugs either way J

Course project (20%) Topic: ANYTHING YOU WANT Goals: - Learn how to break big, unwieldy questions down into clear, manageable problems - Figure out if/how the techniques we cover in class apply to your specific problems - Use ML to address them Several (graded) milestones along the way Demos and discussion on the final day of class More on this later

What I expect from you You like difficult problems and you re excited about figuring stuff out You have a solid foundation in introductory statistics (or are ready to work to get there) You are proficient in coding and debugging (or are ready to work to get there) You re willing to ask questions

What you can expect from me I value your learning experience and process I m flexible w.r.t. the topics we cover I m happy to share my professional connections Somewhat limited in-person access, but I respond quickly on Slack

Course learning objectives 1. Understand what ML is (and isn t) 2. Learn some foundational methods / tools 3. Be able to choose methods that make sense

One model to rule them all? Question: why not just teach you the best method first?

Answer: there isn t one No single method dominates One method may prove useful in answering some questions on a given data set On a related (not identical) dataset or question, another might prevail

Measuring quality of fit Question we often ask: how good is my model? What we usually mean: how well do my model s predictions actually match the observations? How do we choose the right approach?

Mean squared error True response for the i th observation MSE = 1 n n i=1 ( y ŷ ) 2 i i We take the average over all observations Prediction our model gives for the i th observation

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 What if we don t have any new observations to test? - Can we just use the training MSE? - Why or why not?

Example Y 2 4 6 8 10 12 Mean Squared Error 0.0 0.5 1.0 1.5 2.0 2.5 Test MSE Avg. training MSE 0 20 40 60 80 100 2 5 10 20 X Flexibility

Training vs. test MSE As flexibility : - monotone in training MSE - U-shape in the test MSE Fun fact: occurs regardless of data or statistical method This is called overfitting 0.0 0.5 1.0 1.5 2.0 2.5 Test MSE Overfitting Avg. training MSE 2 5 10 20 Flexibility

Training vs. test MSE Question: why does this happen?

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: the amount the model would change if we had different training data Bias: the error introduced by approximating a complex phenomenon using a simple model

Relationship between bias and variance In general, more flexible methods have higher variance Y 2 4 6 8 10 12 Y 2 4 6 8 10 12 0 20 40 60 80 100 X 0 20 40 60 80 100 X

Relationship between bias and variance In general, more flexible methods have lower bias Y 2 4 6 8 10 12 Y 2 4 6 8 10 12 0 20 40 60 80 100 X 0 20 40 60 80 100 X

Trade-off between bias and variance Expected test MSE can be decomposed into three terms: ( ) 2 = Var( ˆf ( x )) 0 + Bias( ˆf ( x )) 0 E y 0 ˆf ( x ) 0 2 +Var ε ( ) The variance of our model on the test value The bias of our model on the test value The variance of the error terms

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: how to evaluate a regression model Bias-variance trade-off also present in classification Need a way to deal with qualitative responses What are some options?

Training error rate Common approach: measure the proportion of the times our model incorrectly classifies a training data point and take the average 1 n n i=1 I ( y ŷ ) i i where the model s tally up classification was different all the times from the true class

Takeaways Choosing the right level of flexibility is critical (in both regression and classification) Bias-variance trade off makes this challenging Coming up in Ch. 5: - Various methods for estimating test error rates - How to use these estimates to find the optimal level of flexibility

Reading In today s class, we covered ISLR: p. 29-37 Next class, we ll have a crash course in linear regression (ISLR: p. p.59-82)

Introduction to R Basic commands Loading external data Data wrangling 101 Graphics Generating summaries

Introduction to R

Introduction to R

Introduction to R

Introduction to R Today s walkthrough was run using R Markdown: This allows me to build notebooks to combine step-bystep code and instructions/descriptions Want to learn more? Check out the Reporting with R Markdown course on DataCamp!

For Monday Make sure you can access the slack channel Install the tool(s) you re planning to use for lab Need a refresher on something? Just ask!

#questions?