maschinelles lernen mit matlab - matlab expo … · 2 machine learning is everywhere ! image...

20
1 © 2015 The MathWorks, Inc. Jérémy Huard Applikationsingenieur The MathWorks GmbH Maschinelles Lernen mit MATLAB ®

Upload: nguyenkiet

Post on 17-Sep-2018

221 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Maschinelles Lernen mit MATLAB - MATLAB EXPO … · 2 Machine Learning is Everywhere ! Image Recognition ! Speech Recognition ! Stock Prediction ! Medical Diagnosis ! Data Analytics

1 © 2015 The MathWorks, Inc.

Jérémy Huard Applikationsingenieur The MathWorks GmbH

Maschinelles Lernen mit MATLAB®

Page 2: Maschinelles Lernen mit MATLAB - MATLAB EXPO … · 2 Machine Learning is Everywhere ! Image Recognition ! Speech Recognition ! Stock Prediction ! Medical Diagnosis ! Data Analytics

2

Machine Learning is Everywhere

§  Image Recognition §  Speech Recognition §  Stock Prediction §  Medical Diagnosis §  Data Analytics §  Robotics §  and more…

[TBD]

Page 3: Maschinelles Lernen mit MATLAB - MATLAB EXPO … · 2 Machine Learning is Everywhere ! Image Recognition ! Speech Recognition ! Stock Prediction ! Medical Diagnosis ! Data Analytics

3

Machine Learning Machine learning uses data and produces a program to perform a task

Standard Approach Machine Learning Approach

𝑚𝑜𝑑𝑒𝑙  =    =  <█■𝑴𝒂𝒄𝒉𝒊𝒏𝒆@𝑳𝒆𝒂𝒓𝒏𝒊𝒏𝒈@𝑨𝒍𝒈𝒐𝒓𝒊𝒕𝒉𝒎 

>(𝑠𝑒𝑛𝑠𝑜𝑟_𝑑𝑎𝑡𝑎,  𝑎𝑐𝑡𝑖𝑣𝑖𝑡𝑦) ,  𝑎𝑐𝑡𝑖𝑣𝑖𝑡𝑦) )

Computer Program

Machine Learning

𝑚𝑜𝑑𝑒𝑙:Inputs→Outputs Hand Written Program Formula or Equation

If X_acc > 0.5 then “SITTING”

If Y_acc < 4 and Z_acc > 5 then “STANDING”

𝑌↓𝑎𝑐𝑡𝑖𝑣𝑖𝑡𝑦 = 𝛽↓1 𝑋↓𝑎𝑐𝑐 + 𝛽↓2 𝑌↓𝑎𝑐𝑐 + 𝛽↓3 𝑍↓𝑎𝑐𝑐 +  

Task: Human Activity Detection

Page 4: Maschinelles Lernen mit MATLAB - MATLAB EXPO … · 2 Machine Learning is Everywhere ! Image Recognition ! Speech Recognition ! Stock Prediction ! Medical Diagnosis ! Data Analytics

4

Different Types of Learning

Machine Learning

Supervised Learning

Classification

Regression

Unsupervised Learning

•  Discover a good internal representation •  Learn a low dimensional representation

•  Output is a real number (temperature, stock prices).

•  Output is a choice between classes •  (True, False) (Red, Blue, Green)

Page 5: Maschinelles Lernen mit MATLAB - MATLAB EXPO … · 2 Machine Learning is Everywhere ! Image Recognition ! Speech Recognition ! Stock Prediction ! Medical Diagnosis ! Data Analytics

5

“Essentially, all models are wrong, but some are useful”

– George Box

Page 6: Maschinelles Lernen mit MATLAB - MATLAB EXPO … · 2 Machine Learning is Everywhere ! Image Recognition ! Speech Recognition ! Stock Prediction ! Medical Diagnosis ! Data Analytics

6

General Challenges in Machine Learning Hard to get started

Steps Challenge Access, explore and analyze data

Data diversity Numeric, Images, Signals, Text – not always tabular

Preprocess data Lack of domain tools

Filtering and feature extraction Feature selection and transformation

Train models Time consuming Train several models to find the “best”

Assess model performance Avoid pitfalls

Over Fitting Speed-Accuracy-Complexity tradeoffs

Iterate

Page 7: Maschinelles Lernen mit MATLAB - MATLAB EXPO … · 2 Machine Learning is Everywhere ! Image Recognition ! Speech Recognition ! Stock Prediction ! Medical Diagnosis ! Data Analytics

7

MODEL

PREDICTION

Supervised Learning Workflow Train: Iterate till you find the best model

Predict: Integrate trained models into applications

MODEL

SUPERVISED LEARNING

CLASSIFICATION

REGRESSION

PREPROCESS DATA

SUMMARY STATISTICS

PCA FILTERS

CLUSTER ANALYSIS

LOAD DATA

PREPROCESS DATA

SUMMARY STATISTICS

PCA FILTERS

CLUSTER ANALYSIS

NEW DATA

Page 8: Maschinelles Lernen mit MATLAB - MATLAB EXPO … · 2 Machine Learning is Everywhere ! Image Recognition ! Speech Recognition ! Stock Prediction ! Medical Diagnosis ! Data Analytics

8

Statistics and Machine Learning What’s New

Classification Learner §  New app to train models and classify data

using supervised machine learning

Features §  Import and interactively explore data §  Choose kfold or holdout validation §  Train SVM, kNN, bagged trees and other algorithms §  Assess results using classification accuracy, ROC curves and Confusion Matrices §  Export models to the MATLAB or generate MATLAB code

Page 9: Maschinelles Lernen mit MATLAB - MATLAB EXPO … · 2 Machine Learning is Everywhere ! Image Recognition ! Speech Recognition ! Stock Prediction ! Medical Diagnosis ! Data Analytics

9

Train a Model with the Classification Learner App

Page 10: Maschinelles Lernen mit MATLAB - MATLAB EXPO … · 2 Machine Learning is Everywhere ! Image Recognition ! Speech Recognition ! Stock Prediction ! Medical Diagnosis ! Data Analytics

10

Train a Model with the Classification Learner App

1.  Data import and Cross-validation setup

Page 11: Maschinelles Lernen mit MATLAB - MATLAB EXPO … · 2 Machine Learning is Everywhere ! Image Recognition ! Speech Recognition ! Stock Prediction ! Medical Diagnosis ! Data Analytics

11

Train a Model with the Classification Learner App

1.  Data import and Cross-validation setup

2.  Data exploration and feature selection

Page 12: Maschinelles Lernen mit MATLAB - MATLAB EXPO … · 2 Machine Learning is Everywhere ! Image Recognition ! Speech Recognition ! Stock Prediction ! Medical Diagnosis ! Data Analytics

12

Train a Model with the Classification Learner App

1.  Data import and Cross-validation setup

2.  Data exploration and feature selection

3.  Train multiple models

Page 13: Maschinelles Lernen mit MATLAB - MATLAB EXPO … · 2 Machine Learning is Everywhere ! Image Recognition ! Speech Recognition ! Stock Prediction ! Medical Diagnosis ! Data Analytics

13

Train a Model with the Classification Learner App

1.  Data import and Cross-validation setup

2.  Data exploration and feature selection

3.  Train multiple models

Page 14: Maschinelles Lernen mit MATLAB - MATLAB EXPO … · 2 Machine Learning is Everywhere ! Image Recognition ! Speech Recognition ! Stock Prediction ! Medical Diagnosis ! Data Analytics

14

Train a Model with the Classification Learner App

1.  Data import and Cross-validation setup

2.  Data exploration and feature selection

3.  Train multiple models

Page 15: Maschinelles Lernen mit MATLAB - MATLAB EXPO … · 2 Machine Learning is Everywhere ! Image Recognition ! Speech Recognition ! Stock Prediction ! Medical Diagnosis ! Data Analytics

15

Train a Model with the Classification Learner App

1.  Data import and Cross-validation setup

2.  Data exploration and feature selection

3.  Train multiple models

4.  Model comparison and assessment

Page 16: Maschinelles Lernen mit MATLAB - MATLAB EXPO … · 2 Machine Learning is Everywhere ! Image Recognition ! Speech Recognition ! Stock Prediction ! Medical Diagnosis ! Data Analytics

16

Train a Model with the Classification Learner App

1.  Data import and Cross-validation setup

2.  Data exploration and feature selection

3.  Train multiple models

4.  Model comparison and assessment

5.  Share model

Page 17: Maschinelles Lernen mit MATLAB - MATLAB EXPO … · 2 Machine Learning is Everywhere ! Image Recognition ! Speech Recognition ! Stock Prediction ! Medical Diagnosis ! Data Analytics

17

Train a Model with the Classification Learner App

1.  Data import and Cross-validation setup

2.  Data exploration and feature selection

3.  Train multiple models

4.  Model comparison and assessment

5.  Share model or automate process

Page 18: Maschinelles Lernen mit MATLAB - MATLAB EXPO … · 2 Machine Learning is Everywhere ! Image Recognition ! Speech Recognition ! Stock Prediction ! Medical Diagnosis ! Data Analytics

18

Statistics and Machine Learning What’s New?

New: §  Classification Learner app §  Multiclass SVM §  Statistical tests for comparing classifiers §  Kmediods Clustering (robust to outliers) §  C Code Generation for PCA Enhancements: §  Speedup of the kmeans and gmdistribution using the kmeans++ §  Performance enhancements for decision trees and performance curves

Requires MATLAB Coder

Page 19: Maschinelles Lernen mit MATLAB - MATLAB EXPO … · 2 Machine Learning is Everywhere ! Image Recognition ! Speech Recognition ! Stock Prediction ! Medical Diagnosis ! Data Analytics

19

Machine Learning with MATLAB:

§  For complex tasks with no equation or formula

§  Interactive App-driven workflow

§  Flexible architecture for customized workflow

Key Takeaways

Page 20: Maschinelles Lernen mit MATLAB - MATLAB EXPO … · 2 Machine Learning is Everywhere ! Image Recognition ! Speech Recognition ! Stock Prediction ! Medical Diagnosis ! Data Analytics

20

Additional Resources

Documentation mathworks.com/machine-learning

Training