Just about every explanation of Artificial Intelligence mentions Machine Learning. That’s because it enables systems to learn from data and adapt to change. We know that Machine Learning does amazing things, but have you ever wondered how it does its magic.
Machine Learning is the way we teach computers to find patterns in data. Algorithms are step-by-step instructions on how to process data. Humans use them to program computers to learn. Let’s take a walk through a simple example of how this works.
Let’s say you’re showing a computer a bunch of pictures of cats and dogs. You tell it that there’s a difference between cats and dogs and describe the key differences. Over time, the computer figures out how to tell them apart without you giving it detailed instructions.
There are three key ideas to remember: Data is what the computer learns from. Think of it as the pictures of dogs and cats you show it. Features are the inputs, like a pet’s size, fur color, or, if audio is available, that one barks and the other purrs. The target is the thing we want to predict. Is it a cat or a dog.
We can learn a lot by looking a little closer. Say you’re planning a vacation and want to know the price range of hotels at your destination. You know there’s data online that you can use for your query.
This is most of the Python code needed to do the whole job. Amazingly, it doesn’t take thousands of lines.
The search starts with preparing the data. It needs to be clean and uniform. There can be no blank cells, and the entries must be consistent and complete.
When cleaning ends, Machine Learning starts. The computer begins looking for patterns. In our example the variables you’re examining are latitude, longitude and price.
The data is divided into two separate sets, one for training and another for testing. The computer looks for patterns in the larger training set to make predictions. The model it uses to find patterns is called linear regression. It’s like the computer saying, 'Based on what I’ve learned, here’s my guess.” These predictions are checked for accuracy against data in the test set.
The final output is a scatter plot. Linear regression has calculated a straight line through the data points. The tighter the grouping around the straight line, the more reliable the predictions. This is what is meant by regressing to the mean.
Once the ML model has been trained and evaluated for accuracy, it can be integrated into a web application, such as a web form, to query price information or make predictions in real-time.
What’s really cool is that we can provide new data after the program is rolled out. Updated input makes the predictions more accurate and enable the system to adapt over time. Machine Learning systems continue to learn after their initial training.
Subscribe if you find the video useful, comment if you have questions or have something to add. There are links to more resources in the description. And that’s today’s byte sized tech tip.
Share this post