A-Z of Machine Learning

Prajjwal Sule
7 min readApr 6, 2022

--

“Machine learning is a part of Computer Science as well as a subset of Artificial Intelligence”.

Where we give data to a computer program and then that computer program automatically understands some patterns or data points in that given data with the help of mathematics and provides us with prediction and this process is called Machine Learning.

We are giving data to the machine and the machine is searching those parameters in data that are given in the mathematical equation of the ML algorithm.

Why Machine Learning?

Let’s say without using Machine Learning, we want to write a filter program in a traditional way of programming, like filtering the ‘Spam Emails’.

Now here we have to keep some things in mind like:

  • In the beginning, we will see how spam emails look.
  • We can select the words or sentences that spammers use, such as “debit card”, “free”, “offer”, “exclusive”, and many more.
  • Now we will write an algorithm to detect the patterns we have observed.
  • And then our computer program will display some emails as spam if a certain number of spam patterns are detected in those emails, which we have specified in our algorithm.

Now we will test the program and repeat the first two steps until the results are sufficient.

It has a very long list of rules that are difficult to maintain. It takes a lot of time to make such a program from traditional programming and as well it’s accuracy is Unknown.

For example: “We have given a word ‘for you’ in our algorithm and told the algorithm that in whichever email you see or find such word, then declare that email as a spam email. Now if spammers replace the word ‘for you’ with ‘4U’. Then our program will start giving spam detection errors.”

Programs that use traditional techniques will need to be updated, which means that, if any other changes occur, we will have to update our code frequently.

And on the other hand, a program that uses Machine Learning Techniques will automatically detect every change by the spammer, and it starts declaring them (emails) as spam emails without our frequent manual effort.

Where to use Machine Learning?

When you have a problem that requires many long lists of rules to solve. So in this case, machine learning techniques can simplify your code and improve its performance.

Very complex problems are difficult to solve with traditional programming.

Where there is a non-stationary environment, machine learning can adapt to new data.

History of Machine Learning

The first case of neural networks came in 1943 when neurophysiologist Warren McCulloch and mathematician Walter Pitts wrote a paper about neurons, that is, “how neurons work”.

They decided to make a model of it using an electrical circuit, and here the neural network was born.

In 1950, Alan Turing created the world-famous Turing test. The test is quite simple — “For a computer to pass, it must be able to convince a human that it is a human being, not a computer.”

1952 saw the first computer program that could learn while walking. It was a game in which checkers (a type of game) made by Arthur Samuel were played. And this was the birth of machine learning, Arthur Samuel first came up with the phrase “machine learning” in 1952.

Frank Rosenblatt designed the first artificial neural network, called the perceptron, in 1958. Its main goal was to identify patterns and shapes.

It has also been said in many places that the term “Machine Learning” was coined by Arthur Samuel in 1959.

Similarly, there were many inventions and experiments in the field of Machine Learning and Deep Learning.

Prerequisites of Machine Learning

To learn or understand Machine Learning, we need Mathematics. That is, some math is working behind the ML models, with the help of the same math, we can extract the output from the data.

As we saw in the definition of Machine Learning that we give data to the machine/algorithm and then the machine/algorithm finds the pattern or data points with the help of mathematics in that data.

Mathematics for ML

Now as soon as the word Mathematics comes, some people get very scared and run away from the name of Mathematics.

So let me tell you that here you should have an understanding of mathematics. Not that you have to solve big math questions. All you need to know is how the given equation works and what parameters affect the equation.

You should know about all these branches of Mathematics:

  • Linear Algebra
  • Matrix
  • Vector Calculus
  • Statistics and Probability
  • Analytic Geometry

What is training and testing in Machine Learning?

Whenever we write a program of Machine Learning, it is called ML Model. In ML Model, math equations with their optimized parameters are present in the model, and for finding the optimized parameter of an equation we need data, with the help of which the model can predict.

And we divide the data used in it into two parts. We call one part the training data which comes in handy while training the model and the other part we call the testing data. When the model is ready, the testing data is used to test that model.

“Why divide the data in Training and Testing? Can’t we use the whole data while making the ML model?

You can use all the data while creating the ML Model. But by doing this you will never know how accurate your model is, how well it is working or how low its error rate is. If the entire data is used only for training, then the problem of overfitting and underfitting may also arise.

What is the error rate?

The difference between actual output and predicted output is called error rate. The higher the error rate, the lower the accuracy of your model. And the lower the error rate, the more accurate results your ML Model will give you.

Concept of overfitting and underfitting

Overfitting is a modeling error that occurs when a function fits too closely to a finite set of data points.

Underfitting represents a model that can neither model training data nor normalizes new data.

You can understand overfitting and underfitting like this.

Overfitting: Good performance on training data, poor generalization for other data.

Underfitting: Poor performance on training data as well as poor generalization of other data.

Regularization parameters are done to prevent overfitting and underfitting.

What should be the ratio between Training and Testing Data?

There is no rule for this, you can split the training data and testing data according to you.

But many Machine Learning experts and Data Scientists say that you should keep the ratio of 80/20 i.e. use 80% data training and 20% data for testing.

And some experts also recommend a ratio of 70/30. So it depends on your dataset and your problem statement, how much ratio of data you keep in training and testing.

Understanding of Feature and Label

Feature: Feature is defined as individual independent variables that act as input. Models use the feature to make predictions.

Label: Label is defined as the final output. Output classes can be treated as Labels and Labels are seen as dependent variables.

Let us understand this with an example.

Suppose you have student’s data in which Student’s CGPA, Student IQ, and student is placed or not, this data is available.

Now here the CGPA of the student and IQ of the student are all independent variables i.e. it can be anything.

And on the other hand, whether a Student is placed or not is dependent on independent variables like IQ and CGPA.

So here we can consider the student’s IQ and CGPA as Features and placement record as a Label.

Student IQ , Student CGPA = = Input data also known as Features

Student Placement record == Output data also known as Label

Types of Machine Learning

We can classify machine learning systems according to the type and amount of human supervision during training. There are some types of machine learning systems.

  • Supervised learning
  • Unsupervised learning
  • Semi-Supervised Learning

Supervised Learning

In Supervised Learning, we have both input and output in the data. If both features and labels are present in your data, then you can use supervised learning algorithms on that data.

As the name Supervised Learning suggests, there is a need for supervision or guidance.

In Supervised ML, two types of algorithms are used:

  • Regression
  • Classification

Regression

It is used for the prediction of continuous variables, such as weather forecast, market trends, placement percentage of a student, car price, marketing revenue, etc.

Classification

Classification is used when the label is categorical, such as Yes-No, Male-Female, True-False, etc.

Algorithms of Supervised Learning

  • Linear Regression
  • Regression Trees
  • Non-Linear Regression
  • Bayesian Linear Regression
  • Polynomial Regression
  • Random Forest
  • Decision Trees
  • Logistics Regression
  • Support vector machines
  • XGBoost

Unsupervised Learning

Unsupervised learning is a type of machine learning in which the model is trained with the help of unlabeled data.

The goal of unsupervised learning is to discover the underlying structure of a dataset, group that data according to similarities, and present that dataset in a compressed format.

In Unsupervised ML also, two types of algorithms are used:

  • Clustering
  • Association

Clustering

Clustering is a method of grouping objects such that the objects with the most similarity reside in a group and have no similarity with any other group of objects.

Cluster analysis finds similarities between data objects and classifies them according to the presence and absence of those similarities.

Association

Association rule is an unsupervised learning method used to find relationships between variables in large databases. It determines the set of objects that occur together in the dataset.

Algorithms of Unsupervised Learning

  • K-means clustering
  • KNN (k-nearest neighbors)
  • Hierarchical clustering
  • Anomaly detection
  • Neural Networks
  • Principal Component Analysis
  • Independent Component Analysis
  • Apriori algorithm
  • Singular value decomposition
  • DBSCAN

Semi-Supervised Learning

Semi-supervised learning is an approach to machine learning that combines a small amount of labeled data with a large amount of unlabeled data during training.

Semi-supervised learning falls between unsupervised learning (unlabeled training data) and supervised learning (labeled training data).

We can say that Semi-supervised learning is a mixture of supervised and unsupervised machine learning.

Final Words

I hope you liked this article on Machine Learning. If we talk about the whole machine learning or its algorithms, then it is a very big topic and it is difficult to cover all those in one article. But I have written this article in such a way that if you don’t know anything about machine learning, then you can get the basic information about machine learning through this article.

--

--