machine learning with r and tableau

18
Machine Learning with R and Tableau Tableau User Group (TUG) Greg Armstrong Blast Analytics & Marketing [email protected]

Upload: kayden-kelly

Post on 13-Jan-2017

1.847 views

Category:

Software


5 download

TRANSCRIPT

Page 1: Machine Learning with R and Tableau

Machine Learning with R and Tableau

Tableau User Group (TUG)

Greg Armstrong Blast Analytics & Marketing [email protected]

Page 2: Machine Learning with R and Tableau

TUG | Machine Learning with R and Tableau

AgendaMachine Learning with R and Tableau

2

1. What is Machine Learning? 2. What is R? 3. Live Examples using Tableau and R

Page 3: Machine Learning with R and Tableau

TUG | Machine Learning with R and Tableau

Machine LearningWhat is machine learning?

3

Machine learning explores the study and construction of algorithms that can learn from and make predictions on data.

• Classification • Regression • Segmentation

Common Methods

Page 4: Machine Learning with R and Tableau

TUG | Machine Learning with R and Tableau 4

Regression

Machine LearningSupervised Learning

Classification

X

Y

X

Y

Page 5: Machine Learning with R and Tableau

TUG | Machine Learning with R and Tableau 5

Segmentation (cluster)

Machine LearningUnsupervised Learning

X

Y

Page 6: Machine Learning with R and Tableau

TUG | Machine Learning with R and Tableau

Machine LearningMarketing use cases

6

• Predicting Lifetime Value (LTV)• Predicting Churn• Customer segmentation• Product recommendations

I like it. I like it a lot!

Page 7: Machine Learning with R and Tableau

TUG | Machine Learning with R and Tableau

Machine LearningFinance use cases

7

• Predicting credit risk • Treasury or currency risk • Fraud detection • Accounts Payable Recovery

“Because a large font makes profits look bigger.”

Page 8: Machine Learning with R and Tableau

TUG | Machine Learning with R and Tableau

Machine LearningHuman Resources use cases

8

• Resume screening • Employee churn • Training recommendation • Talent management

“I pruned a tree once, so technically I’m allowed to put ‘branch manager’ on my resume”

Page 9: Machine Learning with R and Tableau

TUG | Machine Learning with R and Tableau

Machine LearningWeb Search

9

… and predictive text algorithms to fill in the most common keyword search terms.

Google uses machine learning algorithms to serve up the correct search even when the search terms are vastly misspelled.

Page 10: Machine Learning with R and Tableau

TUG | Machine Learning with R and Tableau

Machine LearningSocial Networks

10

Page 11: Machine Learning with R and Tableau

TUG | Machine Learning with R and Tableau

Machine LearningSpam Filtering

11

No Spam

Page 12: Machine Learning with R and Tableau

TUG | Machine Learning with R and Tableau

Machine LearningResearch - Fishers Iris

12

Based on Ronald Fisher’s 1936 paper the idea was to perform statistical classification on the Iris flower data set.

Petal widthPetal length

Sep

al w

idth

Sep

al le

ngth

Page 13: Machine Learning with R and Tableau

TUG | Machine Learning with R and Tableau

ahhRRRR!What is R?

13

• Data manipulation• Statistical modeling• Visualization tool• Open Source

R is a language for statistical analysis and data visualization.

Page 14: Machine Learning with R and Tableau

TUG | Machine Learning with R and Tableau

R Studio, R & TableauA brief introduction

14

+

Page 15: Machine Learning with R and Tableau

TUG | Machine Learning with R and Tableau

Tableau + RWhat did we discover?

15

Customer Segmentation (clusters)

1. There are some big spenders in the Red group, who may not have purchased in a while.

2. Our most profitable customers seem to be older with higher incomes. (Blue group)

Forecasting (linear regression)

1. Tableau forecasting is very good. 2. More flexibility with R forecasting.

Page 16: Machine Learning with R and Tableau

TUG | Machine Learning with R and Tableau

Tableau User Group (TUG)Machine Learning with R and Tableau

16

Questions?

Thank you!

Page 17: Machine Learning with R and Tableau

Phone (888) 252-7866 Email [email protected] www.blastam.com

Roseville Office 6020 West Oaks Blvd, Suite 260

Rocklin, CA 95765

San Francisco Office 625 Second Street, Suite 280

San Francisco, CA 94107

New York Office 261 Madison Ave, 9th Floor

New York, NY 10016

Seattle Office 500 Yale Avenue North

Seattle, WA 98109

Los Angeles Office 7083 Hollywood Boulevard

Los Angeles, CA 90028

Page 18: Machine Learning with R and Tableau

TUG | Machine Learning with R and Tableau

Calculated FieldsTableau Calculated Fields for R

18

SCRIPT_INT(" ## Sets the seed set.seed( .arg7[1]) ## Studentizes the variables day <- ( .arg1 - mean(.arg1) )/ sd(.arg1) mos <- ( .arg2 - mean(.arg2) )/ sd(.arg2) dis <- ( .arg3 - mean(.arg3) )/ sd(.arg3) inc <- ( .arg4 - mean(.arg4) )/ sd(.arg4) age <- ( .arg5 - mean(.arg5) )/ sd(.arg5) dat <- cbind(day, mos, dis, inc, age) day <- .arg6[1] ## Creates the clusters kmeans(dat, day)$cluster ", MIN([Days Since Last Order]), [Months as Customer], AVG([Discount]), MAX([Income]), MAX([Age]), [clusters], [seed])

K-means cluster for customer segmentation

SCRIPT_STR('hello <- "Hello TUG!"', ATTR([R Result]))

Pass string to R with a parameter

SCRIPT_INT("as.integer(.arg1 * 2)", [R Variable])

Pass calculation to R based on parameter

SCRIPT_BOOL("print('***************************************************************')print('the vector sent was')print(.arg1)print('with length')print(length(.arg1))TRUE",SUM([Sales]))

Print to console R arguments