mastering the 80% of analytics: what data scientists really do

127
Mastering the 80% of Analytics What Data Scientists Really Do Mik, PhD @AvrioAnalytics

Upload: avrio-analytics

Post on 22-Mar-2017

140 views

Category:

Data & Analytics


2 download

TRANSCRIPT

Page 1: Mastering the 80% of Analytics: What Data Scientists Really Do

Mastering the 80% of Analytics

What Data Scientists Really Do

Mik, PhD @AvrioAnalytics

Page 2: Mastering the 80% of Analytics: What Data Scientists Really Do

Boss Parents

Me Reality

Page 3: Mastering the 80% of Analytics: What Data Scientists Really Do

Boss Parents

Me Reality

Page 4: Mastering the 80% of Analytics: What Data Scientists Really Do

Caveat

•Data Science is very broad

•This is a particular perspective

•Mathematician

•Predictive algorithm developer

•Very brief

Page 5: Mastering the 80% of Analytics: What Data Scientists Really Do

A Day in the LifeWrangling

Modeling

FeaturesR

esul

ts

Page 6: Mastering the 80% of Analytics: What Data Scientists Really Do

What is “Wrangling”?•Data:

•Getting

•Formatting

•Cleaning

Page 7: Mastering the 80% of Analytics: What Data Scientists Really Do

What is “Wrangling”?•Data:

•Getting

•Formatting

•Cleaning

Data Janitorial Work

Page 8: Mastering the 80% of Analytics: What Data Scientists Really Do

Getting the Data

•Myriad of sources

Page 9: Mastering the 80% of Analytics: What Data Scientists Really Do

Getting the Data

•Myriad of sources

•Varying collection, storage and maintenance

Page 10: Mastering the 80% of Analytics: What Data Scientists Really Do

Getting the Data

•Myriad of sources

•Varying collection, storage and maintenance

•Most people just don’t care

Page 11: Mastering the 80% of Analytics: What Data Scientists Really Do

Getting the Data

•Myriad of sources

•Varying collection, storage and maintenance

•Most people just don’t care

•At least not soon enough

Page 12: Mastering the 80% of Analytics: What Data Scientists Really Do

Got it. Now what?

•Structured: in a consistent and defined format

Page 13: Mastering the 80% of Analytics: What Data Scientists Really Do

Got it. Now what?

•Structured: in a consistent and defined format

•Unstructured: no consistent format

Page 14: Mastering the 80% of Analytics: What Data Scientists Really Do

Got it. Now what?

•Structured: in a consistent and defined format

•Unstructured: no consistent format

•Text data

Page 15: Mastering the 80% of Analytics: What Data Scientists Really Do

Got it. Now what?

•Structured: in a consistent and defined format

•Unstructured: no consistent format

•Text data

Movie Rating

Star Wars 5 StarsI loved the new Star Wars,

definitely 5/5 stars!

Page 16: Mastering the 80% of Analytics: What Data Scientists Really Do

Formatting

•Alignment

Page 17: Mastering the 80% of Analytics: What Data Scientists Really Do

Formatting

•Alignment

•Unions, intersections, grouping

Page 18: Mastering the 80% of Analytics: What Data Scientists Really Do

Formatting

•Alignment

•Unions, intersections, grouping

•Transformations

Page 19: Mastering the 80% of Analytics: What Data Scientists Really Do

FormattingTime Username Views

12:30 jsmith 32

12:45 mik 27

1:00 dmartin 8

1:15 jsmith 46

Time Username Views

12:20 gwarren 12

12:30 lpeabody 53

12:40 dmartin 20

12:50 hjohnson 5

Page 20: Mastering the 80% of Analytics: What Data Scientists Really Do

Formatting

Username Views

jsmith 32, 46

Page 21: Mastering the 80% of Analytics: What Data Scientists Really Do

Data is Dirty Business

•Duplicates

Page 22: Mastering the 80% of Analytics: What Data Scientists Really Do

Data is Dirty Business

•Duplicates

•Missing values

Page 23: Mastering the 80% of Analytics: What Data Scientists Really Do

Data is Dirty Business

•Duplicates

•Missing values

• Ill-formed values

Page 24: Mastering the 80% of Analytics: What Data Scientists Really Do

Data is Dirty Business

•Duplicates

•Missing values

• Ill-formed values

•Wrong values

Page 25: Mastering the 80% of Analytics: What Data Scientists Really Do

Data is Dirty Business

•Duplicates

•Missing values

• Ill-formed values

•Wrong values

Similar in effect

Page 26: Mastering the 80% of Analytics: What Data Scientists Really Do

Data is Dirty Business

•Duplicates

•Missing values

• Ill-formed values

•Wrong values

Page 27: Mastering the 80% of Analytics: What Data Scientists Really Do

Types of Missing-ness

•MCAR: Missing Completely at Random

Page 28: Mastering the 80% of Analytics: What Data Scientists Really Do

Types of Missing-ness

•MCAR: Missing Completely at Random

•MAR: Missing at Random

Page 29: Mastering the 80% of Analytics: What Data Scientists Really Do

Types of Missing-ness

•MCAR: Missing Completely at Random

•MAR: Missing at Random

•MNAR: Missing Not at Random

Page 30: Mastering the 80% of Analytics: What Data Scientists Really Do

Types of Missing-ness

•MCAR: Missing Completely at Random

•MAR: Missing at Random

•MNAR: Missing Not at Random

Bad

Worse

Page 31: Mastering the 80% of Analytics: What Data Scientists Really Do

Dealing with Missing DataX Y Z

129 1 40110 3210 32

989 65

Page 32: Mastering the 80% of Analytics: What Data Scientists Really Do

Dealing with Missing Data

•DeletionX Y Z

129 1 40110 3210 32

989 65

Page 33: Mastering the 80% of Analytics: What Data Scientists Really Do

Dealing with Missing Data

•Deletion

•Pairwise

•Listwise

X Y Z129 1 40110 3210 32

989 65

Page 34: Mastering the 80% of Analytics: What Data Scientists Really Do

Dealing with Missing Data

•Deletion

•Pairwise

•Listwise

X Y Z129 1 40110 3210 32

989 65

X Z129 40210 32

PairwiseX Y Z

129 40

Listwise

Page 35: Mastering the 80% of Analytics: What Data Scientists Really Do

Dealing with Missing Data

• Imputation

Page 36: Mastering the 80% of Analytics: What Data Scientists Really Do

Dealing with Missing Data

• Imputation

•Mean substitution

•Regression

Page 37: Mastering the 80% of Analytics: What Data Scientists Really Do

Dealing with Missing Data

•Multiple Imputation

Page 38: Mastering the 80% of Analytics: What Data Scientists Really Do

Dealing with Missing Data

•Multiple Imputation

•Stochastic simulation

Page 39: Mastering the 80% of Analytics: What Data Scientists Really Do

Dealing with Missing Data

•Multiple Imputation

•Stochastic simulation

•Must know distribution

Page 40: Mastering the 80% of Analytics: What Data Scientists Really Do

Gotchas

•Sampling Error

Page 41: Mastering the 80% of Analytics: What Data Scientists Really Do

Gotchas

•Sampling Error

•Statistical Power

Page 42: Mastering the 80% of Analytics: What Data Scientists Really Do

Gotchas

•Sampling Error

•Statistical Power

•Population Parameters

Page 43: Mastering the 80% of Analytics: What Data Scientists Really Do

Gotchas

•Sampling Error

•Statistical Power

•Population Parameters

•Propagation

Page 44: Mastering the 80% of Analytics: What Data Scientists Really Do

So what do I do?

•Approaches vary quite a lot

Page 45: Mastering the 80% of Analytics: What Data Scientists Really Do

So what do I do?

•Approaches vary quite a lot

•MCAR, MAR hard to prove

Page 46: Mastering the 80% of Analytics: What Data Scientists Really Do

So what do I do?

•Approaches vary quite a lot

•MCAR, MAR hard to prove

•Principle of Least Harm

Page 47: Mastering the 80% of Analytics: What Data Scientists Really Do

60% - 80% of Work

Page 48: Mastering the 80% of Analytics: What Data Scientists Really Do

Cleaning Done! Now the fun!

•Almost…

Page 49: Mastering the 80% of Analytics: What Data Scientists Really Do

Cleaning Done! Now the fun!

•Almost…

•Clean data is still “raw”

Page 50: Mastering the 80% of Analytics: What Data Scientists Really Do

Cleaning Done! Now the fun!

•Almost…

•Clean data is still “raw”

•Features: pre-processed for modeling

Page 51: Mastering the 80% of Analytics: What Data Scientists Really Do

Feature Engineering

•A lot of data is useless

Page 52: Mastering the 80% of Analytics: What Data Scientists Really Do

Feature Engineering

•A lot of data is useless

•Filter, slice, transform

Page 53: Mastering the 80% of Analytics: What Data Scientists Really Do

Feature Engineering

•A lot of data is useless

•Filter, slice, transform

•Singular idea: What’s the main driver?

Page 54: Mastering the 80% of Analytics: What Data Scientists Really Do

Feature Engineering

•Considerations

•Relevance

•Redundancy

Page 55: Mastering the 80% of Analytics: What Data Scientists Really Do

Feature Engineering

•Considerations

•Relevance

•Redundancy

•Curse of Dimensionality

Page 56: Mastering the 80% of Analytics: What Data Scientists Really Do

Feature Engineering Methods

• PCA

• Edge Detection

• Blob Detection

• Auto encoding

• Kernel PCA

• Partial Least Squares

• Generalized Least Squares

• Direct Modeling

• Isomapping

• Mutual Information Theory

• Information Entropy Theory

• ICA

• MDR

• Latent Factors

• MPCA

• LSA

• Statistical Moments

• Random Projections

•De-Noising

•Weighting

•Patch Extraction

•Functional Mapping

•Discretization

•Filtering

•FFT

•Smoothing

•Density Mapping

Page 57: Mastering the 80% of Analytics: What Data Scientists Really Do

Feature Engineering

• It’s hard

Page 58: Mastering the 80% of Analytics: What Data Scientists Really Do

Feature Engineering

• It’s hard

•Analysis + Domain knowledge

Page 59: Mastering the 80% of Analytics: What Data Scientists Really Do

Feature Engineering

• It’s hard

•Analysis + Domain knowledge

•…Deserves a presentation on its own

Page 60: Mastering the 80% of Analytics: What Data Scientists Really Do

Feature Engineering

• It’s hard

•Analysis + Domain knowledge

•…Deserves a presentation on its own

•Features are input to machine learning

Page 61: Mastering the 80% of Analytics: What Data Scientists Really Do

Now the fun stuff (finally)

•ML: computer acts without explicit program

Page 62: Mastering the 80% of Analytics: What Data Scientists Really Do

Now the fun stuff (finally)

•ML: computer acts without explicit program

•Utilizes empirical data to “teach” a process

Page 63: Mastering the 80% of Analytics: What Data Scientists Really Do

Now the fun stuff (finally)

•ML: computer acts without explicit program

•Utilizes empirical data to “teach” a process

•Pattern Rec. -> ML -> Deep Learning

Page 64: Mastering the 80% of Analytics: What Data Scientists Really Do

Now the fun stuff (finally)

•ML: computer acts without explicit program

•Utilizes empirical data to “teach” a process

•Pattern Rec. -> ML -> Deep Learning

•Buzzwords abound

Page 65: Mastering the 80% of Analytics: What Data Scientists Really Do

Now the fun stuff (finally)

•ML: computer acts without explicit program

•Utilizes empirical data to “teach” a process

•Pattern Rec. -> ML -> Deep Learning

•Buzzwords abound

•Fairly simple, lots of libraries

Page 66: Mastering the 80% of Analytics: What Data Scientists Really Do

ML Approaches

•Classes of problems

Page 67: Mastering the 80% of Analytics: What Data Scientists Really Do

ML Approaches

•Classes of problems

•Continuous (regression)

Page 68: Mastering the 80% of Analytics: What Data Scientists Really Do

ML Approaches

•Classes of problems

•Continuous (regression)

•Discrete (classification)

Page 69: Mastering the 80% of Analytics: What Data Scientists Really Do

ML Approaches

•Classes of problems

•Continuous (regression)

•Discrete (classification)

•Classes of solutions

Page 70: Mastering the 80% of Analytics: What Data Scientists Really Do

ML Approaches

•Classes of problems

•Continuous (regression)

•Discrete (classification)

•Classes of solutions

•Supervised

Page 71: Mastering the 80% of Analytics: What Data Scientists Really Do

ML Approaches

•Classes of problems

•Continuous (regression)

•Discrete (classification)

•Classes of solutions

•Supervised

•Unsupervised

Page 72: Mastering the 80% of Analytics: What Data Scientists Really Do

ML Algorithms

•Neural Networks

Page 73: Mastering the 80% of Analytics: What Data Scientists Really Do

ML Algorithms

•Neural Networks

•Genetic Algorithms

Page 74: Mastering the 80% of Analytics: What Data Scientists Really Do

ML Algorithms

•Neural Networks

•Genetic Algorithms

•Bayesian Classification

Page 75: Mastering the 80% of Analytics: What Data Scientists Really Do

ML Algorithms

•Neural Networks

•Genetic Algorithms

•Bayesian Classification

•Support Vector Machines

Page 76: Mastering the 80% of Analytics: What Data Scientists Really Do

ML Algorithms

•Neural Networks

•Genetic Algorithms

•Bayesian Classification

•Support Vector Machines

•Many used as type of feature extraction

Page 77: Mastering the 80% of Analytics: What Data Scientists Really Do

Neural Networks

•Motivated by brain function

•Neurons fire, activate paths

•Non-linear

•Simplest: PerceptronX1

X2

Logic Layer

w1

w2

Page 78: Mastering the 80% of Analytics: What Data Scientists Really Do

Neural Networks

• Inputs feed neuron with weight

Page 79: Mastering the 80% of Analytics: What Data Scientists Really Do

Neural Networks

• Inputs feed neuron with weight

•Logic Layer: activation function

Page 80: Mastering the 80% of Analytics: What Data Scientists Really Do

Neural Networks

• Inputs feed neuron with weight

•Logic Layer: activation function

•Fires (or not) based on inputs

Page 81: Mastering the 80% of Analytics: What Data Scientists Really Do

Neural Networks

• Inputs feed neuron with weight

•Logic Layer: activation function

•Fires (or not) based on inputs

•Weights from minimizing cost function

Page 82: Mastering the 80% of Analytics: What Data Scientists Really Do

Neural Networks

• Inputs feed neuron with weight

•Logic Layer: activation function

•Fires (or not) based on inputs

•Weights from minimizing cost function

•Backpropagation

Page 83: Mastering the 80% of Analytics: What Data Scientists Really Do

Sigmoid Logic Layer

0

0.25

0.5

0.75

1

-10 -8 -6 -4 -2 0 2 4 6 8 10

w = 1 w = 2

1

1 + e�w

Tx

Page 84: Mastering the 80% of Analytics: What Data Scientists Really Do

Neural Networks

•Most networks are bigger

X1

X2

A1

AM

Y1

YK

Page 85: Mastering the 80% of Analytics: What Data Scientists Really Do

Machine Learning

•Got data, features and algorithm

Page 86: Mastering the 80% of Analytics: What Data Scientists Really Do

Machine Learning

•Got data, features and algorithm

•Just plug in and profit!

Page 87: Mastering the 80% of Analytics: What Data Scientists Really Do

Machine Learning

•Got data, features and algorithm

•Just plug in and profit!

•Not quite

Page 88: Mastering the 80% of Analytics: What Data Scientists Really Do

Machine Learning

•Got data, features and algorithm

•Just plug in and profit!

•Not quite

•Tuning and training

Page 89: Mastering the 80% of Analytics: What Data Scientists Really Do

Tuning

•What about N, M and K?

X1

X2

A1

AM

Y1

YK

Page 90: Mastering the 80% of Analytics: What Data Scientists Really Do

Tuning

•What about N, M and K?

•Hyper-parameters

X1

X2

A1

AM

Y1

YK

Page 91: Mastering the 80% of Analytics: What Data Scientists Really Do

Tuning

•What about N, M and K?

•Hyper-parameters

•Size of layers, thresholds, etc.

X1

X2

A1

AM

Y1

YK

Page 92: Mastering the 80% of Analytics: What Data Scientists Really Do

Tuning

•What about N, M and K?

•Hyper-parameters

•Size of layers, thresholds, etc.

•Static specifics of the algorithm

X1

X2

A1

AM

Y1

YK

Page 93: Mastering the 80% of Analytics: What Data Scientists Really Do

Training

• It’s all about the teaching

Page 94: Mastering the 80% of Analytics: What Data Scientists Really Do

Training

• It’s all about the teaching

•Representative data set

Page 95: Mastering the 80% of Analytics: What Data Scientists Really Do

Training

• It’s all about the teaching

•Representative data set

•Large, clean

Page 96: Mastering the 80% of Analytics: What Data Scientists Really Do

Training

•Don’t teach to the test

Page 97: Mastering the 80% of Analytics: What Data Scientists Really Do

Training

•Don’t teach to the test

•Causes overfitting

Page 98: Mastering the 80% of Analytics: What Data Scientists Really Do

Training

•Don’t teach to the test

•Causes overfitting

•Training (80%) and Testing (20%) data

Page 99: Mastering the 80% of Analytics: What Data Scientists Really Do

Training

•Don’t teach to the test

•Causes overfitting

•Training (80%) and Testing (20%) data

•Cross-validation

Page 100: Mastering the 80% of Analytics: What Data Scientists Really Do

With all the open source libraries, isn’t machine learning easy now?

Page 101: Mastering the 80% of Analytics: What Data Scientists Really Do

I got results!

•Why doesn’t anyone care?

Page 102: Mastering the 80% of Analytics: What Data Scientists Really Do

I got results!

•Why doesn’t anyone care?

•Kaggle vs. Real Life Syndrome

Page 103: Mastering the 80% of Analytics: What Data Scientists Really Do

I got results!

•Why doesn’t anyone care?

•Kaggle vs. Real Life Syndrome

• It’s all in the presentation

Page 104: Mastering the 80% of Analytics: What Data Scientists Really Do

It’s all in the presentation

•Complex topic

Page 105: Mastering the 80% of Analytics: What Data Scientists Really Do

It’s all in the presentation

•Complex topic

•Non-technical audience

Page 106: Mastering the 80% of Analytics: What Data Scientists Really Do

It’s all in the presentation

•Complex topic

•Non-technical audience

•Several stakeholders

Page 107: Mastering the 80% of Analytics: What Data Scientists Really Do

It’s all in the presentation

•Complex topic

•Non-technical audience

•Several stakeholders

•Many likely skeptics

Page 108: Mastering the 80% of Analytics: What Data Scientists Really Do

It’s all in the presentation

•Avoid buzzwords

Page 109: Mastering the 80% of Analytics: What Data Scientists Really Do

It’s all in the presentation

•Avoid buzzwords

•Focus on a business problem

Page 110: Mastering the 80% of Analytics: What Data Scientists Really Do

It’s all in the presentation

•Avoid buzzwords

•Focus on a business problem

•Show value

Page 111: Mastering the 80% of Analytics: What Data Scientists Really Do

It’s all in the presentation

•Avoid buzzwords

•Focus on a business problem

•Show value

•Keep in mind cost

Page 112: Mastering the 80% of Analytics: What Data Scientists Really Do

Is it actually science?

•Sometimes

Page 113: Mastering the 80% of Analytics: What Data Scientists Really Do

Is it actually science?

•Sometimes

•…but often not

Page 114: Mastering the 80% of Analytics: What Data Scientists Really Do

Is it actually science?

•Sometimes

•…but often not

•Data Sciences vs. Data Engineering

Page 115: Mastering the 80% of Analytics: What Data Scientists Really Do

Is it actually science?

•Sometimes

•…but often not

•Data Sciences vs. Data Engineering

• It should be — focus on why

Page 116: Mastering the 80% of Analytics: What Data Scientists Really Do

Is it actually science?

Applied Math

Computer Science

Domain Expertise

Page 117: Mastering the 80% of Analytics: What Data Scientists Really Do

Is it actually science?

Applied Math

Computer Science

Domain Expertise

Applied Math

Computer Science

Physics

Physicist

Page 118: Mastering the 80% of Analytics: What Data Scientists Really Do

Why Data Science?

•Big problems, fun challenges

Page 119: Mastering the 80% of Analytics: What Data Scientists Really Do

Why Data Science?

•Big problems, fun challenges

•Both science and business

Page 120: Mastering the 80% of Analytics: What Data Scientists Really Do

Why Data Science?

•Big problems, fun challenges

•Both science and business

•Consistently awesome

Page 121: Mastering the 80% of Analytics: What Data Scientists Really Do

2012: Sexiest Job of the Century

2016: Best Job of the Year

2016: Hottest Job of the Year

2016: Best Career Opportunity

Page 122: Mastering the 80% of Analytics: What Data Scientists Really Do

Why Data Science?S

alar

y

Page 123: Mastering the 80% of Analytics: What Data Scientists Really Do

So want to get started?

•Theano

Page 124: Mastering the 80% of Analytics: What Data Scientists Really Do

So want to get started?

•Theano

•TensorFlow

Page 125: Mastering the 80% of Analytics: What Data Scientists Really Do

So want to get started?

•Theano

•TensorFlow

•Torch

Page 126: Mastering the 80% of Analytics: What Data Scientists Really Do

So want to get started?

•Theano

•TensorFlow

•Torch

•Pandas

Page 127: Mastering the 80% of Analytics: What Data Scientists Really Do

Tomorrow is here

www.avrioanalytics.com