Cloud Galacticos COO Paul Battisson explains artificial intelligence, machine learning, and how to leverage them to get better insights from your data.
Artificial intelligence (AI) and machine learning (ML) have surged in use and popularity since 2015.
In this webinar, Cloud Galacticos COO Paul Battisson explains AI and ML in ways the average business data user can easily understand. He discusses what they are, how they differ, and how to use them to get better, more useable answers from your data. He walks through a detailed example, using his love of football (soccer) and the game Football Manager to show how these techniques help build the perfect football team. He starts by building a simple program, then adds to it to refine the data to meet his discovery goals. He discusses errors and how AI and ML work to reduce it and find the best answer possible.
He ends his presentation with a discussion of how AI and ML apply to real-life problem solving, showing how to figure out where to reinforce military aircraft.
[00:00:16] Good day. Welcome to another X-Force data summit session. Today, we have, Paul Battisson, who is the COO of Cloud Galacticos, which is Salesforce consultancy, mainly headquartered in the UK. Paul’s going to talk about machine learning and artificial intelligence for normal humans.
[00:00:35] And you know, hopefully we're all normal humans on this, listening to this talk, and so all get something out of it. With that, take it away, Paul.
[00:00:45] Super. Thank you. So, yeah, welcome everyone to this talk. it is machine learning and artificial intelligence for normal human beings. As mentioned, typically. . . there you go,
[00:00:57] As mentioned, my name is Pail Battisson. I am the CEO of Cloud Galacticos and I am a seven-time Salesforce MVP, a 13 times Salesforce certified. I'm a Salesforce instructor, and I'm pretty easy to find online. If, after listening to this, you would like to hear more, find me @pbattissonon Twitter.com or paulbattisson.com, and I also run the cloud bites TV YouTube channel, which is a free learning resource for Salesforce admins and developers and architects, that’s @cloudbitestv or cloudbites.tv
[00:01:29] So, let's jump into this. So why am I doing this talk, aside from being asked to? So over the past few years, there's been a real surge in the use of AI and ML as terms of artificial intelligence and machine learning. And, you know, we can see that through a Google trends graph, which is, you know, Google is obviously the answer to how we know that anything's becoming popular.
[00:01:55] As you can see here, this is the search graph for the term machine learning. It's gone way off in popularity over the years. Starting out in 2015 fairly low down enough. and in end of 2019 was one of those popular terms out there. So, yeah, there's been a lot of use of these terms and we can also just see this through the Gartner hype cycle.
[00:02:16] And I've got three years’ worth of the hype cycle here, and what we can see is the terms AI and machine learning appear lots of times along with different variations on them. So, whether it's deep reinforcement learning or artificial general intelligence, and moving on then to, you know, AI platforms as a service and edge AI.
[00:02:35] And my current favorite, which is explainable AI. What we've seen is despite the fact that the technology industry has a fantastic variety of ways to come up with different names for something, it's just a really popular piece of technology and a real trend that's emerging out there.
[00:02:55] So I wanted to go through and explain it a little bit. As I mentioned with the title of the talk, I want to make it more explainable to real humans.
[00:03:05] My background is in mathematics. I actually have a maths degree and not a computer science degree. And I was playing around with machine learning systems sort of 10 years ago, 15 years ago, back before I was even doing Salesforce And back in around 2013, 2014, I did a talk at Dreamforce with a colleague of mine, Jennifer Wire, where we built a machine learning system in Apex.
[00:03:29] If only we'd have been sensible enough to sort of, you know, build something a bit more productized, we could have built Einstein before it was there, but, it's you know, it was a topic that we were doing then, and we really put it together because people were telling us that you couldn't do such things in Apex. That was a challenge. But part of the reason we wanted to do it was to get a deeper understanding of the technology.
[00:03:48] And I think that's. . . and there's a good example of technology not working as Siri butts in. But, I wanted to, you know, I think the key thing about any technology, to feel comfortable with it, is to understand what it's doing under the hood. And for me, machine learning and artificial intelligence is still a little bit of a black box to a lot of people.
[00:04:11] So let's open up that box and try and understand what's going on inside it. So before we can do that, we want to start off with some definitions. So the first definition we've got is for what is AI? And AI stands to artificial intelligence. I think we all got that far. And it's effectively taking a computer and getting it to achieve some sort of task in a reliable fashion.
[00:04:32] And more generally it's getting it to do so without explicitly telling it how to do so. Okay. And you know, the golden kind of panacea for all this is artificial general intelligence, which is a bit like a human. And that's where you can give it any problem and it will go away and work with that. And a really good way of thinking about this is, say you took an average, sort of 12-13 year old, and you sat them down at a desk and you gave them a word search, and then you gave them a dot-to-dot, you gave them a piece of coloring and you also gave them, I don't know, a story to read.
[00:05:10] Most 12-year-olds could sit down and they'd be able to look at all of those different things, and I'm hoping most adults on the call would be able to as well, look at those different things and figure out what they needed to do with each of them.
[00:05:22] Despite the fact they're four different representations of just some black and white on a piece of paper, your brain is able to pick that up quickly and switch different contexts in an abstract fashion to understand what to do. If you go to a computer to try and do that, it would have to recognize what it was first, then start processing it.
[00:05:40] And so that's what the ultimate aim is, is to have a brain a bit like a human, who can go away and do that, but we're quite a way off that yet.
[00:05:50] Machine learning, then, is a subset of this. And AI as a field has been around since around the 1950s. It was really where it started. And machine learning is really a subset of techniques within the artificial intelligence field.
[00:06:03] And these subset of techniques use data analysis to achieve specific outcomes. So whereas artificial intelligence is really based around generic outcomes. So being able to look at any one of those things and do it, machine learning is really focused on, okay, if I take this large set of data, and look through it, can I achieve a specific outcome following that?
[00:06:24] So a good example is something like Sudoku, okay? You can give a machine learning system lots and lots of to Sudokus, and it can pretty much guess what it means to do straight away. Okay. And it can just do data analysis to run through that whole playing a tic tac toe.
[00:06:38] Simple examples, really. All you're doing is you're looking for a pattern in this and you're trying to infer a solution. So, we have the more generic AI term, we then have machine learning, which is a subset. We're just looking to infer a solution. But underlying all of this, it's statistics.
[00:06:57] And anyone who's taken a high school level statistics class knows that statistics is gathering information about a data set in order to provide you knowledge. And for those who have done, you know, some sort of information technology course in the background, we remember that there is data, there is information, and there is knowledge. And that's what statistics is, is we take some data, we manipulate it to get some information about that data. So almost metadata.
[00:07:23] And then as humans, we can take that metadata and obtain some knowledge from it. And so, this is just calculated using the underlying data. So, think of, you know, the average or the mean, think of the median, the mode, the number. All of these things are just statistics. And you can put these together in kind of a series of crawl, walk, run, or baby, child, adult, whatever process you would like to think about there.
[00:07:48] But a very kind of genesis when you're crawling or when you're like a baby, you just learning through repetition. And that's, you know, for those who've had kids, you'll stand there and you will say, mama or dada until you're blue in the face and eventually, the baby will keep on trying and trying and trying and repeat back to you what it's learned, kind of parrot-fashion.
[00:08:07] And that's really just statistics. There's no new information there. You're just repeating information. You've then got as a child, or when you're starting into the process of walking, that's looking at the world and kind of inferring some patterns from it.
[00:08:20] So, you know, children are starting to piece things together where they can see commonalities between, you know, two things being red or two balls being different colors but being the same thing, even if they're different sizes. And that's a second sort of process, which is really machine learning, where you're inferring something and solving a problem based upon your previous data.
[00:08:42] The running portion of this or kind of the adult set up is where we are all now. Which is where we can take any generic tasks we're given and based upon our previous knowledge, we can, even if it's something we've not ever seen before, go away and work out how to do it. And that's really the skill of being an adult. And being a human is, you know, if you're a consultant or a developer or an admin or an architect or whatever, you're used to someone coming to you and saying, we have this problem we need to solve.
[00:09:13] And what you're doing is, you're going based upon what I've done before, I'm going to be able to take this abstract concept, map it crossed to this other abstract concept, this other problem I've got here, and then come up with a third abstract concept that is the solution. And that's really, really powerful in something we do without even thinking about it.
[00:09:31] So. Why is AI and machine learning exploded over the recent years, then? Well, it's for three main reasons. Number one, there's more data, so to be able to do more inference from these things and gather more statistics, you need more data.
[00:09:48] We didn't really have what's termed big data until after the year 2000 for the majority of organizations, and so we needed more data to be able to do things. We then needed to be able to do more complex analytics on more complex data, and you know, most of the data that was stored historically in systems was really sort of transactional accounting data, and things like that.
[00:10:11] You know, accountancy was the big use for computers and machines at the start. Now we're storing everything in there, knowledge, graphs, and networks, and all of these different pieces in there. And we're trying to piece that together and do more complex analytics on them.
[00:10:27] Then finally, scalability. That's been the real game-changer over the past five to 10 years, is things like the cloud. Storage has become super cheap, and processing powers become super cheap, and both of those combined together mean that you can go away and process all this data and run these algorithms in a much more cost-effective manner. So, where something might usually take, you know, if somebody takes a hundred thousand CPU cycles to run, previously that might have taken days or weeks, and now can be done in minutes or hours.
[00:10:56] So you can have a basic understanding of machine learning, of AI, of statistics, and kind of how they all piece together. But I want to go deeper. I told you I want you to understand how it works. So, I want to look at this picture.
[00:11:12] This is a neural network, and by the end of this talk, the aim is that you're going to be able to understand what each of these three colored sets of dots does. The left-hand side on the screen as you look at it, is the input layer. That's the green dots. Above the middle layer, which is the orange dots, the hidden layer. And we've got the output layer, which is the blue dots. By the end of this, talk, we want to be able to understand what each of these things is doing in a typical artificial intelligence machine learning algorithm. Okay?
[00:11:42] Now I understand this looks like a just a mess at the moment. And if you've never seen one of these diagrams before, apart from maybe thinking, “Oh, there's a number of pretty patterns that are coming up and all the lines crisscrossing,” it just looks like gobbledygook.
[00:11:57] And it's actually fashioned on the way in which the brain operates. Each of these dots represents what is meant to be a neuron within the brain. And your brain has all of these neurons connected together, firing off each other, and they're doing that all the time. And that's what allows you to think and understand things. And there are, you know, hundreds of millions of them all firing off right now as you listen to me and look at this picture.
[00:12:18] So our job is to try and understand what this simplistic picture is doing by the end of this. Okay?
[00:12:25] So, let's start off by looking at some data. So, I am a big fan of football or soccer, you know, always have been, always will be. And one of the things I'd love to do is play the FIFA video games. A great way to relax and play.
[00:12:43] And so I wanted to use some data I was interested in, as I started to do this. And as a kid, I used to have a couple of games where I would genuinely sit there for hours. There's a particular game called Football Manager, I would spend hours poring over what is just a spreadsheet of statistics around football players. So this is really taking me back to being a teenager here.
[00:13:03] And what I've got here is I've got a plot on the X-axis. Going across, we have the height of a certain set of data, of players in FIFA, and that's in inches. And then on the vertical axis, we have their weight. And we want to see how well correlated a player’s waist is to their height.
[00:13:23] And this is a set of professional athletes, remember, okay? So, there should be some decent correlation. They should be fairly fit and healthy. So, we’ve all seen, you know, plot lines and timelines before, I'm sure everyone's done it in Excel. And what you can do is you can go away with this data and you can start to produce some statistics.
[00:13:42] They give you a plotline, okay? And we can create a plotline that allows us to see how well correlated this data is. And so what we can see is though we've got a bundle of data on the left hand. Let me see if I can highlight it. At the bottom of the page on the left here, this is telling us that we have a lot of short players who vary in weights.
[00:14:00] We've then got a bundle of data here, with, kind of shorter players under the mid-range of weights. And then total players who are a bit heftier. and we can see that we've got a trend line that goes all the way through this. That trend line gives us the equation. Y equals 1.45, one X plus 68.123, which in English means if I know how tall you are in inches, I times that by 1.45 for one and I add 68 pounds on. And if you are 72 inches, it guesses you should be around, I think at 170-173 pounds, something like that. So fairly accurate. It's just telling us where you will be on this line.
[00:14:40] We then got a couple of other statistics there. We’ve got the R squared, which is our error, and we've got this letter P, or actually it should be a Greek Rho, which is telling us how well correlated they are. And you can see here the correlation is not that great. Okay. So, these are just two pieces of input data we've got. We've got the heights and the weights, and from this, we can see there's not really a great correlation.
[00:15:02] So let's add a third metric. Let's start adding in the player's age because you know, when you're a younger player, you'll not as tall, especially youngsters get signed up over in the UK in football teams at the age of 15. So, you know, you've still got lots of growing to do. And when you're an older player, you might not be as, uh, you might not be as fit, shall we say, running around the pitch all the time. So, you might put on a little bit of extra weight. So, let’s add this variable in, and we start to have a 3D graph. Okay. So, we've now got three pieces of data coming in for us to do our statistics on, and us to make our guess all.
[00:15:39] But you can see that these tools are graphlets. I mean, it's fair to say it's not easy to read. Yeah, I think most, most people can probably comprehend that there's, there's a blob of points here and you can shift it around in your mind to see some sort of rough trends. But, it's not really doable.
[00:15:58] And so this is a problem for humans, is that humans are really good at working in 2D, and they're pretty good at working in 3D, but we're really bad at working in 4D.
[00:16:08] And when we talked earlier about having all of this additional data, this more complex data coming in, well, let’s just think about if we were working with data on opportunities in Salesforce.
[00:16:21] So say you wanted to work out some metrics or statistics around our opportunities where you might want to know the total amount that's been sold to that account. You might want to know the number of products they've got.
[00:16:30] You might want to know their average order value. You might want to know their revenue, their profitability, the number of employees they've go, the number of new employees they're planning on hiring this year. All of these things you may want as different numbers to add into your calculations to help you to better gauge what they're going to be ordering or how much you should expect them to order. But that becomes difficult to do. And there's a really good picture here that illustrates this. You know, as we start to think about different dimensions of things, they very quickly become very hard to comprehend.
[00:17:05] So a one-dimensional cube is a line. A two-dimensional cube is a square, a three-dimensional cube as a cube, and that orange dot in the middle there is actually both kind of the front corner and the back corner. I'm never pleased with this picture, but I like all the others.
[00:17:20] When we start off talking about a four-dimensional cube, it'll start to make everyone's head hurt. I'm pretty calm. Yeah. I'm pretty confident there's no one sat there at home now going, “Oh yeah, six-dimensional cube, I can easily visualize that.”
[00:17:33] As a fun side story, when I was at university, I once went into a lecture at 9:00 AM on a Thursday morning. You know, even know, even now, I'm not the most alert awake at 9AM. But backer as a student, I definitely wasn't. And the lecturer wandered in and first thing they started talking away at nine o'clock was, okay, imagine you're in a nine-dimensional cube. And, and they just continued without missing a beat. And, I, you know, I've never managed to visualize a nine-dimensional cube, and I don't know how that lecturer did it, or even if he was just putting it off.
[00:18:09] But this is a problem for humans is that we visualize things, you want to be able to understand things, but we can't really do that in higher orders. Now for a machine, that's not a problem. Your computer doesn't care whether it's one dimensional or 12 dimensional, it just sees numbers. And so that's why machine learning systems can become far more useful when we have more points of data we want to input and are working in a higher dimension system.
[00:18:36] So, if we jump back to on your neural network picture, what we've just discussed is the green layer. And our green layer is our input layer. And these are just all the numbers we're putting in as different dimensions. Each green dot is a dimension. So, in our picture, we have three, which was the height, the weight, and the age.
[00:18:57] We could have had 10 we could have had four. It doesn't matter. And our machine learning system can work with that. We've also looked at the blue layer, which is our guests as to what the weight should be, based upon the height and the age. And that's our output number. So, given that we have a certain input value, we can guess what we expect the output values, debate.
[00:19:19] So very quickly, just by looking at a couple of simple graphs, we understood what our inputs are and what our outputs are and what those mean. So now let's get into the interesting and more complicated bits, which is this big orange mess in the middle.
[00:19:34] So let's go back to this graph. And what I want you to do is everyone at home now, hopefully, the video is recording so you can see me. Is you’re hold up your arm like that, so that you're looking at it just like you're looking at the blue line. Okay. And this is the best plotline that the system could come up with for this data. Okay? So, it has, the error is minimized because it's the best plot.
[00:19:58] Now, if you tilt your arm up like that, as you do so, your error gets worse. Okay? And so, we've got a bigger gap from the top downs of where will the other points are, and a bigger gap from the bottom to where all the points are down here, and that’s going to increase our error. If we go back flat to where we were and then go the other way, we’re then going to have our error increase again.
[00:20:18] Okay. And so what we're saying is that as we tilt this one way or the other, our area increases. Now, if we were to plot a graph of what that means our error looks like, we get a parabola, okay? And our parabola is effectively our distance away from that trend line that's giving us the error. And what do we want?
[00:20:40] We want to find it where the error is smallest because that's going to give us the best results, our best guess at what's going to happen. Okay? The way in which we do that in a machine learning algorithm is by a process called gradient descent, and what that means is that we're going to choose any point on this, on this curve, on this parabola.
[00:20:58] I'm going to try going down the slope. We're going to make guesses and hop from side to side, side to side, and so we get closer to that point where we can't get any better. Okay. And that's just how machine learning algorithms work, that big blob of orange dots, all that’s doing, is it’s making a guess, feeding back how good that guess was, making another guess, feeding back how good that guess was, how good that guess was, you making another guess, feeding that back, making another guess.
[00:21:27] Okay, that's all it’s doing. And so it does that by what's called a learning rate. So, there's a value set in these systems which is the learning rate, and it's how quick it's going to try and go down this gradient.
[00:21:38] And you can set a big learning rate, but the problem is that it can dart around and actually get worse. You can a small learning rate, but the problem there is that it can take a long time to go and do all these guesses and go backwards and forwards and backwards and forwards and backwards and forwards. And so we have to do is try and find the best learning rate for your system.
[00:21:57] And often with machine learning systems, you end up running them multiple times to get the right answer. Okay? You can have multiple different sets of data come out with different answers, and your job is to go away and find the best from all those different sets of data. And that's all those orange areas are doing.
[00:22:13] Now this error graph here, looks pretty simple and easy when we're talking about two-dimensional data again. If we started to have three-dimensional data again, it could be nice and easy. Here, this is what I like to call the tea towel graph. So if anyone who's got a towel at home, if you grab all four corners of the towel and hold them up, the middle of the towel should sink to the middle unless you are in an antigravity situation, in which case, you're working on something completely different.
[00:22:41] But the bottom of that, that kind of bowl there is where our error is minimal. And that’s where we want to get the value from. So that's all we want to try and find. Now, this is really an idealized situation.
[00:22:55] If we could get this graph, your data’s perfect. You'll never have to worry about anything, and you can put your feet up. You aren’t likely to get something like this though. And this is a graph that shows us the error over time and also the error over multiple dimensions. And if you think about when we were doing that with our arm a minute ago, imagine you're doing that with your arm in three dimensions, moving it backwards and forwards as well as up and down.
And if you're doing it in four dimensions, so you're doing it backwards, forwards, up and down, left and right, and over time, well, you can start to end up with very weird and complicated graphs. And these can give you different results that are incorrect. So we can see here that if we started on point A, and trying to find the minimum, we might actually find what's called a local minima, which is a minimum, which is shown here on the left hand side, but it's not actually the best result we could get.
[00:23:46] We might actually have to get worse by going up over that little red hump in the middle and then get to the global minima. We don't have to go over the saddle point, which is just like a saddle on the horse to get to that global minimum.
[00:24:00] And this is why you might want to run your machine learning system many, many different times to get many, many different results. And this is why scalability and performance have become such a big part of this. Because if you've got to run a process that takes, you know, a hundred million calculations more than once, you're going to need a lot of computers to do it.
[00:24:19] So, if we just jump back to our neural network now, we can see that we've understood all three parts of this. We've got all green inputs, which are our different dimensions. They're going to give us some value in our blue outfits, which are our output dimensions.
[00:24:34] And in the middle we've got these hidden layers, and all these hidden layers are doing is giving some values as a guess, seeing how bad that guess is, feeding that back, and then making another guess. And it's effectively just me and you sitting there. And if I asked you to guess a number between one and 10, and you said seven, I could then go higher or lower. And you could then go again and guess again. And I could then say higher or lower until we found the right value.
[00:25:02] That’s all that these things are doing is going backwards and forwards. So now, you understand how a neural network works and you understand exactly what this diagram is doing. When someone comes to you with a machine matting system and post this on slide and says this is all very complicated, it's actually not.
[00:25:17] It's just trying to minimize how wrong it is. So following this, I just want to finish up with a couple of quick, quick how-tos or quick guides for you.
[00:25:26] The first one is, when do I use statistics, machine learning or AI? Because, you know, they're all fantastic, but when do you use one? And there's a really simple guide for you here.
[00:25:36] If you have some well-defined rules, just use statistics. If your data’s fairly small volume, you know exactly what you're looking for. You know exactly how it's put together. Use some statistics and see how far that gets you. That's going to give you just a wealth of information. And there's a lot of people who just don't actually run the right statistics on their data anyway.
[00:25:58] Salesforce makes this really easy for you in reports. And again, if you've got a larger volume of data, put it in something like Einstein analytics. That’ll allow you to do slightly more complicated statistics on a larger set of data, but still within those well-defined rules.
[00:26:16] If you do have a really large volume of data, and you really have no concept of how it's related or what these different bits and pieces mean together or it's too vast for you to be able to comprehend like that with different dimensions. Then you should [00:26:00] start looking at machine learning and AI.
[00:26:31] And the reason I mentioned Einstein analytics a minute ago is because the way that I in Salesforce have tied together that analytics and discovery in the Einstein product really kind of helps with this. You can start by putting your data in those Einstein Analytics dashboards and visualizations for you, and then you can make discovery run and see if it’s giving you some useful insight, and then started do more machine learning back.
[00:26:55] But the reason I raised that to see if it gives you useful in a useful insight is to just finish with this story:
[00:27:01] So this here is a plane from World War two it's a. It's a picture of a statistical analysis of where bullet holes were found on these planes. Okay? And the British command were trying to figure out where they should reinforce the airplane. And so they took this picture and they drew all these red dots on there, and they were trying to pinpoint where they should put the actual reinforcement. And the problem was that the first suggestion that they made was to put it where all the red dots are.
[00:27:32] Now, the problem with that is that you're only capturing those bullet holes on planes that make it back. Planes that don't make it back are the ones where you really want to be adding extra reinforcement. And so one of the key things to remember whenever you're getting any piece of output, be it a statistic you've gained or run from your data, be it some deep AI or machine learning thing that's running, giving you some output is to just take a step back. And think about it.
[00:28:01] Does it make sense and why? Because otherwise, you can end up reinforcing the wrong part, and just going away and doing what somebody has told you, without actually thinking about why. And that's really the difference between the humans and the machines, is our ability to look at this and truly understand the planes that don't land or the ones that need reinforcing in the front.
[00:28:20] Thank you very much for listening. I hope you've enjoyed this. Again, if you want to find me afterwards to ask any questions or find out more, please follow me on Twitter, @pbattisson, @cloudbites.tv. And there's also going to be a coupon going around for 20%, 25% off, I think is for my course on Apex testing if you're interested as well.