Machine Learning | How Machines Works Definition - Information Technology

Machine Learning  How Machines Works

Machine Learning How Machines Works
Artificial intelligence the wave of the future well it has applications so scary that includes things like you know software that can hold lots fickle conversations with you or even go so far as to read your mind the thing is AI is no longer science fiction both the examples one of the key components of artificial intelligence called machine learning and we're gonna try and realize together that it is not witchcraft at oh you're watching another random Wednesday episode on 0612 TV hello and welcome back to another random Wednesday episode now as mentioned artificial intelligence is quite a broad subject and all we're gonna look at today is just one feel of it and that would be machine learning now before we go into you know great depths of what machine learning actually is I think it's important to be able to compare it with traditional programming to you know just tell the difference between the two get two ways to solve computational problems in general traditionally the method we use to solve it is by actually writing an algorithm what you do things this way the operation is more or less rigid you have an input the input is processed in a consistent and well-defined manner and then you get an output so a known thing set of input will always produce the same set of output and in fact this is the law that governs basically the vast majority of the programs you're using you know this includes productivity applications like spreadsheets or document processors all the way to programs like games they're all written in the same manner a fixed set of input gives you a fixed set of output machine learning differs in a sense that the process
Machine Learning How Machines Works
part of the equation is actually modeled or shipped by the input and that is where the learning part happens the program itself is actually shaped by the input now this still sounds a lot like witchcraft so let's delve deeper and try to understand it better now consider this analogy you may have done this in school before but maybe you've done a set of experiments they have given you a set of data so what do you do is you take out a piece of graph paper and you plot these points on that graph paper naturally the next thing you want to do is to either interpolate between the results a chapel eat them or just fine you know the relation between these two variables what do you then do is you draw a line of best fit through all the points in fact with this line what you've generated is an expectation of you know what kind of Y values you'll get given a particular x value and in fact what you've done is you've generated a function you know it's kind of like a program because it takes an input and produces an output and you've actually defined this function entirely based on a set of data at the simplest this is what machine learning does and proper name for this is called regression of course many other techniques exist but I think this is a good example to show you how you can actually generate a program just based on a set of input data so the answer is machine learning is in witchcraft it is simply a statistical method and just the proof is not witchcraft what I'm going to do is I'm actually going to show you an example running on my very own computer I'm going to teach my computer to recognize the difference between a circle and a square that is hand-drawn now for the sake of simplicity we are going to very much limit the scope of this experiment the input data are these 100 by 100 pixel images that are entirely black and white these pictures consist of a white background as well as a shape and black so what are you seeing here are these 16 training examples we're gonna be using now I can't just take all these pictures show them to a machine learning algorithm and say here do your stuff that would be witchcraft instead what we need to do is we need to extract what are known as feature vectors these are the things that will be fit into this statistical model and that is basically what the algorithm will use to learn about the input data to achieve this I've written a little utility in Python and the whole idea is we want to look up for two things first we want to look at all the horizontal lines in an image that are not completely empty and what we want to do is we want to see how many pixels are being colored black the idea is this for a circle you'll expect this number to start off slow increase slowly to a maximum and then decrease again that is of course because of the shape of the circle from ask where you'd expect this value to start off large and stay at a more or less constant number throughout the entire duration and then jump back to zero almost immediately so all I'll do is we'll find the average length the average width of black pixels and we'll try to see how much the other lines differ from this average theoretically if we have a circle the variance will be large whereas if we have a square the variance will be very little this will be our first of two feature vectors our second one can pass the biggest difference between two consecutive lines
Machine Learning How Machines Works
theoretically this value will be small for a circle and large for a square so we have a to feature vectors that are generated for every image now that we have that ready we can feed that into a mesh learning algorithm and hopefully it sees the pattern that we expected to see what I'm using here is a free open source program called orange it basically gives you a note based interface in which you can very nicely push data around and into machine learning algorithms so here's a plan we take the 16 samples we have run it through my algorithm to generate the feature vectors and then feed them into orange we run the data through a test learnist note and I have just one algorithm hooked up to it right now what we're doing here is called cross-validation the idea is this I have 16 pieces of data right now that are known in other words i have included both the values as well as you know its classification what cross-validation does is it uses some of the data to train the algorithm any remaining ones to test it to see if the training was successful it does this a certain number of times currently I have it set to fivefold cross-validation so it does this five times with five different partitions when this is done we can actually look at the results in terms of a confusion matrix what the speed tricks does is it shows you how many of the instances will correctly classified and how many were wrongly classified in this case we have a perfect score what we're going to do now is we're going to add a few more algorithms so all these are different machine learning techniques that we're just going to pit against each other using the same set of input data and we'll see how they all fit and maybe because my feature vectors were really effective or my input data is really simple most of the algorithms actually don't have much trouble in the worst case they misclassify one piece of the input and then is considered you know pretty good performance they're different ways to test you know how well a classification has went we've already seen cross-validation or we can also do is we can bring in a new set of data in fact what I have here are eight more samples that are different from the training data so what i can do is i can introduce that you know to the entire setup and basically test them on the new set of data as you can see the algorithms fed pretty well with the exception of the majority algorithm most of the others are able to identify the new items without any problems try some other different sets of data I've publicly meet these more challenging so that's a higher likelihood of thanks messing up for example this set of data has all these shapes of center or drawn in a very sloppy manner almost algorithms that pretty well fesem speak confusion with one particular square in fact if we were to look at its feature vectors you realize that they look a lot like that of a circle obviously the algorithms going to get confused let's try again with a little noise what I've done is I've sprinkled random black and white pixels throughout the image and not surprisingly at all all the algorithms have actually failed in this case it is not the fault of the algorithms at all instead you realize that my future factors were completely confused thanks to the noise so in this particular case the issue lies with my feature vector generation and there have it that is machine learning in a nutshell we've tried to understand the concept behind how machine learning works we've then gone on to look at an extended example of me putting machine learning through its paces we've seen that given favorable conditions machine learning can do really well at classifying samples and probably most importantly of all with lund that it is not witchcraft it's just meant that...

No comments:

Post a Comment

Boost WiFi Hotspots With a Hotspot Booster - Information Technology

Boost WiFi Hotspots With a Hotspot Booster if you've got one of these then you're probably on the go and if this is your mobil...