WEBINAR Series

AI/ML for Normal Humans

Use Salesforce regularly? This webinar recap is for you. Here, Integrate.io's panel of experts explore hot-button Salesforce issues and more.

AI/ML for Normal Humans

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.

VIEW TRANSCRIPT

Good day. Welcome to another, X Force Data Summit session. Today we have, Paul Badison, who, is the COO of Cloud Galacticos, which is Salesforce consultancy mainly headquartered in the UK.

Paul's gonna talk about machine learning and artificial intelligence for normal humans. And, you know, hopefully we're all normal humans on this listening to this talk and so we'll all get something out of it. With that take it away Paul.

Superb, thank you. So yeah welcome everyone to this talk. It is machine learning and artificial intelligence for normal human beings. As mentioned typically, there we go.

As mentioned, my name is Paul Baterson. I am the CEO of Claro Galactico's. I am a seven times Salesforce MVP, thirteen 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, or find me, you're pbatterson on Twitter or pbatterson dot com.

I also run the CloudBytes TV YouTube channel, which is a free learning resource for Salesforce admins and developers and architects. That's cloudbytes. Tv or cloudbytes. Tv.

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 or artificial intelligence and machine learning. And we can see that through a Google Trends graph, is Google's obviously the answer to how we know that anything's becoming popular. As you can see here, this is the search graph for the term machine learning. It's gone way up in popularity over the years, starting out in twenty fifteen fairly low down and up in end of twenty nineteen was one of the most popular terms out there. So there's been a lot of use of these terms and we can also just see this through the Gartner hype cycle.

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 of them. So whether it's deep reinforcement learning or artificial general intelligence and moving on then to AI platforms as a service and edge AI 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. 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. 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 ten years ago, fifteen years ago, but before I was even doing Salesforce.

And back in around twenty thirteen, twenty fourteen, I did a talk at Dreamforce with a colleague of mine, Jennifer Weyer, where we built a machine learning system in Apex.

If only we'd have been sensible enough to sort of build something a bit more productized, we could have built Einstein before it was there. But 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.

I think that's I'm sure I understand. And there's a good example of technology not working as Siri butts in. But I wanted to I think the key thing about any technology is to feel comfortable with it, is understand what it's doing under the hood. For me, machine learning and artificial intelligence is still a little bit of a black box to a lot of people.

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 for 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.

And more generally, it's getting it to do so without explicitly telling it how to do so. Okay? And 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, took an average sort of twelve, thirteen 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.

Most twelve 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. Despite the fact there are 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 got a computer to try and do that, it would have to recognize what it was first, then start processing it. That's what the ultimate aim is, is to have a brain a bit like a human that can go away and do that, but we're quite a way off that yet.

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, 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 for it, can I achieve a specific outcome following that? So a good example is something like a sudoku. You can give a machine learning system lots and lots of sudokus, and it can pretty much guess what it needs to do straight away. And it can just do data analysis to run through that or playing tic tac toe. 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 is statistics, and anyone who has taken a high school level statistics class knows that statistics is gathering information about a data set in order to provide you knowledge.

For those who have done some sort of information technology course in the background, we remember that there is data, there is information, there is knowledge, that's what statistics is. We take some data, we manipulate it to get some information about that data, so almost metadata, 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 the average or the mean, think of the median, the mode, the number, all of these things are just statistics.

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 here. But at the very kind of genesis when you're crawling or when you're like a baby, you're just learning through repetition.

For those who've had kids you will 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 when it's learned in kind of parrot fashion. And that's really just statistics. There's no new information there. You're just repeating information back. You then got as a child or when you're starting to the process of walking, that's looking at the world and kind of inferring some patterns from it. So children are starting to piece things together where they can see commonalities between two things being red or two balls being different colors but being the same thing even if they're different sizes.

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.

The running portion of this or kind of the adult setup is where we are all now, which is where we can take any generic task 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. That's really the skill of being an adult and being a human is, 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. And all 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 across 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 and something we do without even thinking about it.

So why has AI and machine learning exploded over the recent years then? Well, it's for three main reasons. Number one, there's more data for you to be able to do more inference from these things and gather more statistics, you need more data. We didn't really have what's termed big data until after the year two thousand 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.

Most of the data that was stored historically in systems was really sort of transactional accounting data and things like that. 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.

And then finally, scalability. That's been the real game changer over the past five to ten years is things like the cloud. Storage has become super cheap and processing power has become super cheap. And both of those combined together, maybe you can go away and process all this data and run these algorithms in a much more cost effective manner.

Whereas something might usually take, if something 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.

We've now got a basic understanding of machine learning, of AI, of statistics, and how they will piece together, but I want to go deeper. I told you I want you to understand how it works.

I want to look at this picture.

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. We've got 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 or machine learning algorithm.

Now, I understand this looks like 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 in all the lines crossing. It just looks like gobbledygook. 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. That's what allows you to think and understand things, and there are hundreds of millions of them all firing off right now as you listen to me and look at this picture. So our job is to try and understand what this simplistic picture is doing by the end of this. Okay, so let's start off by looking at some data.

So I am a big fan of football or soccer.

Always have been, always will be, And one of the things I love to do is play the FIFA video games. Great way to relax and to play. And so I wanted to use some data I was interested in as I started to do this. 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 pouring over what is just a spreadsheet of statistics around football players. So this is really taking me back to being a teenager here.

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, have their weight. And we want to see how well correlated a player's weight is to their height. This is a set of professional athletes, remember. So there should be some decent correlation. They should be fairly fit and healthy.

So we've all seen plot lines and trend lines 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 that give you a plot line. Okay? And we can create a plot line that allows us to see how well correlated this data is.

And so what we can see is that we've got a bundle of data on the left here. Let me see if I can highlight it. A bundle of data on the left here that's telling us that we have a lot of short players who vary in weight. We then got a bundle of data here which are kind of shorter players under the mid range of weight and then taller 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 one point four five one x plus sixty eight point one two three, which in English means if I know how tall you are in inches, I times that by one point four five four one and I add sixty eight pounds on, and if you are seventy two inches, it guesses you should be around I think at one hundred and seventy two, one hundred and seventy three pounds, something like that. Fairly accurate. It's just telling us where you'll be on this line.

We then got a couple of other statistics here. We've got the r squared, which is our error, and we've got this letter p or actually it should be a Greek row, which is telling us how well correlated they are. You can see here the correlation is not that great.

These are just two pieces of input data we've got. We've got the height and the weight. From this we can see there's not really a great correlation.

Let's add a third metric. Let's start adding in the player's age because when you're a younger player you're not as tall especially youngsters get signed up over in the UK and football teams at the age of fifteen. So you know you've still got a lot of growing to do. When you're an older player you might not be as fit, shall we say, running around the pitch all the time. So you might find a little bit extra weight. So let's have this variable in, and we start to have a three d graph. Okay, so we've now got three pieces of data coming in for us to do our statistics on and for us to make our guess on.

But you can see that this draws a graph that's, I mean, it's fair to say it's not easy to read.

Yeah, I think most people can probably comprehend that there's a blob of points here and you could shift it around in your mind to see some sort of rough trends, but it's not really doable.

And so this is a problem for humans is that humans are really good at working in two d and they're pretty good at working in three d, but we're really bad at working in four d.

And when we talked earlier on 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. 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. You might want to know their average order value. You might want to know their revenue, their profitability, the number of employees they've got, 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 better gauge what they're going to be ordering or how much you should expect them to order, but that becomes difficult to do.

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. So a one dimensional cube is a line, a two dimensional cube is a square, a three-dimensional cube is a cube, and that orange dot in the middle there is actually both kind of a front corner and the back corner.

I'm never pleased with this picture, but I like all the others.

But when we start talking about four dimensional cube, it will start to make everyone's head hurt. I'm pretty confident there's no one sat there at home now going, oh yeah, six dimensional cube, I can easily visualize that.

As a fun side story, when I was at university, I once went into a lecture at nine am on a Thursday morning.

Even now I'm not the most alert awake at nine am, but back 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 they just continued without missing a beat. And 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 on. But this is a problem for humans is that we want to visualize things, 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 twelve dimensional, it just sees numbers. 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 systems.

If we jump back to our 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 of the numbers we're putting in as different dimensions. Each green dot is a dimension. In our picture, have three, which is the height, the weight, and the age. We could have had ten, 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 guess as to what the weight should be based upon the height and the age, and that's our output number. Given that we have a certain input value, we can guess what we expect the output values to be.

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 go on to the interesting and more complicated bit, which is this big orange mess in the middle.

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, really hold up your arm like that so that you're looking at it just like you're looking at the blue line.

This is the best plot line that the system could come up with for this data. So it has the error is minimized because it's the best plot. Now if you tilt your arm up like that, as you do so your error gets worse.

And so we've got a bigger gap from the top down to where all 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.

So what we're saying is that as we tilt this one way or the other, our error increases.

Now if we were to plot a graph of what that means our error looks like we get a parabola.

And our parabola is effectively our distance away from that trend line that's giving us the error.

And what do we want? 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.

What that means is that we're going to choose any point on this curve, on this parabola, and we're going to try going down the slope. We're going to make guesses and hop from side to side, side to side until 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 you, making another guess, feeding that back, making another guess. 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.

And you can set a big learning rate, but the problem is that it can dart around and actually get worse.

You can set 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 what you have to do is try and find the best learning rate for your system. And often when machine learning systems end up running them multiple times to get the right answer. You can have multiple different sets of data come out between different answers, and your job is to go away and find the best from all those different sets of data. That's all those orange areas are doing.

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 t 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, middle of the towel should sink to the middle unless you are in an anti gravity situation in which case you're working on something completely different. But at the bottom of 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 what we want to try and find. Now this is really an idealized situation. If we could get this graph, your data is perfect. You'll never have to worry about anything and you can put your feet up.

You're more likely to get something like this though.

And this is a graph that shows us the error over time and oh sorry the error over multiple dimensions and if you think about when we were doing that with our arm a minute ago, 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. We can see here that if we're starting 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.

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 might have to go over the saddle point, which is just like a saddle on a horse to get to that global minima. 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 a hundred million calculations more than once, you're going to need a lot of computers to do it.

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 our green inputs, which are all different dimensions.

They're going to give us some value in our blue outputs, which are our output dimensions, and in the middle we've got these hidden layers and all these hidden layers are doing is getting 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, if I asked you to guess a number between one and ten, 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. 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 learning system and puts this on a slide and says this is all very complicated. It's actually not. It's just trying to minimize how wrong it is.

So following this, I just want to finish up with a couple of quick how tos or quick guides for you. The first one is when do I use statistics, machine learning, or AI? Because they're all fantastic, but when do you use one? There's a really simple guide for you here.

If you have some well defined rules, just use statistics.

If your data is 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. 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 allow you to do slightly more complicated statistics on a larger set of data, but still within those well defined rules.

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 start looking at machine learning and AI. And the reason I mentioned Einstein Analytics a minute ago is because the way that sales force of tied together analytics and discovery in the Einstein product really kind of helps with this. You can start off by putting your data in those Einstein Analytics dashboards and visualizations for you, and then you can let discovery run and see if it's giving you some useful insight and then start to do more machine learning there.

The reason I raise that to see if it gives you a useful insight is to just finish with this story.

So this here is a plane from World War II.

It's a picture of a statistical analysis of where bullet holes were found on these planes, 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 extra reinforcement.

The problem was that the first suggestion that they made was to put it where all the red dots are.

Now the problem with that is that you are 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, to just take a step back and think about it. Does it make sense and why? Because otherwise you can end up reinforcing the wrong part and just going away and doing what something has told you without actually thinking about why. 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 are the ones that need reinforcing at the front.

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 pdasen or cloudbytes tv. There's also going to be a coupon going around for twenty twenty five percent off I think it is for my course on apex testing if you're interested as well.