Вы находитесь на странице: 1из 7

Contents

About the Authors��������������������������������������������������������������������������� xiii


About the Technical Reviewers������������������������������������������������������� xv
Acknowledgments������������������������������������������������������������������������� xvii
Foreword���������������������������������������������������������������������������������������� xix
Introduction���������������������������������������������������������������������������������� xxiii

■■Part I: Introducing Data Science and Microsoft Azure


Machine Learning����������������������������������������������������������� 1

■Chapter 1: Introduction to Data Science����������������������������������������� 3
What is Data Science?���������������������������������������������������������������������������� 3
Analytics Spectrum��������������������������������������������������������������������������������� 4
Descriptive Analysis������������������������������������������������������������������������������������������������� 5
Diagnostic Analysis��������������������������������������������������������������������������������������������������� 5
Predictive Analysis���������������������������������������������������������������������������������������������������� 5
Prescriptive Analysis������������������������������������������������������������������������������������������������ 6
Why Does It Matter and Why Now?��������������������������������������������������������� 7
Data as a Competitive Asset������������������������������������������������������������������������������������� 7
Increased Customer Demand ���������������������������������������������������������������������������������� 8
Increased Awareness of Data Mining Technologies ������������������������������������������������� 8
Access to More Data������������������������������������������������������������������������������������������������� 8
Faster and Cheaper Processing Power �������������������������������������������������������������������� 9
The Data Science Process�������������������������������������������������������������������������������������� 11

www.it-ebooks.info
■ Contents

Common Data Science Techniques������������������������������������������������������� 14


Classification Algorithms���������������������������������������������������������������������������������������� 14
Clustering Algorithms��������������������������������������������������������������������������������������������� 15
Regression Algorithms�������������������������������������������������������������������������������������������� 16
Simulation�������������������������������������������������������������������������������������������������������������� 17
Content Analysis ���������������������������������������������������������������������������������������������������� 17
Recommendation Engines ������������������������������������������������������������������������������������� 18

Cutting Edge of Data Science���������������������������������������������������������������� 18


The Rise of Ensemble Models�������������������������������������������������������������������������������� 18

Summary����������������������������������������������������������������������������������������������� 20
Bibliography������������������������������������������������������������������������������������������ 20

■Chapter 2: Introducing Microsoft Azure Machine Learning���������� 21
Hello, Machine Learning Studio!����������������������������������������������������������� 21
Components of an Experiment�������������������������������������������������������������� 22
Introducing the Gallery�������������������������������������������������������������������������� 25
Five Easy Steps to Creating a Training Experiment������������������������������� 26
Step 1: Getting the Data������������������������������������������������������������������������������������������ 26
Step 2: Preprocessing the Data������������������������������������������������������������������������������ 28
Step 3: Defining the Features��������������������������������������������������������������������������������� 31
Step 4: Choosing and Applying Machine Learning Algorithms������������������������������� 33
Step 5: Predicting Over New Data�������������������������������������������������������������������������� 35

Deploying Your Model in Production������������������������������������������������������ 38


Creating a Predictive Experiment��������������������������������������������������������������������������� 38
Publishing Your Experiment as a Web Service������������������������������������������������������� 40
Accessing the Azure Machine Learning Web Service��������������������������������������������� 41

Summary����������������������������������������������������������������������������������������������� 43

vi

www.it-ebooks.info
■ Contents


■Chapter 3: Data Preparation��������������������������������������������������������� 45
Data Cleaning and Processing�������������������������������������������������������������� 46
Getting to Know Your Data�������������������������������������������������������������������������������������� 46
Missing and Null Values������������������������������������������������������������������������������������������ 53
Handling Duplicate Records����������������������������������������������������������������������������������� 56
Identifying and Removing Outliers�������������������������������������������������������������������������� 56
Feature Normalization�������������������������������������������������������������������������������������������� 59
Dealing with Class Imbalance�������������������������������������������������������������������������������� 60
Feature Selection���������������������������������������������������������������������������������� 62
Feature Engineering������������������������������������������������������������������������������ 67
Binning Data����������������������������������������������������������������������������������������������������������� 72
The Curse of Dimensionality����������������������������������������������������������������������������������� 75

Summary����������������������������������������������������������������������������������������������� 79

■Chapter 4: Integration with R������������������������������������������������������� 81
R in a Nutshell��������������������������������������������������������������������������������������� 81
Building and Deploying Your First R Script�������������������������������������������� 84
Using R for Data Preprocessing������������������������������������������������������������ 88
Using a Script Bundle (ZIP)�������������������������������������������������������������������� 92
Building and Deploying a Decision Tree Using R����������������������������������� 96
Summary��������������������������������������������������������������������������������������������� 101

■Chapter 5: Integration with Python�������������������������������������������� 103
Overview��������������������������������������������������������������������������������������������� 103
Python Jumpstart�������������������������������������������������������������������������������� 104
Using Python in Azure ML Experiments����������������������������������������������� 108
Using Python for Data Preprocessing�������������������������������������������������� 115
Combining Data using Python������������������������������������������������������������������������������ 116
Handling Missing Data Using Python�������������������������������������������������������������������� 119

vii

www.it-ebooks.info
■ Contents

Feature Selection Using Python���������������������������������������������������������������������������� 121


Running Python Code in an Azure ML Experiment������������������������������������������������ 125

Summary��������������������������������������������������������������������������������������������� 130


■Part II: Statistical and Machine Learning Algorithms 131
■■Chapter 6: Introduction to Statistical and Machine
Learning Algorithms������������������������������������������������������������������� 133
Regression Algorithms������������������������������������������������������������������������ 133
Linear Regression������������������������������������������������������������������������������������������������� 134
Neural Networks��������������������������������������������������������������������������������������������������� 136
Decision Trees������������������������������������������������������������������������������������������������������ 138
Boosted Decision Trees���������������������������������������������������������������������������������������� 139

Classification Algorithms��������������������������������������������������������������������� 140


Support Vector Machines�������������������������������������������������������������������������������������� 141
Bayes Point Machines������������������������������������������������������������������������������������������ 144

Clustering Algorithms�������������������������������������������������������������������������� 145


Summary��������������������������������������������������������������������������������������������� 148


■Part III: Practical Applications����������������������������������� 149

■Chapter 7: Building Customer Propensity Models���������������������� 151
The Business Problem������������������������������������������������������������������������� 151
Data Acquisition and Preparation�������������������������������������������������������� 152
Data Analysis�������������������������������������������������������������������������������������������������������� 153

Training the Model������������������������������������������������������������������������������� 161


Model Testing and Validation��������������������������������������������������������������� 164
Model Performance����������������������������������������������������������������������������� 165
Prioritizing Evaluation Metrics������������������������������������������������������������� 169
Summary��������������������������������������������������������������������������������������������� 171

viii

www.it-ebooks.info
■ Contents


■Chapter 8: Visualizing Your Models with Power BI�������������������� 173
Overview��������������������������������������������������������������������������������������������� 173
Introducing Power BI��������������������������������������������������������������������������� 174
Three Approaches for Visualizing with Power BI��������������������������������� 176
Scoring Your Data in Azure Machine Learning and
Visualizing in Excel������������������������������������������������������������������������������ 177
Scoring and Visualizing Your Data in Excel������������������������������������������ 182
Scoring Your Data in Azure Machine Learning and Visualizing in
powerbi.com��������������������������������������������������������������������������������������� 184
Loading Data��������������������������������������������������������������������������������������������������������� 184
Building Your Dashboard�������������������������������������������������������������������������������������� 185

Summary��������������������������������������������������������������������������������������������� 188

■Chapter 9: Building Churn Models���������������������������������������������� 189
Churn Models in a Nutshell����������������������������������������������������������������� 189
Building and Deploying a Customer Churn Model������������������������������� 191
Preparing and Understanding Data���������������������������������������������������������������������� 191
Data Preprocessing and Feature Selection���������������������������������������������������������� 195
Classification Model for Predicting Churn������������������������������������������������������������ 201
Evaluating the Performance of the Customer Churn Models�������������������������������� 204
Summary��������������������������������������������������������������������������������������������� 206

■Chapter 10: Customer Segmentation Models����������������������������� 207
Customer Segmentation Models in a Nutshell������������������������������������ 207
Building and Deploying Your First K-Means Clustering Model������������ 208
Feature Hashing��������������������������������������������������������������������������������������������������� 211
Identifying the Right Features������������������������������������������������������������������������������ 212
Properties of K-Means Clustering������������������������������������������������������������������������� 213

ix

www.it-ebooks.info
■ Contents

Customer Segmentation of Wholesale Customers������������������������������ 216


Loading the Data from the UCI Machine Learning Repository������������������������������ 216
Using K-Means Clustering for Wholesale Customer Segmentation���������������������� 217
Cluster Assignment for New Data������������������������������������������������������������������������� 219

Summary��������������������������������������������������������������������������������������������� 220

■Chapter 11: Building Predictive Maintenance Models���������������� 221
Overview��������������������������������������������������������������������������������������������� 221
Predictive Maintenance Scenarios������������������������������������������������������ 223
The Business Problem������������������������������������������������������������������������� 223
Data Acquisition and Preparation�������������������������������������������������������� 224
The Dataset���������������������������������������������������������������������������������������������������������� 224
Data Loading��������������������������������������������������������������������������������������������������������� 225
Data Analysis�������������������������������������������������������������������������������������������������������� 225

Training the Model������������������������������������������������������������������������������� 228


Model Testing and Validation��������������������������������������������������������������� 230
Model Performance����������������������������������������������������������������������������� 231
Techniques for Improving the Model��������������������������������������������������� 233
Upsampling and Downsampling��������������������������������������������������������������������������� 234
Model Deployment������������������������������������������������������������������������������ 238
Creating a Predictive Experiment������������������������������������������������������������������������� 239
Publishing Your Experiment as a Web Service����������������������������������������������������� 240

Summary��������������������������������������������������������������������������������������������� 241

■Chapter 12: Recommendation Systems������������������������������������� 243
Overview��������������������������������������������������������������������������������������������� 243
Recommendation Systems Approaches and Scenarios���������������������� 244
The Business Problem������������������������������������������������������������������������� 245

www.it-ebooks.info
■ Contents

Data Acquisition and Preparation�������������������������������������������������������� 246


The Dataset���������������������������������������������������������������������������������������������������������� 246

Training the Model������������������������������������������������������������������������������� 255


Model Testing and Validation��������������������������������������������������������������� 257
Summary��������������������������������������������������������������������������������������������� 262
■■Chapter 13: Consuming and Publishing Models on
Azure Marketplace��������������������������������������������������������������������� 263
What Are Machine Learning APIs?������������������������������������������������������ 263
How to Use an API from Azure Marketplace���������������������������������������� 266
Publishing Your Own Models in Azure Marketplace���������������������������� 272
Creating and Publishing a Web Service for Your Machine
Learning Model����������������������������������������������������������������������������������� 272
Creating Scoring Experiment�������������������������������������������������������������������������������� 273
Publishing Your Experiment as a Web Service����������������������������������������������������� 274

Obtaining the API Key and the Details of the OData Endpoint������������� 274
Publishing Your Model as an API in Azure Marketplace���������������������� 275
Summary��������������������������������������������������������������������������������������������� 277

■Chapter 14: Cortana Analytics���������������������������������������������������� 279
What Is the Cortana Analytics Suite?�������������������������������������������������� 279
Capabilities of Cortana Analytics Suite������������������������������������������������ 280
Example Scenario�������������������������������������������������������������������������������� 282
Summary��������������������������������������������������������������������������������������������� 283

Index���������������������������������������������������������������������������������������������� 285

xi

www.it-ebooks.info

Вам также может понравиться