Transcript for:
Module 2 - Video - Machine Learning 1: Basics

although the title of this course is artificial intelligence and machine learning for managers machine learning in fact is part of artificial intelligence it's one of the many technologies that have enabled this ability for machines to do things that apparently require human intelligence and it does lie at the heart of a lot of other pieces of artificial intelligence so in the next few lectures i want to go over what machine learning is and how it works and what it's used for in this lecture which will be the first of three i'm going to define machine learning i'm going to describe the two main tasks of machine learning and then i'm going to go through the difference between supervised machine learning unsupervised machine learning and reinforcement learning i think the best way to understand machine learning is to look at an example of how we would how we tend to go about solving problems and making decisions in the human way let's say we wanted to come up with a model for admitting college students and we have all of these attributes of the applicants so gpa letters of recommendation essay standardized test scores and extracurricular activities and we want to be able to make a good choice we want to make sure that the student who is admitted is going to be a successful student here and let's say that we decide just on the basis of experience and a combination of intuition we we decide that we're going to weight these different attributes with the numbers that are in the right column here so we have decided that you know the letters of recommendation are worth twice as much as gpa and that gpa is worth twice as much as extracurricular activities okay but we kind of came up with these weights just on the basis of our own experience and so what what would me what this would mean is that we would come up with a rating for the student as some kind of a function like this where it would be you know a weighted sum their score would be a weighted sum two times gpa plus four times letters of recommendation so on and so forth okay but the idea is that we came up with these weights on our own just you know on the basis of these tend to go along with what have been successful students in the past now a better way to do this would be to actually figure out what the ideal weights would be that is let's say we have a database of you know 100 200 000 students and what you know the kind of you know some kind of measure of their success and we would like to just be able to figure out well what are the best weights if we are going to come up with a rating equation how do we come up with these weights well it would be very difficult for a person to look at 200 000 records and find out what those weights should be but a computer can do it fairly easily so what we could do is take this data set that we have and put it into the computer and have the computer figure out okay over time we found out that the best way to weight these criteria is to use these numbers here and so the computer came up with these and these numbers tend to best predict the success of the student okay well this in essence is what machine learning is about it's starting with data and then asking the computer to come up with some way that we can you know some kind of formula or some kind of model that we can use you know for our own decision making needs so in general with machine learning what we do is we feed data into the computer and we ask it to find some pattern that would be useful for us so instead of specifying the solution the machine learns from the examples so this is the general idea we we have what's called training data where we have let's say the target variable that is the student's success we feed it into the computer and then the computer comes up with some kind of model now in the case of the previous example that model was just in the form of a weighted sum but there are infinite numbers of models and but the idea of a model is that now once we have this model we can take new data feed it into the model and it will predict what the student's level of success would be so we start with the you know the historical data provides training to make this model and then we can just plug our new data into the model and it will come up with a prediction okay so they're really two fundamental tasks within the machine learning you know process there is regression and classification under regression we take data let's say we have our model already trained the regression model will take the data and run the numbers and then give you back a number okay so this could be um well i'll go into detail in a minute um and the other task is classification where we run the data through here and it does the model calculations and it inputs it gives you back or rather it outputs a class that is what what class non-overlapping class this particular row belongs to so just to give you some examples so with regression we might use the model to predict how much should we pay for this house okay so we have some kind of model based on previous data that tells us what does a house like this typically cost how many customers will respond to this promotion how many days before this machine requires maintenance so there's any number of uses for a regression model that will give you back a number that you can use for decision making the classification task takes data and then decides which of which of two or more non-overlapping categories this row goes into so for example in our student data we might say okay this is going to be classified as a student that we should not admit versus that we should admit so that's a classifier in this case it's a binary classifier that means it just looks at new data and then based on its training it drops it into the bucket either zero or one a you know there could be any number of categories so in this example we could run some historical data to train a classifier that will tell us whether a certain pattern of computer usage indicates some kind of cyber security threat so it would look at let's say a user session and then based on the attributes of that session return okay this is a high level threat low level threat or no threat so there's another example of how you would use a classifier so there's really three broad categories of machine learning supervised unsupervised and reinforcement in supervised machine learning we begin with the data as we did before and we apply some kind of label so we have said let's say we have 10 000 pictures of cats and we have a label that says cat and this label says not a cat okay so we feed the data and the labels into the into the computer and it comes back with some model for taking a new picture that it hasn't seen before and then telling you whether it's a cat or not okay so that's a classification so another example of machine learning you know supervised machine learning you you know more pragmatic would be if you want to be able to identify pictures of when people are wearing hard hats versus when they're not so you would have these pictures labeled hard hat present hard hat present hard hat not present and it would come up with some model for figuring out when you know based on the new input picture whether the people in the picture are wearing a hard hat now this particular problem we're going to see solved later with neural networks with unsupervised machine learning we have the data but we don't have any labels we are simply putting the data into the computer and saying look for patterns what do you notice usually this takes the form of clustering so for example it might do some churning on the pixel data of these pictures and then group the pictures into classes based on how many people are present or it might group them on the color of their bests or it could come you know group them into images of people that have hard hats versus people that don't have hard hats but the idea here is we're not setting the goal we're simply asking for the computer to look for patterns and this is called clustering my experience most unsupervised machine learning is not really ready for commercial prime time with the possible exception of something called k-means clustering which has been useful for um customer segmentation and in you know under customer segmentation we take all possible customers in our market and we group them according to you know how we should approach them so this might be if we were to look at this on an axis this axis might be age this might be income and these are all of the different observations and we put this into a machine learning clustering algorithm and it might decide okay well really they kind of group themselves into three chunks like this so we have um we have three different clusters of customers so that that i think that the marketing has seen some pretty good success with k-means clustering for customer segmentation but for the most part supervised machine learning works a lot better so the third major type of machine learning is reinforcement learning and a good way to understand what's going on with this is to imagine a mouse that has a goal of getting to cheese and the mouse doesn't have any idea where to go it's just going to take a guess and it's just going to go and then at each step we reinforce the mouse by either saying you know hotter or colder or we add points for a good move and subtract points for a bad move so at each move the mouse gets a better understanding of what are good moves and what are bad moves so notice this is not supervised it's not unsupervised and it really has a particular use case that is whenever we have some kind of entity that's going to go through some kind of process to reach a goal and you can reinforce it along the way this is you know use case for reinforcement learning you probably have seen a roomba well this is how a roomba works it goes through you know it starts off random and it as it as it hits walls that's a negative reinforcement as it makes correct guesses about which way to turn it's it's making um you know it gets rewarded by adding points so this is how roombas are learning okay so those are the three main types of machine learning supervised unsupervised and reinforcement