Foreword by Ravi Bapna xxi

Foreword by Gareth James xxiii

Preface to the Second R Edition xxv

Acknowledgments xxix

PART I PRELIMINARIES

CHAPTER 1 Introduction 3

1.1 What Is Business Analytics? 3

1.2 What Is Machine Learning? 5

1.3 Machine Learning, AI, and Related Terms 5

1.4 Big Data 7

1.5 Data Science 8

1.6 Why Are There So Many Different Methods? 8

1.7 Terminology and Notation 9

1.8 Road Maps to This Book 11

CHAPTER 2 Overview of the Machine Learning Process 17

2.1 Introduction 17

2.2 Core Ideas in Machine Learning 18

2.3 The Steps in a Machine Learning Project 21

2.4 Preliminary Steps 23

2.5 Predictive Power and Overfitting 35

2.6 Building a Predictive Model 41

2.7 Using R for Machine Learning on a Local Machine 46

2.8 Automating Machine Learning Solutions 47

2.9 Ethical Practice in Machine Learning 52

PART II DATA EXPLORATION AND DIMENSION REDUCTION

CHAPTER 3 Data Visualization 63

3.1 Uses of Data Visualization 63

3.2 Data Examples 65

3.3 Basic Charts: Bar Charts, Line Charts, and Scatter Plots 67

3.4 Multidimensional Visualization 75

3.5 Specialized Visualizations 91

3.6 Major Visualizations and Operations, by Machine Learning Goal 97

CHAPTER 4 Dimension Reduction 101

4.1 Introduction 101

4.2 Curse of Dimensionality 102

4.3 Practical Considerations 102

4.4 Data Summaries 103

4.5 Correlation Analysis 107

4.6 Reducing the Number of Categories in Categorical Variables 109

4.7 Converting a Categorical Variable to a Numerical Variable 111

4.8 Principal Component Analysis 111

4.9 Dimension Reduction Using Regression Models 121

4.10 Dimension Reduction Using Classification and Regression Trees 121

PART III PERFORMANCE EVALUATION

CHAPTER 5 Evaluating Predictive Performance 129

5.1 Introduction 130

5.2 Evaluating Predictive Performance 130

5.3 Judging Classifier Performance 136

5.4 Judging Ranking Performance 150

5.5 Oversampling 156

PART IV PREDICTION AND CLASSIFICATION METHODS

CHAPTER 6 Multiple Linear Regression 167

6.1 Introduction 167

6.2 Explanatory vs Predictive Modeling 168

6.3 Estimating the Regression Equation and Prediction 170

6.4 Variable Selection in Linear Regression 176

CHAPTER 7 k-Nearest Neighbors (kNN) 193

7.1 The k-NN Classifier (Categorical Outcome) 193

7.2 k-NN for a Numerical Outcome 201

7.3 Advantages and Shortcomings of k-NN Algorithms 204

CHAPTER 8 The Naive Bayes Classifier 207

8.1 Introduction 207

8.2 Applying the Full (Exact) Bayesian Classifier 209

8.3 Solution: Naive Bayes 211

8.4 Advantages and Shortcomings of the Naive Bayes Classifier 220

CHAPTER 9 Classification and Regression Trees 225

9.1 Introduction 226

9.2 Classification Trees 228

9.3 Evaluating the Performance of a Classification Tree 235

9.4 Avoiding Overfitting 239

9.5 Classification Rules from Trees 247

9.6 Classification Trees for More Than Two Classes 248

9.7 Regression Trees 249

9.8 Advantages and Weaknesses of a Tree 250

9.9 Improving Prediction: Random Forests and Boosted Trees 252

CHAPTER 10 Logistic Regression 261

10.1 Introduction 261

10.2 The Logistic Regression Model 263

10.3 Example: Acceptance of Personal Loan 264

10.4 Evaluating Classification Performance 271

10.5 Variable Selection 273

10.6 Logistic Regression for Multi-Class Classification 274

10.7 Example of Complete Analysis: Predicting Delayed Flights 277

CHAPTER 11 Neural Nets 293

11.1 Introduction 293

11.2 Concept and Structure of a Neural Network 294

11.3 Fitting a Network to Data 295

11.4 Required User Input 307

11.5 Exploring the Relationship Between Predictors and Outcome 308

11.6 Deep Learning 309

11.7 Advantages and Weaknesses of Neural Networks 320

CHAPTER 12 Discriminant Analysis 325

12.1 Introduction 325

12.2 Distance of a Record from a Class 327

12.3 Fisher’s Linear Classification Functions 329

12.4 Classification Performance of Discriminant Analysis 333

12.5 Prior Probabilities 334

12.6 Unequal Misclassification Costs 334

12.7 Classifying More Than Two Classes 336

CHAPTER 13 Generating, Comparing, and Combining Multiple Models 345

13.1 Ensembles 346

13.2 Automated Machine Learning (AutoML) 352

13.3 Explaining Model Predictions 358

13.4 Summary 360

PART V INTERVENTION AND USER FEEDBACK

CHAPTER 14 Interventions: Experiments, Uplift Models, and Reinforcement Learning 367

14.1 A/B Testing 368

14.2 Uplift (Persuasion) Modeling 373

14.3 Reinforcement Learning 380

14.4 Summary 388

PART VI MINING RELATIONSHIPS AMONG RECORDS

CHAPTER 15 Association Rules and Collaborative Filtering 393

15.1 Association Rules 394

15.2 Collaborative Filtering 407

15.3 Summary 419

CHAPTER 16 Cluster Analysis 425

16.1 Introduction 426

16.2 Measuring Distance Between Two Records 429

16.3 Measuring Distance Between Two Clusters 434

16.4 Hierarchical (Agglomerative) Clustering 437

16.5 Non-Hierarchical Clustering: The k-Means Algorithm 444

PART VII FORECASTING TIME SERIES

CHAPTER 17 Handling Time Series 455

17.1 Introduction 455

17.2 Descriptive vs Predictive Modeling 457

17.3 Popular Forecasting Methods in Business 457

17.4 Time Series Components 458

17.5 Data Partitioning and Performance Evaluation 463

CHAPTER 18 Regression-Based Forecasting 469

18.1 A Model with Trend 469

18.2 A Model with Seasonality 476

18.3 A Model with Trend and Seasonality 478

18.4 Autocorrelation and ARIMA Models 479

CHAPTER 19 Smoothing and Deep Learning Methods for Forecasting 499

19.1 Smoothing Methods: Introduction 500

19.2 Moving Average 500

19.3 Simple Exponential Smoothing 505

19.5 Deep Learning for Forecasting 511

PART VIII DATA ANALYTICS

CHAPTER 20 Social Network Analytics 527

20.1 Introduction 527

20.2 Directed vs Undirected Networks 529

20.3 Visualizing and Analyzing Networks 530

20.4 Social Data Metrics and Taxonomy 534

20.5 Using Network Metrics in Prediction and Classification 538

20.6 Collecting Social Network Data with R 545

CHAPTER 21 Text Mining 549

21.1 Introduction 549

21.2 The Tabular Representation of Text 550

21.3 Bag-of-Words vs Meaning Extraction at Document Level 551

21.4 Preprocessing the Text 552

21.5 Implementing Machine Learning Methods 560

21.6 Example: Online Discussions on Autos and Electronics 560

21.7 Example: Sentiment Analysis of Movie Reviews 564

21.8 Summary 568

CHAPTER 22 Responsible Data Science 573

22.1 Introduction 573

22.2 Unintentional Harm 574

22.3 Legal Considerations 576

22.4 Principles of Responsible Data Science 577

22.5 A Responsible Data Science Framework 580

22.6 Documentation Tools 584

22.7 Example: Applying the RDS Framework to the COMPAS Example 588

22.8 Summary 598

PART IX CASES

CHAPTER 23 Cases 603

23.1 Charles Book Club 603

23.2 German Credit 610

23.3 Tayko Software Cataloger 615

23.4 Political Persuasion 619

23.5 Taxi Cancellations 623

23.6 Segmenting Consumers of Bath Soap 625

23.7 Direct-Mail Fundraising 629

23.8 Catalog Cross-Selling 632

23.9 Time Series Case: Forecasting Public Transportation Demand 634

23.10 Loan Approval 636

Index 649