Introduction to Machine Learning

By | March 22, 2020

A simple definition of machine learning

Machine learning is a type of Artificial Intelligence where machines can learn on their own by experience, without any explicit programming. The experience comes from learning and training with the help of huge datasets collected from various sources. The learning and training process starts with processing and analysis of the data, like finding similar patterns, trends, and instructions that help machines give better results with each iteration, eventually making better business decisions without any human intervention.

How is machine learning useful?

With a lot of people trusting and moving to digitization today, a lot of data is generated every day by users. From Facebook posts to uber rides, Zomato deliveries to Netflix movies, amazon purchases to Google browsing history, everything is data from a business perspective.

This data, when corrected and processed can be used by businesses to improve their services and marketing. However, the gush of data is so huge that it is near impossible for humans to process, analyze and make conclusions without making errors. Since a machine works, in the same way, every time, when it is presented with such data, thorough analysis and processing can be done giving good predictions and trends.


Machines cannot make these decisions on their own unless they are trained.

This is where machine learning becomes useful.

Applications of Machine Learning

As of today, there are many applications of machine learning. Some of the most relatable and prominent applications are –

  1. Product/Movie recommendations – When you browse online giants like Amazon or Flipkart, you are shown similar products and recommendations that might interest you. Same way, if you watch a particular movie, Netflix, Prime, etc… suggest you similar movies that other similar users liked and you may like as well. This is through machine learning algorithms that note your preferences and give you recommendations accordingly.
  2. Social media – A good example of machine learning in social media is friends tagging by Facebook, which happens through image recognition algorithms.
  3. Live traffic updates and rerouting – Google and other maps collect user data and route data. Since those who use maps provide their location, route and speed information, using machine learning algorithms, Google can inform users about the routes that are faster or are most affected by traffic and should be avoided at a particular time.
  4. Virtual assistants – Virtual assistants like Alexa, Siri, Cortana work on machine learning algorithms for speech recognition, Natural language processing, speech to text conversion and vice versa, thus enabling users to do their work faster – like setting up appointments, searching information, etc…
  5. Google Translate – Through Natural language processing, which is one of the most successful applications of machine learning, Google provides the best translation for thousands of languages in the world.
  6. Fraud detection – Through machine learning models like classification, fraud and suspicious profiles can be scanned by machines to prevent online frauds.

Why should you learn ML?

Machine learning is one of the most challenging, ever-growing, high-paying and fulfilling jobs in the market right now. The average salary of a machine learning engineer is about $146,090 per annum. Machine learning has a lot of scope in the next few decades too. This is why you should learn machine learning – for a rewarding career.

Is ML part of AI or data science?

This is a confusion almost everyone who starts with AI, data science or ML has.

ML is a branch of AI, which relies on machines to perform predictive data analysis during the data science lifecycle.

Machine learning is thus the relation between data science and Artificial intelligence. Here is a simple diagram to show how machine learning fits into data science and AI –

Types of machine learning

Machine learning focuses on just one thing – learning. Everything in machine learning is about gaining knowledge and enhancing the same through experience. For this, there are several types of learning –

1. Problem learning types

These are the most common and most important types of learning and are classified into three –

  • Supervised learning – This is the most basic type of learning where a model is used to determine the mapping between input and output. Models are trained using data sets where outputs are known. Once the model is built, testing data is fed by providing only the input, and the output is measured against the previously set target variables: Learn more
  • Unsupervised learning – Unlike supervised learning, there is no correcting the model, as there are no outputs. Only the input is fed and the machine trains itself without supervision. Clustering, density estimation, visualization, projection are few important unsupervised learning algorithms. Some unsupervised learning algorithms are k-means and the Apriori algorithm.
  • Reinforced learning – In this type of learning, the machine learns what is to be done based on feedback from previous actions. The learning system and the feedback (experience) work in a loop. However, there is no fixed set of input and output data (unlike supervised learning). Examples are the Markov decision process, Q learning, etc…

2. Hybrid learning types

How about algorithms that can’t be categorized as supervised or unsupervised – what if they are a little of both – or a hybrid?

There are 3 types of hybrid learning –

  • Semi-supervised learning – It is a balance between supervised and unsupervised methods where there are only a few labeled datasets, but a lot of unlabelled datasets, so that all the available data can be effectively used for training.
  • Self-supervised learning – this type of learning mechanism solves an unsupervised learning problem using supervised learning methods. The approach is to create alternate tasks (to the original task) that are solved using supervised learning, thus creating a model that can be then used to solve the original problem using unsupervised methods.
  • Multi-instance learning – It is a subtype of supervised learning where instead of labeling individual examples, groups of samples are labeled. These groups are called bags (instead of sets). The model is based on the knowledge that a bag pertains to a certain category or target group.

ML algorithms

There are many algorithms used for machine learning each of which falls into one or more of the above learning types. Here are some of the top machine learning algorithms to start your ML journey –

  1. Linear regression – Suppose there are x input variables that determine the value of output variable Y. In linear regression, the relationship between Y and X is represented as a linear equation or a line, Y = a + bX, where a and b are intercept and slope of the line respectively.
  2. Logistic regression – For a binary classification of values, like true/false, yes/no, logistic regression is much suitable. The output is an S-shaped curve defined using the logistic function, h(x) = 1/(1 + e-x)
  3. Naïve Bayes – This method determines the probability of an event occurring (B) when the occurrence of another related event is known (A). The prior event A is true, and to determine whether the hypothesis B is also true (given P(A) is true), we use the formula, P(B/A) = (P(A/B)*P(B))/P(A)
  4. Classification and Regression trees (Decision trees) – One of the most powerful algorithms, decision trees are based on the answer to several questions to determine an outcome. For example, to know if a person aged 20 years will prefer to buy a laptop or groceries, the system will ask a few simple questions, like, is the person married, is he living with friends, does he have provision to cook, does he watch movies or pay bills online, etc…
  5. K-nearest neighbor – In this method, all the data is used for training (and none for testing). When a new instance is encountered, k nearest instances to the new instance are determined and the new instance is categorized as part of the nearest old instance.
  6. Random forests – Random forests combine several decision trees. The output of a random forest is the mean or median of the individual decision trees, by finding the random sampling or random subset of data.
  7. Principal Component Analysis (PCA) – In this method, the number of variables is reduced to make data exploration easy. These reduced set of variables are called principal components which are determined by capturing the maximum variance in the data. There is orthogonality between the components thereby creating zero or no correlation between the components.
  8. Apriori – This method operates on a database that contains lots of transactions, mines data to find associations between data. For example, if a person purchases a laptop, it is likely that he also purchases accessories like a laptop bag or headphones.

There are many more complex algorithms like SVM (support vector machines), deep learning algorithms like CNN (Convolutional Neural Network), DBM (Deep Boltzmann Machine), clustering algorithms like k-means and so on, which are out of scope for this article. You can choose to learn the algorithms based on their learning style or similarity between the algorithms. For example, you can learn all the supervised learning algorithms first, or you can choose similar algorithms like decision trees and random forest, or, linear regression and SVM, etc…

Effect of human bias on data collection and ML results

There are chances that the data is not sufficient or correct to proceed with analysis or machine learning. This can happen due to human bias while collecting data. For example, if users are asked to describe bread, and if all of them describe it as square-shaped and brown color, then we would leave out the possibilities of white bread or subway sandwich bread, which may completely wipe out one category itself. Thus, the collection and organization of data.

Such errors can be minimized by collecting data from people of various age groups, people having different preferences, people from different cultures, etc… –a diverse set of people, so that we can get enough variety of data for training and testing.

Choosing your language to write ML algorithms

The most popular programming languages as of today, to write ML algorithms are Python and R. Other languages that are also popular and widely used are C++, Java, C# and JavaScript. These languages have loads of libraries and tools that help build complex algorithms.

If you haven’t worked on any of the above languages, Python will be your best starting point.

How to start learning ML

Machine learning is certainly an exhaustive subject and requires a lot of technical knowledge. But if you follow a proper approach to learn, you can overcome all the obstacles and make your learning interesting –

  • Identify the prerequisites – Knowing linear algebra, calculus, statistics and Python (or R) is essential. Just the basics (working knowledge).
  • Learn the ML terminologies – some common terms used are model, learning, target, training, prediction/predictive, feature, labeling, etc… Know the meanings of these and other similar jargons.
  • Types of machine learning – understanding each type will help you figure out which type you want to start your learning with. Generally, supervised learning algorithms are the easiest to start with.
  • Learn the basics of data science – to fully appreciate the usefulness of ML, you should understand the data science lifecycle and understand various real-life examples where ML is used for business.
  • Delve deeply into ML, one algorithm at a time – and don’t confuse yourself with others till you have fully grasped one.

Of course, there are plenty of tutorials and courses available on the internet. But, we would suggest you learn through books, which you can keep as a reference too. Online materials can further your knowledge by providing you access to real data sets for practice and mastering the field.


This article introduced you to the concepts and jargon of Machine learning, and some important pointers to where exactly ML fits into the entire data science process. We also learned about the usefulness and types of ML, and gently introduced ourselves to the various algorithms that are widely used. Learning about the applications of ML helped us understand why we should learn ML. Note that this is just an introductory article and in no way covers every aspect of machine learning. As a quick recap, here are some important characteristics of Machine learning –

  • Machines can learn and enhance based on experience and observations.
  • Increase in efficiency of utilization of structured and unstructured data to identify patterns, trends and perform predictive data analytics.
  • Boost business operations by enabling better business decisions and accurate forecasting.
  • Brings us one step closer to Artificial Intelligence, where humans and machines can be at par with each other in terms of thinking capabilities.

You might be interested in:

Leave a Reply

Your email address will not be published. Required fields are marked *