0% found this document useful (0 votes)
2 views84 pages

Module - 3 AI

This document provides an introduction to Artificial Intelligence (AI) and its applications, focusing on Machine Learning (ML) techniques, including neural networks, deep learning, and natural language processing. It explains how AI mimics human traits to learn from data, improve over time, and make decisions autonomously. Additionally, it discusses the role of supporting technologies like GPUs and the Internet of Things in enhancing AI capabilities.

Uploaded by

yashusuma7779
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)
2 views84 pages

Module - 3 AI

This document provides an introduction to Artificial Intelligence (AI) and its applications, focusing on Machine Learning (ML) techniques, including neural networks, deep learning, and natural language processing. It explains how AI mimics human traits to learn from data, improve over time, and make decisions autonomously. Additionally, it discusses the role of supporting technologies like GPUs and the Internet of Things in enhancing AI capabilities.

Uploaded by

yashusuma7779
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

INTRODUCTION TO

AI AND APPL IC ATIO NS


B E T C 10 5 / 2 0 5
Module 3
B O S ( C S / IS)
VTU Belagavi

Prepared by
Dr. Likewin Thomas, Dr. Pavan Kumar M P, Dr. Demian Antony D'Mello,
BOS Members ( C S / I S ) - V T U Belagavi BOS Members ( C S / I S ) - V T U Belagavi BOS Chairman ( C S / I S ) - V T U Belagavi
Prof. & Head, Dept of AIML, Assoc. Prof., Dept of ISE, Vice Principal and Dean - Academics
PESITM Shivamogg JNNCE Shivamogg Canara Engineering College
Outline
Module 3: Machine Learning
Reema Thareja, Artificial Intelligence: Beyond Classical AI,Pearson Education, 2023.

1. Machine Learning in AI
Overview of Machine Learning Techniques
Introduction to Machine Learning Models

2. Regression Analysis in Machine Learning


Basics of Regression
Linear and Non-Linear Regression Techniques
Module 3: Machine Learning in AI
Overview of Machine Learning Techniques

Artificial Intelligence (AI) is a field that focuses on creating machines that can perform tasks
typically requiring human intelligence, such as learning, reasoning, and problem-solving.
To understand how AI works, it's important to break it down into its key techniques and sub-
domains.

How AI Works:
AI combines large datasets, fast processing power, and intelligent algorithms to allow
systems to learn and deduce patterns from data. By processing and analyzing vast
amounts of information, AI systems improve their performance without the need for
explicit programming.
Module 3: Machine Learning in AI
Overview of Machine Learning Techniques

AI as a Process of Reverse-Engineering Human Traits


AI tries to mimic human traits like reasoning, decision-making, and pattern recognition.
The goal is to make machines that can learn, adapt, and solve problems autonomously by
recognizing patterns in the data they process.

Sub-Domains of AI
Module 3: Machine Learning in AI
[Link] in AI

[Link] Networks:
[Link] learning:
[Link] learning
[Link] language processing
[Link] vision
[Link] Computing

Additional technologies that enable and support AI include the following


[Link] processing units
[Link] of Things
Module 3: Machine Learning in AI
[Link] in AI - 1. Neural Networks:
1.A neural network is a type of AI that works like the human brain. It
helps machines learn patterns from data and make decisions or
predictions.
[Link] of it as a group of connected “neurons” (nodes) that pass
information to each other to understand complex data.
[Link] (Neurons(:
[Link] node is like a tiny decision-maker.
[Link] takes input, processes it, and passes output to the next node.
[Link]: Imagine a neuron receives information about the weather
(sunny, rainy) and helps decide whether to carry an umbrella.
[Link] Process:
[Link] network looks at the data many times to find patterns.
[Link] is like a student practicing multiple times to understand a
concept.
Module 3: Machine Learning in AI
[Link] in AI - 1. Neural Networks:
[Link] of a Neural Network: A neural network has
three main layers:
[Link] Layer:
i. Where the data enters the network.
ii. Example: If you want to predict house prices, inputs
could be size, location, number of rooms.
[Link] Layer(s(:
i. Where the AI processes data using algorithms.
ii. Weights and biases are applied to inputs to determine
importance.
iii. Example: The hidden layer analyzes how size, location,
and rooms combine to affect house price.
[Link] Layer:
i. Gives the final result or prediction.
ii. Example: The predicted house price based on the inputs.
Module 3: Machine Learning in AI
[Link] in AI - 2 Machine learning:
Machine Learning (ML) is a field of computer science that focuses on teaching
machines to learn from data and make decisions on their own, without needing human
instructions.

How Machine Learning Works:

[Link] from Data:


[Link] Human Instructions Needed:
[Link] Over Time:
[Link] Better Decisions:
Module 3: Machine Learning in AI
[Link] in AI - 2 Machine learning:
How Machine Learning Works:
[Link] from Data:
ML algorithms analyze large sets of data to find patterns.
For example, an ML algorithm might look at thousands of images of cats and dogs, and learn to recognize the
differences between them.
[Link] Human Instructions Needed:
Instead of writing step-by-step rules for the machine, ML learns automatically from the data.
Example: If you want the machine to recognize a cat, you don’t need to tell it exactly what a cat looks like. Instead, you
feed it data of cats and dogs, and the machine learns from the examples.
[Link] Over Time:
The machine improves by analyzing its errors and correcting them automatically.
Example: If it wrongly identifies a dog as a cat, it adjusts and tries again, getting better each time.
[Link] Better Decisions:
ML saves time and effort because it automates decision-making. It can analyze data and make decisions more accurately
than humans.
Example: In healthcare, ML can analyze medical data and predict diseases faster than doctors.
Module 3: Machine Learning in AI
1. Techniques in AI - 2 Machine learning:
How It’s Different from Human Instructions:
Human Instructions:
Humans write specific rules to perform tasks (e.g., write code for a program).
Machine Learning:
Machines learn by themselves from data, without explicit rules. They improve as they process more
data.

Example in Action:
Problem: Classifying emails as "spam" or "not spam."
Without ML: Humans write specific rules (e.g., "If email contains 'buy now', mark as spam").
With ML: The machine analyzes data of past emails and learns to identify patterns like words, subject
lines, or email addresses that are likely to be spam. It improves over time as it processes more emails.
Module 3: Machine Learning in AI
1. Techniques in AI - 2 Machine learning:
Relationship Between AI, ML, DL, and N L P
Machine Learning is a sub-domain of Artificial Intelligence (AI). AI refers to the broad concept of creating
machines that can think and act intelligently. Within AI, we have specific areas like Machine Learning (ML),
Deep Learning (DL), and Natural Language Processing (NLP).

AI: The broad field of creating intelligent machines.


ML: Focuses on teaching machines to learn from data.
DL: A deeper level of ML that uses neural networks to process large datasets, especially useful for tasks like
image recognition.
NLP: A branch of AI that enables machines to understand, interpret, and respond to human language.
Module 3: Machine Learning in AI
[Link] in AI - 3 Deep learning

Deep Learning ( D L ) is a powerful technique within Machine Learning (ML) that uses
neural networks with
many layers to process and learn from data. It is especially good at handling complex
patterns in large datasets.

How Deep Learning Works:


[Link] Networks with Layers:
[Link] Propagation:
[Link] Propagation:
[Link] the Model:
Module 3: Machine Learning in AI
[Link] in AI - 3 Deep learning

How Deep Learning Works:


[Link] Networks with Layers:
In Deep Learning, a neural network has multiple layers of processing units
(also called nodes or neurons).
Each layer processes the data, learns patterns, and passes the results to the
next layer.
Example: In image recognition, the first layer might detect edges, the next
layer might recognize shapes, and further layers might identify objects.
Module 3: Machine Learning in AI
[Link] in AI - 3 Deep learning

How Deep Learning Works:


2. Forward Propagation:
As the data moves through each layer, it gets processed and refined until it reaches
the output layer.
This is called forward propagation, where the input data is passed through the
network and results in the final output.
Example: In an image recognition task, forward propagation will take raw pixel
data, process it layer by layer, and finally output a classification like "cat" or "dog."
Module 3: Machine Learning in AI
1. Techniques in AI - 3 Deep learning

How Deep Learning Works:


3. Backward Propagation:
Once the output is generated, the model checks if the result is accurate by
calculating the error (the difference between predicted and actual results).
If the result is wrong, the weights (importance) of the nodes are updated and the
error is sent back through the network to adjust the weights. This is called
backward propagation.
Example: If the model misclassifies an image, backward propagation helps the
model adjust its calculations to avoid the same mistake next time.
Module 3: Machine Learning in AI
1. Techniques in AI - 3 Deep learning

How Deep Learning Works:


4. Training the Model:
The model learns from both the forward and backward propagation processes by
adjusting weights, improving its accuracy with every iteration.
Example: Over time, with enough data, the model gets better at recognizing
images or predicting outcomes.
Module 3: Machine Learning in AI
1. Techniques in AI - 3 Deep learning

Types of Learning in Deep Learning:


Supervised Learning:
In supervised learning, the model is trained on labeled data (i.e., data with known outcomes).
The model learns to predict outcomes based on these examples.
Example: Training a model to identify cats in photos, where the images are labeled as "cat" or
"not cat."
Unsupervised Learning:
Deep learning can also work with unlabeled data, where the model identifies patterns or
structures in data on its own, without needing specific labels.
Example: Grouping customers into different segments based on their purchasing behavior
without predefined labels.
Module 3: Machine Learning in AI
[Link] in AI - 3 Deep learning

Applications of Deep Learning:


[Link] Recognition:
Deep learning is excellent at identifying objects, faces, and scenes in images.
Example: Face recognition systems in smartphones.
[Link] Recognition:
Deep learning models can process audio data to convert speech into text.
Example: Virtual assistants like Siri or Google Assistant that understand
spoken commands.
Module 3: Machine Learning in AI
1. Techniques in AI - 3 Deep learning

Concept Explanation Example

A series of interconnected layers that Deep learning in image recognition where the model
Neural Networks
process data in steps. processes raw images through multiple layers.

Forward Data moves through layers to generate an The input image is processed layer by layer until the
Propagation output. model outputs "cat."
Backward Adjusting weights in the network based If the model misclassifies an image, backward
Propagation on errors to improve accuracy. propagation updates the weights.

Supervised Training a model to predict house prices based on


The model is trained on labeled data.
Learning features like size, location, and number of rooms.

Unsupervised The model learns from unlabeled data, Clustering customers based on buying habits without
Learning finding hidden patterns. predefined labels.
Module 3: Machine Learning in AI
[Link] in AI - 4 Natural Language Processing ( N L P (
Natural Language Processing (NLP) is a field of Artificial Intelligence (AI) focused on enabling
machines to read, understand, and respond to human language in a way that is both meaningful and
useful.

Applications of NLP:
Chatbots and Virtual Assistants:
Text Translation:
Sentiment Analysis:
Text Summarization:

How N L P Works:
[Link] and Understanding:
[Link]:
[Link]:
Module 3: Machine Learning in AI
[Link] in AI - 4 Natural Language Processing ( N L P (

[Link] and Understanding:


NLP allows machines to process human language (spoken or written) just like we do. It breaks down
sentences into meaningful units, such as words and phrases.
Example: If you say, “What’s the weather like today?”, NLP helps the machine understand that you are asking
about the weather.
[Link]:
[Link] understanding the words, NLP helps the machine interpret the meaning behind them, considering the
context.
[Link]: The machine knows that "cold" can mean "low temperature" or "emotionally distant," depending
on the context.
[Link]:
[Link] the machine interprets the input, NLP enables it to respond in a natural way, either in text or speech.
[Link]: If you ask, “Tell me a joke,” the machine will generate a response like, “Why don’t skeletons fight
each other? They don’t have the guts!”
Module 3: Machine Learning in AI
[Link] in AI - 5 Computer Vision
Computer Vision is a branch of Artificial Intelligence (AI) that focuses on enabling machines to see,
understand, and interpret images and videos just like humans do.

Applications of Computer Vision:


Facial Recognition:
Autonomous Vehicles:
Retail Stores:
Medicine:
Financial Institutions:

How Computer Vision Works


[Link] Down Images:
[Link] and Learning:
[Link] Decisions:
Module 3: Machine Learning in AI
1. Techniques in AI - 5 Computer Vision
How Computer Vision Works:
[Link] Down Images:
Computer vision starts by breaking an image into smaller parts (like shapes, colors, and textures).
Example: In an image of a cat, computer vision might break it down into features like the shape of the
ears, eyes, and whiskers.
[Link] and Learning:
The machine then uses patterns from many images to learn and classify objects (e.g., identifying a cat
in an image).
Example: After processing many images of cats, the machine learns to identify common features like
pointy ears and a small nose.
[Link] Decisions:
Based on what the machine has learned from past observations, it makes decisions about the current
image or video it sees.
Example: If the machine sees a new image of a cat, it can correctly identify it by matching the features
to what it has learned.
Module 3: Machine Learning in AI
1. Techniques in AI - 6 Cognitive Computing
Cognitive Computing is a subfield of Artificial Intelligence (AI) designed to make
machines think and respond in a human-like way. It mimics the way the human brain
works by analyzing text, speech, images, or objects to understand and interact with
the world.
Applications of Cognitive Computing:
Virtual Assistants:
Healthcare:
Customer Service:
Education:
Module 3: Machine
Learning in AI
1. Techniques in AI -
Additional
technologies that
enable and support AI
Module 3: Machine Learning in AI
[Link] in AI - Additional technologies that enable and support AI
[Link] Processing Units (GPUs( in AI
Graphical Processing Units (GPUs) are essential for AI tasks
because they provide the computing power required for
iterative processing and training neural networks.
GPUs are designed to handle these large volumes of data
more efficiently than traditional CPUs, making them ideal
for tasks like:
Parallel Processing: GPUs can process many operations
at once, speeding up the training of models.
Faster Training of Neural Networks: They help process
the data through multiple layers in deep learning,
making models train faster.
Example: In deep learning, GPUs are used to train
models for tasks like image recognition or speech
recognition, where data is analyzed and patterns are
learned across millions of inputs.
Module 3: Machine Learning in AI
[Link] in AI - Additional technologies that enable and support AI
2. Internet of Things (IoT( and AI for Data Analysis
The Internet of Things (IoT) refers to a network of connected devices that generate massive amounts
of data. These devices can range from smartphones and wearables to home appliances and industrial
sensors. However, this data often remains unprocessed or under-analyzed.
AI and advanced algorithms help in automating the analysis of IoT data, extracting useful insights
and making sense of the vast amounts of information. Here's how AI plays a role:
Data Analysis at Scale: AI can analyze data from millions of connected devices quickly and
efficiently.
Predicting Rare Events: AI models can identify patterns and predict rare events (like equipment
failure in manufacturing) that could otherwise be missed.
Understanding Complex Systems: AI helps make sense of complex systems (e.g., smart cities,
healthcare systems) by analyzing data from various sources.
Module 3: Machine Learning in AI
2 Machine Learning Model
Machine Learning (ML) involves teaching a computer program to improve its performance at a
specific task through experience (data). A widely accepted definition by Professor Mitchell
describes it as:

“A computer program is said to learn from experience E with respect to some class of tasks T and
performance measure P, if its performance at tasks in T, as measured by P, improves with experience E.”

This definition leads to understanding Machine Learning Models in three key components:
[Link] (T),
2. Experience (E), and
3. Performance (P).
Module 3: Machine Learning in AI
2 Machine Learning Model

Key Components of a Machine Learning Model:


1. Task (T):
This is the real-world problem that we want the machine to solve.
Examples of tasks (T):
Predicting sales of a product.
Classifying emails as spam or not spam.
Other examples: classification, regression, clustering, and recognition.
Task ( T ( defines what the machine is trying to learn or predict.
Module 3: Machine Learning in AI
2 Machine Learning Model

Key Components of a Machine Learning Model:


2. Experience (E(:
Experience refers to the data that the machine learns from.
Just like humans learn from past experiences, machines learn from data. The more data
the model is exposed to, the better it can learn and improve.
Example:
If you want the model to classify emails, you provide it with a set of labeled emails
(spam and non-spam). This is its experience (E).

Experience ( E ( can be gained through different types of learning:


[Link] Learning (with labeled data),
b. Unsupervised Learning (with unlabeled data),
[Link] Learning (through trial and error, receiving rewards or penalties).
Module 3: Machine Learning in AI
2 Machine Learning Model

Key Components of a Machine Learning Model:


3. Performance (P(:
Performance is how well the model performs a task after learning from the data. It’s a
measure of the accuracy or effectiveness of the model’s predictions.
Metrics to measure performance (P):
Accuracy: How many predictions were correct.
Precision: How many predicted positive outcomes were actually positive.
Recall: How many actual positive outcomes were identified.
F1 Score: A balance between precision and recall.
Confusion Matrix: A table showing true positive, false positive, true negative, and false
negative results.
Module 3: Machine Learning in AI
2 Machine Learning Model

How the Machine Learning Model Works:


[Link] (T(: Define the problem (e.g., classifying emails).
[Link] (E(: Provide data for the model to learn from (e.g., labeled emails).
[Link] (P(: Measure the model’s effectiveness using metrics (e.g., accuracy or
precision).

Example of the M L Model:


Let’s say we want to build a model to predict house prices (Task T):
Task (T(: Predict the price of a house based on features like size, location, and number of rooms.
Experience (E(: We provide the model with historical data on house sales (e.g., size, location, price).
Performance (P(: The model’s performance is measured by how accurately it predicts the price of new
houses, which we evaluate using metrics like mean squared error or R*.
Module 3: Machine Learning in AI
2 Machine Learning Model
Types of Machine Learning Algorithms
[Link] Machine Learning Algorithms
a. Classification Algorithm
b. Regression
[Link] Learning
a. Clustering
b. Association analysis:
[Link] reduction
d. Outlier detection or anomaly detection
3. Semi-Supervised Learning
4. Reinforcement Learning (Rl)
a. Positive reinforcement
b. Negative reinforcement
Module 3: Machine Learning in AI
2 Machine Learning Model - Supervised Machine Learning Algorithms
Supervised Machine Learning is a type of learning where the machine learns from labeled data. Think of it like
a student learning from a teacher who provides both the questions (inputs) and the correct answers (outputs).

How It Works:
[Link] from Past Data:
The algorithm is trained on labeled examples, where both the input and output are provided.
The machine learns the relationship between the inputs ( X ) and the outputs (Y).
Example: If we have a basket of fruits with labels (apple, banana, orange), the machine learns to
associate features (like color, shape, size) of fruits with their labels.
[Link] Function ( Y = f(X((:
The relationship between input ( X ) and output ( Y ) can be expressed as a function, like Y = f(X), where
the machine learns to map inputs to outputs.
After learning from the data, it can predict the output for new, unseen data.
Example: If the input is a fruit with color = red, shape = round, the model predicts that it’s an apple.
Module 3: Machine Learning in AI
2 Machine Learning Model - Supervised Machine Learning Algorithms
Supervised Learning Example:
Imagine you have a basket filled with apples, bananas, and oranges. You want to teach a machine to identify
them based on certain features like color, size, and shape.
[Link] 1: Train the model using labeled data.
Input: Fruit features (e.g., color, shape, size).
Output: Correct labels (apple, banana, orange).
[Link] 2: The machine learns to map the input features to the correct fruit labels (mapping function: Y =
f(X)).
[Link] 3: Now, if you give the machine a fruit with unknown features (e.g., color = yellow, shape =
elongated), it will predict that it’s a banana.
Module 3: Machine Learning in AI
2 Machine Learning Model - Supervised Machine Learning Algorithms
Categories of Supervised Learning:
Supervised learning can be classified into two main types:
1. Classification:
When the output is a category or label.
Example: Identifying whether an email is spam or not spam.
2. Regression:
When the output is a continuous value.
Example: Predicting the price of a house based on its size, location, and features.
Module 3: Machine Learning in AI
2 Machine Learning Model - Supervised Machine Learning Algorithms
1. Classification Algorithm

A Classification Algorithm is a type of machine learning algorithm that classifies or


categorizes data into specific groups or categories. It helps the machine predict which
category a new piece of data belongs to based on patterns learned during training.

How Classification Works:


Training Phase:
During the training phase, the model is given labeled data, meaning each piece of data
already has a known category (label).
Example: If you have a dataset of fruits with labels like apple and banana, the
algorithm learns the features (color, size, shape) of each fruit and associates them
with the correct label.
Prediction:
After learning from the data, the model can predict the category (class) for new,
unseen data based on the patterns it has learned.
Example: When given a new fruit (e.g., color = red, shape = round), the model
predicts that it’s an apple.
Module 3: Machine Learning in AI
2 Machine Learning Model - Supervised Machine Learning Algorithms
1. Classification Algorithm
Module 3: Machine Learning in AI
2 Machine Learning Model - Supervised Machine Learning Algorithms
[Link] Algorithm
Applications of Classification Algorithms:
[Link] Imaging:
Example: Predicting whether an X-ray image shows a benign or cancerous tumor.
[Link] Recognition:
Example: Classifying spoken words into specific commands like "turn on" or "turn off".
[Link] Recognition:
Example: Identifying handwritten characters and classifying them as A, B, or C.
[Link] Scoring:
Example: Classifying loan applicants into groups like high risk or low risk based on their financial data.
[Link] Classification:
Example: Predicting whether an incoming email is spam or not spam based on previous examples.
Module 3: Machine Learning in AI
2 Machine Learning Model - Supervised Machine Learning Algorithms
2. Regression Algorithm A Regression Algorithm is used in machine learning to predict a real value (a
continuous number) based on the data it has learned from. Unlike classification
algorithms, which predict discrete categories, regression algorithms predict
continuous values.

How Regression Works:


[Link] Phase:
[Link] training, the algorithm is provided with labeled data that includes
input variables (features) and their corresponding real values (output).
Example: You have data on house features (size, location, number of
rooms) and their prices. The model learns the relationship between
these features and the price.
[Link]:
[Link] learning, the model can predict the real value (continuous output)
for new, unseen data.
Example: Given the size, location, and number of rooms of a new
house, the model can predict its price.
Module 3: Machine Learning in AI
2 Machine Learning Model - Un-Supervised Machine Learning Algorithms

Unsupervised Learning is a type of machine learning where the model is trained using data that
is neither labeled nor classified. This means the machine doesn’t have any predefined answers
to learn from and must discover patterns or relationships in the data on its own.
Module 3: Machine Learning in AI
2 Machine Learning Model - Un-Supervised Machine Learning Algorithms
How Unsupervised Learning Works:
[Link] Labeled Data:
In unsupervised learning, there is no guidance or labels provided to the machine. It only has the data and must
find patterns or groupings within it.
Example:
If we give the machine images of fruits (like mangoes and oranges) without labels, it doesn't know what a mango
or orange is. It must figure out how to group the fruits based on similarities like color, shape, or texture.
[Link] Patterns and Grouping:
The machine looks for patterns, similarities, and differences in the data and creates groups or clusters.
Example: The machine might notice that all mangoes are yellow and oranges are orange, so it will group the
images into two clusters based on color and shape.
[Link]:
Unsupervised learning works by creating clusters where similar data points are grouped together.
Example: If the machine is given a dataset of fruits, it could automatically create two clusters—one for mangoes
and one for oranges—without knowing what these fruits are called.
Module 3: Machine Learning in AI
2 Machine Learning Model - Un-Supervised Machine Learning Algorithms

Unsupervised Learning in Action:


[Link] Fruits:
Imagine the machine receives pictures of mangoes and oranges, but it has no idea what fruits these are.
The model will analyze the features of the images (like color, shape, texture) and group similar images together.
Result: It will create two clusters—one for mangoes and one for oranges—but it won’t label them as "mango" or
"orange." The machine simply groups similar items together.
Module 3: Machine Learning in AI
2 Machine Learning Model - Un-Supervised Machine Learning Algorithms

Unsupervised Learning in Action:

2. Finding Patterns in Data:


Example: In a dataset of customer behaviors, unsupervised learning could identify patterns and group customers with
similar shopping habits, even if no labels (like “high spender” or “low spender”) are given.
Module 3: Machine Learning in AI
2 Machine Learning Model - Un-Supervised Machine Learning Algorithms
What Unsupervised Learning Cannot Do:
No Labels:
Unlike supervised learning, unsupervised learning does not provide labels or categories. It can only group data
based on patterns or similarities.
Example: The machine can group mangoes and oranges, but cannot label them as such. It just knows these items
belong together in one group.

Applications of Unsupervised Learning:


Customer Segmentation:
Unsupervised learning can help businesses group customers with similar purchasing behaviors for targeted
marketing campaigns.
Image Segmentation:
It can be used in image processing to automatically group pixels that form certain objects or regions in an image.
Anomaly Detection:
It helps detect outliers or unusual data points in a dataset, which can be useful for fraud detection or network
security.
Module 3: Machine Learning in AI
2 Machine Learning Model - Un-Supervised Machine Learning Algorithms
[Link]

Clustering is a technique in unsupervised machine learning where the goal is to group similar data points together into
clusters. This technique helps to discover hidden patterns or inherent groupings in the data, which might not be obvious at
first glance.
Module 3: Machine Learning in AI
2 Machine Learning Model - Un-Supervised Machine Learning Algorithms
1. Clustering
How Clustering Works:
[Link] Data Based on Similarities:
The main idea of clustering is to group data points that are similar to each other.
Each group is called a cluster, and the goal is for data within the same cluster to be similar while data in different
clusters is distinct or different.
Example:
In a dataset of customer purchases, clustering might group customers who buy similar products into the same
cluster. One cluster might include people who buy tech gadgets, while another might include people who buy
home appliances.
[Link] Patterns in Data:
Clustering identifies patterns or relationships in the data by grouping similar points together.
Example:
A cell phone company can use clustering to find where most of its customers live and use that information to
decide the best locations to build new cell phone towers.
Module 3: Machine Learning in AI
2 Machine Learning Model - Un-Supervised Machine Learning Algorithms
1. Clustering
Real-World Applications of Clustering:
[Link] Segmentation:
Companies can use clustering to group customers based on purchasing behavior, allowing them to target
marketing campaigns to specific groups.
Example: A retail store can identify one cluster of customers who frequently buy sportswear, while another cluster
may buy formal clothing.
[Link]-based Decisions (e.g., Cell Tower Placement(:
Companies can use clustering to find the best locations for services like cell towers, based on where the most
people are located.
Example: A mobile company could use clustering to identify cities with the highest customer density, helping them
plan where to build more towers.
[Link] Sequence Analysis:
In biology, clustering is used to group similar gene sequences, helping researchers to understand genetic
relationships and identify specific patterns.
Example: Researchers can analyze gene data to identify groups of genes that behave similarly across different
species.
Module 3: Machine Learning in AI
2 Machine Learning Model - Un-Supervised Machine Learning Algorithms
2. Association Analysis
Association Analysis is a technique used in data mining to find relationships or patterns between different items in large
datasets. The goal is to discover rules that describe these patterns, showing how items or events are associated with each
other.

How Association Analysis Works:


[Link] Relationships:
Association analysis tries to find patterns that describe how different items or actions are linked together.
Example: If customers frequently buy bread, they might also buy butter. The analysis finds that these two products
are often purchased together.
[Link] Association Rules:
The main goal is to create association rules in the form of:
"If X happens, then Y happens".
These rules help businesses understand which items tend to be bought together.
Example: "If a customer buys a laptop (X), then they are likely to buy a mouse (Y)."
This rule can be used to recommend related products to customers.
Module 3: Machine Learning in AI
2 Machine Learning Model - Un-Supervised Machine Learning Algorithms
2. Association Analysis
Applications of Association Analysis:
[Link] and E-commerce:
Businesses use association analysis to discover which products are often bought together.
Example: In a supermarket, if many customers buy diapers and baby wipes together, the store might place these
items next to each other to increase sales.
2. Market Basket Analysis:
Commonly used in retail, this technique finds associations between products purchased together.
Example: "If a customer buys shampoo, they are likely to buy conditioner."
[Link] Systems:
Used in online platforms (like Amazon or Netflix) to suggest products or movies based on what others with similar
preferences have liked.
Example: "Customers who bought this book also bought these other books."
Module 3: Machine Learning in AI
2 Machine Learning Model - Un-Supervised Machine Learning Algorithms
3. Dimensionality reduction

Dimensionality Reduction is a technique used to simplify a dataset by reducing the number of


features (variables) without losing important information. This is especially useful when you have
datasets with a large number of features, often in the millions, making it difficult to process and
analyze the data effectively.
Module 3: Machine Learning in AI
2 Machine Learning Model - Un-Supervised Machine Learning Algorithms
3. Dimensionality reduction
Why is Dimensionality Reduction Important?
[Link] Data:
When datasets have too many features (variables), it can be overwhelming and computationally
expensive to work with them.
Dimensionality reduction reduces the number of features, making the dataset more manageable.
[Link] Complexity:
Fewer features make models easier to train, faster to process, and often lead to better performance.
Reducing features also helps to avoid problems like overfitting, where a model is too complex and
doesn’t generalize well to new data.
[Link] Visualization:
With too many features, it's hard to visualize the data. Dimensionality reduction makes it easier to
visualize the dataset in 2D or 3D.
Module 3: Machine Learning in AI
2 Machine Learning Model - Un-Supervised Machine Learning Algorithms
4. Outlier Detection
Outlier detection, also known as anomaly detection, is a technique used to find rare or unusual events in a
dataset that do not follow the normal pattern. These events or observations are called outliers and can
indicate important issues like fraud, errors, or new trends.

How Outlier Detection Works:


[Link] Anomalies:
Outlier detection identifies data points that differ significantly from the rest of the data.
Example: In credit card transactions, a sudden large withdrawal made in an unusual location could be
flagged as an anomaly (possible fraud).
[Link] (KNN(:
K-Nearest Neighbors ( K N N) is a common technique used to detect anomalies by checking the distance
between data points. If a data point is far from its neighbors, it's considered an outlier.
Example: In a KNN-based anomaly detection, if a customer transaction is much higher than the usual range,
it may be flagged as suspicious.
Module 3: Machine Learning in AI
2 Machine Learning Model - Un-Supervised Machine Learning Algorithms
4. Outlier Detection
Applications of Outlier Detection:
[Link] Detection:
In banking or credit card systems, detecting unusual transactions (like purchases in unexpected
locations) is done using anomaly detection.
[Link]:
Detecting rare diseases or unusual symptoms in patients’ data can be done using anomaly detection.
[Link]:
In a production line, detecting defects or malfunctioning machinery through unusual patterns in
data can prevent larger issues.
Module 3: Machine Learning in AI
2 Machine Learning Model - Semi-Supervised Learning
Semi-Supervised Learning is a type of machine learning that combines the strengths of supervised and
unsupervised learning. It uses both labeled data (data with known answers) and unlabeled data (data
without known answers) to train the machine. This approach helps to improve the accuracy of the model
while requiring less labeled data than supervised learning alone.

How Semi-Supervised Learning Works:


1. Using Labeled and Unlabeled Data:
The algorithm is provided with a small amount of labeled data (where the answers are known) and
a large amount of unlabeled data (where the answers are unknown).
The algorithm learns from both the labeled and the unlabeled data to improve its predictions.
Module 3: Machine Learning in AI
2 Machine Learning Model - Semi-Supervised Learning
Two Approaches to Semi-Supervised Learning:
1. Supervised Model + Unsupervised Model Approach:
Step 1: Start by building a supervised model using a small amount of labeled data.
Step 2: Apply the trained model to a large amount of unlabeled data to generate predictions.
Step 3: Use the predicted labels from the unlabeled data to add more labeled data.
Step 4: Iterate this process multiple times to improve the model's accuracy by generating more
labeled data from the initial small set.
Example: If you have a small dataset of labeled images (e.g., some images labeled as "cat"
or "dog"), the model is first trained using these images. Then, it can predict labels for a
large set of unlabeled images, and you can use the predicted labels to expand your
training data.
Module 3: Machine Learning in AI
2 Machine Learning Model - Semi-Supervised Learning

Two Approaches to Semi-Supervised Learning:


2. Unsupervised Clustering + Annotation Approach:
Step 1: Use unsupervised learning techniques to group similar unlabeled data
into clusters.
Step 2: Annotate or label these clusters based on patterns observed.
Step 3: Use the labeled clusters to train the model.
Example: In a set of unlabeled customer data, you can cluster customers
with similar purchasing habits. Then, based on the cluster characteristics,
you can assign labels to these groups and use that information to train the
model.
Module 3: Machine Learning in AI
2 Machine Learning Model - Reinforcement Learning ( R L (
Reinforcement Learning ( R L ) is a type of machine learning where an agent learns how
to make decisions by interacting with an environment. Unlike supervised learning,
where the model is trained on labeled data, R L involves an agent that learns by trial and
error, with the goal of maximizing rewards and minimizing penalties.
Module 3: Machine Learning in AI
2 Machine Learning Model - Reinforcement Learning ( R L (

How Reinforcement Learning Works:


[Link]-Environment Interaction:
An agent interacts with its environment by taking actions (decisions) and receiving feedback in the form of
rewards or penalties.
Example: In a game scenario, the agent might be a robot and the environment is the game world.
[Link] and Penalties:
Rewards are given for performing correct actions, while penalties are given for incorrect actions.
The agent’s goal is to maximize its total reward over time by learning from experience.
Example: If a robot picks the right path in the game (avoiding fire), it earns a reward (like a diamond). If it
chooses the wrong path (touches fire), it loses some reward.
[Link] and Error:
The agent starts with no knowledge and learns by trying different actions, observing the results, and
adjusting its strategy.
Over time, the agent learns which actions lead to the highest rewards and which actions lead to penalties.
Module 3: Machine Learning in AI
2 Machine Learning Model - Reinforcement Learning ( R L (
Module 3: Machine Learning in AI
2 Machine Learning Model - Reinforcement Learning ( R L (
Key Features of Reinforcement Learning:
[Link] (State(:
The initial state from which the agent begins its learning.
Example: In the game, the starting point of the robot is the initial state.
[Link] (Action(:
The action the agent can take in response to the current state.
Example: The robot can choose to move forward, turn left, or turn right based on the environment.
[Link] Process (Learning from Experience(:
The agent learns by interacting with the environment and getting feedback. It keeps adjusting its actions based
on whether it receives a reward or penalty.
Example: If the robot’s action leads to a reward, it will try to repeat that action next time; if it leads to a penalty, it
will try to avoid it.
[Link] Reward:
The agent’s goal is to maximize its total reward over time, finding the best path to reach the final goal.
Example: The robot tries to find the best path to reach the diamond with the least number of hurdles (fires).
Module 3: Machine Learning in AI
2 Machine Learning Model - Reinforcement Learning ( R L (
Reinforcement Learning vs. Supervised Learning:
Supervised Learning:
The model learns from labeled data, where the correct answers are already
provided.
Example: In supervised learning, you train the model with a dataset where the
correct answers (labels) are known.
Reinforcement Learning:
The agent learns from its own experience by receiving feedback in the form of
rewards and penalties.
Example: The robot learns the best path to the diamond by experimenting
and learning from each step.
Module 3: Machine Learning in AI
2 Machine Learning Model - Reinforcement Learning ( R L (
Example: Reinforcement Learning in a Game
Scenario:
A robot needs to reach a diamond (reward) while avoiding fires
(penalties) in a game.
The robot starts at a random point and tries different paths.
Right path = Reward (diamond), Wrong path = Penalty
(fire).
The robot learns over time by repeating the process and
adjusting its behavior to maximize rewards and avoid
penalties.
Final Goal: The robot learns the best path to take in the game and
successfully reaches the diamond, maximizing its total reward.
Module 3: Machine Learning in AI
2 Machine Learning Model - Reinforcement Learning ( R L (
Types of Reinforcement in Reinforcement Learning
In Reinforcement Learning (RL), reinforcement refers to the process of giving
feedback to an agent based on its actions to encourage or discourage certain
behaviors.
There are two types of reinforcement:
Positive Type
Negative Type
Module 3: Machine Learning in AI
2 Machine Learning Model - Reinforcement Learning ( R L (
1. Positive Reinforcement:
Positive Reinforcement is when a reward is given to the agent for performing a desired action. This
increases the strength and frequency of the behavior, motivating the agent to repeat that action in
the future.
How It Works:
When the agent does something right, it receives a positive reward (like points, praise, or a
desirable outcome), encouraging the agent to continue performing that action.
Example:
Imagine a robot in a game. If the robot successfully avoids a fire and reaches the diamond
(goal), it gets a reward (like 10 points or a success message). This positive feedback makes the
robot more likely to avoid fires in future attempts.
Module 3: Machine Learning in AI
2 Machine Learning Model - Reinforcement Learning ( R L (
2. Negative Reinforcement:
Negative Reinforcement is when a negative condition is removed or avoided after the agent performs
the desired action. The removal of the negative condition strengthens the behavior and encourages
the agent to repeat the action.
How It Works:
The agent performs an action to avoid a negative outcome or to stop an unpleasant event
from happening.
Example:
In a driving simulator, if the agent (car) drives safely and avoids crashing into objects, it
avoids a penalty (like losing points or a time delay). The removal of the penalty encourages
the agent to drive safely in the future.
Module 3: Machine Learning in AI
2 Machine Learning Model - Reinforcement Learning ( R L (

Type Definition Example Effect on Behavior

Increases behavior by A robot gets a reward Strengthens the


Positive
giving a reward for a for avoiding a fire in a behavior, encouraging
Reinforcement
correct action. game. it to be repeated.

Increases behavior by Strengthens the


Negative A car avoids a penalty
removing an behavior by avoiding
Reinforcement by driving safely.
unpleasant condition. negative consequences.
Module 3: Machine Learning in AI
2 Machine Learning Model - Regression Analysis in Machine Learning
Regression Analysis is a statistical method used to study the relationship between a dependent
(target) variable and one or more independent (predictor) variables. The primary goal of regression
analysis is to predict the value of the dependent variable based on the given predictors.

How Regression Analysis Works:


[Link] Relationships:
Regression analysis aims to determine how changes in the independent variables affect the
dependent variable.
Example: A company may want to find out how advertising expenditure affects sales.
[Link] Continuous Values:
Unlike classification, which predicts discrete categories, regression predicts continuous
values like price, salary, or temperature.
Example: Predicting the price of a house based on its size, location, and age.
Module 3: Machine Learning in AI
2 Machine Learning Model - Regression Analysis in Machine Learning
Steps in Regression Analysis:
[Link] Collection:
Collect data for the independent and dependent variables.
[Link] Creation:
Create a mathematical equation that defines the dependent variable as a function of the independent
variables.
Example:
If Y is the price of a house, and X1 and X2 are size and location, then the model might be:
Y = f(X1, X2).
[Link] the Best Fit:
A regression line or curve is plotted on a graph to find the best fit through the data points.
The goal is to minimize the vertical distance between the data points and the regression line.
[Link] the Model:
After building the regression model, evaluate its accuracy by measuring how well it predicts new data.
Module 3: Machine Learning in AI
2 Machine Learning Model - Regression Analysis in Machine Learning
Types of Regression:
[Link] Regression:
The simplest form of regression where the relationship between the dependent and independent
variables is assumed to be linear (a straight line).
Equation for Linear Regression:
Y=b 0 +b 1 X+e
b0 is the intercept, b1 is the coefficient of the predictor variable (X), and e is the error term.
Example:
A company can calculate sales based on advertising expenditure using a linear regression model.
[Link] Regression:
When there are multiple independent variables, the equation extends to:
Y=b 0 +b1 X 1 +b2 X 2 +e
This is used when there are multiple predictors.
Module 3: Machine Learning in AI
2 Machine Learning Model - Regression Analysis in Machine Learning
Examples of Regression Analysis:
Case Study 1 - Auto Fare Calculation:
Problem: The cost of an auto fare depends on a fixed charge plus a per-kilometer rate.
Linear Equation:
y=11x+30
Where y is the total cost, x is the distance traveled (in km), and the fixed charge is 30.
For 10 km, the fare would be:
y=11×10+30=140 Rs.
Case Study 2 - Monthly Rental Cost:
Problem: A company’s rental cost is based on a fixed cost plus a per-employee charge.
Linear Equation:
y=10000x+20000
Where x is the number of employees and y is the total rental cost.
For 20 employees, the monthly rental is:
y=10000×20+20000=220000 Rs.
Module 3: Machine Learning in AI
2 Machine Learning Model - Regression Analysis in Machine Learning
Summary:
Regression Analysis helps predict continuous values (e.g., price, salary) based on the relationship between
dependent and independent variables.
Linear Regression is the most common technique, but multiple regression, non-linear regression, and
other techniques are used for more complex tasks.
Applications include cost predictions, profit calculations, and sales forecasting.
Module 3: Machine Learning in AI
2 Machine Learning Model - Regression Analysis in Machine Learning
Model Evaluation Metrics for Regression

To evaluate the performance of a regression model, we focus on the prediction error and use various metrics.

1. Key Metrics:
[Link] Mean Squared Error (RMSE(:
Measures the difference between observed and predicted values.
Lower RMSE indicates a better model.
Formula: RMSE = √(Σ(observed - predicted)* / n)
[Link] R-Square (R*(:
Represents the proportion of variation in the data explained by the model.
Higher R* indicates a better model.
Module 3: Machine Learning in AI
2 Machine Learning Model - Regression Analysis in Machine Learning
Model Evaluation Metrics for Regression

2. Evaluation Methods:
1. Train-Test Split:
Split data into 80% for training and 20% for testing to evaluate model performance.
2. K-Fold Cross-Validation:
Step 1: Split the data into k subsets (e.g., 5 subsets for k=5).
Step 2: Train the model on k-1 subsets, and test on the remaining subset.
Step 3: Repeat for all subsets and calculate the average prediction error.
Best model is the one with the lowest error.
Module 3: Machine Learning in AI
2 Machine Learning Model - Regression Analysis in Machine Learning
Types of Regression

Regression analysis involves different types of models, each suited for specific types of data and
relationships between variables.

[Link] Regression
[Link] regression
[Link] regression
[Link] (Least Absolute Shrinkage Selector Operator) regression
[Link] regression
6. Stepwise regression
[Link] regression
Module 3: Machine Learning in AI
2 Machine Learning Model - Regression Analysis in Machine Learning
Types of Regression

1. Linear Regression:
Use Case: Predicting a continuous dependent variable with a linear relationship to one or more independent variables.
Example: Predicting house prices based on size, location, and number of rooms.
Equation: Y=bX+CY
Y is the dependent variable (e.g., house price).
X is the independent variable (e.g., size of the house).
b is the slope (relationship between X and Y).
C is the intercept.
Advantages: Simple, fast, and easy to understand.
Limitations: Can suffer from overfitting if data is too complex.
Module 3: Machine Learning in AI
2 Machine Learning Model - Regression Analysis in Machine Learning
2. Logistic Regression:
Use Case: Predicting a binary outcome (yes/no, true/false) or the probability of an event occurring.
Example: Predicting whether an email is spam or not spam based on certain features.
Equation: The output is transformed using the logit function (log-odds).
Applications: Categorical data, such as in classification tasks (e.g., disease diagnosis, fraud detection).
Module 3: Machine Learning in AI
2 Machine Learning Model - Regression Analysis in Machine Learning
3. Ridge Regression:
Use Case: Used when there is multicollinearity (high correlation between independent variables) in the
data. It helps prevent overfitting by reducing the size of coefficients.
How It Works: It adds a penalty to the size of coefficients to reduce their impact and stabilize the model.
Example: Predicting sales, where multiple variables are highly correlated (e.g., price, promotion, and
distribution).
Module 3: Machine Learning in AI
2 Machine Learning Model - Regression Analysis in Machine Learning
4. Lasso Regression (Least Absolute Shrinkage and Selection Operator(:
Use Case: Used for variable selection and regularization in regression models.
How It Works: Lasso reduces the coefficients of less important predictors to zero, effectively eliminating
them from the model.
Example: In a dataset with many features, Lasso can help select the most important ones, improving
model efficiency.
Also Known As: L1 regularization.
Module 3: Machine Learning in AI
2 Machine Learning Model - Regression Analysis in Machine Learning
5. Polynomial Regression:
Use Case: When the relationship between the
independent and dependent variables is non-linear.
Example: Predicting temperature changes with
respect to time, where the relationship is curved
(e.g., seasonal variations).
Equation:
Y=b 0 +b1 X1 +b2 X2 2 +...+b n Xn n
Best Fit: This technique is used when data cannot be
fit by a straight line, but a curve is needed.
Applications: Modeling curvilinear data (e.g., trends
in population growth).
Module 3: Machine Learning in AI
2 Machine Learning Model - Regression Analysis in Machine Learning
6. Stepwise Regression:
Use Case: Builds the regression model by adding or removing variables step by step based on
performance.
Approaches:
Forward Selection: Starts with no variables and adds them one at a time.
Backward Elimination: Starts with all variables and removes them step by step.
Bidirectional Elimination: Combines both approaches.
Example: Selecting the most significant predictors in a dataset for predicting sales growth.
Module 3: Machine Learning in AI
2 Machine Learning Model - Regression Analysis in Machine Learning
7. ElasticNet Regression:
Use Case: A combination of Ridge and Lasso regression, especially useful when there are many predictors
compared to observations.
How It Works: ElasticNet combines the L1 penalty of Lasso and the L2 penalty of Ridge to create a more
balanced model.
Example: In Support Vector Machines (SVM) or document optimization, where there are many features
but not enough data points.
Module 3: Machine Learning in AI
2 Machine Learning Model - Regression Analysis in Machine Learning
7. ElasticNet Regression:
Use Case: A combination of Ridge and Lasso regression, especially useful when there are many predictors
compared to observations.
How It Works: ElasticNet combines the L1 penalty of Lasso and the L2 penalty of Ridge to create a more
balanced model.
Example: In Support Vector Machines (SVM) or document optimization, where there are many features
but not enough data points.
Module 3: Machine Learning in AI
2 Machine Learning Model - Regression Analysis in Machine Learning
Type Use Case Key Feature Example
Predict continuous data with a Simple, fast, used for straight-line Predicting house prices based on
Linear Regression
linear relationship. relationships. size.
Logistic Predict binary outcomes or Used for classification tasks Spam vs. non-spam email
Regression probabilities. (yes/no, true/false). classification.
Handle multicollinearity in Adds a penalty to reduce Predicting sales with correlated
Ridge Regression
regression. overfitting. features.
Variable selection and Reduces coefficients to zero to Feature selection in a large
Lasso Regression
regularization. eliminate irrelevant features. dataset.
Polynomial Non-linear relationships Predicting temperature
Fits a curve rather than a line.
Regression between variables. variations.
Stepwise Build models by Automates variable selection Selecting predictors for sales
Regression adding/removing variables. based on model performance. forecasting.
ElasticNet Combines Ridge and Lasso Balances L1 and L2 penalties for Used in SVM and document
Regression regression. better performance. optimization.

You might also like