What is Machine Learning | How Python is used with Machine Learning

profile abhishek

In this article, I will introduce you to machine learning with a detailed overview of its type, how machine learning works, and its use cases. This article is for people who want to start a career in Machine Learning or those who just want to take a quick recap about this particular field. So hi everyone let's get started on this journey with a motivational quote.

“A baby learns to crawl, walk and then run. We are in the crawling stage when it comes to applying machine learning.” ~Dave Waters

Understanding Machine Learning and how it works is more difficult than its implementations, so let me start to explain machine learning in a simple way with a real-life example, in past, you have to decide that whether the message or email you received is spam or not by reading and analyzing the text but now this is done by a computer so how it's done, here machine learning(ML) and artificial intelligence(AI) comes into the picture, now your emails are spam filtered and this is done with the combination of different machine learning (ML) techniques that help to make decisions for you. These ML techniques have the capacity to learn and identify spam emails by analyzing such emails using a vast collection of computers.

What is Machine Learning?                                                           

What is Machine Learning

Definition - Machine Learning (ML) is a sub-field of artificial intelligence (AI) that focuses on building applications that can automatically and periodically learn and improve from experience or through gathered data and help in solving practical problems. These practical problems can be anything that includes some sort of data or information.

How machine learning works

How machine learning works

The Machine Learning process starts with gathering the data. The data is a collection of pairs (input, output). Inputs could be anything, for example, email messages, images, or sensor readings. Outputs are usually real numbers, or labels (e.g. “spam”, “not_spam”, “true”, “false”, “eyes”, "nose" etc).

Let’s say the problem that you want to solve using machine learning is spam detection. You gather the data, for example, 1000 email messages, each with a label either spam or not_spam. Now, the next step is you have to convert each email message into a feature vector (used to represent characteristics) which gives us 1000 features vector with each feature vector having the labelled spam or not_spam.

Now you have input data that is understandable by machine, but the output labels are in the form of human-readable text. Some learning algorithms require for transforming labels into numbers. For example, some algorithms require numbers like 0 (to represent the label not_spam) and 1 (to represent the label spam).

The algorithm I use to illustrate machine learning is called Support Vector Machine (SVM). This algorithm requires that the positive label (in our case it’s “spam”) has the numeric value of +1 (plus one), and the negative label (“not_spam”) has the value of - 1 (minus one). At this point, you have a dataset with labeled data and a learning algorithm, so you are ready to apply the learning algorithm to the dataset to get the model in order to train the model.

The process of building the model is called training. The training process involves initializing some values for say spam and not_spam of our model and predict the output with those values.

So, Here you Finally use your model to predict the outcome of the problem statement. The above-mentioned steps take you from where you create a model to where you predict its output which makes a clear understanding of the process of how machine learning works.

How machine learning works

Types of machine learning

There are three types of machine learning: supervised learning, unsupervised learning, and reinforcement learning. All three types are briefly discussed below.

Types of machine learning

1. Supervised Learning 

In Supervised Machine Learning, a trained data is given to the machine having input and output variables, which is based on the characteristics and data sets, for example, emails converted into feature vectors and with each feature vector (used to represent characteristics) having label spam or not_spam is given to the machine as training data in order to prepare the machine to make predictions with help of provided data or new input data.

Supervised Machine Learning is further divided into two types:

i) Classification and ii) Regression

i) Classification: A classification problem is when the output variable is a category, for example, "spam" or "not_spam" (in case of email) or "green" or "blue" (in case of balls)

ii) Regression: A regression problem is when the output variable is a real value or numeric outcome, for example, house price prediction for a given feature like price, size, and location.

Want to learn about Supervised Learning Algorithms with Python implementation you can check  Supervised Learning | Python Implementation

2.  Unsupervised learning

In Unsupervised Machine Learning, no trained data is given to the machine or we can say unlabelled or uncategorized data is given to the machine, in that case, the machine with the help of certain algorithms collects and categorized all the data on the basis of assumption and figure out the unknown pattern of data and group them in manner,  for example, clustering DNA patterns to analyze evolutionary biology.

Unsupervised Machine Learning is further divided into two types:-

i) Clustering and ii) Association

i) Clustering: In clustering problem, the machine tries to search inherit groups in a given data set such as grouping customers by purchasing behavior

ii) Association: An association learning problem is where you want to discover rules that describe large portions of your data, such as people that buy X also tend to buy Y.

3. Reinforcement learning

In Reinforcement Learning, a machine is able to learn from the consequence of its actions by past experience or new explorations like when we play a new game, we take time to learn and experience over it, we try certain things to accumulate the right possibilities same as machine do, for example, your music player or youtube, showing you the similar playlist on the basis of your play or search history and its keep changes as your preference do.

Reinforcement Learning is further divided into two types:-

i) Positive and ii) Negative

i) Positive:- Positive reinforcement is the most common type of reinforcement learning that helps models to maximize the performance on a given task.

ii) Negative:- Negative reinforcement is used for maintaining a minimum performance standard instead of maximizing the performance.

What is Deep learning?                   

What is Deep learning?

Deep Learning is the subfield of machine learning, that enables the machine to improve with experience and data, it is based on artificial neural network.

It is a type of Machine Learning, inspired by the structure of the human brain, so like humans make a decision by analyzing data gathered from surrounding same as a machine do with the help of algorithms, and to achieve this, deep learning uses a multi-layered structure of algorithms called artificial neural networks.

Practical examples of deep learning include self-driving cars, face recognition systems, google translator, IBM Watson studio, and many more.

How python is used with machine learning

Python is the most popular object-oriented high-level programming language. It is easy to learn and widely used in a lot of applications especially in the field of artificial intelligence (AI), with its high enrich libraries and packages, the implementations will be easy and portable. I am assuming that you all readers are familiar with python, so here I just give you a little overview of its use in machine learning.

Here are some useful python libraries that are used in machine learning -

  • Numpy  - NumPy is the fundamental package for scientific computing in Python. ( User Guide PDF Link )
  • Scikit-learn - Scikit-learn or sklearn contains a lot of efficient tools for machine learning and statistical modeling including classification, regression, clustering, and dimensionality reduction. Sklearn is the most used library in machine learning. ( User Guide )
  • TensorFlow - TensorFlow is used to create machine learning models for desktop, mobile, web, and cloud. ( User Guide )
  • Pandas - Pandas is an open-source, library mostly used for data analysis written in Python programming language. ( User Guide )
  • Matplotlib - Matplotlib is a python library for creating static, animated, and interactive visualizations in Python.  ( User Guide )

Want to learn about Machine Learning Algorithms with Python implementation you can check  Supervised Learning | Python Implementation

Applications of machine learning

Machine Learning (ML) is designed to solve many real-world problems which cannot be solved with the traditional approach. Following are some real-world applications of Machine Learning -

  • Medical diagnosis
  • Sentiment analysis
  • Error detection and prevention
  • Weather forecasting and prediction
  • Stock market analysis and forecasting
  • Speech recognition
  • Object recognition
  • image recognition
  • Fraud detection
  • Fraud prevention
  • Products recommendation to customers in online shopping.

Future Scope of Machine Learning 

The main goal or vision of Machine Learning is to make accurate predictions in various platforms and applications, that are described below -

1) Robotics 

Robotics is an emerging field in engineering that aims to design machines that helps and assist humans in their tasks, with the help of Artificial Intelligence (AI) and Machine Learning (ML) robots are able to acquire skills by understanding physical and logical data patterns as humans do that make a robot proactive and act accordingly.

2) Healthcare

Machine Learning (ML), helps the healthcare sector in making better decisions on patient’s diagnoses and treatment options, which leads to an overall improvement of healthcare services. Some key areas in the health sector where machine learning plays a vital role include Disease Prediction, Drug Discovery, diagnosis, and treatments.

3) Fraud Detection

Banks and other financial sectors use machine learning-based models for fraud detection, which helps in identifying suspicious customers having fraud transactions.

4) Automotive Industry

Autonomous vehicles relate to self-driving cars that are the most discussed topic in automotive Industries which aims of providing vehicles with artificial intelligence and machine learning technology that makes a vehicle smart enough to become driverless. You may hear of Tesla which is in the lead in developing a self-driving car and Waymo by Google. The big advantage that AI provides to autonomous vehicles is learning and adapting as per the environment.

Skills Required to Become a Machine Learning Engineer

  • Computer Science Fundamentals
  • Programming Language (most recommended Python and R)
  • Probability and Statistics
  • Data Modeling and Evaluation
  • Natural Language Processing

A Career in Machine Learning 

Machine Learning provides a wide range of applications and scope which also opens a good career path and opportunities too. With a background and skills in machine learning, you can get a high-paying job.

Machine Learning Engineer is the topmost job in terms of salary, postings, and demand as per experts study. Some of the topmost jobs as a machine learning background with average salary are mentioned below.

1. Machine Learning Engineer ( average salary ₹701,354 )

2. Data Scientist ( average salary ₹822,722 )

3. NLP Scientist ( average salary ₹609K )

4. Business Intelligence Developer ( average salary ₹544,724 )

Career in Machine Learning
Average Machine Learning Engineer Salary in the United States (source)


Career in Machine Learning
Average Machine Learning Engineer Salary in India (source)


Through this article, my main purpose is to provide a complete basic understanding of Machine Learning, so I hope you people read it well and clear the basic concepts that I discussed here. For any questions or guidance or suggestions, you can leave your comment below.

Related Blogs

Also, Read

Subscribe Us

* indicates required


I am a passionate software developer, providing solutions to make industry more robust. readmore