0% found this document useful (0 votes)
36 views46 pages

Data Science Lectures 3

The document provides an introduction to machine learning, detailing its history, branches (supervised, unsupervised, and reinforcement learning), and focuses on supervised learning techniques, particularly the Decision Tree algorithm. It explains how Decision Trees work, including the process of attribute selection using Information Gain and Gini Index, as well as the ID3 algorithm for constructing trees. Additionally, it discusses the advantages and disadvantages of Decision Trees and introduces the Random Forest algorithm as a method to enhance predictive accuracy by combining multiple decision trees.

Uploaded by

suptosaha.915
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views46 pages

Data Science Lectures 3

The document provides an introduction to machine learning, detailing its history, branches (supervised, unsupervised, and reinforcement learning), and focuses on supervised learning techniques, particularly the Decision Tree algorithm. It explains how Decision Trees work, including the process of attribute selection using Information Gain and Gini Index, as well as the ID3 algorithm for constructing trees. Additionally, it discusses the advantages and disadvantages of Decision Trees and introduces the Random Forest algorithm as a method to enhance predictive accuracy by combining multiple decision trees.

Uploaded by

suptosaha.915
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

CSE 603 Introduction to Data Science

m
Nayan Kumar Nath
Lecturer,
Dept. Of CSE,Company
Sylhet Engineering
LOGOCollege
1
What is machine learning?

Blue faces seem to be important…


What is machine learning really?
1950’s: creation of first
“intelligent” algorithms and
[Link] published
“Computer Machinery and
Intelligence” which proposed a
test of machine intelligence
called The Imitation Game

1980’s: statistical models and


algorithms that can learn from data

2010’s: statistical models and algorithms


inspired by neurones that can learn from
data
Machine Learning Branches

3 Main Branches:
- Supervised Learning
- Unsupervised
Learning
- Reinforcement
Learning
Machine Learning Branches
Machine Learning Branches: Supervised Learning

In supervised learning Values, Vectors,


Words, Images etc.
the training data
consists of input/output
Input
pairs and we train a
function to map the
inputs to the outputs. Classification Regression

Categorical Variable Continuous Variables


eg. Image Classification eg. Market Prediction
A, B, C Prize/Cost,
Dogs/Cats Weight, Lifetime
Supervised Learning: Classification
Classification: Classification algorithms are used to solve the classification
problems in which the output variable is categorical, such as "Yes" or No, Male
or Female, Red or Blue, etc. The classification algorithms predict the categories
present in the dataset. Assign categorical labels from a fixed set of labels to data
samples. Some popular classification algorithms are given below:
Random Forest Algorithm,Decision Tree Algorithm,Logistic Regression Algorithm,
Support Vector Machine Algorithm, Naive Bayes Algorithm

Input
Data:

“Normal “Broken
Output/Label: Bike” Bike”
Decision Tree Classification Algorithm
▪ Decision Tree is a Supervised learning technique that can be used for both classification
and Regression problems, but mostly it is preferred for solving Classification [Link] is a
tree-structured classifier, where internal nodes represent the features of a dataset,
branches represent the decision rules and each leaf node represents the outcome.
▪ In a Decision tree, there are two nodes, which are the Decision Node and Leaf Node
▪It is a graphical representation for getting all the possible solutions to a
problem/decision based on given conditions.
▪ In order to build a tree, we use the CART algorithm, which stands for Classification and
Regression Tree algorithm.
▪ A decision tree simply asks a question, and based on the answer (Yes/No), it further split
the tree into subtrees.
How does the Decision Tree algorithm Work?
▪ In a decision tree, for predicting the class of the given dataset, the algorithm starts from
the root node of the tree. This algorithm compares the values of root attribute with the
record (real dataset) attribute and, based on the comparison, follows the branch and jumps to
the next node.

▪ For the next node, the algorithm again compares the attribute value with the other sub-
nodes and move further. It continues the process until it reaches the leaf node of the tree.
The complete process can be better understood using the below algorithm:

Step-1: Begin the tree with the root node, says S, which contains the complete dataset.
Step-2: Find the best attribute in the dataset using Attribute Selection Measure (ASM).
Step-3: Divide the S into subsets that contains possible values for the best attributes.
Step-4: Generate the decision tree node, which contains the best attribute.
Step-5: Recursively make new decision trees using the subsets of the dataset created in step
-3. Continue this process until a stage is reached where you cannot further classify the nodes
and called the final node as a leaf node.
Decision Tree algorithm: Example
Suppose there is a candidate who has a job offer and wants to decide whether he should accept the offer or Not.
So, to solve this problem, the decision tree starts with the root node (Salary attribute by ASM). The root node
splits further into the next decision node (distance from the office) and one leaf node based on the
corresponding labels. The next decision node further gets split into one decision node (Cab facility) and one leaf
node. Finally, the decision node splits into two leaf nodes (Accepted offers and Declined offer). Consider the
below diagram:
Attribute Selection Measures(ASM):
▪ While implementing a Decision tree, the main issue arises that how to select the best
attribute for the root node and for sub-nodes. So, to solve such problems there is a technique
which is called as Attribute selection measure or ASM. The goal of ASM is to identify the
attribute that will create the most homogeneous subsets of data after the split, thereby
maximizing the information gain. This process is repeated on each derived subset in a
recursive manner called recursive partitioning
▪ By this measurement, we can easily select the best attribute for the nodes of the tree. There
are two popular techniques for ASM, which are:
▪ Information Gain
▪ Gini Impurity or Index
1. Information Gain:
Information gain is the measurement of changes in entropy after the segmentation of a
dataset based on an attribute. It calculates how much information a feature provides us about
a class. According to the value of information gain, we split the node and build the decision
tree. A decision tree algorithm always tries to maximize the value of information gain, and a
node/attribute having the highest information gain is split first. It can be calculated using the
below formula:
Information Gain= Entropy(S)- [(Weighted Avg) *Entropy(each feature)
The information gain of an attribute A, with respect to a dataset S, is calculated as
follows: |𝑺𝒗 |
𝑮𝒂𝒊𝒏 𝑺, 𝒂 = 𝑬𝒏𝒕𝒓𝒐𝒑𝒚 𝑺 − ෍ 𝑬𝒏𝒕𝒓𝒐𝒑𝒚(𝑺𝒗 )
|𝑺|
A is the specific attribute or class label,|H| is the entropy of dataset sample S
•|HV| is the number of instances in the subset S that have the value v for attribute A.
Attribute Selection Measures(ASM):
Entropy: Entropy is a metric to measure the impurity in a given attribute. It specifies
randomness in data. Entropy can be calculated as:
Entropy(s)= -P(yes)log2 P(yes)- P(no) log2 P(no)
Where,
•S= Total number of samples,P(yes)= probability of yes,P(no)= probability of no
•Important points related to Entropy:
•The entropy is 0 when the dataset is completely homogeneous, meaning that each instance belongs to
the same class. It is the lowest entropy indicating no uncertainty in the dataset sample.
•when the dataset is equally divided between multiple classes, the entropy is at its maximum value.
Therefore, entropy is highest when the distribution of class labels is even, indicating maximum
uncertainty in the dataset sample.
•Entropy is used to evaluate the quality of a split. The goal of entropy is to select the attribute that
minimizes the entropy of the resulting subsets, by splitting the dataset into more homogeneous subsets
with respect to the class labels.
•The highest information gain attribute is chosen as the splitting criterion (i.e., the reduction in entropy
after splitting on that attribute), and the process is repeated recursively to build the decision tree.
2. Gini Impurity or Index
Gini index is a measure of impurity or purity used while creating a decision tree in the
CART(Classification and Regression Tree) algorithm. An attribute with the low Gini index
should be preferred as compared to the high Gini index. It only creates binary splits, and the
CART algorithm uses the Gini index to create binary splits. Gini index can be calculated
using the below formula: Gini Index= 1- ∑jPj2
pj is the proportion of elements in the set that belongs to the jth category.
ID3 Algorithm
The ID3 (Iterative Dichotomiser 3) algorithm is one of the earliest and most widely used algorithms to
create Decision Trees from a given dataset. It uses the concept of entropy and information gain to select the
best attribute for splitting the data at each node.
Understanding the ID3 Algorithm:
The ID3 algorithm uses the concept of entropy and information gain to construct a decision tree. Entropy
measures the amount of uncertainty or randomness in a dataset, while information gain quantifies the
reduction in entropy achieved by splitting the data on a specific attribute. The attribute with the highest
information gain is selected as the decision node for the tree.
Steps to Create a Decision Tree using the ID3 Algorithm:
Step 1: Data Preprocessing: Clean and preprocess the data. Handle missing values and convert
categorical variables into numerical representations if needed.
Step 2: Selecting the Root Node: Calculate the entropy of the target variable (class labels) based on the
dataset. The formula for entropy is:
Entropy(S) = -Σ (p_i * log2(p_i))
where p_i is the proportion of instances belonging to class i.
Step 3: Calculating Information Gain:For each attribute in the dataset, calculate the information gain
when the dataset is split on that attribute. The formula for information gain is:
Information Gain(S, A) = Entropy(S) - Σ ((|S_v| / |S|) * Entropy(S_v))
where S_v is the subset of instances for each possible value of attribute A, and |S_v| is the number of
instances in that subset.
Step 4: Selecting the Best Attribute: Choose the attribute with the highest information gain as the
decision node for the tree.
Step 5: Splitting the Dataset: Split the dataset based on the values of the selected attribute.
Step 6: Repeat the Process: Recursively repeat steps 2 to 5 for each subset until a stopping criterion is
met (e.g., the tree depth reaches a maximum limit or all instances in a subset belong to the same class).
Example
▪ What is the entropy of this collection of training examples with respect to target function
classification.
▪ What is the information gain of a1 and a2 relative to these training examples?
▪ Draw a decision tree for the given dataset.
Instance Classification a1 a2
1. + T T
2. + T T
3. - T F
4. + F F
5. - F T
6. - F T
Attribute(a1): values(T,F)
▪ S=[3+,3-] , Entropy(S)=1.0 [Equal no of –ve,+ve E=1 / If only +ve/-ve ,E=0 ]
𝟐 𝟐 𝟏 𝟏
▪ ST = =[2+,1-] , Entropy(ST)=−𝒑+ 𝐥𝐨𝐠 𝟐 𝒑+ − 𝒑− 𝐥𝐨𝐠 𝟐 𝒑− =− 𝟑 𝒍𝒐𝒈 𝟐 𝟑 − 𝒍𝒐𝒈 𝟐 𝟑
𝟑

0.9183
𝟏 𝟏 𝟐 𝟐
▪ SF = =[1+,2-] , Entropy(SF)=−𝒑+ 𝐥𝐨𝐠 𝟐 𝒑+ − 𝒑− 𝐥𝐨𝐠 𝟐 𝒑− =− 𝒍𝒐𝒈 𝟐 − 𝒍𝒐𝒈 𝟐 𝟑
𝟑 𝟑 𝟑

0.9183
ID3 Algorithm: Examples
|𝐒𝐯 |
❑ 𝐆𝐚𝐢𝐧 𝐒, 𝐚 = 𝐄𝐧𝐭𝐫𝐨𝐩𝐲 𝐒 − σ𝐯∈𝐯𝐚𝐥𝐮𝐞𝐬(𝐒) 𝐄𝐧𝐭𝐫𝐨𝐩𝐲 𝐒𝐯
|𝐒|

𝟑 𝟑
❑ 𝑮𝒂𝒊𝒏 𝑺, 𝒂𝟏 = 𝑬𝒏𝒕𝒓𝒐𝒑𝒚 𝑺 − ∗ 𝑬𝒏𝒕𝒓𝒐𝒑𝒚(ST ) − ∗ 𝑬𝒏𝒕𝒓𝒐𝒑𝒚(SF )
𝟔 𝟔
𝟑 𝟑
= 1− ∗ 0.9183 − ∗ 𝟎. 𝟗𝟏𝟖𝟑 = 0.087 -> maximum gain
𝟔 𝟔

Attribute(a2): values(a2) = (T,F)


▪ S=[3+,3-] , Entropy(S)=1.0 [Equal no of –ve,+ve E=1 / If only +ve/-ve ,E=0 ]
▪ ST = =[2+,2-] , Entropy(ST)= 1
▪ SF = =[1+,1-] , Entropy(SF)= 1

𝟒 𝟐
❑ 𝑮𝒂𝒊𝒏 𝑺, 𝒂𝟐 = 𝑬𝒏𝒕𝒓𝒐𝒑𝒚 𝑺 − ∗ 𝑬𝒏𝒕𝒓𝒐𝒑𝒚(ST ) − ∗ 𝑬𝒏𝒕𝒓𝒐𝒑𝒚(SF )
𝟔 𝟔
𝟒 𝟐
= 1− ∗1− ∗ 𝟏 = 0 -> minimum gain
𝟔 𝟔
Decision Tree
a1
T F
1,2,3 4,5,6

a2 a2

T F T F

1,2 5,6 4
3
+ − +

Decision Tree algorithm

Advantages of the Decision Tree


•It is simple to understand as it follows the same process which a human
follow while making any decision in real-life.
•It can be very useful for solving decision-related problems.
•It helps to think about all the possible outcomes for a problem.
•There is less requirement of data cleaning compared to other algorithms.
Disadvantages of the Decision Tree
•The decision tree contains lots of layers, which makes it complex.
•It may have an overfitting issue, which can be resolved using the Random
Forest algorithm.
•For more class labels, the computational complexity of the decision tree may
increase.
Random Forest Algorithm
▪ Random Forest is a classifier that contains a number of decision trees on various subsets of the given
dataset and takes the average to improve the predictive accuracy of that dataset." Instead of relying on
one decision tree, the random forest takes the prediction from each tree and based on the majority votes
of predictions, and it predicts the final output. It can be used for both Classification and Regression
problems in ML. It is based on the concept of ensemble learning, which is a process of combining
multiple classifiers to solve a complex problem and to improve the performance of the model.
▪The individual decision trees tend to overfit to the training data but random forest can mitigate that
issue by averaging the prediction results from different trees. The greater number of trees in the forest
leads to higher accuracy and prevents the problem of overfitting.
Therefore, below are two assumptions for a better Random forest classifier:
•There should be some actual values in the feature variable of the dataset so that the classifier can
predict accurate results rather than a guessed result.
•The predictions from each tree must have very low correlations.
How does Random Forest algorithm work?
▪Random Forest works in two-phase first is to create the random forest by combining N
decision tree, and second is to make predictions for each tree created in the first phase.
▪The Working process can be explained in the below steps and diagram:
▪Step-1: Select random K data points from the training set.
▪Step-2: Build the decision trees associated with the selected data points (Subsets).
▪Step-3: Choose the number N for decision trees that you want to build.
▪Step-4: Repeat Step 1 & 2.
▪Step-5: For new data points, find the predictions of each decision tree, and assign the new
data points to the category that wins the majority votes.
The combination of multiple models is called Ensemble. Ensemble uses two methods:
Bagging: Creating a different training subset from sample training data with replacement is
called Bagging. The final output is based on majority voting.
Boosting: Combing weak learners into strong learners by creating sequential models such that
the final model has the highest accuracy is called Boosting. Example: ADA BOOST, XG
BOOST.
Applications of Random Forest
There are mainly four sectors where Random forest mostly used:
[Link]: Banking sector mostly uses this algorithm for the identification of loan risk.
[Link]: With the help of this algorithm, disease trends and risks of the disease can be
identified.
[Link] Use: We can identify the areas of similar land use by this algorithm.
[Link]: Marketing trends can be identified using this algorithm.
Random forest algorithm: Example
Suppose there is a dataset that contains multiple fruit images. So, this dataset is given to the
Random forest classifier. The dataset is divided into subsets and given to each decision tree.
During the training phase, each decision tree produces a prediction result, and when a new data
point occurs, then based on the majority of results, the Random Forest classifier predicts the final
decision. Consider the below image:
Example:Penguine classification
Species Island Body_mass_g Flipper_length
_mm
Adelie Togersen 3750.0 181.0
Adelie Togersen 3800.0 186.0
Chinstrip Dream 3250.0 187.0
Chinstrip Dream 3675.00 198.0
Gentoo Biscoe 6000.0 220.0
Gentoo Biscoe 4750.0 215.0

Working of random forest algorithm:


1. Random sampling with replacement
2. Ensemble techniques(bootstrap aggregation or bagging): Aggregating the result of
decision trees and taking the majority votes(classification) or mean(regratigon)
3. How feature selection is done in classification and regression problem?
• Classification: By default feature selection is taken as the square root of total
number of all the features.
• Regression: By default the feature are selected by total number of all features
divided by 3.
[Link] best split is chosen on Gini impurity or information gain method
Example:Penguine classification
1. Random sampling with replacement/Bootstrap
Species Island Body_
Species Island Body_ Flipper_le mass_
mass_ ngth_mm g
g Adelie Togersen 3750.0
Chinstrip Dream 3250.0
Gentoo Biscoe 6000.0
Adelie Togers 3750.0 181.0 Gentoo Biscoe 4750.0
en
Species Island Flipper
Adelie Togers 3800.0 186.0 _lengt
en h_mm
Adelie Togersen 186.0
Chinstrap Dream 3250.0 187.0
Chinstrip Dream 187.0
Gentoo Biscoe 215.0
Chinstrip Dream 3675.00 198.0
Gentoo Biscoe 215.0

Gentoo Biscoe 6000.0 220.0 Species Body_ Flipper


mass_g _lengt
h_mm
Gentoo Biscoe 4750.0 215.0 Adelie Togersen 186.0
Adelie Dream 187.0
Chinstrip Biscoe 198.0
Gentoo Biscoe 220.0
Example:Penguine classification
Creating decision trees from the subsamples

Species Island Body_ Species Island Flipper Species Body_ Flipper


mass_ _lengt mass_g _lengt
g h_mm h_mm
Adelie Togersen 3750.0 Adelie Togersen 186.0 Adelie Togersen 186.0
Chinstrap Dream 3250.0 Chinstrap Dream 187.0 Adelie Dream 187.0
Gentoo Biscoe 6000.0 Gentoo Biscoe 215.0 Chinstrap Biscoe 198.0
Gentoo Biscoe 4750.0 Gentoo Biscoe 215.0 Gentoo Biscoe 220.0

Body_mass_g Flipper_length_mm Flipper_length_mm

>=3500 >=190 No Yes >=4000


No Yes No
Yes

Island Flipper_length_mm G
c Island
G >=190

T D A C
T B
Example:Penguine classification
2. Ensemble techniques: bootstrap aggregation or bagging:
Unknown
Dream 325.5 186.3 Species? Data

DT 1 DT 2 DT 3

Body_mass_g Flipper_length_mm Flipper_length_mm


>=3500 >=190
No Yes No No Yes >=4000
Yes

c Island Island Flipper_length_mm


G G
>=190

T B T D A C

Unknown
Ensemble
Species =
max votes Chinstrap Result
Chinstrap Adelie
Chinstrap Adelie

Dream 325.5 186.3 Species? 2 1


Random forest algorithm

Advantages of Random Forest


•Random Forest is capable of performing both Classification and Regression tasks.
•It is capable of handling large datasets with high dimensionality.
•It enhances the accuracy of the model and prevents the overfitting issue.

Disadvantages of Random Forest


•Although random forest can be used for both classification and regression tasks, it is
not more suitable for Regression tasks.
Naïve Bayes Classifier Algorithm
▪ Naive Bayes is a statistical classification technique based on Bayes Theorem. It is one of the
simplest supervised learning algorithms. Naive Bayes classifier is the fast, accurate and reliable
algorithm. Naive Bayes classifiers have high accuracy and speed on large datasets. It is a
probabilistic classifier, which means it predicts on the basis of the probability of an
object. Some popular examples of Naïve Bayes Algorithm are spam filtration, Sentimental
analysis, and classifying articles.
▪ The Naïve Bayes algorithm is comprised of two words Naïve and Bayes, Which can be described
as:
▪ Naïve: It is called Naïve because it assumes that the occurrence of a certain feature is
independent of the occurrence of other features. Such as if the fruit is identified on the bases of
color, shape, and taste, then red, spherical, and sweet fruit is recognized as an apple. Hence
each feature individually contributes to identify that it is an apple without depending on each
other.
▪ Bayes: It is called Bayes because it depends on the principle of Bayes' Theorem.
Bayes' Theorem: Bayes' theorem is also known as Bayes' Rule or Bayes' law, which is used to
determine the probability of a hypothesis with prior knowledge. It depends on the conditional
probability. The formula for Bayes' theorem is given as:
Where,
P(A|B) is Posterior probability: Probability of hypothesis A on the
observed event B.
P(B|A) is Likelihood probability: Probability of the evidence given
that the probability of a hypothesis is true.
P(A) is Prior Probability: Probability of hypothesis before
observing the evidence.
P(B) is Marginal Probability: Probability of Evidence.
How does Naïve Bayes' Classifier work?
Working of Naïve Bayes' Classifier:
Working of Naïve Bayes' Classifier can be understood with the help of the below example:
Suppose we have a dataset of weather conditions and corresponding target variable "Play".
So using this dataset we need to decide that whether we should play or not on a particular day
according to the weather conditions. So to solve this problem, we need to follow the below
steps: Outlook Play
No
[Link] the given dataset into frequency tables. 0 Rainy Yes
[Link] Likelihood table by finding the
1 Sunny Yes
probabilities of given features.
2 Overcast Yes
[Link], use Bayes theorem to calculate the posterior
3 Overcast Yes
probability.
4 Sunny No
Problem: If the weather is sunny, then the Player should
play or not? 5 Rainy Yes
Solution: To solve this, first consider the defined 6 Sunny Yes
dataset: 7 Overcast Yes
Weather Yes No 8 Rainy No
Overcast 5 0 9 Sunny No
10 Sunny Yes
Rainy 2 2
11 Rainy No
Sunny 3 2 12 Overcast Yes
Total 10 5 13 Overcast Yes

Frequency table for the Weather Conditions Datasets


How does Naïve Bayes' Classifier work?
Weather No Yes
Overcast 0 5 5/14= 0.35
Rainy 2 2 4/14=0.29
Sunny 2 3 5/14=0.35
All 4/14=0.29 10/14=0.71
Likelihood table weather condition
Applying Bayes 'theorem:
▪ P(Yes|Sunny)= P(Sunny|Yes)*P(Yes)/P(Sunny)
P(Sunny|Yes)= 3/10= 0.3
P(Sunny)= 0.35
P(Yes)=0.71
So P(Yes|Sunny) = 0.3*0.71/0.35= 0.60
▪ P(No|Sunny)= P(Sunny|No)*P(No)/P(Sunny)
P(Sunny|NO)= 2/4=0.5
P(No)= 0.29
P(Sunny)= 0.35
So P(No|Sunny)= 0.5*0.29/0.35 = 0.41
So as we can see from the above calculation that P(Yes|Sunny)>P(No|Sunny)
Hence on a Sunny day, Player can play the game.
Naïve Bayes Classifier
Advantages of Naïve Bayes Classifier:
•Naïve Bayes is one of the fast and easy ML algorithms to predict a class of datasets.
•It can be used for Binary as well as Multi-class Classifications.
•It performs well in Multi-class predictions as compared to the other Algorithms.
•It is the most popular choice for text classification problems.
Disadvantages of Naïve Bayes Classifier:
•Naive Bayes assumes that all features are independent or unrelated, so it cannot learn the relationship
between features.
Applications of Naïve Bayes Classifier:
•It is used for Credit Scoring.
•It is used in medical data classification.
•It can be used in real-time predictions because Naïve Bayes Classifier is an eager learner.
•It is used in Text classification such as Spam filtering and Sentiment analysis.
Types of Naïve Bayes Model:
There are three types of Naive Bayes Model, which are given below:
Gaussian: The Gaussian model assumes that features follow a normal distribution. This means if
predictors take continuous values instead of discrete, then the model assumes that these values are
sampled from the Gaussian distribution.
Multinomial: The Multinomial Naïve Bayes classifier is used when the data is multinomial
distributed. It is primarily used for document classification problems, it means a particular document
belongs to which category such as Sports, Politics, education, etc. The classifier uses the frequency of
words for the predictors.
Bernoulli: The Bernoulli classifier works similar to the Multinomial classifier, but the predictor
variables are the independent Booleans variables. Such as if a particular word is present or not in a
document. This model is also famous for document classification tasks.
Supervised Learning: Regression
Regression: 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.
Find the relationship between one dependent variable and a series of other changing
variables. Some popular Regression algorithms are given below:
Simple Linear Regression Algorithm,Multivariate Regression Algorithm,Decision
Tree Algorithm,Lasso Regression
Concentration

Length of
lecture
Machine Learning Branches: Unsupervised Learning
In unsupervised learning there are no labels available, insights are
gained without* prior knowledge. The main aim of the unsupervised
learning algorithm is to group or categories the unsorted dataset
according to the similarities, patterns, and differences

* Usually some model parameters need to be set ahead of training.


Unsupervised Learning: Clustering
Clustering: The clustering technique is used when we want to find the
inherent groups from the data. It is a way to group the objects into a
cluster such that the objects with the most similarities remain in one group
and have fewer or no similarities with the objects of other groups. An
example of the clustering algorithm is grouping the customers by their
purchasing behaviour. Some of the popular clustering algorithms are given
below:K-Means Clustering algorithm,Mean-shift algorithm,DBSCAN
Algorithm,Principal Component Analysis,Independent Component Analysis
Unsupervised Learning: Association
Association rule learning is an unsupervised learning technique, which finds
interesting relations among variables within a large dataset. The main aim of this
learning algorithm is to find the dependency of one data item on another data item
and map those variables accordingly so that it can generate maximum profit. This
algorithm is mainly applied in Market Basket analysis, Web usage mining,
continuous production, etc.
Some popular algorithms of Association rule learning are Apriori Algorithm, Eclat,
FP-growth algorithm.
Machine
Learning
Branches
Machine Learning Branches: Reinforcement Learning
Reinforcement learning works on a feedback-based process, in which an AI agent (A
software component) automatically explore its surrounding by hitting & trail, taking action,
learning from experiences, and improving its performance. Agent gets rewarded for each
good action and get punished for each bad action; hence the goal of reinforcement learning
agent is to maximize the rewards. Due to its way of working, reinforcement learning is
employed in different fields such as Game theory, Operation Research, Information theory,
multi-agent systems.
Reinforcement Learning: Positive
Positive Reinforcement Learning: Positive reinforcement learning
specifies increasing the tendency that the required behaviour would occur
again by adding something. It enhances the strength of the behaviour of
the agent and positively impacts it.
Reinforcement Learning: Negative
Negative Reinforcement Learning: negative reinforcement learning
works exactly opposite to the positive RL. It increases the tendency that the
specific behavior would occur again by avoiding the negative condition
Part II: Deep Learning
Deep learning (DL) is the type of machine learning (ML) that resembles human
brains, where it learns from data by using artificial neural networks. Just like human
brains, these deep neural networks learn from real-life examples. In a few cases, it has
surpassed human intelligence, just like Google's AlphaGo has defeated number one
Go Player Ke Jie.
Why now? In recent years two things became available:
1. A lot of data
Part II: Deep Learning
Why now? In recent years two things became available:
2. Necessary compute
What is deep learning?

Rosenblatt -
1961
What is new in deep learning?

What is new (among other things) is a learning


algorithm called backpropagation which allows
to train deep neural nets.

State-of-the-art networks can have over 200


layers!

GoogLeNet -
2014
Difference classical ML vs. Deep Learning

Classical ML methods don’t handle


high dimensionality well.

dimensionality reduction & feature selection

Deep neural nets learn compact


representations of data even in a high
dimensionality/sparse setting - no feature
engineering required!
Unsupervised Learning: Generative Adversarial Nets (GAN)

NVIDIA
None of these images were taken in the real world!
Unsupervised Learning: Generative Adversarial Nets (GAN)

DeepMind - 2018

Which of these images was generated?


Unsupervised Learning: Language Generation

OpenAI, February 14 2019: Better Language Models and Their Implications


Unsupervised Learning: Language Generation
OpenAI, February 14 2019: Better Language Models and Their Implications

[Link]
So why not use Deep Learning for everything?

► There are reasons why we don’t only use DL:


- Necessary data no available
- Computational power not available
- Harder to interpret results
- Deep networks can be fooled:

You might also like