Machine Learning is used in multiple fields and industries. When I say multiple, I mean it.
Let’s say like, Cooking industry!
“What? Cooking? How is it even related to cooking?!!”
Well.. it is actually. Industries have developed food sorting solutions with machine learning capabilities. The systems use various technologies, including cameras and near-infrared sensors, to sort vegetables based on their size and color. For example, sorting potatoes by size can help manufacturers decide which ones should be made into French fries versus potato chips.
So, what is machine learning? is it magic?
What is Machine learning?
- Making Robots.
- Artificial Intelligence.
- The field of study that gives computers the ability to learn without being explicitly programmed.
What did you guess?
Easy, Option 4 right? But if you haven’t given me the options I would’ve probably told: “Artificial Intelligence” or “J.A.R.V.I.S”. Because first, I knew Machine learning had something to do with Artificial Intelligence and second, I am a huge fan of Ironman.
Machine Learning: Field of study that gives computers the ability learn without being explicitly programmed. — Arthur Samuel (1959)
Traditional programming has been around for many years. It is a manual process. A programmer creates the program(Rules) according to the problem. Now using these rules we can get the output(Answer for certain input data).
For Example, let’s say your teacher gives you a problem where the task is to classify emails as spam or not spam by looking only at the subject of the email. As a traditional programmer, you would create a simple program that checks for certain things: subject length, spam words like “Buy now” or “Free” or “money”, exclamation points, different colored fonts, etc. And then label it as spam/not spam, according to these rules.
But now the teacher tells you to take into account various factors apart from a subject such as the content of the email, image to text ratio, and attachments. All of a sudden it becomes extremely difficult to find a unique formula to solve this.
Now, this is where Machine Learning comes in. Machine learning is the idea that there are specific algorithms that can tell you something interesting about a set of data without you having to write any custom code specific to the problem. Instead, you feed data to the generic algorithm and it builds its own rules based on the data.
The two major sections of machine learning are.
- Supervised Learning
- Unsupervised Learning
Supervised learning is the machine learning task of learning a function that maps an input to an output based on example input-output pairs.
This is the definition for supervised learning in Wikipedia.
Let me make it simple for you.
Let’s say you are trying to apply for a graduate program in some university. But you are not confident enough with your application. So, you decide to write a simple program that can estimate whether your application would be selected or rejected based on your GRE score, TOEFL score, and CGPA.
So you gather several applications of students who have previously applied for the program. For each application, you write down the above-mentioned details — GRE scores, TOEFL scores, etc. But most importantly, you write down the final result(selected/rejected):
Now using this training data we want to classify our application as selected or rejected.
This is called supervised learning. You knew the results of other applications and you use that to classify your application.
So in supervised learning, we train an algorithm using a labeled training data(other applications), then the algorithm will create a logic to classify a new data(your application). So, instead of feeding the logic and the data to get the output, like traditional programming. We feed the output and the data to get the logic. Now using this logic we can find the output for several other inputs. So, what I’m saying is, you don’t need to spend the whole time programming a bunch of logics to see which one gives the desired output. Instead you spend time on collecting the perfect data to train your algorithm for it to give you the perfect logic.
Here are few widely used supervised learning algorithms:
- Linear Regression
- Logistic Regression
- Support-Vector machine
- Naive Bayes
- K-Nearest neighbors
- Decision trees
- Neural networks
1. Why Corporate AI projects fail?
2.How AI Will Power the Next Wave of Healthcare Innovation?
3. Machine Learning by Using Regression Model
4. Top Data Science Platforms in 2021 Other than Kaggle
Unsupervised learning (UL) is a type of algorithm that learns patterns from untagged data.
This is the definition of unsupervised learning in Wikipedia.
You know what? Let me make it simple for you.
In supervised learning, we use several previous data which were labeled (Selected/Rejected), to find the logic. But in unsupervised learning, the algorithm works on its own to discover patterns and information that was previously not known. It mainly deals with the unlabeled data.
Here’s a simple but brilliant example from this website.
Let’s, take the case of a baby and her dog.
She knows and identifies this dog. A few weeks later a family friend brings along a dog and tries to play with the baby.
Baby has not seen this new dog earlier. But it recognizes many features (2 ears, eyes, walking on 4 legs, tail) are like her pet dog. She identifies the new animal as a dog. This is unsupervised learning, where you are not taught but you learn from the data (in this case data about a dog.) Had this been supervised learning, the family friend would have told the baby that it’s a dog.
So in unsupervised learning, we train an algorithm using unlabeled training data. The algorithm will work on its own to discover patterns and information from the given data and then labels the data on its own.
Here are few widely used unsupervised learning algorithms:
- K-means Clustering
- Anomaly Detection
- Principal Component Analysis
Let’s plot a simple training set that represents the salary of an employee concerning the years of experience. It would look something like this.
Here we can see the salary is directly dependent on the years of experience: Salary increases if the number of years is higher.
So, our objective is to train an algorithm to find the salary for the given experience.
Let’s use a Linear regression algorithm for this problem.
Every algorithm has a hypothesis function. Which is nothing but the prediction for a given input value. It takes in single(x) or multiple values(X) and gives out the output/prediction(y) for the given input. Let’s look at the hypothesis function for Linear Regression.
The hypothesis function is nothing but a line(for a 2-dimensional data set) or a plane(for a 3-dimensional data set). Since we are dealing with a dataset which has a single input feature(experience), our hypothesis will be a line.
Now we will try to fit this line to the above plot so that we can get approximate y values for the given x values. Like this:
Now How to fit the line to get the best predictions?
θ0 and θ1 are called the weights of the hypothesis function. We can move and change the angle of the line by adjusting the weights with different combinations of values. Ok, of course, you can’t just manually try every combination of all possible weights to find the combo that fits the best. That would take forever since you’d never run out of numbers to try.