Machine Learning

Robots and computers from its primitive days to even right now are being programmed to do a set of activities. These activities can be very large. Hence, to develop complex programs, there is a need for a lot of software engineers who work day and night to achieve a certain functionality. This is workable when the problem is well defined. But what about situations when the problem is also way complex?

Learning is something that has made us humans what we are. Our experiences molded us to adapt to situations in a better and a more efficient way. Every time we do something, we know more. This makes us better at doing that task over a period of time. It is said practice makes a man perfect, and it is learning through doing things again and again that makes us better.

However, let us step back and define what learning is? I would like to quote Google here according to it, It is a knowledge acquired through study, experience or being taught. So, learning is basically a way of acquiring information from our surroundings to understand a process and its nature. 

Now, you must be thinking, wait a minute, haven't we made our system learn a lot of vision data in previous chapters when we were making the guard robot. You would be absolutely correct to think so. However, the learning can be done in different ways. What may work for one kind of problem can be futile for some other kind of problem. Hence, there are various types of learning algorithms and their principles. In this chapter, we will be focusing on an algorithm named k-nearest neighbor. It's named the lazy algorithm. I love this algorithm personally for classification. Why? Because technically there is no training phase. How? 

k-nearest neighbor is actually a smart algorithm. Rather than computing a regression of data provided and do a lot of mathematics calculations, it simply takes a structured data from the dataset provided. Whenever there is new data that has come in for prediction, then it simply searches the closest k match of the data provided by the user to the database based on its classification given. So, in this chapter, we will learn how this algorithm will work and how we can use it to make our home smart. 

We will cover the following topics in this chapter:

  • Making a dataset
  • Prediction using dataset
  • Making your home learn
  • Home learning and automation