Shih-Yang Su Virginia Tech

Slides:



Advertisements
Similar presentations
CHAPTER 2: Supervised Learning. Lecture Notes for E Alpaydın 2004 Introduction to Machine Learning © The MIT Press (V1.1) 2 Learning a Class from Examples.
Advertisements

ETHEM ALPAYDIN © The MIT Press, Lecture Slides for.
INTRODUCTION TO Machine Learning ETHEM ALPAYDIN © The MIT Press, Lecture Slides for.
Part I: Classification and Bayesian Learning
Classification and Prediction: Regression Analysis
Evaluating Hypotheses Reading: Coursepack: Learning From Examples, Section 4 (pp )
Model representation Linear regression with one variable
Andrew Ng Linear regression with one variable Model representation Machine Learning.
ISCG8025 Machine Learning for Intelligent Data and Information Processing Week 3 Practical Notes Regularisation *Courtesy of Associate Professor Andrew.
Introduction to Machine Learning Supervised Learning 姓名 : 李政軒.
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.
Concept learning, Regression Adapted from slides from Alpaydin’s book and slides by Professor Doina Precup, Mcgill University.
Bias and Variance of the Estimator PRML 3.2 Ethem Chp. 4.
The problem of overfitting
INTRODUCTION TO MACHINE LEARNING 3RD EDITION ETHEM ALPAYDIN © The MIT Press, Lecture.
M Machine Learning F# and Accord.net.
Review of fundamental 1 Data mining in 1D: curve fitting by LLS Approximation-generalization tradeoff First homework assignment.
Machine Learning with Discriminative Methods Lecture 05 – Doing it 1 CS Spring 2015 Alex Berg.
Over-fitting and Regularization Chapter 4 textbook Lectures 11 and 12 on amlbook.com.
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.
Machine Learning CUNY Graduate Center Lecture 6: Linear Regression II.
MACHINE LEARNING 3. Supervised Learning. Learning a Class from Examples Based on E Alpaydın 2004 Introduction to Machine Learning © The MIT Press (V1.1)
Evaluating Classifiers. Reading for this topic: T. Fawcett, An introduction to ROC analysis, Sections 1-4, 7 (linked from class website)
PatReco: Model and Feature Selection Alexandros Potamianos Dept of ECE, Tech. Univ. of Crete Fall
ECE 5984: Introduction to Machine Learning Dhruv Batra Virginia Tech Topics: –(Finish) Model selection –Error decomposition –Bias-Variance Tradeoff –Classification:
Computational Intelligence: Methods and Applications Lecture 14 Bias-variance tradeoff – model selection. Włodzisław Duch Dept. of Informatics, UMK Google:
Support Vector Machines
Evaluating Classifiers
ECE 5424: Introduction to Machine Learning
Lecture 19. Review CS 109A/AC 209A/STAT 121A Data Science: Harvard University Fall 2016 Instructors: P. Protopapas, K. Rader, W. Pan.
Goodfellow: Chap 5 Machine Learning Basics
Machine Learning – Regression David Fenyő
CSE 4705 Artificial Intelligence
Project 4: Facial Image Analysis with Support Vector Machines
CH. 2: Supervised Learning
ECE 5424: Introduction to Machine Learning
Christoph Eick: Learning Models to Predict and Classify 1 Learning from Examples Example of Learning from Examples  Classification: Is car x a family.
Softmax Classifier + Generalization
Bias and Variance of the Estimator
Machine Learning – Regression David Fenyő
Probabilistic Models for Linear Regression
INTRODUCTION TO Machine Learning
Logistic Regression Classification Machine Learning.
The basic notions related to machine learning
CS 2750: Machine Learning Line Fitting + Bias-Variance Trade-off
Hyperparameters, bias-variance tradeoff, validation
10701 / Machine Learning Today: - Cross validation,
Linear Model Selection and regularization
CS 1675: Intro to Machine Learning Regression and Overfitting
Overfitting and Underfitting
Bias-variance Trade-off
Support Vector Machine I
Basis Expansions and Generalized Additive Models (2)
Neural Networks II Chen Gao Virginia Tech ECE-5424G / CS-5824
Model generalization Brief summary of methods
Softmax Classifier.
Where does the error come from?
Neural Networks II Chen Gao Virginia Tech ECE-5424G / CS-5824
The Bias-Variance Trade-Off
Multiple features Linear Regression with multiple variables
Multiple features Linear Regression with multiple variables
Derek Hoiem CS 598, Spring 2009 Jan 27, 2009
INTRODUCTION TO Machine Learning
INTRODUCTION TO Machine Learning 3rd Edition
Introduction to Machine learning
Support Vector Machines 2
Presentation transcript:

Shih-Yang Su Virginia Tech Diagnosing ML System Shih-Yang Su Virginia Tech ECE-5424G / CS-5824 Spring 2019

Today's Lectures How to fix your learning algorithm Basically ZERO MATH

Debugging a learning algorithm You have built you awesome linear regression model predicting price Work perfectly on you testing data Source: Andrew Ng

Debugging a learning algorithm You have built you awesome linear regression model predicting price Work perfectly on you testing data Then it fails miserably when you test it on the new data you collected Source: Andrew Ng

Debugging a learning algorithm You have built you awesome linear regression model predicting price Work perfectly on you testing data Then it fails miserably when you test it on the new data you collected What to do now? Source: Andrew Ng

Things You Can Try Get more data Try different features Try tuning your hyperparameter

Things You Can Try Get more data Try different features Try tuning your hyperparameter But which should I try first?

Diagnosing Machine Learning System Figure out what is wrong first Diagnosing your system takes time, but it can save your time as well Ultimate goal: low generalization error

Diagnosing Machine Learning System Figure out what is wrong first Diagnosing your system takes time, but it can save your time as well Ultimate goal: low generalization error Source: reddit?

Diagnosing Machine Learning System Figure out what is wrong first Diagnosing your system takes time, but it can save your time as well Ultimate goal: low generalization error Source: reddit?

Problem: Fail to Generalize Model does not generalize to unseen data Fail to predict things that are not in training sample Pick a model that has lower generalization error

Evaluate Your Hypothesis Price ($) Price ($) Price ($) Size (ft) Size (ft) Size (ft) Source: Andrew Ng

Evaluate Your Hypothesis Price ($) Price ($) Price ($) Size (ft) Size (ft) Size (ft) Underfit Just right Overfit Source: Andrew Ng

Evaluate Your Hypothesis Price ($) Price ($) Price ($) Size (ft) Size (ft) Size (ft) Underfit Just right Overfit What if the feature dimension is too high? Source: Andrew Ng

Model Selection Model does not generalize to unseen data Fail to predict things that are not in training sample Pick a model that has lower generalization error

Model Selection Model does not generalize to unseen data Fail to predict things that are not in training sample Pick a model that has lower generalization error How to evaluate generalization error?

Model Selection Model does not generalize to unseen data Fail to predict things that are not in training sample Pick a model that has lower generalization error How to evaluate generalization error? Split your data into train, validation, and test set. Use test set error as an estimator of generalization error

Model Selection Training error Validation error Test error

Model Selection Training error Validation error Test error Procedure: Step 1. Train on training set Step 2. Evaluate validation error Step 3. Pick the best model based on Step 2. Step 4. Evaluate the test error

Bias/Variance Trade-off Price ($) Price ($) Price ($) Size (ft) Size (ft) Size (ft) Underfit Overfit Just right Source: Andrew Ng

Bias/Variance Trade-off Price ($) Price ($) Price ($) Size (ft) Size (ft) Size (ft) Underfit High bias Overfit High Variance Just right Source: Andrew Ng

Bias/Variance Trade-off Price ($) Price ($) Price ($) Size (ft) Size (ft) Size (ft) Underfit High bias Too simple Overfit High Variance Too Complex Just right Source: Andrew Ng

Linear Regression with Regularization Price ($) Price ($) Price ($) Size (ft) Size (ft) Size (ft) Underfit High bias Too simple Too much regularization Overfit High Variance Too Complex Too little regularization Just right Source: Andrew Ng

Bias / Variance Trade-off Training error Cross-validation error Loss Degree of Polynomial Source: Andrew Ng

Bias / Variance Trade-off Training error Cross-validation error High bias High Variance Loss Degree of Polynomial

Bias / Variance Trade-off with Regularization Training error Cross-validation error Loss λ Source: Andrew Ng

Bias / Variance Trade-off with Regularization Training error Cross-validation error High Variance High bias Loss λ Source: Andrew Ng

Problem: Fail to Generalize Should we get more data?

Problem: Fail to Generalize Should we get more data? Getting more data does not always help

Problem: Fail to Generalize Should we get more data? Getting more data does not always help How do we know if we should collect more data?

Learning Curve m=1 m=2 m=3 m=4 m=5 m=6

Learning Curve m=1 m=2 m=3 m=4 m=5 m=6

Learning Curve

Learning Curve Underfit High bias Overfit High Variance

Learning Curve Does adding more data help? Price ($) Size (ft) Underfit High bias

Learning Curve Does adding more data help? Price ($) Size (ft) Underfit High bias

Learning Curve Does adding more data help? Price ($) Size (ft) Underfit High bias

Learning Curve Does adding more data help? Price ($) Price ($) Size (ft) Size (ft) More data doesn't help when your model has high bias

Learning Curve Does adding more data help? Price ($) Size (ft) Overfit High Variance

Learning Curve Does adding more data help? Price ($) Size (ft) Overfit High Variance

Learning Curve Does adding more data help? Price ($) Price ($) Size (ft) Size (ft) More data is likely to help when your model has high variance

Things You Can Try Get more data Try different features When you have high variance Try different features Adding feature helps fix high bias Using smaller sets of feature fix high variance Try tuning your hyperparameter Decrease regularization when bias is high Increase regularization when variance is high

Things You Can Try Get more data Try different features When you have high variance Try different features Adding feature helps fix high bias Using smaller sets of feature fix high variance Try tuning your hyperparameter Decrease regularization when bias is high Increase regularization when variance is high Analyze your model before you act