week4-Discussion

profileJaspereric
Lecture.pptx

Data Driven Decision Making Week 3 Data Analysis Data Software

1

How to choose what data analysis to do?

Data Analysis: Process

Data preparation

Exploratory Data Analysis

Plotting

Distributions

Correlations

Advanced analytics

Descriptive modeling

Categorization

Predictive Modeling

Forecasting

Recommendation Systems

Business Question/Need

Business Decision

Data collection

Never actually this linear

Any step may be your stopping point

Simple analyses are great!

Will jump in and out of it

Data Preparation

Exploratory Data Analysis

Plotting

Distributions

Correlations

Continuous data, calculated for every year, 1928-2017

Mean return, 12%

Learning Data Methods

For each method you learn consider:

What sorts of data would I apply this method to?

Types of data

E.g. seasonal and frequency analyses would be used for time series data

Data from particular industries or specialties

E.g. Markov chain modeling for financial growth modeling

E.g. Logistics and Supply chain modeling

What do I have to look out for with this analysis?

Who do I know who’s an expert in this?

Data analysis

Machine Learning Artificial Intelligence

Regression and Statistical Modeling

What do you know about regression and statistical modeling?

What is Machine Learning? Artificial Intelligence?

“Formally”

Artificial Intelligence (AI)

Coined in 1956 by John McCarthy

“machines that can perform tasks that are characteristic of human intelligence” - McCarthy

General AI – AI that has all aspects of human intelligence

Narrow AI – AI that expresses some facet(s) of human intelligence, e.g. facial recognition

Machine learning (ML)

Coined in 1959 by Arthur Samuel

“the ability to learn without being explicitly programmed” - Samuel

Saves the billions of lines of code you’d need to procedurally create AI

“Machine learning is simply a way of achieving AI” – McClelland

Narrow AI

McClelland, Calum. (Dec 4, 2017) The Difference Between Artificial Intelligence, Machine Learning, and Deep Learning. Medium.com. Retrieved from https://medium.com/iotforall/the-difference-between-artificial-intelligence-machine-learning-and-deep-learning-3aa67bff5991

What is Machine Learning? Artificial Intelligence?

In usual conversation

Artificial Intelligence = Machine learning

With a computer scientist

Depending on the era they came up in, more likely to use AI or ML, generally more likely to use ML unless talking to potential funders / think pieces / TEDTalks

Press/public thinker

More likely to use AI

Start ups

More likely to use AI

From Rob Tibshirani

http://statweb.stanford.edu/~tibs/stat315a/

What is Machine Learning?

Statistics with different terminology?

From Rob Tibshirani

http://statweb.stanford.edu/~tibs/stat315a/

What is Machine Learning?

Supervised vs. Unsupervised learning

Supervised learning – you know the labels for the data

Regression

Classification

Unsupervised learning – you don’t know the labels

(probability) density estimation

clustering

https://commons.wikimedia.org/wiki/File:Cluster-2.svg

From Rob Tibshirani

http://statweb.stanford.edu/~tibs/stat315a/

What is Machine Learning?

Supervised vs. Unsupervised learning

Supervised learning – you know the labels for the data

Regression

Classification

Unsupervised learning – you don’t know the labels

(probability) density estimation

clustering

In both cases, you’re fitting the weights/parameters of model

You may be familiar with

Using Solver in Excel

Fitting a regression line to data

Forecasting

From Rob Tibshirani

http://statweb.stanford.edu/~tibs/stat315a/

What is Machine Learning?

Once you’ve fit your model, need to see how it performs with new data.

Overfit?

Set aside a subset of your data as a “test set” to see how the model performs on data that you didn’t fit on

From Rob Tibshirani

http://statweb.stanford.edu/~tibs/stat315a/

What is Deep Learning?

What is Deep Learning?

Deep learning is a method of Machine Learning (that is hot right now)

Deep learning is a type of (Artificial) Neural Network

Primary used for Supervised Learning

Aka Regression with A LOT OF WEIGHTS

What is Deep Learning?

(Artificial) Neural Network

Lots of parameters to fit

Deep learning

ANN with many layers

More difficult to train (incl time)

Computer scientists figured out how to train ~2006

Advanced field in many difficult ML tasks, e.g. object recognition

https://commons.wikimedia.org/wiki/File:Colored_neural_network.svg

What is Deep Learning?

(Artificial) Neural Network

Lots of parameters to fit

Deep learning

ANN with many layers

More difficult to train (incl time)

Computer scientists figured out how to train ~2006

Advanced field in many difficult ML tasks, e.g. object recognition

https://commons.wikimedia.org/wiki/File:Colored_neural_network.svg

https://www.dtreg.com/solution/view/21

What is Deep Learning?

(Artificial) Neural Network

Lots of parameters to fit

Deep learning

ANN with many layers

More difficult to train (incl time)

Computer scientists figured out how to train ~2006

Advanced field in many difficult ML tasks, e.g. object recognition

https://commons.wikimedia.org/wiki/File:Colored_neural_network.svg

https://www.dtreg.com/solution/view/21

https://www.dtreg.com/solution/view/21

What is Deep Learning?

(Artificial) Neural Network

Lots of parameters to fit

Deep learning

ANN with many layers

More difficult to train (incl time)

Computer scientists figured out how to train ~2006

Advanced field in many difficult ML tasks, e.g. object recognition

https://commons.wikimedia.org/wiki/File:Colored_neural_network.svg

https://www.rsipvision.com/exploring-deep-learning/

https://www.dtreg.com/solution/view/21

Deep learning: Facial recognition example

Exploring Deep Learning & CNNs - RSIP Vision. (2015). RSIP Vision. Retrieved 13 November 2018, from https://www.rsipvision.com/exploring-deep-learning/

Each layer combines features from previous layer

ML Interpretability

ML often uses high-dimensional non-linear transformations of data

Can we build a model based on the ML results? Or is it a black box?

Why do we care?

Easier to motivate

Easier to identify biases

Statistical Diagnostics

The following is based on Randy Bartlett’s book: A Practitioner’s Guide to Business Analytics, Chapter 8, Statistical Diagnostics

Evaluating the analysis

Statistical Diagnostics measure the quality of the data analysis. They provide five broad benefits:

Detecting mistakes or weaknesses—foibles.

Measuring the accuracy of an analysis.

Measuring the reliability of an analysis.

Providing insight into interpreting the results.

Providing insight into potential improved solutions.

Uwe Hohgrawe

Diagnostics families: Tool sets and Themes

Diagnostics families: Tool sets and Themes

External numbers

Numbers outside the analysis

Test forecasting model against what happens

Diagnostics families: Tool sets and Themes

Juxtaposing Results

By Method

By Quant

By Approach

By Repetition

Diagnostics families: Tool sets and Themes

Cross-Validation

Homework video

Diagnostics families: Tool sets and Themes

Statistical tests on your model

Simulation/stress testing

Performance Measurement

Test Statistical Assumptions

Test Business Assumptions

Intervals and Regions

Diagnostics families: Tool sets and Themes

Design of Samples

Design of Experiments

Covered earlier in the lecture

Data Software

Quick overview, for more information (as you need it) see this week’s supplemental materials readings on the subject and Bartlett Chapter 11

Programming languages for Data Science

This week’s reading!

Articles put it better and more concisely than I could.

Read (optional): "Which Languages Should You Learn For Data Science?" by Peter Gleeson

Overview of most commonly used programming languages in Data Science and their pros and cons

Read (optional): "What programming language should aspiring data scientists learn?" by Derrick Mwiti

Includes plots from Kaggle survey data about what programming language data scientists would recommend others learn first, what methods/tools they are interested in learning next, etc.

What language – consider:

Frameworks/libraries: Does a particular framework or library exist, which fits your needs? Do you have to use a free library, or can you spend money on a commercial product?

Performance: Are there performance restrictions which require a compiler language? Are there perhaps "soft" performance expectations by the customer?

Language-task fit: Do you have a task which can more simply or more expressively be solved in one language or another?

Language features: Do you need specific language features (e.g., regular expressions), which one language supports better than the other?

Industry standards: What languages or tools are regularly used in your company or your industry?

Last not least - personal experience. Do you need excessive ramp-up time in one language, maybe because your knowledge in one language is significantly better than in the other?

Modified from Uwe Hohgrawe

Data visualization software

Examples

Tableau

Qlikview

Can integrate with programming languages and/or data warehouse

We’ll discuss data visualizations more in Week 5

Best Coding Practices

Learn to write good code.

Even if you’re using tool like Excel or Tableau, you are writing code

Why?

Limit mistakes – at the moment and in the future

Collaboration with yourself and others

“All code has at least one collaborator and that is future you.” – Hadley Wickham

Your Github repo can be a part of your virtual resume

Basics:

Don’t hard code parameters. Especially not globals.

Keep things organized and neat

File, function, and variable names

Break problems down into smaller components

Document

Test

Use version control

More (optional) supplemental material

Better Science Code slides by Eric Denovellis

Many points from Better Science Code by Eric Denovellis

0 5

10 15 20

-0. 6

-0. 5

-0. 4

-0. 3

-0. 2

-0. 1 0 0.1 0.2 0.3 0.4 0.5 0.6

M ore

Fr eq

ue nc

y

Bin

Histogram of S&P Annual Return

Frequency

0

5

10

15

20

-

0

.

6

-

0

.

5

-

0

.

4

-

0

.

3

-

0

.

2

-

0

.

1

0

0

.

1

0

.

2

0

.

3

0

.

4

0

.

5

0

.

6

M

o

r

e

F

r

e

q

u

e

n

c

y

Bin

Histogram of S&P Annual Return

Frequency

1920 1930 1940 1950 1960 1970 1980 1990 2000 2010 2020 2030

Pe rc

en t A

nn ua

l R et

ur n

Year

S&P 500

192019301940195019601970198019902000201020202030

P

e

r

c

e

n

t

A

n

n

u

a

l

R

e

t

u

r

n

Year

S&P 500

Glossary

Machine learning Statistics

network, graphs model

weights parameters

learning fitting

generalization test set performance

supervised learning regression/classification

unsupervised learning density estimation, clustering

large grant = $1,000,000 large grant= $50,000

nice place to have a meeting: nice place to have a meeting:

Snowbird, Utah, French Alps Las Vegas in August

1