Machine Learning for dummies with Python EUROPYTHON Javier Arias - - PowerPoint PPT Presentation

machine learning
SMART_READER_LITE
LIVE PREVIEW

Machine Learning for dummies with Python EUROPYTHON Javier Arias - - PowerPoint PPT Presentation

Machine Learning for dummies with Python EUROPYTHON Javier Arias @javier_arilos One day in your life July 2016 One day in your life Time to leave the office One day in your life Tesla autopilot One day in your life Playing music One


slide-1
SLIDE 1

Machine Learning

for dummies with Python EUROPYTHON

Javier Arias @javier_arilos

slide-2
SLIDE 2

One day in your life

July 2016

slide-3
SLIDE 3

One day in your life

Time to leave the office

slide-4
SLIDE 4

One day in your life

Tesla autopilot

slide-5
SLIDE 5

One day in your life

Playing music

slide-6
SLIDE 6

One day in your life

Your photos organized

slide-7
SLIDE 7

One day in your life

Machine Learning is here, it is everywhere and it is going to stay

slide-8
SLIDE 8

About this presentation

Why Machine Learning (ML) matters A journey on Machine Learning Some ML technologies and resources Some basic ML concepts, with code samples

slide-9
SLIDE 9

Machine Learning is the next big thing

slide-10
SLIDE 10

Are machines already intelligent?

slide-11
SLIDE 11

Image-net challenge

2015: machines outperform people

slide-12
SLIDE 12

Chess

1997: Deepblue defeats Kasparov

slide-13
SLIDE 13

Game of Go

2016: AlphaGo wins world champion Lee Sedol

slide-14
SLIDE 14
slide-15
SLIDE 15

The journey

slide-16
SLIDE 16

Learning about ML

MOOC - Massive Open Online Courses Contents by the best universities and companies Udacity, Coursera, EdX

slide-17
SLIDE 17

Udacity - Intro to Machine Learning

Pattern Recognition for Fun and Profit

  • Very well organized contents
  • Python + sklearn
  • Free
  • At your own pace
slide-18
SLIDE 18

Udacity - Intro to Machine Learning

Pattern Recognition for Fun and Profit

slide-19
SLIDE 19

Udacity - Intro to Machine Learning

Pattern Recognition for Fun and Profit

slide-20
SLIDE 20

What is Machine Learning?

slide-21
SLIDE 21

Solving a complex problem

something features

(data)

prediction

slide-22
SLIDE 22

First approach, programming

tell the computer what to do in very tiny steps

slide-23
SLIDE 23

programming does not scale for very complex problems...

First approach, programming

slide-24
SLIDE 24

Machine Learning

show the computer some real world data the algorithm will learn from it

slide-25
SLIDE 25

Machine Learning, implications

we can train computers to do things we do not know how to do

slide-26
SLIDE 26
slide-27
SLIDE 27

ML example: character recognition

Not-MNIST dataset Thousands of 28x28 grayscale images with labels

slide-28
SLIDE 28

features x 1000s labels x 1000s

F G F J

ML step 1: get samples (training data)

slide-29
SLIDE 29

ML step 2: choose an algorithm

Linear regression Support Vector Mach. k-Means Decision Trees Random Forests Neural networks Convolutional NN Naive Bayes

slide-30
SLIDE 30

ML step 3: train your algorithm

features x 1000s labels x 1000s ML algorithm

F G F J

slide-31
SLIDE 31

ML, last step: getting predictions

ML algorithm features

(data)

prediction

D

slide-32
SLIDE 32

Tricky Question

How good are our predictions?

slide-33
SLIDE 33

The Tools

slide-34
SLIDE 34

The Tools: Python

  • Opensource
  • Expressive
  • Interpreted, dynamically typed
  • Widely used many different problems
  • Batteries included: Notebook, Libraries
slide-35
SLIDE 35

The Tools: sklearn

  • Opensource, Python
  • Wonderful documentation
  • Support to full ML lifecycle:

○ Feature engineering ○ Algorithms ○ Validation ○ Datasets

slide-36
SLIDE 36

A summary of ML process

  • Get features (with labels)
  • Choose and configure an algorithm
  • Train your algorithm
  • Do predictions
  • Validate your results
slide-37
SLIDE 37

train your model

tr_ds, _, tr_lbl, _ = train_test_split(dataset, labels, train_size=size, random_state=17) clf = LogisticRegression() clf.fit(tr_ds, tr_lbl) # fit with train dataset and train labels train_ds test_ds dataset

slide-38
SLIDE 38

make predictions

pred = clf.predict(test_dataset)

How good are our predictions?

slide-39
SLIDE 39

accuracy

test_predicions = clf.predict(test_dataset) acc = accuracy_score(test_labels, test_predictions)

slide-40
SLIDE 40

89% accuracy

slide-41
SLIDE 41

Improving prediction results

Training data Algorithm + config

slide-42
SLIDE 42
slide-43
SLIDE 43

Udacity - Deep Learning

Take machine Learning to the next level

ML branch based on algorithms that use multiple processing layers

  • By Google
  • Python and Tensorflow
  • No wine for the moment :-(
slide-44
SLIDE 44

The Tools: TensorFlow

  • Opensource, Python
  • Deep Learning
  • Data flow graphs.

○ Nodes: mathematical operations ○ Edges: Tensors, multidimensional arrays

slide-45
SLIDE 45

Simplest Neural Network

weight b i a s

S O F T M A X

X Y PRED

weight b i a s

LAYER 1 LAYER 2

* +

relu

* +

softmax

slide-46
SLIDE 46

Deep Learning as a chain of operations

slide-47
SLIDE 47

Let’s recap

slide-48
SLIDE 48
slide-49
SLIDE 49
slide-50
SLIDE 50
slide-51
SLIDE 51
slide-52
SLIDE 52
slide-53
SLIDE 53
slide-54
SLIDE 54
slide-55
SLIDE 55

Thank you for your attention