Silver Oal College Of Engineering And Technology
Unit 1 :
Introduction to Machine Learning
1 Prof. Monali Suthar (SOCET-CE)
Outline
Overview of Human Learning and Machine Learning,
Types of Machine Learning,
Applications of Machine Learning ,
Tools and Technology for Machine Learning
2 Prof. Monali Suthar (SOCET-CE)
What is Human Learning ?
3 Prof. Monali Suthar (SOCET-CE)
What is Machine Learning ?
4 Prof. Monali Suthar (SOCET-CE)
What Is Machine Learning?
Machine learning is an application
of artificial intelligence (AI) that
provides systems the ability to
automatically learn and improve
from experience without being
explicitly programmed.
Machine learning focuses on the
development of computer
programs that can access data and
use it learn for themselves.
The primary aim is to allow the
computers learn
automatically without human
intervention or assistance and
adjust actions accordingly.
5 Prof. Monali Suthar (SOCET-CE)
Introduction To Analytics,
Machine Learning and deep learning
Artificial Intelligence: Algorithms and systems that exhibit human-
like intelligence.
Machine Learning: Subset of AI that can learn to perform a task with
extracted data and/or models.
Deep Learning: Subset of machine learning that imitate the
functioning of human brain to solve problems.
6 Prof. Monali Suthar (SOCET-CE)
Types of Machine learning algorithms
1. Supervised Learning Algorithms: Require the knowledge of both the
outcome variable (dependent variable) and the features (independent
variable or input variables). E.G., Linear regression, logistic regression,
discriminant analysis.
In the case of multiple linear regression, the regression parameters
are estimated by
2. Unsupervised Learning Algorithms: Set of algorithms which do not have
the knowledge of the outcome variable in the dataset. E.g., clustering,
principal component analysis.
3. Reinforcement Learning Algorithms: Algorithms that have to take
sequential actions (decisions) to maximize a cumulative reward. E.g.,
techniques such as Markov chain and Markov decision process.
4. Evolutionary Learning Algorithms: Algorithms that imitate natural
evolution to solve a problem. E.g., techniques such as genetic algorithm and
ant colony optimization.
7 Prof. Monali Suthar (SOCET-CE)
Types of Machine learning algorithms
Machine learning algorithms are often categorized as
supervised or unsupervised.
Learning System
Unsupervised Semi supervised
Supervised Learning Reinforcement
Learning Learning
8 Prof. Monali Suthar (SOCET-CE)
Supervised machine learning algorithms
Supervised machine learning algorithms can apply what has been learned
in the past to new data using labeled examples to predict future events.
Starting from the analysis of a known training dataset, the learning
algorithm produces an inferred function to make predictions about the
output values.
The system is able to provide targets for any new input after sufficient
training.
The learning algorithm can also compare its output with the correct,
intended output and find errors in order to modify the model accordingly.
9 Prof. Monali Suthar (SOCET-CE)
10 Prof. Monali Suthar (SOCET-CE)
Supervised machine learning algorithms
11 Prof. Monali Suthar (SOCET-CE)
Types of supervised Machine learning
Regression: Regression algorithms are used
if there is a relationship between the input
variable and the output variable. It is used Supervised
for the prediction of continuous variables, Learning
such as Weather forecasting, Market Trends,
etc. Below are some popular Regression
algorithms which come under supervised
learning: Classificati
Regression
Linear Regression on
Regression Trees
Non-Linear Regression
Bayesian Linear Regression
Polynomial Regression
12 Prof. Monali Suthar (SOCET-CE)
Types of supervised Machine learning
Classification : Classification algorithms are
used when the output variable is Supervised
categorical, which means there are two Learning
classes such as Yes-No, Male-Female, True-
false, etc.
Spam Filtering,
Classificati
Random Forest Regression
on
Decision Trees
Logistic Regression
Support vector Machines
13 Prof. Monali Suthar (SOCET-CE)
Advantages and Disadvantages
Advantages:
With the help of supervised learning, the model can predict the output on
the basis of prior experiences.
In supervised learning, we can have an exact idea about the classes of
objects.
Supervised learning model helps us to solve various real-world problems
such as fraud detection, spam filtering, etc.
Disadvantages :
Supervised learning models are not suitable for handling the complex tasks.
Supervised learning cannot predict the correct output if the test data is
different from the training dataset.
Training required lots of computation times.
In supervised learning, we need enough knowledge about the classes of
object.
14 Prof. Monali Suthar (SOCET-CE)
Unsupervised machine learning
Algorithms
In contrast, unsupervised machine learning algorithms are used when the
information used to train is neither classified nor labeled.
Unsupervised learning studies how systems can infer a function to describe a
hidden structure from unlabeled data.
The system doesn’t figure out the right output, but it explores the data and can
draw inferences from datasets to describe hidden structures from unlabeled
data.
“Unsupervised learning is a type of machine learning in which models are
trained using unlabeled dataset and are allowed to act on that data without any
supervision.”
15 Prof. Monali Suthar (SOCET-CE)
Unsupervised Learning
16 Prof. Monali Suthar (SOCET-CE)
Types of Unsupervised Learning
Clustering:
Clustering is a method of grouping the
objects into clusters such that objects
with most similarities remains into a
group and has less or no similarities
with the objects of another group.
Cluster analysis finds the
commonalities between the data
objects and categorizes them as per
the presence and absence of those
commonalities.
17 Prof. Monali Suthar (SOCET-CE)
Types of Unsupervised Learning
Association :
An association rule is an unsupervised
learning method which is used for
finding the relationships between
variables in the large database.
It determines the set of items that
occurs together in the dataset.
Association rule makes marketing
strategy more effective.
Such as people who buy X item
(suppose a bread) are also tend to
purchase Y (Butter/Jam) item.
A typical example of Association rule
is Market Basket Analysis.
18 Prof. Monali Suthar (SOCET-CE)
Unsupervised Learning Algorithm
Below is the list of some popular unsupervised learning algorithms:
K-means clustering
KNN (k-nearest neighbors)
Hierarchal clustering
Anomaly detection
Neural Networks
Principle Component Analysis
Independent Component Analysis
19 Prof. Monali Suthar (SOCET-CE)
Advantages & Disadvantages
Advantages :
Unsupervised learning is used for more complex tasks as compared to
supervised learning because, in unsupervised learning, we don't have labeled
input data.
Unsupervised learning is preferable as it is easy to get unlabeled data in
comparison to labeled data.
Disadvantages :
Unsupervised learning is intrinsically more difficult than supervised learning
as it does not have corresponding output.
The result of the unsupervised learning algorithm might be less accurate as
input data is not labeled, and algorithms do not know the exact output in
advance.
20 Prof. Monali Suthar (SOCET-CE)
Difference between SL and USL
21 Prof. Monali Suthar (SOCET-CE)
Difference between SL and USL
SUPERVISED LEARNING UNSUPERVISED
LEARNING
Input Data Uses Known and Labeled Data Uses Unknown Data as input
as input
Computational
Complexity Simpler method computationally complex
Real Time Uses off-line analysis Uses Real Time Analysis of
Data
Number of Classes are known Number of Classes are not
Number of Classes known
Moderate Accurate and
Accuracy of Results Accurate and Reliable Results Reliable Results
22 Prof. Monali Suthar (SOCET-CE)
Semi-supervised machine learning
algorithms
Semi-supervised machine learning algorithms fall somewhere in between
supervised and unsupervised learning, since they use both labeled and
unlabeled data for training – typically a small amount of labeled data and a
large amount of unlabeled data.
The systems that use this method are able to considerably improve learning
accuracy.
Usually, semi-supervised learning is chosen when the acquired labeled data
requires skilled and relevant resources in order to train it / learn from it.
Otherwise, acquiring unlabeled data generally doesn’t require additional
resources.
23 Prof. Monali Suthar (SOCET-CE)
Reinforcement machine learning
algorithms
Reinforcement machine learning algorithms is a learning method that interacts
with its environment by producing actions and discovers errors or rewards.
Trial and error search and delayed reward are the most relevant characteristics
of reinforcement learning.
This method allows machines and software agents to automatically determine
the ideal behavior within a specific context in order to maximize its
performance.
Simple reward feedback is required for the agent to learn which action is best;
this is known as the reinforcement signal.
24 Prof. Monali Suthar (SOCET-CE)
Reinforcement machine learning
algorithms
Though both supervised and reinforcement learning use mapping between
input and output, unlike supervised learning where the feedback provided to
the agent is correct set of actions for performing a task, reinforcement learning
uses rewards and punishments as signals for positive and negative behavior.
Application:
RL is quite widely used in building AI for playing computer games.
In robotics and industrial automation, RL is used to enable the robot to
create an efficient adaptive control system for itself which learns from its
own experience and behavior.
25 Prof. Monali Suthar (SOCET-CE)
Reinforcement machine learning
26 Prof. Monali Suthar (SOCET-CE)
Methods of ML
Learning System
Semi supervised Unsupervised
Supervised Learning Reinforcement
Learning Learning
Regression Classification Clustering Dimension reduction
27 Prof. Monali Suthar (SOCET-CE)
Applications of ML
28 Prof. Monali Suthar (SOCET-CE)
Applications of ML
1. Image Recognition:
Image recognition is one of the most common applications of machine learning. It is
used to identify objects, persons, places, digital images, etc. The popular use case of
image recognition and face detection is, Automatic friend tagging suggestion:
Facebook provides us a feature of auto friend tagging suggestion. Whenever we
upload a photo with our Facebook friends, then we automatically get a tagging
suggestion with name, and the technology behind this is machine learning's face
detection and recognition algorithm.
It is based on the Facebook project named "Deep Face," which is responsible for face
recognition and person identification in the picture.
29 Prof. Monali Suthar (SOCET-CE)
Applications of ML
2. Speech Recognition
While using Google, we get an option of "Search by voice," it comes
under speech recognition, and it's a popular application of machine
learning.
Speech recognition is a process of converting voice instructions into text,
and it is also known as "Speech to text", or "Computer speech
recognition." At present, machine learning algorithms are widely used
by various applications of speech recognition. Google
assistant, Siri, Cortana, and Alexa are using speech recognition
technology to follow the voice instructions.
30 Prof. Monali Suthar (SOCET-CE)
Applications of ML
3.Traffic prediction:
If we want to visit a new place, we take help of Google Maps, which
shows us the correct path with the shortest route and predicts the
traffic conditions.
It predicts the traffic conditions such as whether traffic is cleared, slow-
moving, or heavily congested with the help of two ways:
Real Time location of the vehicle form Google Map app and sensors
Average time has taken on past days at the same time.
Everyone who is using Google Map is helping this app to make it better.
It takes information from the user and sends back to its database to
improve the performance.
31 Prof. Monali Suthar (SOCET-CE)
Applications of ML
4. Product recommendations:
Machine learning is widely used by various e-commerce and
entertainment companies such as Amazon, Netflix, etc., for product
recommendation to the user. Whenever we search for some product on
Amazon, then we started getting an advertisement for the same product
while internet surfing on the same browser and this is because of
machine learning.
Google understands the user interest using various machine learning
algorithms and suggests the product as per customer interest.
As similar, when we use Netflix, we find some recommendations for
entertainment series, movies, etc., and this is also done with the help of
machine learning.
32 Prof. Monali Suthar (SOCET-CE)
Applications of ML
5. Email Spam and Malware Filtering:
Whenever we receive a new email, it is filtered automatically as
important, normal, and spam. We always receive an important mail in
our inbox with the important symbol and spam emails in our spam box,
and the technology behind this is Machine learning. Below are some
spam filters used by Gmail:Content Filter
Header filter
General blacklists filter
Rules-based filters
Permission filters
Some machine learning algorithms such as Multi-Layer
Perceptron, Decision tree, and Naïve Bayes classifier are used for email
spam filtering and malware detection.
33 Prof. Monali Suthar (SOCET-CE)
Applications of ML
6. Self-driving cars:
7.Virtual Personal Assistant:
Google assistant, Alexa, Cortana, Siri.
8. Online Fraud Detection:
9. Stock Market trading:
10. Medical Diagnosis:
11. Automatic Language Translation:
Google's GNMT (Google Neural Machine Translation)
34 Prof. Monali Suthar (SOCET-CE)
Tools for Machine Learning
Scikit-learn:
Scikit-learn is for machine learning development in python. It provides a
library for the Python programming language.
Features:
It helps in data mining and data analysis.
It provides models and algorithms for Classification, Regression,
Clustering, Dimensional reduction, Model selection, and Pre-
processing.
Pros:
Easily understandable documentation is provided.
Parameters for any specific algorithm can be changed while calling
objects.
Official Website: http://scikit-learn.org/stable/
35 Prof. Monali Suthar (SOCET-CE)
Tools for Machine Learning
PyTorch:
PyTorch is a Torch based, Python machine learning library. The torch is a
Lua based computing framework, scripting language, and machine
learning library.
Features:
Helps in training and building your models.
You can run your existing models with the help of TensorFlow.js which
is a model converter.
It helps in the neural network.
Pros:
You can use it in two ways, i.e. by script tags or by installing through
NPM.
It can even help for human pose estimation.
36 Prof. Monali Suthar (SOCET-CE)
Tools for Machine Learning
TensorFlow:
TensorFlow provides a JavaScript library which helps in machine learning.
APIs will help you to build and train the models.
Features:
It helps in building neural networks through Autograd Module.
It provides a variety of optimization algorithms for building neural
networks.
PyTorch can be used on cloud platforms.
It provides distributed training, various tools, and libraries.
Pros:
It helps in creating computational graphs.
Ease of use because of the hybrid front-end.
Official Website: https://www.tensorflow.org/
Cons:
It is difficult to learn.
37 Prof. Monali Suthar (SOCET-CE)
Tools for Machine Learning
Weka
It is also open-source software.
One can access it through a graphical user interface.
The software is very user-friendly.
The application of this tool is in research and teaching.
Along with this, Weka lets you access other machine learning tools as well.
For example, R, Scikit-learn, etc.
38 Prof. Monali Suthar (SOCET-CE)
Tools for Machine Learning
Jupyter Notebook
Jupyter notebook is one of the most widely used machine learning tools
among all.
It is a very fast processing as well as an efficient platform.
Thus the name of Jupyter is formed by the combination of these three
programming languages.
Jupyter Notebook allows the user to store and share the live code in the
form of notebooks. One can also access it through a GUI.
For example, winpython navigator, anaconda navigator, etc.
Moreover, it supports three languages viz. Julia, R, Python.
39 Prof. Monali Suthar (SOCET-CE)
Tools for Machine Learning
Accord.net
Accord.net is a computational machine learning framework. It comes with
an image as well as audio packages.
Such packages assist in training the models and in creating interactive
applications.
For example, audition, computer vision, etc.
As .net is present in the name of the tool, the base library of this framework
is C# language.
Accord libraries are very much useful in testing as well as manipulating
audio files.
40 Prof. Monali Suthar (SOCET-CE)
Programming Language for Machine
Learning
Python Programming Language
With over 8.2 million developers across the world using Python for coding,
Python ranks first in the latest annual ranking of popular programming
languages by IEEE Spectrum with a score of 100.
Stack overflow programming language trends clearly show that it’s the only
language on rising for the last five years.
Features:
Extensive Collection of Libraries and Packages
Code Readability
Flexibility
41 Prof. Monali Suthar (SOCET-CE)
Programming Language for Machine
Learning
Python Programming Language
Python Libraries:
Working with textual data – use NLTK, SciKit, and NumPy
Working with images – use Sci-Kit image and OpenCV
Working with audio – use Librosa
Implementing deep learning – use TensorFlow, Keras, PyTorch
Implementing basic machine learning algorithms – use Sci-Kit- learn.
Want to do scientific computing – use Sci-Py
Want to visualise the data clearly – use Matplotlib, Sci-Kit, and Seaborn.
42 Prof. Monali Suthar (SOCET-CE)
Core Python Libraries for Machine Learning
43 Prof. Monali Suthar (SOCET-CE)
Getting Started With Anaconda Platform
Step 1: Go to Anaconda Site
Go to https://www.Anaconda.Com/distribution/ using your browser
window.
Step 2: Download Anaconda Installer for your Environment
Select your OS environment and choose Python 3.7 version to download
the installation files as shown in figure.
44 Prof. Monali Suthar (SOCET-CE)
Getting Started With Anaconda Platform
Step 3: Install Anaconda
Double click on the downloaded file and follow the on-screen installation instructions, leaving
options as set by default. This will take a while and complete the installation process.
Step 4: Start Jupyter Notebook
Open the command terminal window as per your OS environment and type the following
command:
jupyter notebook -- ip=*
This should start the Jupyter notebook. Open a browser window in your default browser
software.
Step 5: Create a New Python Program
On the browser window, select “New” for a menu. Clicking on the “Folder” will create a
directory in the current directory. To create a Python program, click on “Python 3”. It will open
a new window, which will be the program editor for the new Python program as shown in the
figure.
45 Prof. Monali Suthar (SOCET-CE)
Getting Started With Anaconda Platform
Step 6: Rename the Program
By default, the program name will be
“Untitled”. Click on it to rename the
program and name as per your
requirement. For example, we have
renamed it to “My First Program”.
Step 7: Write and Execute Code
Write Python code in the cell and then
press SHIFT+ENTER to execute the
cell.
Step 8: Basic Commands for Working
with Jupyter Notebook
Click on “User Interface Tour” for a
quick tour of Jupyter notebook
features. Or click on “Keyboard
Shortcuts” for basic editor commands
as shown in the figure.
46 Prof. Monali Suthar (SOCET-CE)
Programming Language for Machine
Learning
R Programming Language
R is an incredible programming language for machine learning written by
a statistician for statisticians.
R language can also be used by non-programmer including data miners,
data analysts, and statisticians.
47 Prof. Monali Suthar (SOCET-CE)
Programming Language for Machine
Learning
R Programming Language
R language provides a variety of tools to train and evaluate machine
learning algorithms for predicting future events making machine learning
easy and approachable. R has an exhaustive list of packages for machine
learning –
MICE for dealing with missing values.
CARET for working with classification and regression problems.
PARTY and rpart for creating data partitions.
randomFOREST for creating decision trees.
dplyr and tidyr for data manipulation.
ggplot2 for creating beautiful visualisations.
Rmarkdown and Shiny for communicating insights through reports.
48 Prof. Monali Suthar (SOCET-CE)
Programming Language for Machine
Learning
JAVA and JAVAScriptProgramming Language
Using Java for machine learning projects makes it easier for machine
learning engineers to integrate with existing code repositories.
Features like the ease of use, package services, better user interaction,
easy debugging, and graphical representation of data make it a machine
learning language of choice
Java has plenty of third party libraries for machine learning
JavaML : provides a collection of machine learning algorithms
implemented in Java
Arbiter Java library for hyper parameter tuning which is an integral part
of making ML algorithms run effectively
Deeplearning4J library which supports popular machine learning
algorithms like K-Nearest Neighbor and Neurop
49 Prof. Monali Suthar (SOCET-CE)
50 Prof. Monali Suthar (SOCET-CE)
Reference
https://www.javatpoint.com/applications-of-machine-
learning
https://www.edureka.co/blog/machine-learning-
applications/
https://www.geeksforgeeks.org/machine-learning-
introduction/
https://towardsdatascience.com/10-most-popular-
machine-learning-software-tools-in-2019-678b80643ceb
https://in.springboard.com/blog/best-language-for-
machine-learning/
Machine Learning :A Probabilistic Perspective,Kevin P.
Murphy
51 Prof. Monali Suthar (SOCET-CE)
52 Prof. Monali Suthar (SOCET-CE)