22
Experiments with Machine Learning Yuriy Guts Solutions Architect

Experiments with Machine Learning - GDG Lviv

Embed Size (px)

Citation preview

Page 1: Experiments with Machine Learning - GDG Lviv

Experiments with Machine Learning

Yuriy GutsSolutions Architect

Page 2: Experiments with Machine Learning - GDG Lviv

First Things FirstWhat Is Machine Learning?

Page 3: Experiments with Machine Learning - GDG Lviv

“ A computer program is said to learn from experience Ewith respect to some class of tasks T and performance measure P,if its performance at tasks in T, as measured by P,improves with experience E.

— Tom M. Mitchell

Page 4: Experiments with Machine Learning - GDG Lviv

Categories of Machine Learning

1. Supervised Learning.

2. Unsupervised Learning.

3. Reinforcement Learning.

Page 5: Experiments with Machine Learning - GDG Lviv
Page 6: Experiments with Machine Learning - GDG Lviv
Page 7: Experiments with Machine Learning - GDG Lviv

RegressionPredict a continuous dependent variable

based on independent predictors

Page 8: Experiments with Machine Learning - GDG Lviv
Page 9: Experiments with Machine Learning - GDG Lviv
Page 10: Experiments with Machine Learning - GDG Lviv
Page 11: Experiments with Machine Learning - GDG Lviv

Linear Regression

Page 12: Experiments with Machine Learning - GDG Lviv
Page 13: Experiments with Machine Learning - GDG Lviv
Page 14: Experiments with Machine Learning - GDG Lviv
Page 15: Experiments with Machine Learning - GDG Lviv

ClassificationAssign an observation to some categoryfrom a known discrete list of categories

Page 16: Experiments with Machine Learning - GDG Lviv

Logistic Regression

hypothesis  =  1  /  (1  +  exp(-­‐theta'  *  x));

Page 17: Experiments with Machine Learning - GDG Lviv

Logistic Regression: Cost Function

hypotheses  =  sigmoid(X  *  theta);cost  =  (1  /  m)  *  (-­‐y'  *  log(hypotheses)  -­‐ (1  -­‐ y)'  *  log(1  -­‐ hypotheses));

Page 18: Experiments with Machine Learning - GDG Lviv

Let’s classify human speech!Decide whether a spoken phrase contains the word ‘Google’ or not

Page 19: Experiments with Machine Learning - GDG Lviv

‘Google’ Detector: Feature Mapping

Options for building X[ ]:

Input: Audio file (WAV, 16 bit mono, 44.1 kHz)Output: 1 if it contains the word ‘Google’, otherwise 0

1. Use raw waveform as a feature vector.But: will have 66150 features for a 1.5 second file.Kinda scary, and easy to overfit.

2. Use Mel-Frequency Cepstral Coefficients (MFCC).Believed to be closer to human auditory response.Depending on parameters, can give about 80 features per file.

Page 20: Experiments with Machine Learning - GDG Lviv

[cepstra,  aSpectrum,  pSpectrum]  =  MFCC(waveform);

x  =  [cepstra(1);  cepstra(2);  ...;  cepstra(n)];

Page 21: Experiments with Machine Learning - GDG Lviv

Let’s code it upMATLAB, logistic regression with conjugate gradient optimization

Page 22: Experiments with Machine Learning - GDG Lviv

yuriy . guts  @  gmail . com

linkedin . com / in / yuriyguts

github.com/YuriyGuts/gdg-speech-classifier

Q & A