How to make AI work for your business Veljko Krunic M A N N I N G Succeeding with AI ii Succeeding with AI HOW TO MAKE AI WORK FOR YOUR BUSINESS VELJKO KRUNIC MANNING SHELTER ISLAND For online information and ordering of this and other Manning books, please visit www.manning.com. The publisher offers discounts on this book when ordered in quantity. For more information, please contact Special Sales Department Manning Publications Co. 20 Baldwin Road PO Box 761 Shelter Island, NY 11964 Email: [email protected] ©2020 by Manning Publications Co. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by means electronic, mechanical, photocopying, or otherwise, without prior written permission of the publisher. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in the book, and Manning Publications was aware of a trademark claim, the designations have been printed in initial caps or all caps. Recognizing the importance of preserving what has been written, it is Manning’s policy to have the books we publish printed on acid-free paper, and we exert our best efforts to that end. Recognizing also our responsibility to conserve the resources of our planet, Manning books are printed on paper that is at least 15 percent recycled and processed without the use of elemental chlorine. Manning Publications Co. Acquisitions editor: Mike Stephens 20 Baldwin Road Development editor: Marina Michaels PO Box 761 and Jennifer Stout Shelter Island, NY 11964 Technical development editor: Al Krinker Review editor: Ivan Martinovic´ Production editor: Anthony Calcara Copy editor: Carl Quesnel ESL editor: Frances Buran Proofreader: Keri Hales Typesetter and cover designer: Marija Tudor Neither Manning nor the Author make any warranty regarding the completeness, accuracy, timeliness, or other fitness for use nor the results obtained from the use of the contents herein and accept no liability for any decision or action taken in reliance on the information in this book nor for any damages resulting from this work or its application. ISBN 9781617296932 Printed in the United States of America brief contents 1 ■ Introduction 1 2 ■ How to use AI in your business 26 3 ■ Choosing your first AI project 53 4 ■ Linking business and technology 82 5 ■ What is an ML pipeline, and how does it affect an AI project? 112 6 ■ Analyzing an ML pipeline 135 7 ■ Guiding an AI project to success 165 8 ■ AI trends that may affect you 195 v vi BRIEF CONTENTS contents preface xiii acknowledgments xv about this book xvii about the author xxi about the cover illustration xxii 1 Introduction 1 1.1 Whom is this book for? 2 1.2 AI and the Age of Implementation 4 1.3 How do you make money with AI? 6 1.4 What matters for your project to succeed? 7 1.5 Machine learning from 10,000 feet 8 1.6 Start by understanding the possible business actions 11 1.7 Don’t fish for “something in the data” 13 1.8 AI finds correlations, not causes! 15 1.9 Business results must be measurable! 16 1.10 What is CLUE? 19 1.11 Overview of how to select and run AI projects 21 1.12 Exercises 23 True/False questions 24 ■ Longer exercises: Identify the problem 24 vii viii CONTENTS 2 How to use AI in your business 26 2.1 What do you need to know about AI? 27 2.2 How is AI used? 29 2.3 What’s new with AI? 31 2.4 Making money with AI 33 AI applied to medical diagnosis 34 ■ General principles for monetizing AI 36 2.5 Finding domain actions 38 AI as part of the decision support system 39 ■ AI as a part of a larger product 40 ■ Using AI to automate part of the business process 42 ■ AI as the product 43 2.6 Overview of AI capabilities 45 2.7 Introducing unicorns 47 Data science unicorns 47 ■ What about data engineers? 48 So where are the unicorns? 49 2.8 Exercises 50 Short answer questions 51 ■ Scenario-based questions 51 3 Choosing your first AI project 53 3.1 Choosing the right projects for a young AI team 54 The look of success 54 ■ The look of failure 57 3.2 Prioritizing AI projects 59 React: Finding business questions for AI to answer 60 Sense/Analyze: AI methods and data 63 ■ Measuring AI project success with business metrics 65 ■ Estimating AI project difficulty 68 3.3 Your first project and first research question 69 Define the research question 70 ■ If you fail, fail fast 74 3.4 Pitfalls to avoid 74 Failing to build a relationship with the business team 75 Using transplants 75 ■ Trying moonshots without the rockets 76 ■ It’s about using advanced tools to look at the sea of data 77 ■ Using your gut feeling instead of CLUE 78 3.5 Exercises 80 CONTENTS ix 4 Linking business and technology 82 4.1 A project can’t be stopped midair 83 What constitutes a good recommendation engine? 83 ■ What is gut feeling? 85 4.2 Linking business problems and research questions 85 Introducing the L part of CLUE 86 ■ Do you have the right research question? 87 ■ What questions should a metric be able to answer? 87 ■ Can you make business decisions based on a technical metric? 88 ■ A metric you don’t understand is a poor business metric 91 ■ You need the right business metric 93 4.3 Measuring progress on AI projects 94 4.4 Linking technical progress with a business metric 96 Why do we need technical metrics? 97 ■ What is the profit curve? 97 ■ Constructing a profit curve for bike rentals 99 Why is this not taught in college? 102 ■ Can’t businesses define the profit curve themselves? 103 ■ Understanding technical results in business terms 105 4.5 Organizational considerations 106 Profit curve precision depends on the business problem 106 A profit curve improves over time 107 ■ It’s about learning, not about being right 108 ■ Dealing with information hoarding 108 ■ But we can’t measure that! 109 4.6 Exercises 110 5 What is an ML pipeline, and how does it affect an AI project? 112 5.1 How is an AI project different? 113 The ML pipeline in AI projects 113 ■ Challenges the AI system shares with a traditional software system 117 ■ Challenges amplified in AI projects 117 ■ Ossification of the ML pipeline 118 ■ Example of ossification of an ML pipeline 121 How to address ossification of the ML pipeline 123 5.2 Why we need to analyze the ML pipeline 126 Algorithm improvement: MNIST example 126 ■ Further examples of improving the ML pipeline 127 ■ You must analyze the ML pipeline! 128 5.3 What’s the role of AI methods? 129 5.4 Balancing data, AI methods, and infrastructure 131 5.5 Exercises 133