Course - Machine Learning
Course code-IT312
Topic- Types of ML(Unit-I)
Sanjivani Rural Education Society’s
Sanjivani College of Engineering, Kopargaon-423603
(An Autonomous Institute Affiliated to Savitribai Phule Pune University, Pune)
NAAC ‘A’ Grade Accredited, ISO 9001:2015 Certified
Department of Information Technology
(NBAAccredited)
Dr.R.D.Chintamani
Asst. Prof.
1
ML- Unit-II Department of IT
Unit-I INTRODUCTION TO MACHINE
LEARNING
• Syllabus
Introduction: Definition, Real life applications, Introduction to Data in
Machine Learning Types of Learning: Supervised Learning Unsupervised
Learning, Semi-Supervised Learning, Reinforcement Learning.
Features:Types of Data (Qualitative and Quantitative), Scales of Measurement
(Nominal, Ordinal, Interval, Ratio), Concept of Feature, Feature construction,
Feature Selection and Transformation, Curse of Dimensionality.
Dataset Preparation: Training Vs. Testing Dataset, Dataset Validation
Techniques – Hold-out, k-fold Cross validation, Leave-One-Out Cross-
Validation (LOOCV).
2
ML- Unit-II Department of IT
Types of Machine Learning
Machine learning is a subset of AI, which enables the machine to
automatically learn from data, improve performance from past experiences,
and make predictions. Machine learning contains a set of algorithms that work
on a huge amount of data. Data is fed to these algorithms to train them, and on
the basis of training, they build the model & perform a specific task.
These ML algorithms help to solve different business problems like Regression,
Classification, Forecasting, Clustering, and Associations
3
ML- Unit-II Department of IT
Types of Machine Learning
1. Supervised Machine Learning
2. Unsupervised Machine Learning
3. Semi-Supervised Machine Learning
4. Reinforcement Learning
4
ML- Unit-II Department of IT
Supervised Machine Learning
• Train the machines using the "labelled" dataset, and based on the training, the
machine predicts the output.
• Train the machine with the input and corresponding output, and then we ask the
machine to predict the output using the test dataset.
• Example of training to the machine to understand the images, such as the shape &
size of the tail of cat and dog, Shape of eyes, color, height (dogs are taller, cats
are smaller), etc.
• The main goal of the supervised learning technique is to map the input
variable(x) with the output variable(y). Some real-world applications of supervised
learning are Risk Assessment, Fraud Detection, Spam filtering, etc.
5
ML- Unit-II Department of IT
Categories of Supervised Machine Learning
• Classification
• Regression:
Types of Classification
Classification is of two types:
1. Binary Classification: When we have to categorize given data into 2 distinct classes.
Example – On the basis of given health conditions of a person, we have to determine
whether the person has a certain disease or not.
2. Multiclass Classification: The number of classes is more than 2. For Example – On
the basis of data about different species of flowers, we have to determine which specie
our observation belongs.
6
ML- Unit-II Department of IT
Binary and Multiclass Classification
Fig1: Binary and Multiclass Classification. Here x1 and x2 are the variables upon which
the class is predicted.
7
ML- Unit-II Department of IT
Types of Classifiers (algorithms)
8
There are various types of classifiers. Some of them are :
• Linear Classifiers: Logistic Regression
• Tree-Based Classifiers: Decision Tree Classifier
• Support Vector Machines
• Artificial Neural Networks
• Bayesian Regression
• Gaussian Naive Bayes Classifiers
• Stochastic Gradient Descent (SGD) Classifier
• Ensemble Methods: Random Forests, AdaBoost, Bagging Classifier,
Voting Classifier, ExtraTrees Classifier
ML- Unit-II Department of IT
Regression
9
Regression algorithms are used to solve regression problems in which
there is a linear relationship between input and output variables. These are
used to predict continuous output variables, such as market trends, weather
prediction, etc.
• Simple Linear Regression Algorithm
• Multivariate Regression Algorithm
• Decision Tree Algorithm
• Lasso Regression
ML- Unit-II Department of IT
Advantages and Disadvantages of Supervised Learning
10
Advantages:
• Since supervised learning work with the labelled dataset so we can
have an exact idea about the classes of objects.
• These algorithms are helpful in predicting the output on the basis of
prior experience.
Disadvantages:
• These algorithms are not able to solve complex tasks.
• It may predict the wrong output if the test data is different from the
training data.
• It requires lots of computational time to train the algorithm.
ML- Unit-II Department of IT
Applications of Supervised Learning
11
• Image Segmentation:
• Supervised Learning algorithms are used in image segmentation. In this process, image
classification is performed on different image data with pre-defined labels.
• Medical Diagnosis:
• Supervised algorithms are also used in the medical field for diagnosis purposes. It is
done by using medical images and past labelled data with labels for disease conditions.
With such a process, the machine can identify a disease for the new patients.
• Fraud Detection - Supervised Learning classification algorithms are used for identifying
fraud transactions, fraud customers, etc. It is done by using historic data to identify the
patterns that can lead to possible fraud.
• Spam detection - In spam detection & filtering, classification algorithms are used. These
algorithms classify an email as spam or not spam. The spam emails are sent to the spam
folder.
• Speech Recognition - Supervised learning algorithms are also used in speech
recognition. The algorithm is trained with voice data, and various identifications can be
done using the same, such as voice-activated passwords, voice commands, etc.
ML- Unit-II Department of IT
Unsupervised Machine Learning
12
• the machine is trained using the unlabeled dataset, and the
machine predicts the output without any supervision.
• the models are trained with the data that is neither classified nor
labelled, and the model acts on that data without any
supervision.
• The main aim of the unsupervised learning algorithm is to
group or categories the unsorted dataset according to the
similarities, patterns, and differences. Machines are instructed
to find the hidden patterns from the input dataset.
ML- Unit-II Department of IT
Types of Unsupervised Machine Learning
13
• 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.
• 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.
ML- Unit-II Department of IT
List of some popular unsupervised learning algorithms:
14
• K-means clustering
• KNN (k-nearest neighbors)
• Hierarchal clustering
• Anomaly detection
• Neural Networks
• Principle Component Analysis
• Independent Component Analysis
• Apriori algorithm
• Singular value decomposition
ML- Unit-II Department of IT
Semi-Supervised learning
15
• Semi-Supervised learning is a type of
Machine Learning algorithm that
represents the intermediate ground
between Supervised and Unsupervised
learning algorithms. It uses the
combination of labeled and unlabeled
datasets during the training period.
ML- Unit-II Department of IT
Semi-Supervised learning
16
• Semi-Supervised learning is a type of Machine Learning algorithm
that represents the intermediate ground between Supervised and
Unsupervised learning algorithms. It uses the combination of
labeled and unlabeled datasets during the training period.
• The basic disadvantage of supervised learning is that it requires hand-
labeling by ML specialists or data scientists, and it also requires a high
cost to process. Further unsupervised learning also has a limited
spectrum for its applications. To overcome these drawbacks of
supervised learning and unsupervised learning algorithms, the
concept of Semi-supervised learning is introduced.
ML- Unit-II Department of IT
Reinforcement Learning
17
• Reinforcement Learning is a feedback-based Machine learning
technique in which an agent learns to behave in an environment by
performing the actions and seeing the results of actions. For each
good action, the agent gets positive feedback, and for each bad
action, the agent gets negative feedback or penalty.
• In Reinforcement Learning, the agent learns automatically using
feedbacks without any labeled data, unlike supervised learning.
• Since there is no labeled data, so the agent is bound to learn by its
experience only.
• RL solves a specific type of problem where decision making is
sequential, and the goal is long-term, such as game-playing,
robotics, etc.
ML- Unit-II Department of IT
Reinforcement Learning
18
• The problem is as follows: We have an agent and a reward, with
many hurdles in between. The agent is supposed to find the best
possible path to reach the reward. The above image shows the
robot, diamond, and fire. The goal of the robot is to get the
reward that is the diamond and avoid the hurdles that are fired.
The robot learns by trying all the possible paths and then
choosing the path which gives him the reward with the least
hurdles. Each right step will give the robot a reward and each
wrong step will subtract the reward of the robot. The total reward
will be calculated when it reaches the final reward that is the
diamond.
ML- Unit-II Department of IT
Reinforcement Learning
19
ML- Unit-II Department of IT
Application of Reinforcement Learnings
20
1. Robotics: Robots with pre-programmed behavior are useful in
structured environments, such as the assembly line of an automobile
manufacturing plant, where the task is repetitive in nature.
2. A master chess player makes a move. The choice is informed both by
planning, anticipating possible replies and counter replies.
3. An adaptive controller adjusts parameters of a petroleum refinery’s
operation in real time.

Unit1_Types of MACHINE LEARNING 2020pattern.pdf

  • 1.
    Course - MachineLearning Course code-IT312 Topic- Types of ML(Unit-I) Sanjivani Rural Education Society’s Sanjivani College of Engineering, Kopargaon-423603 (An Autonomous Institute Affiliated to Savitribai Phule Pune University, Pune) NAAC ‘A’ Grade Accredited, ISO 9001:2015 Certified Department of Information Technology (NBAAccredited) Dr.R.D.Chintamani Asst. Prof. 1
  • 2.
    ML- Unit-II Departmentof IT Unit-I INTRODUCTION TO MACHINE LEARNING • Syllabus Introduction: Definition, Real life applications, Introduction to Data in Machine Learning Types of Learning: Supervised Learning Unsupervised Learning, Semi-Supervised Learning, Reinforcement Learning. Features:Types of Data (Qualitative and Quantitative), Scales of Measurement (Nominal, Ordinal, Interval, Ratio), Concept of Feature, Feature construction, Feature Selection and Transformation, Curse of Dimensionality. Dataset Preparation: Training Vs. Testing Dataset, Dataset Validation Techniques – Hold-out, k-fold Cross validation, Leave-One-Out Cross- Validation (LOOCV). 2
  • 3.
    ML- Unit-II Departmentof IT Types of Machine Learning Machine learning is a subset of AI, which enables the machine to automatically learn from data, improve performance from past experiences, and make predictions. Machine learning contains a set of algorithms that work on a huge amount of data. Data is fed to these algorithms to train them, and on the basis of training, they build the model & perform a specific task. These ML algorithms help to solve different business problems like Regression, Classification, Forecasting, Clustering, and Associations 3
  • 4.
    ML- Unit-II Departmentof IT Types of Machine Learning 1. Supervised Machine Learning 2. Unsupervised Machine Learning 3. Semi-Supervised Machine Learning 4. Reinforcement Learning 4
  • 5.
    ML- Unit-II Departmentof IT Supervised Machine Learning • Train the machines using the "labelled" dataset, and based on the training, the machine predicts the output. • Train the machine with the input and corresponding output, and then we ask the machine to predict the output using the test dataset. • Example of training to the machine to understand the images, such as the shape & size of the tail of cat and dog, Shape of eyes, color, height (dogs are taller, cats are smaller), etc. • The main goal of the supervised learning technique is to map the input variable(x) with the output variable(y). Some real-world applications of supervised learning are Risk Assessment, Fraud Detection, Spam filtering, etc. 5
  • 6.
    ML- Unit-II Departmentof IT Categories of Supervised Machine Learning • Classification • Regression: Types of Classification Classification is of two types: 1. Binary Classification: When we have to categorize given data into 2 distinct classes. Example – On the basis of given health conditions of a person, we have to determine whether the person has a certain disease or not. 2. Multiclass Classification: The number of classes is more than 2. For Example – On the basis of data about different species of flowers, we have to determine which specie our observation belongs. 6
  • 7.
    ML- Unit-II Departmentof IT Binary and Multiclass Classification Fig1: Binary and Multiclass Classification. Here x1 and x2 are the variables upon which the class is predicted. 7
  • 8.
    ML- Unit-II Departmentof IT Types of Classifiers (algorithms) 8 There are various types of classifiers. Some of them are : • Linear Classifiers: Logistic Regression • Tree-Based Classifiers: Decision Tree Classifier • Support Vector Machines • Artificial Neural Networks • Bayesian Regression • Gaussian Naive Bayes Classifiers • Stochastic Gradient Descent (SGD) Classifier • Ensemble Methods: Random Forests, AdaBoost, Bagging Classifier, Voting Classifier, ExtraTrees Classifier
  • 9.
    ML- Unit-II Departmentof IT Regression 9 Regression algorithms are used to solve regression problems in which there is a linear relationship between input and output variables. These are used to predict continuous output variables, such as market trends, weather prediction, etc. • Simple Linear Regression Algorithm • Multivariate Regression Algorithm • Decision Tree Algorithm • Lasso Regression
  • 10.
    ML- Unit-II Departmentof IT Advantages and Disadvantages of Supervised Learning 10 Advantages: • Since supervised learning work with the labelled dataset so we can have an exact idea about the classes of objects. • These algorithms are helpful in predicting the output on the basis of prior experience. Disadvantages: • These algorithms are not able to solve complex tasks. • It may predict the wrong output if the test data is different from the training data. • It requires lots of computational time to train the algorithm.
  • 11.
    ML- Unit-II Departmentof IT Applications of Supervised Learning 11 • Image Segmentation: • Supervised Learning algorithms are used in image segmentation. In this process, image classification is performed on different image data with pre-defined labels. • Medical Diagnosis: • Supervised algorithms are also used in the medical field for diagnosis purposes. It is done by using medical images and past labelled data with labels for disease conditions. With such a process, the machine can identify a disease for the new patients. • Fraud Detection - Supervised Learning classification algorithms are used for identifying fraud transactions, fraud customers, etc. It is done by using historic data to identify the patterns that can lead to possible fraud. • Spam detection - In spam detection & filtering, classification algorithms are used. These algorithms classify an email as spam or not spam. The spam emails are sent to the spam folder. • Speech Recognition - Supervised learning algorithms are also used in speech recognition. The algorithm is trained with voice data, and various identifications can be done using the same, such as voice-activated passwords, voice commands, etc.
  • 12.
    ML- Unit-II Departmentof IT Unsupervised Machine Learning 12 • the machine is trained using the unlabeled dataset, and the machine predicts the output without any supervision. • the models are trained with the data that is neither classified nor labelled, and the model acts on that data without any supervision. • The main aim of the unsupervised learning algorithm is to group or categories the unsorted dataset according to the similarities, patterns, and differences. Machines are instructed to find the hidden patterns from the input dataset.
  • 13.
    ML- Unit-II Departmentof IT Types of Unsupervised Machine Learning 13 • 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. • 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.
  • 14.
    ML- Unit-II Departmentof IT List of some popular unsupervised learning algorithms: 14 • K-means clustering • KNN (k-nearest neighbors) • Hierarchal clustering • Anomaly detection • Neural Networks • Principle Component Analysis • Independent Component Analysis • Apriori algorithm • Singular value decomposition
  • 15.
    ML- Unit-II Departmentof IT Semi-Supervised learning 15 • Semi-Supervised learning is a type of Machine Learning algorithm that represents the intermediate ground between Supervised and Unsupervised learning algorithms. It uses the combination of labeled and unlabeled datasets during the training period.
  • 16.
    ML- Unit-II Departmentof IT Semi-Supervised learning 16 • Semi-Supervised learning is a type of Machine Learning algorithm that represents the intermediate ground between Supervised and Unsupervised learning algorithms. It uses the combination of labeled and unlabeled datasets during the training period. • The basic disadvantage of supervised learning is that it requires hand- labeling by ML specialists or data scientists, and it also requires a high cost to process. Further unsupervised learning also has a limited spectrum for its applications. To overcome these drawbacks of supervised learning and unsupervised learning algorithms, the concept of Semi-supervised learning is introduced.
  • 17.
    ML- Unit-II Departmentof IT Reinforcement Learning 17 • Reinforcement Learning is a feedback-based Machine learning technique in which an agent learns to behave in an environment by performing the actions and seeing the results of actions. For each good action, the agent gets positive feedback, and for each bad action, the agent gets negative feedback or penalty. • In Reinforcement Learning, the agent learns automatically using feedbacks without any labeled data, unlike supervised learning. • Since there is no labeled data, so the agent is bound to learn by its experience only. • RL solves a specific type of problem where decision making is sequential, and the goal is long-term, such as game-playing, robotics, etc.
  • 18.
    ML- Unit-II Departmentof IT Reinforcement Learning 18 • The problem is as follows: We have an agent and a reward, with many hurdles in between. The agent is supposed to find the best possible path to reach the reward. The above image shows the robot, diamond, and fire. The goal of the robot is to get the reward that is the diamond and avoid the hurdles that are fired. The robot learns by trying all the possible paths and then choosing the path which gives him the reward with the least hurdles. Each right step will give the robot a reward and each wrong step will subtract the reward of the robot. The total reward will be calculated when it reaches the final reward that is the diamond.
  • 19.
    ML- Unit-II Departmentof IT Reinforcement Learning 19
  • 20.
    ML- Unit-II Departmentof IT Application of Reinforcement Learnings 20 1. Robotics: Robots with pre-programmed behavior are useful in structured environments, such as the assembly line of an automobile manufacturing plant, where the task is repetitive in nature. 2. A master chess player makes a move. The choice is informed both by planning, anticipating possible replies and counter replies. 3. An adaptive controller adjusts parameters of a petroleum refinery’s operation in real time.