0% found this document useful (0 votes)
9 views128 pages

Merged Presentation Choladeck

Module 3 of the course 23AD201 covers various machine learning algorithms, focusing on classification, regression, and clustering techniques. It discusses the principles of classification models, decision trees, artificial neural networks, and linear regression, along with their applications and evaluation metrics. Additionally, it introduces K-means clustering as an unsupervised learning method for grouping similar data points.

Uploaded by

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

Merged Presentation Choladeck

Module 3 of the course 23AD201 covers various machine learning algorithms, focusing on classification, regression, and clustering techniques. It discusses the principles of classification models, decision trees, artificial neural networks, and linear regression, along with their applications and evaluation metrics. Additionally, it introduces K-means clustering as an unsupervised learning method for grouping similar data points.

Uploaded by

727824TUIO042
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 128

MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

MODULE III MACHINE LEARNING ALGORITHMS

1
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

CLASSIFICATION
Classification teaches a machine to sort things
into categories. It learns by looking at examples
with labels (like emails marked “spam” or “not
spam”). After learning, it can decide which
category new items belong to, like identifying if a
new email is spam or not. For example a
classification model might be trained on dataset of
images labeled as either dogs or cats and it can be
used to predict the class of new and unseen images as
dogs or cats based on their features such as color,
texture and shape.

2
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

3
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

4
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

5
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

6
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

7
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

8
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

9
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

10
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

11
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

12
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

• Logistic Regression, Support Vector Machines having kernel = ‘linear’, Single-layer

Perceptron, Stochastic Gradient Descent (SGD) Classifier

Non-linear Classifiers: Non-linear models create a non-linear decision boundary between

classes. They can capture more complex relationships between input features and target

variable. Some of the non-linear classification models are as follows:

• K-Nearest Neighbours, Kernel SVM, Naive Bayes, Decision Tree Classification

• Ensemble learning classifiers:

Random Forests, AdaBoost,Bagging Classifier, Voting Classifier, Extra Trees Classifier, Multi-

layer Artificial Neural Networks

13
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

Decision Tree in Machine Learning

A decision tree is a supervised learning algorithm used for both classification and regression tasks. It

models decisions as a tree-like structure where internal nodes represent attribute tests, branches

represent attribute values, and leaf nodes represent final decisions or predictions. Decision trees are

versatile, interpretable, and widely used in machine learning for predictive modeling.

Intuition behind the Decision Tree

Imagine you’re deciding whether to buy an umbrella:

1. Step 1 – Ask a Question (Root Node):

Is it raining?

If yes, you might decide to buy an umbrella. If no, you move to the next question.

2. Step 2 – More Questions (Internal Nodes):

If it’s not raining, you might ask:

14
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

2. Is it likely to rain later?

If yes, you buy an umbrella; if no, you don’t.

3. Step 3 – Decision (Leaf Node):

Based on your answers, you either buy or skip the umbrella

15
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

16
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

Example: Predicting Whether a Person Likes Computer Games Using Two Decision Trees
Tree 1: Age and Gender
The first tree asks two questions:
“Is the person’s age less than 15?”
If Yes, they get a score of +2.
If No, proceed to the next question.
“Is the person male?”
If Yes, they get a score of +0.1.
If No, they get a score of -1.
Tree 2: Computer Usage
The second tree focuses on daily computer usage:
“Does the person use a computer daily?”
If Yes, they get a score of +0.9.
If No, they get a score of -0.9.
Combining Trees: Final Prediction
The final prediction score is the sum of scores from both trees

17
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

18
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

19
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

ARTIFICIAL NEURAL NETWORKS

20
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

21
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

22
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

23
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

24
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

25
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

26
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

27
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

28
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

29
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

APPLICATIONS OF ARTIFICIAL NEURAL NETWORKS:

• Social Media

• Marketing and Sales

• Healthcare

• Personal Assistants

30
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

REGRESSION

Regression in machine learning refers to a supervised learning technique where

the goal is to predict a continuous numerical value based on one or more

independent features. It finds relationships between variables so that predictions

can be made. we have two types of variables present in regression:

• Dependent Variable (Target): The variable we are trying to predict e.g house

price.

• Independent Variables (Features): The input variables that influence the

prediction e.g locality, number of rooms.

Regression analysis problem works with if output variable is a real or continuous

value such as “salary” or “weight”. Many different regression models can be used

but the simplest model in them is linear regression.


31
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

LINEAR REGRESSION

• Linear regression is a statistical method used to model the relationship

between a dependent variable and one or more independent variables.

• It provides valuable insights for prediction and data analysis.

• Linear regression is also a type of supervised machine-learning

algorithm that learns from the labelled datasets and maps the data points

with most optimized linear functions which can be used for prediction on

new datasets.

• It computes the linear relationship between the dependent variable and

one or more independent features by fitting a linear equation with observed

data. 32
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

• It predicts the continuous output variables based on the independent input variable.

• For example if we want to predict house price we consider various factor such as house

age, distance from the main road, location, area and number of room, linear regression

uses all these parameter to predict house price as it consider a linear relation between all

these features and price of house.

Why Linear Regression is Important?

• The interpretability of linear regression is one of its greatest strengths. The model’s

equation offers clear coefficients that illustrate the influence of each independent variable

on the dependent variable, enhancing our understanding of the underlying relationships.

• Its simplicity is a significant advantage; linear regression is transparent, easy to

implement, and serves as a foundational concept for more advanced algorithms.

33
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

What is the best Fit Line?

Our primary objective while using linear regression is to locate the best-fit line, which implies

that the error between the predicted and actual values should be kept to a minimum. There

will be the least error in the best-fit line.

The best Fit Line equation provides a straight line that represents the relationship between

the dependent and independent variables. The slope of the line indicates how much the

dependent variable changes for a unit change in the independent variable(s).

34
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

• Here Y is called a dependent or target variable and X is called an independent

variable also known as the predictor of Y.

• There are many types of functions or modules that can be used for regression. A

linear function is the simplest type of function. Here, X may be a single feature or

multiple features representing the problem.

• Linear regression performs the task to predict a dependent variable value (y)

based on a given independent variable (x)).

• Hence, the name is Linear Regression. In the figure above, X (input) is the work

experience and Y (output) is the salary of a person. The regression line is the

best-fit line for our model.

• In linear regression some hypothesis are made to ensure reliability of the model’s

results. 35
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

Hypothesis function in Linear Regression

Assumptions are:

• Linearity: It assumes that there is a linear relationship between the independent

and dependent variables. This means that changes in the independent variable

lead to proportional changes in the dependent variable.

Independence: The observations should be independent from each other that is the

errors from one observation should not influence other. As we have discussed that our

independent feature is the experience i.e X and the respective salary Y is the dependent variable.

Let’s assume there is a linear relationship between X and Y then the salary can be predicted

using:

36
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

37
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

38
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

Types of Linear Regression


When there is only one independent feature it is known as Simple Linear
Regression or Univariate Linear Regression and when there are more than one feature it
is known as Multiple Linear Regression or Multivariate Regression.

39
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

40
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

41
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

42
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

43
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

44
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

45
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

46
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

47
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

Evaluation Metrics for Linear Regression


A variety of evaluation measures can be used to determine the strength of any linear regression
model. These assessment metrics often give an indication of how well the model is producing the
observed outputs.

The most common measurements are:

48
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

49
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

50
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

51
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

52
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

53
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

54
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

55
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

56
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

57
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

58
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

59
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

60
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

61
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

62
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

63
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

64
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning

65
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning

66
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning

67
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning

68
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning

69
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning

70
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning

71
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

What is K-Means Clustering?

• K-means clustering is a popular unsupervised machine learning algorithm used for partitioning

a dataset into a pre-defined number of clusters. The goal is to group similar data points together

and discover underlying patterns or structures within the data.

• Recall the first property of clusters – it states that the points within a cluster should be similar to

each other. So, our aim here is to minimize the distance between the points within a cluster.

• There is an algorithm that tries to minimize the distance of the points in a cluster with their

centroid – the k-means clustering technique.

72
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

• K-means is a centroid-based algorithm or a distance-based algorithm, where we calculate the

distances to assign a point to a cluster. In K-Means, each cluster is associated with a centroid.

• The main objective of the K-Means algorithm is to minimize the sum of distances between

the points and their respective cluster centroid.

• Optimization plays a crucial role in the k-means clustering algorithm. The goal of the optimization

process is to find the best set of centroids that minimizes the sum of squared distances between

each data point and its closest centroid.

73
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

How K-Means Clustering Works?

Here’s how it works:

Initialization: Start by randomly selecting K points from the dataset. These points will act as the initial cluster

centroids.

Assignment: For each data point in the dataset, calculate the distance between that point and each of the K

centroids. Assign the data point to the cluster whose centroid is closest to it. This step effectively forms K

clusters.

Update centroids: Once all data points have been assigned to clusters, recalculate the centroids of the

clusters by taking the mean of all data points assigned to each cluster.

74
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

Repeat: Repeat steps 2 and 3 until convergence. Convergence occurs when the centroids no

longer change significantly or when a specified number of iterations is reached.

Final Result: Once convergence is achieved, the algorithm outputs the final cluster centroids

and the assignment of each data point to a cluster.

75
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

Objective of k means Clustering

The main objective of k-means clustering is to partition your data into a specific number (k) of groups,

where data points within each group are similar and dissimilar to points in other groups. It achieves this by

minimizing the distance between data points and their assigned cluster’s center, called the centroid.

Here’s an objective:

• Grouping similar data points: K-means aims to identify patterns in your data by grouping data

points that share similar characteristics together. This allows you to discover underlying structures within

the data.

• Minimizing within-cluster distance: The algorithm strives to make sure data points within a cluster are

as close as possible to each other, as measured by a distance metric (usually Euclidean

distance). This ensures tight-knit clusters with high cohesiveness.

• Maximizing between-cluster distance: Conversely, k-means also tries to maximize the separation

between clusters. Ideally, data points from different clusters should be far apart, making the clusters

distinct from each other.


76
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

EXAMPLE:

77
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

78
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

We are also given the information that we need to make 3 clusters. It means we are given K=3.We

will solve this numerical on k-means clustering using the approach discussed below.

First, we will randomly choose 3 centroids from the given data. Let us consider A2 (2,6), A7 (5,10),

and A15 (6,11) as the centroids of the initial clusters. Hence, we will consider that

• Centroid 1=(2,6) is associated with cluster 1.

• Centroid 2=(5,10) is associated with cluster 2.

• Centroid 3=(6,11) is associated with cluster 3.

Now we will find the euclidean distance between each point and the centroids. Based on the minimum

distance of each point from the centroids, we will assign the points to a cluster.

79
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

The distance of the given points from the


clusters has been tabulated in the following
table:

80
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

81
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

• At this point, we have completed the first iteration of the k-means clustering algorithm and assigned

each point into a cluster.

• In the above table, you can observe that the point that is closest to the centroid of a given cluster is

assigned to the cluster.

• Now, we will calculate the new centroid for each cluster.

• In cluster 1, we have 6 points i.e. A2 (2,6), A5 (6,4), A6 (1,2), A10 (7,5), A12 (4,6), A14 (3,8).

• To calculate the new centroid for cluster 1, we will find the mean of the x and y coordinates of each

point in the cluster.

• Hence, the new centroid for cluster 1 is (3.833, 5.167).

• In cluster 2, we have 5 points i.e. A1 (2,10), A4 (6,9), A7 (5,10) , A8 (4,9), and A13 (3,10). Hence, the

new centroid for cluster 2 is (4, 9.6)

• In cluster 3, we have 4 points i.e. A3 (11,11), A9 (10,12), A11 (9,11), and A15 (6,11). Hence, the new

centroid for cluster 3 is (9, 11.25).

82
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

83
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

84
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

85
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

86
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

87
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

• Now, we have completed the third iteration of the k-means clustering algorithm and

assigned each point into an updated cluster. In the above table, you can observe that the

point that is closest to the new centroid of a given cluster is assigned to the cluster.

• Now, we will calculate the new centroid for each cluster for the third iteration.

• In cluster 1, we have 5 points i.e. A2 (2,6), A5 (6,4), A6 (1,2), A10 (7,5), and A12 (4,6). To

calculate the new centroid for cluster 1, we will find the mean of the x and y coordinates of

each point in the cluster. Hence, the new centroid for cluster 1 is (4, 4.6).

• In cluster 2, we have 7 points i.e. A1 (2,10), A4 (6,9), A7 (5,10) , A8 (4,9), A13 (3,10), A14

(3,8), and A15 (6,11). Hence, the new centroid for cluster 2 is (4.143, 9.571)

• In cluster 3, we have 3 points i.e. A3 (11,11), A9 (10,12), and A11 (9,11). Hence, the new

centroid for cluster 3 is (10, 11.333).

88
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

89
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

Applications of K-means Clustering in Machine Learning

K-means clustering algorithm finds its applications in various domains. Following are some of

the popular applications of k-means clustering.

• Document Classification: Using k-means clustering, we can divide documents into

various clusters based on their content, topics, and tags.

• Customer segmentation: Supermarkets and e-commerce websites divide their

customers into various clusters based on their transaction data and demography. This

helps the business to target appropriate customers with relevant products to increase

sales.

• Cyber profiling: In cyber profiling, we collect data from individuals as well as groups to

identify their relationships. With k-means clustering, we can easily make clusters of people

based on their connection to each other to identify any available patterns.

• Image segmentation: We can use k-means clustering to perform image segmentation

by grouping similar pixels into clusters.

• Fraud detection in banking and insurance: By using historical data on frauds, banks90
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

Advantages of K-means Clustering Algorithm

Following are some of the advantages of the k-means clustering algorithm.

• Easy to implement: K-means clustering is an iterable algorithm and a

relatively simple algorithm. In fact, we can also perform k-means clustering

manually as we did in the numerical example.

• Scalability: We can use k-means clustering for even 10 records or even 10

million records in a dataset. It will give us results in both cases.

• Convergence: The k-means clustering algorithm is guaranteed to give us

results. It guarantees convergence. Thus, we will get the result of the

execution of the algorithm for sure.

• Generalization: K-means clustering doesn’t apply to a specific problem.

From numerical data to text documents, you can use the k-means clustering

algorithm on any dataset to perform clustering. It can also be applied to

datasets of different sizes having entirely different distributions in the

dataset. Hence, this algorithm is completely generalized. 91


MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

Disadvantages of K-means Clustering Algorithm

With all the advantages, the k-means algorithm has certain disadvantages too which are discussed

below.

• Deciding the number of clusters: In k-means clustering, you need to decide the number of

clusters by using the elbow method.

• Choice of initial centroids: The number of iterations in the clustering process completely

depends on the choice of centroids. Hence, you need to properly choose the centroids in the initial

step for maximizing the efficiency of the algorithm.

• Effect of outliers: In the execution of the k-means clustering algorithm, we use all the points in a

cluster to determine the centroids for the next iteration. If there are outliers in the dataset, they

highly affect the position of the centroids. Due to this, the clustering becomes inaccurate. To avoid

this, you can try to identify outliers and remove them in the data cleaning process.

92
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

• Curse of Dimensionality: If the number of dimensions in the dataset increases, the

distance of the data points from a given point starts converging to a specific value. Due to

this, k-means clustering that calculates the clusters based on the distance between the

points becomes inefficient. To overcome this problem, you can use advanced clustering

algorithms like spectral clustering. Alternatively, you can also try to reduce the dimensionality

of the dataset while data preprocessing.

93
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

ASSOCIATION RULE MINING


Association Rule Mining is an Unsupervised Non-linear algorithm to uncover how the items are associated

with each other. In it, frequent Mining shows which items appear together in a transaction or relation. It’s

majorly used by retailers, grocery stores, an online marketplace that has a large transactional database.

The same way when any online social media, marketplace, and e-commerce websites know what you buy

next using recommendations engines. The recommendations you get on item or variable, while you check

out the order is because of Association rule mining boarded on past customer data. There are three

common ways to measure association:

Support

Confidence

Lift

Theory

In association rule mining, Support, Confidence, and Lift measure association.

94
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

95
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

Example:

A customer does 4 transactions with you. In the first transaction, she buys 1 apple, 1 beer,

1 rice, and 1 chicken. In the second transaction, she buys 1 apple, 1 beer, 1 rice. In the

third transaction, she buys 1 apple, 1 beer only. In fourth transactions, she buys 1 apple

and 1 orange.

Support(Apple) = 4/4 So, Support of {Apple} is 4 out of 4 or 100% Confidence(Apple ->

Beer) = Support(Apple, Beer)/Support(Apple) = (3/4)/(4/4) = 3/4 So, Confidence of {Apple -

> Beer} is 3 out of 4 or 75% Lift(Beer -> Rice) = Support(Beer, Rice)/(Support(Beer) *

Support(Rice)) = (2/4)/(3/4) * (2/4) = 1.33 So, Lift value is greater than 1 implies Rice is

likely to be bought if Beer is bought.

96
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

Apriori Algorithm is a foundational method in data mining used for discovering frequent

itemsets and generating association rules. Its significance lies in its ability to identify

relationships between items in large datasets which is particularly valuable in market

basket analysis.

For example, if a grocery store finds that customers who buy bread often also buy butter,

it can use this information to optimize product placement or marketing strategies.

How the Apriori Algorithm Works?

The Apriori Algorithm operates through a systematic process that involves several key

steps:

1. Identifying Frequent Itemsets: The algorithm begins by scanning the dataset to

identify individual items (1-item) and their frequencies. It then establishes a minimum 97
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

2. Creating Possible item group: Once frequent 1-itemgroup(single items) are identified,

the algorithm generates candidate 2-itemgroup by combining frequent items. This process

continues iteratively, forming larger itemsets (k-itemgroup) until no more frequent itemgroup

can be found.

3. Removing Infrequent Item groups: The algorithm employs a pruning technique based on the Apriori

Property, which states that if an itemset is infrequent, all its supersets must also be infrequent. This

significantly reduces the number of combinations that need to be evaluated.

4. Generating Association Rules: After identifying frequent itemsets, the algorithm generates association

rules that illustrate how items relate to one another, using metrics like support, confidence, and lift to

evaluate the strength of these relationships.

98
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

KEY METRICS : SUPPORT, CONFIDENCE, LIFT

99
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

100
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

101
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

102
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

103
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

104
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

105
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

Applications of Apriori Algorithm

Below are some applications of Apriori algorithm used in today’s companies and startups

1. E-commerce: Used to recommend products that are often bought together,

like laptop + laptop bag, increasing sales.

2. Food Delivery Services: Identifies popular combos, such as burger + fries, to

offer combo deals to customers.

3. Streaming Services: Recommends related movies or shows based on what users

often watch together, like action + superhero movies.

4. Financial Services: Analyzes spending habits to suggest personalized offers, such

as credit card deals based on frequent purchases.

5. Travel & Hospitality: Creates travel packages (e.g., flight + hotel) by finding

commonly purchased services together.


106
ODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

Dimensionality Reduction is a statistical/ML-based technique wherein we try to reduce the number of features
in our dataset and obtain a dataset with an optimal number of dimensions.

One of the most common ways to accomplish Dimensionality Reduction is Feature Extraction, wherein we
reduce the number of dimensions by mapping a higher dimensional feature space to a lower-dimensional
feature space.

The most popular technique of Feature Extraction is Principal Component Analysis (PCA)

The following graph represents the change in model performance with the increase in the number of dimensions
of the dataset. It can be observed that the model performance is best only at an option dimension, beyond
which it starts decreasing.

Model Performance Vs No. of Dimensions (Features) – Curse of Dimensionality


MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

• Having too many features in data can cause problems like overfitting (good on training data but

poor on new data), slower computation, and lower accuracy. This is called the curse of

dimensionality, where more features exponentially increase the data needed for reliable

results.

• The explosion of feature combinations makes sampling harder In high-dimensional data and

tasks like clustering or classification more complex and slow.

• To tackle this problem, we use Feature engineering Techniques ,such as feature

selection (choosing the most important features) and feature extraction (creating new features

from the original ones).

• One popular feature extraction method is dimensionality reduction, which reduces the number

of features while keeping as much important information as possible.

• One of the most widely used dimensionality reduction techniques is Principal Component

Analysis (PCA).

108
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

How PCA Works for Dimensionality Reduction?

PCA is a statistical technique introduced by mathematician Karl Pearson in 1901. It works by

transforming high-dimensional data into a lower-dimensional space while maximizing the

variance (or spread) of the data in the new space. This helps preserve the most important

patterns and relationships in the data.

Note: It prioritizes the directions where the data varies the most (because more variation = more useful

information.

Let’s understand it’s working in simple terms:

Imagine you’re looking at a messy cloud of data points (like stars in the sky) and want to simplify it.

PCA helps you find the “most important angles” to view this cloud so you don’t miss the big patterns.

Here’s how it works, step by step:

109
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

110
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

111
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

112
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

113
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

114
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

115
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

116
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

117
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

GENERATIVE AI

• Generative artificial intelligence, often called generative AI or gen AI, is a type of AI that

can create new content like conversations, stories, images, videos, and music.

• It can learn about different topics such as languages, programming, art, science, and

more, and use this knowledge to solve new problems.

• For example: It can learn about popular design styles and create a unique logo for a

brand or an organisation.

• Businesses can use generative AI in many ways, like building chatbots, creating media,

designing products, and coming up with new ideas.

118
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

Evolution of Generative AI
Generative AI has come a long way from its early beginnings. Here’s how it has evolved over
time, step by step:

1. The Early Days: Rule-Based Systems

• AI systems followed strict rules written by humans to produce results. These systems could
only do what they were programmed for and couldn’t learn or adapt.

• For example, a program could create simple shapes but couldn’t draw something creative like
a landscape.

2. Introduction of Machine Learning (1990s-2000s)

• AI started using machine learning, which allowed it to learn from data instead of just
following rules. The AI was fed large datasets (e.g., pictures of animals), and it learned to
identify patterns and make predictions.

• Example: AI could now recognize a dog in a picture, but it still couldn’t create a picture of a
119
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)
3. The Rise of Deep Learning (2010s)

• Deep learning improved AI significantly by using neural networks, which mimic how the
human brain works. AI could now process much more complex data, like thousands of
photos, and start generating new content.

• Example: AI could now create a realistic drawing of a dog by learning from millions of dog
photos.

4. Generative Adversarial Networks (2014)

• GANs, introduced in 2014, use two AI systems that work together: one generates new
content, and the other checks if it looks real. This made generative AI much better at
creating realistic images, videos, and sounds.

• Example: GANs can create life like images of people who don’t exist or filters (used in apps
like FaceApp or Snapchat ).

5. Large Language Models (LLMs) and Beyond (2020s)

• Models like GPT-3 and GPT-4 can understand and generate human-like text. They are
trained on massive amounts of data from books, websites, and other sources. AI can now
hold conversations, write essays, generate code, and much more.

• Example: ChatGPT can help you draft an email, write a poem, or even solve problems.

120
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

6. Multimodal Generative AI (Present)

• New AI models can handle multiple types of data at once—text, images, audio, and

video. This allows AI to create content that combines different formats.

• Example: AI can take a written description and turn it into an animated video or a

song with the help of different models integrating together.

121
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

122
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

123
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

124
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

125
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

126
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

127
MODULE 3 23AD201 - Artificial Intelligence and Machine Learning)

128

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy