Introducti0n (MLT)

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 39

INTRODUCTI0N

(Machine learning
techniques)
What is Learning?
Learning can be defined as a relatively permanent change in behaviour or potential
behaviour as a result of direct or indirect experience. Learning is thus a change in
behaviour as a result of experience.
Learning is the process of having one’s behaviour modified, more or less permanently,
by what he does and the consequences of his action, or by what he observes.

Meaning of Learning
There are two primary elements in meaning of learning:
1. Change must be relatively permanent: This means that after “learning”
our behavior must be different, either better or worse as compared to our
behaviour prior to this learning experience.

For example, you “learn” to drive a car or have learned how to use a
computer.
2. This change must occur due to some kind of experience or practice. This
learning is not caused by biological maturation.

For example, a child does not learn to walk, it is a natural biological


phenomenon. We do not learn to eat or drink.

Nature of Learning
Learning is a relatively permanent change in knowledge or behavior that results from
practice or experience. There are several key points in this definition.

1. Learning comes change


2. Change in knowledge or behavior has to be relatively permanent or
long-lasting
3. Learning takes place as a result of practice or through experience
Learning comes change
For example, when you learn a second language, your knowledge about how to
communicate evolves, and your behavior changes when communicating with native
speakers of the language.
Change in knowledge or behavior has to be relatively
permanent or long-lasting
For example, If you attempt to communicate with someone in another language by
looking up words in a dictionary that you quickly forget once the interaction is
complete, learning did not take place because there was no permanent change in your
knowledge of the second language.
Learning takes place as a result of practice or through
experience
For example, Learning a second language requires much practice in pronunciation,
word usage, and grammar.

Elements of Learning
Elements of learning are:

1. Motivation
2. Cues
3. Response
4. Reinforcement
The important components of learning are :

1. Acquisition of new knowledge :


a. One component of learning is the acquisition of new knowledge.
b. Simple data acquisition is easy for computers, even though it is difficult for people.
3. Problem solving : The other component of learning is the problem solving that is required for
both to integrate into the system, new knowledge that is presented to it and to deduce new
information when required facts are not been presented.

Following are the performance measures for learning are :


1. Generality:
o Generality refers to how adaptable a learning method is across different domains or
application areas.
o An algorithm with high generality can learn and adapt in various environments.
o Completely general algorithms are flexible and can handle diverse scenarios.
2. Efficiency:
o Efficiency measures the average time required to construct knowledge structures from
initial data.
o It’s essential to compare efficiency relative to a standard benchmark.
o Efficient methods save time and resources during learning.
3. Robustness:
o Robustness assesses a learning system’s ability to function even with unreliable feedback
and noisy training examples.
o A robust system can build tentative structures and adjust them based on statistical
evidence.
4. Efficacy:
o Efficacy combines generality, efficiency, and robustness.
o It represents the overall power of a learning system.
o Effective systems achieve learning goals efficiently and adaptably.
5. Ease of Implementation:
o This measure considers program complexity, data structures, and resource requirements.
o While lacking precise complexity metrics, ease of implementation remains somewhat
subjective.

Supervised and Unsupervised learning


Machine learning is a field of computer science that gives computers the ability to
learn without being explicitly programmed. Supervised learning and unsupervised
learning are two main types of machine learning.

In supervised leaning, the machine is trained on a set of labeled data, which means
that the input data is paired with the desired output. The machine then learns to
predict the output for new input data. Supervised learning is often used for tasks
such as classification, regression, and object detection.

In unsupervised learning , the machine is trained on a set of unlabeled data, which


means that the input data is not paired with the desired output. The machine then
learns to find patterns and relationships in the data. Unsupervised learning is often
used for tasks such as clustering, dimensionality reduction, and anomaly detection.
What is Supervised learning?
Supervised learning is a type of machine learning algorithm that learns from labeled
data. Labeled data is data that has been tagged with a correct answer or
classification.
Supervised learning, as the name indicates, has the presence of a supervisor as a
teacher. Supervised learning is when we teach or train the machine using data that is
well-labelled. Which means some data is already tagged with the correct answer.
After that, the machine is provided with a new set of examples(data) so that the
supervised learning algorithm analyses the training data(set of training examples)
and produces a correct outcome from labeled data.
For example, a labeled dataset of images of Elephant, Camel and Cow would have
each image tagged with either “Elephant” , “Camel”or “Cow.”
Key Points:
 Supervised learning involves training a machine from labeled data.
 Labeled data consists of examples with the correct answer or
classification.
 The machine learns the relationship between inputs (fruit images) and
outputs (fruit labels).
 The trained machine can then make predictions on new, unlabeled data.

Example:
Let’s say you have a fruit basket that you want to identify. The machine would first
analyze the image to extract features such as its shape, color, and texture. Then, it
would compare these features to the features of the fruits it has already learned
about. If the new image’s features are most similar to those of an apple, the machine
would predict that the fruit is an apple.
For instance, suppose you are given a basket filled with different kinds of fruits.
Now the first step is to train the machine with all the different fruits one by one like
this:
 If the shape of the object is rounded and has a depression at the top, is red
in color, then it will be labeled as –Apple.
 If the shape of the object is a long curving cylinder having Green-Yellow
color, then it will be labeled as –Banana.

Now suppose after training the data, you have given a new separate fruit, say Banana
from the basket, and asked to identify it.
Since the machine has already learned the things from previous data and this time
has to use it wisely. It will first classify the fruit with its shape and color and would
confirm the fruit name as BANANA and put it in the Banana category. Thus the
machine learns the things from training data
(basket containing fruits) and then applies the knowledge to test data (new fruit).

Types of Supervised Learning


Supervised learning is classified into two categories of algorithms:
 Regression: A regression problem is when the output variable is a real
value, such as “dollars” or “weight”.
 Classification: A classification problem is when the output variable is a
category, such as “Red” or “blue” , “disease” or “no disease”.
Supervised learning deals with or learns with “labeled” data. This implies that some
data is already tagged with the correct answer.
1- Regression
Regression is a type of supervised learning that is used to predict continuous values,
such as house prices, stock prices, or customer churn. Regression algorithms learn a
function that maps from the input features to the output value.
Some common regression algorithms include:
 Linear Regression
 Polynomial Regression
 Support Vector Machine Regression
 Decision Tree Regression
 Random Forest Regression
2- Classification
Classification is a type of supervised learning that is used to predict categorical
values, such as whether a customer will churn or not, whether an email is spam or
not, or whether a medical image shows a tumor or not. Classification algorithms
learn a function that maps from the input features to a probability distribution over
the output classes.
Some common classification algorithms include:
 Logistic Regression
 Support Vector Machines
 Decision Trees
 Random Forests
 Naive Baye

Applications of Supervised learning


Supervised learning can be used to solve a wide variety of problems, including:
 Spam filtering: Supervised learning algorithms can be trained to identify
and classify spam emails based on their content, helping users avoid
unwanted messages.
 Image classification: Supervised learning can automatically classify
images into different categories, such as animals, objects, or scenes,
facilitating tasks like image search, content moderation, and image-based
product recommendations.
 Medical diagnosis: Supervised learning can assist in medical diagnosis by
analyzing patient data, such as medical images, test results, and patient
history, to identify patterns that suggest specific diseases or conditions.
 Fraud detection: Supervised learning models can analyze financial
transactions and identify patterns that indicate fraudulent activity, helping
financial institutions prevent fraud and protect their customers.
 Natural language processing (NLP): Supervised learning plays a crucial
role in NLP tasks, including sentiment analysis, machine translation, and
text summarization, enabling machines to understand and process human
language effectively.
Advantages of Supervised learning
 Supervised learning allows collecting data and produces data output from
previous experiences.
 Helps to optimize performance criteria with the help of experience.
 Supervised machine learning helps to solve various types of real-world
computation problems.
 It performs classification and regression tasks.
 It allows estimating or mapping the result to a new sample.
 We have complete control over choosing the number of classes we want in
the training data.

Disadvantages of Supervised learning


 Classifying big data can be challenging.
 Training for supervised learning needs a lot of computation time. So, it
requires a lot of time.
 Supervised learning cannot handle all complex tasks in Machine Learning.
 Computation time is vast for supervised learning.
 It requires a labelled data set.
 It requires a training process.
What is Unsupervised learning?
Unsupervised learning is a type of machine learning that learns from unlabeled data.
This means that the data does not have any pre-existing labels or categories. The
goal of unsupervised learning is to discover patterns and relationships in the data
without any explicit guidance.
Unsupervised learning is the training of a machine using information that is neither
classified nor labeled and allowing the algorithm to act on that information without
guidance. Here the task of the machine is to group unsorted information according to
similarities, patterns, and differences without any prior training of data.
Unlike supervised learning, no teacher is provided that means no training will be
given to the machine. Therefore the machine is restricted to find the hidden structure
in unlabeled data by itself.
You can use unsupervised learning to examine the animal data that has been
gathered and distinguish between several groups according to the traits and actions
of the animals. These groupings might correspond to various animal species,
providing you to categorize the creatures without depending on labels that already
exist.
Key Points
 Unsupervised learning allows the model to discover patterns and
relationships in unlabeled data.
 Clustering algorithms group similar data points together based on their
inherent characteristics.
 Feature extraction captures essential information from the data, enabling
the model to make meaningful distinctions.
 Label association assigns categories to the clusters based on the extracted
patterns and characteristics.
Example
Imagine you have a machine learning model trained on a large dataset of unlabeled
images, containing both dogs and cats. The model has never seen an image of a dog
or cat before, and it has no pre-existing labels or categories for these animals. Your
task is to use unsupervised learning to identify the dogs and cats in a new, unseen
image.
For instance, suppose it is given an image having both dogs and cats which it has
never seen.

Thus the machine has no idea about the features of dogs and cats so we can’t
categorize it as ‘dogs and cats ‘. But it can categorize them according to their
similarities, patterns, and differences, i.e., we can easily categorize the above picture
into two parts. The first may contain all pics having dogs in them and the second
part may contain all pics having cats in them. Here you didn’t learn anything before,
which means no training data or examples.
It allows the model to work on its own to discover patterns and information that was
previously undetected. It mainly deals with unlabelled data.
Types of Unsupervised Learning
Unsupervised learning is classified into two categories of algorithms:
 Clustering: A clustering problem is where you want to discover the
inherent groupings in the data, such as grouping customers by purchasing
behavior.
 Association: An association rule learning problem is where you want to
discover rules that describe large portions of your data, such as people that
buy X also tend to buy Y.
Clustering
Clustering is a type of unsupervised learning that is used to group similar data points
together. Clustering algorithms work by iteratively moving data points closer to their
cluster centers and further away from data points in other clusters.
1. Exclusive (partitioning)
2. Agglomerative
3. Overlapping
4. Probabilistic
Clustering Types:-
1. Hierarchical clustering
2. K-means clustering
3. Principal Component Analysis
4. Singular Value Decomposition
5. Independent Component Analysis
6. Gaussian Mixture Models (GMMs)
7. Density-Based Spatial Clustering of Applications with Noise (DBSCAN)
Application of Unsupervised learning
Non-supervised learning can be used to solve a wide variety of problems, including:
 Anomaly detection: Unsupervised learning can identify unusual patterns
or deviations from normal behavior in data, enabling the detection of
fraud, intrusion, or system failures.
 Scientific discovery: Unsupervised learning can uncover hidden
relationships and patterns in scientific data, leading to new hypotheses and
insights in various scientific fields.
 Recommendation systems: Unsupervised learning can identify patterns
and similarities in user behavior and preferences to recommend products,
movies, or music that align with their interests.
 Customer segmentation: Unsupervised learning can identify groups of
customers with similar characteristics, allowing businesses to target
marketing campaigns and improve customer service more effectively.
 Image analysis: Unsupervised learning can group images based on their
content, facilitating tasks such as image classification, object detection,
and image retrieval.
Advantages of Unsupervised learning
 It does not require training data to be labeled.
 Dimensionality reduction can be easily accomplished using unsupervised
learning.
 Capable of finding previously unknown patterns in data.
 Unsupervised learning can help you gain insights from unlabeled data that
you might not have been able to get otherwise.
 Unsupervised learning is good at finding patterns and relationships in data
without being told what to look for. This can help you learn new things
about your data.
Disadvantages of Unsupervised learning
 Difficult to measure accuracy or effectiveness due to lack of predefined
answers during training.
 The results often have lesser accuracy.
 The user needs to spend time interpreting and label the classes which
follow that classification.
 Unsupervised learning can be sensitive to data quality, including missing
values, outliers, and noisy data.
 Without labeled data, it can be difficult to evaluate the performance of
unsupervised learning models, making it challenging to assess their
effectiveness.
Supervised vs. Unsupervised Machine Learning
Supervised machine Unsupervised machine
Parameters learning learning

Algorithms are used


Algorithms are trained
against data that is not
using labeled data.
Input Data labeled

Computational
Simpler method Computationally complex
Complexity

Accuracy Highly accurate Less accurate

No. of classes is not


No. of classes is known
No. of classes known
Supervised machine Unsupervised machine
Parameters learning learning

Uses real-time analysis of


Uses offline analysis
Data Analysis data

Linear and Logistics


regression, Random
K-Means clustering,
forest, multi-class
Hierarchical
classification, decision
clustering, KNN, Apriori
tree, Support Vector
algorithm, etc.
Machine, Neural Network,
Algorithms used etc.

Desired output is not


Desired output is given.
Output given.

Use training data to infer


No training data is used.
Training data model.

It is not possible to learn It is possible to learn


larger and more complex larger and more complex
models than with models with unsupervised
Complex model supervised learning. learning.

Model We can test our model. We can not test our model.

Supervised learning is Unsupervised learning is


Called as also called classification. also called clustering.

Example: Optical Example: Find a face in an


Example character recognition. image.

Unsupervised learning
supervised learning needs
does not need any
supervision to train the
supervision to train the
model.
Supervision model.
Reinforcement learning
Reinforcement learning is an area of Machine Learning. It is about taking suitable
action to maximize reward in a particular situation. It is employed by various
software and machines to find the best possible behavior or path it should take in a
specific situation. Reinforcement learning differs from supervised learning in a way
that in supervised learning the training data has the answer key with it so the model
is trained with the correct answer itself whereas in reinforcement learning, there is
no answer but the reinforcement agent decides what to do to perform the given task.
In the absence of a training dataset, it is bound to learn from its experience.

Reinforcement Learning (RL) is the science of decision making. It is about learning


the optimal behavior in an environment to obtain maximum reward. In RL, the data
is accumulated from machine learning systems that use a trial-and-error method.
Data is not part of the input that we would find in supervised or unsupervised
machine learning.
Reinforcement learning uses algorithms that learn from outcomes and decide which
action to take next. After each action, the algorithm receives feedback that helps it
determine whether the choice it made was correct, neutral or incorrect. It is a good
technique to use for automated systems that have to make a lot of small decisions
without human guidance.
Reinforcement learning is an autonomous, self-teaching system that essentially
learns by trial and error. It performs actions with the aim of maximizing rewards, or
in other words, it is learning by doing in order to achieve the best outcomes.
Example:
The problem is as follows: We have an agent and a reward, with many hurdles in
between. The agent is supposed to find the best possible path to reach the reward.
The following problem explains the problem more easily.
The above image shows the robot, diamond, and fire. The goal of the robot is to get
the reward that is the diamond and avoid the hurdles that are fired. The robot learns
by trying all the possible paths and then choosing the path which gives him the
reward with the least hurdles. Each right step will give the robot a reward and each
wrong step will subtract the reward of the robot. The total reward will be calculated
when it reaches the final reward that is the diamond.

Main points in Reinforcement learning –

 Input: The input should be an initial state from which the model will start
 Output: There are many possible outputs as there are a variety of solutions
to a particular problem
 Training: The training is based upon the input, The model will return a
state and the user will decide to reward or punish the model based on its
output.
 The model keeps continues to learn.
 The best solution is decided based on the maximum reward.

Difference between Reinforcement learning and Supervised learning:

Reinforcement learning Supervised learning

Reinforcement learning is all about making decisions


In Supervised learning, the
sequentially. In simple words, we can say that the
decision is made on the initial
output depends on the state of the current input and
input or the input given at the
the next input depends on the output of the previous
start
input

In supervised learning the


In Reinforcement learning decision is dependent, so decisions are independent of
we give labels to sequences of dependent decisions each other so labels are given
to each decision.

Example: Object recognition,


Example: Chess game, text summarization
spam detetction

Types of Reinforcement:
There are two types of Reinforcement:
1. Positive: Positive Reinforcement is defined as when an event, occurs due
to a particular behaviour, increases the strength and the frequency of the
behaviour. In other words, it has a positive effect on behaviour.
Advantages of reinforcement learning are:
 Maximizes Performance
 Sustain Change for a long period of time
 Too much Reinforcement can lead to an overload of states
which can diminish the results
2. Negative: Negative Reinforcement is defined as strengthening of behaviour
because a negative condition is stopped or avoided.
Advantages of reinforcement learning:
 Increases Behaviour
 Provide defiance to a minimum standard of performance
 It Only provides enough to meet up the minimum behaviour
Elements of Reinforcement Learning

Reinforcement learning elements are as follows:


1. Policy
2. Reward function
3. Value function
4. Model of the environment
Policy: Policy defines the learning agent behavior for given time period. It is a
mapping from perceived states of the environment to actions to be taken when in
those states.
Reward function: Reward function is used to define a goal in a reinforcement
learning problem.A reward function is a function that provides a numerical score
based on the state of the environment
Value function: Value functions specify what is good in the long run. The value of
a state is the total amount of reward an agent can expect to accumulate over the
future, starting from that state.
Model of the environment: Models are used for planning.

Various Practical Applications of Reinforcement Learning –

 RL can be used in robotics for industrial automation.


 RL can be used in machine learning and data processing
 RL can be used to create training systems that provide custom instruction
and materials according to the requirement of students.

Application of Reinforcement Learnings


1. Robotics: Robots with pre-programmed behavior are useful in structured
environments, such as the assembly line of an automobile manufacturing plant,
where the task is repetitive in nature.
2. A master chess player makes a move. The choice is informed both by planning,
anticipating possible replies and counter replies.
3. An adaptive controller adjusts parameters of a petroleum refinery’s operation in
real time.

“Machine Learning enables a Machine to Automatically learn from Data, improve


performance from an Experience and predict things without explicitly programmed.”
In Simple Words, when we fed the Training Data to Machine Learning Algorithm,
this algorithm will produce a mathematical model and with the help of the
mathematical model, the machine will make a prediction and take a decision without
being explicitly programmed. Also, during training data, the more machine will
work with it the more it will get experience and the more efficient result is produced.
Example : In Driverless Car, the training data is fed to Algorithm like how to Drive
Car in Highway, Busy and Narrow Street with factors like speed limit, parking, stop
at signal etc. After that, a Logical and Mathematical model is created on the basis of
that and after that, the car will work according to the logical model. Also, the more
data the data is fed the more efficient output is produced.

Designing a Learning System in Machine Learning :


According to Tom Mitchell, “A computer program is said to be learning from
experience (E), with respect to some task (T). Thus, the performance measure (P) is
the performance at task T, which is measured by P, and it improves with experience
E.”
Example: In Spam E-Mail detection,
 Task, T: To classify mails into Spam or Not Spam.
 Performance measure, P: Total percent of mails being correctly
classified as being “Spam” or “Not Spam”.
 Experience, E: Set of Mails with label “Spam”

Steps used to design a learning system are:


1. Specify the learning task.
2. Choose a suitable set of training data to serve as the
training experience.
3. Divide the training data into groups or classes and label
accordingly.
4. Determine the type of knowledge representation to be
learned from the
training experience.
5. Choose a learner classifier that can generate general
hypotheses from
the training data.
6. Apply the learner classifier to test data.
7. Compare the performance of the system with that of an
expert human.

WELL DEFINED LEARNING PROBLEM


Well Posed Learning Problem – A computer program is said to learn from
experience E in context to some task T and some performance measure P, if its
performance on T, as was measured by P, upgrades with experience E.
Any problem can be segregated as well-posed learning problem if it has three traits

 Task
 Performance Measure
 Experience

Three features in learning problems:


1. The class of tasks (T)
2. The measure of performance to be improved (P)
3. The source of experience (E)
Certain examples that efficiently defines the well-posed learning problem are –
1. To better filter emails as spam or not
 Task – Classifying emails as spam or not
 Performance Measure – The fraction of emails accurately classified as
spam or not spam
 Experience – Observing you label emails as spam or not spam
2. A checkers learning problem
 Task – Playing checker’s game
 Performance Measure – percent of games won against opposer
 Experience – playing implementation games against itself
3. Handwriting Recognition Problem
 Task – Acknowledging handwritten words within portrayal
 Performance Measure – percent of words accurately classified
 Experience – a directory of handwritten words with given classifications
4. A Robot Driving Problem
 Task – driving on public four-lane highways using sight scanners
 Performance Measure – average distance progressed before a fallacy
 Experience – order of images and steering instructions noted down while
observing a human driver
5. Fruit Prediction Problem
 Task – forecasting different fruits for recognition
 Performance Measure – able to predict maximum variety of fruits
 Experience – training machine with the largest datasets of fruits images
6. Face Recognition Problem
 Task – predicting different types of faces
 Performance Measure – able to predict maximum types of faces
 Experience – training machine with maximum amount of datasets of
different face images
7. Automatic Translation of documents
 Task – translating one type of language used in a document to other
language
 Performance Measure – able to convert one language to other efficiently
 Experience – training machine with a large dataset of different types of
languages
A well-posed learning problem is crucial in machine learning because it ensures that the problem is
clearly defined and solvable. Here’s why it matters:
1. Clarity: A well-posed problem has a clear statement of what needs to be learned. It defines the
input data, the desired output, and the task (e.g., classification, regression, clustering).
2. Feasibility: A well-posed problem is feasible to solve using available resources. It avoids
situations where the problem is ill-defined or impossible to learn from the given data.
3. Generalization: A well-posed problem allows for generalization beyond the training data. Models
trained on well-posed problems can make accurate predictions on new, unseen examples.
4. Evaluation: Well-posed problems enable meaningful evaluation. We can measure model
performance using appropriate metrics and compare different approaches.
In summary, a well-posed learning problem sets the foundation for effective machine learning by
providing clarity, feasibility, and meaningful evaluation.
Machine learning is a field within artificial intelligence that
focuses on creating statistical algorithms capable of learning from
data and making decisions without explicit instructions. In other
words, it allows systems to automatically learn from large datasets,
identify patterns, and generalize to unseen data.
As for the formal definition of Machine Learning, we can say that a Machine
Learning algorithm learns from experience E with respect to some type
of task T and performance measure P, if its performance at tasks in T, as
measured by P, improves with experience E.

Applications of Machine learning

1. Image Recognition:
Image recognition is one of the most common applications of machine learning. It is
used to identify objects, persons, places, digital images, etc. The popular use case of
image recognition and face detection is, Automatic friend tagging suggestion

2. Speech Recognition
While using Google, we get an option of "Search by voice," it comes under speech
recognition, and it's a popular application of machine learning.

Speech recognition is a process of converting voice instructions into text, and it is


also known as "Speech to text", or "Computer speech recognition." At present,
machine learning algorithms are widely used by various applications of speech
recognition. Google assistant, Siri, Cortana, and Alexa are using speech recognition
technology to follow the voice instructions.

3. Traffic prediction:
If we want to visit a new place, we take help of Google Maps, which shows us the
correct path with the shortest route and predicts the traffic conditions.

It predicts the traffic conditions such as whether traffic is cleared, slow-moving, or


heavily congested with the help of two ways:

o Real Time location of the vehicle form Google Map app and sensors
o Average time has taken on past days at the same time.

Everyone who is using Google Map is helping this app to make it better. It takes
information from the user and sends back to its database to improve the
performance.

4. Product recommendations:
Machine learning is widely used by various e-commerce and entertainment companies such
as Amazon, Netflix, etc., for product recommendation to the user. Whenever we search for
some product on Amazon, then we started getting an advertisement for the same product
while internet surfing on the same browser and this is because of machine learning.

Google understands the user interest using various machine learning algorithms and
suggests the product as per customer interest.

As similar, when we use Netflix, we find some recommendations for entertainment


series, movies, etc., and this is also done with the help of machine learning.

5. Self-driving cars:
One of the most exciting applications of machine learning is self-driving cars.
Machine learning plays a significant role in self-driving cars. Tesla, the most popular
car manufacturing company is working on self-driving car. It is using unsupervised
learning method to train the car models to detect people and objects while driving.

6. Email Spam and Malware Filtering:


Whenever we receive a new email, it is filtered automatically as important, normal,
and spam. We always receive an important mail in our inbox with the important
symbol and spam emails in our spam box, and the technology behind this is Machine
learning. Below are some spam filters used by Gmail:

o Content Filter
o Header filter
o General blacklists filter
o Rules-based filters
o Permission filters

7. Virtual Personal Assistant:


We have various virtual personal assistants such as Google
assistant, Alexa, Cortana, Siri. As the name suggests, they help us in finding the
information using our voice instruction. These assistants can help us in various ways
just by our voice instructions such as Play music, call someone, Open an email,
Scheduling an appointment, etc.

8. Online Fraud Detection:


Machine learning is making our online transaction safe and secure by detecting fraud
transaction. Whenever we perform some online transaction, there may be various
ways that a fraudulent transaction can take place such as fake accounts, fake ids,
and steal money in the middle of a transaction. So to detect this, Feed Forward
Neural network helps us by checking whether it is a genuine transaction or a fraud
transaction.
9. Stock Market trading:
Machine learning is widely used in stock market trading. In the stock market, there is
always a risk of up and downs in shares, so for this machine learning's long short
term memory neural network is used for the prediction of stock market trends.

10. Medical Diagnosis:


In medical science, machine learning is used for diseases diagnoses. With this,
medical technology is growing very fast and able to build 3D models that can predict
the exact position of lesions in the brain.

It helps in finding brain tumours and other brain-related diseases easily.

11. Automatic Language Translation:


Nowadays, if we visit a new place and we are not aware of the language then it is not
a problem at all, as for this also machine learning helps us by converting the text into
our known languages. Google's GNMT (Google Neural Machine Translation) provide
this feature, which is a Neural Machine Learning that translates the text into our
familiar language, and it called as automatic translation.

The technology behind the automatic translation is a sequence-to-sequence learning


algorithm, which is used with image recognition and translates the text from one
language to another language.

Advantages and Disadvantages of


Machine Learning
The advantages of Machine Learning (ML) include:
1. Automation: ML enables automation of tasks, reducing manual
effort and increasing efficiency.
2. Accuracy: ML algorithms can make predictions and decisions
with high accuracy, often surpassing human capabilities.
3. Scalability: ML can handle large datasets and perform well even
with complex data.
4. Flexibility: ML models can be adapted to various applications
and domains.
5. Improved decision-making: ML provides insights and patterns,
enabling informed decisions.
6. Enhanced customer experiences: ML-powered applications can
personalize interactions and recommendations.
7. Fraud detection and security: ML helps detect and prevent fraud,
enhancing security.
8. Healthcare advancements: ML contributes to medical
breakthroughs, disease diagnosis, and personalized treatment.
9. Time and cost savings: ML automates tasks, reducing time and
costs.
10. Continuous improvement: ML models learn from data,
improving performance over time.

The disadvantages of Machine Learning (ML) include:


1. Data Quality Issues: ML is only as good as the data it's trained
on. Poor data quality leads to biased or inaccurate models.
2. Lack of Interpretability: Complex ML models can be difficult to
understand and interpret, making it challenging to understand
decision-making processes.
3. Bias and Discrimination: ML models can perpetuate existing
biases and discrimination if not designed with fairness in mind.
4. Dependence on Data: ML models require large amounts of data,
which can be time-consuming and expensive to collect.
5. Security and Privacy Risks: ML models can be vulnerable to
cyber-attacks and data breaches, compromising sensitive
information.
6. High Computational Requirements: Training ML models requires
significant computational resources and energy consumption.
7. Need for Expertise: Building and deploying ML models require
specialized skills and expertise.
8. Overfitting and Underfitting: ML models can be prone to
overfitting or underfitting, leading to poor generalization
performance.
9. Ethical Concerns: ML raises ethical concerns, such as job
displacement, privacy invasion, and potential misuse.
10. Continuous Updating Required: ML models require continuous
updating and retraining to maintain performance and adapt to
changing data distributions.

Artificial Neural Networks (ANNs) are


computational models inspired by the human brain. They consist of
interconnected nodes (also called artificial neurons) that perform
simple mathematical operations. Here’s how they work:
1. Structure:
o ANNs have layers: input, hidden, and output.
o The input layer receives data from external sources.
o The hidden layer(s) transform input data into valuable
information.
o The output layer provides the network’s response to the
input data.
2. Connections and Weights:
o Neurons in each layer are connected to neurons in
adjacent layers.
o Each connection has a weight that determines its
influence.
o During training, weights are adjusted to optimize model
performance.
3. Learning Process:
o ANNs learn from data by adjusting weights.
o They identify patterns, generalize, and make predictions.
o Types include feedforward, convolutional, and recurrent
networks.
4. Applications:
o Image recognition (CNNs)
o Natural language processing
o Financial modelling
o Medical diagnosis
ANNs are powerful tools for solving complex problems and

mimicking human cognition. 🧠💡

Clustering
Clustering or cluster analysis is a machine learning technique, which
groups the unlabelled dataset. It can be defined as "A way of grouping
the data points into different clusters, consisting of similar data
points. The objects with the possible similarities remain in a group
that has less or no similarities with another group."
It does it by finding some similar patterns in the unlabelled dataset such
as shape, size, color, behaviour, etc., and divides them as per the
presence and absence of those similar patterns.

It is an unsupervised learning method, hence no supervision is provided


to the algorithm, and it deals with the unlabeled dataset.

The clustering technique can be widely used in various tasks. Some


most common uses of this technique are:
o Market Segmentation
o Statistical data analysis
o Social network analysis
o Image segmentation
o Anomaly detection, etc.
Apart from these general usages, it is used by the Amazon in its
recommendation system to provide the recommendations as per the
past search of products. Netflix also uses this technique to recommend
the movies and web-series to its users as per the watch history.

Applications of Clustering in different fields:


1. Marketing: It can be used to characterize & discover customer
segments for marketing purposes.
2. Biology: It can be used for classification among different species of
plants and animals.
3. Libraries: It is used in clustering different books on the basis of topics
and information.
4. Insurance: It is used to acknowledge the customers, their policies and
identifying the frauds.
5. City Planning: It is used to make groups of houses and to study their
values based on their geographical locations and other factors present.
6. Earthquake studies: By learning the earthquake-affected areas we can
determine the dangerous zones.
7. Image Processing: Clustering can be used to group similar images
together, classify images based on content, and identify patterns in
image data.
8. Genetics: Clustering is used to group genes that have similar
expression patterns and identify gene networks that work together in
biological processes.
9. Finance: Clustering is used to identify market segments based on
customer behaviour, identify patterns in stock market data, and analyze
risk in investment portfolios.
10.Customer Service: Clustering is used to group customer inquiries and
complaints into categories, identify common issues, and develop
targeted solutions.
11.Manufacturing: Clustering is used to group similar products together,
optimize production processes, and identify defects in manufacturing
processes.
12.Medical diagnosis: Clustering is used to group patients with similar
symptoms or diseases, which helps in making accurate diagnoses and
identifying effective treatments.
13.Fraud detection: Clustering is used to identify suspicious patterns or
anomalies in financial transactions, which can help in detecting fraud or
other financial crimes.
14.Traffic analysis: Clustering is used to group similar patterns of traffic
data, such as peak hours, routes, and speeds, which can help in
improving transportation planning and infrastructure.
15.Social network analysis: Clustering is used to identify communities or
groups within social networks, which can help in understanding social
behaviour, influence, and trends.
16.Cybersecurity: Clustering is used to group similar patterns of network
traffic or system behaviour, which can help in detecting and preventing
cyberattacks.
17.Climate analysis: Clustering is used to group similar patterns of
climate data, such as temperature, precipitation, and wind, which can
help in understanding climate change and its impact on the
environment.
18.Sports analysis: Clustering is used to group similar patterns of player
or team performance data, which can help in analyzing player or team
strengths and weaknesses and making strategic decisions.
19.Crime analysis: Clustering is used to group similar patterns of crime
data, such as location, time, and type, which can help in identifying
crime hotspots, predicting future crime trends, and improving crime
prevention strategies.

Difference between classification


and clustering
Comparison between Classification and Clustering:
Parameter CLASSIFICATION CLUSTERING

Type used for supervised learning used for unsupervised learning

process of classifying the input grouping the instances based on


Basic instances based on their their similarity without the help
corresponding class labels of class labels

it has labels so there is need of


there is no need of training and
Need training and testing dataset for
testing dataset
verifying the model created

more complex as compared to less complex as compared to


Complexity
clustering classification

k-means clustering algorithm,


Logistic regression, Naive Bayes
Example Fuzzy c-means clustering
classifier, Support vector
Algorithms algorithm, Gaussian (EM)
machines, etc.
clustering algorithm, etc.

Various clustering techniques


Clustering techniques aim to organize observed data points into clusters
or groups based on their similarities. The key criteria for successful
clustering are:
1. Homogeneity within clusters: Examples within the same cluster
should be similar to each other.
2. Heterogeneity between clusters: Examples from different
clusters should be distinct from each other.
1. Hierarchical Clustering:
o Hierarchical clustering builds a tree-like structure of clusters.
o Two main approaches:
 Agglomerative: Starts with individual data points and
merges them into clusters.
 Divisive: Begins with all data points in one cluster and
recursively splits them.
o Useful for visualizing hierarchical relationships.
2. Partitional clustering: a. This method first creates an initial set of
number of partitions where each partition represents a cluster. b.
The clusters are formed to optimize an objective partition criterion
such as a dissimilarity function based on distance so that the
objects within a cluster are similar whereas the objects of different
clusters are dissimilar.
 Divides data into non-overlapping subsets (partitions).
 Commonly used for large datasets.
 Example: k-means.
Following are the types of partitioning methods:
a. Centroid based clustering:
i. In this, it takes the input parameter and partitions a set of objects into a
number of clusters so that resulting intracluster similarity is high but the
intercluster similarity is low. ii. Cluster similarity is measured in terms of
the mean value of the objects in the cluster, which can be viewed as the
cluster’s centroid or centre of gravity. b. Model-based clustering: This
method hypothesizes a model for each of the cluster and finds the best
fit of the data to that model.

Decision Tree
A decision tree is a flowchart-like structure used to make decisions or predictions. It
consists of nodes representing decisions or tests on attributes, branches representing
the outcome of these decisions, and leaf nodes representing final outcomes or
predictions. Each internal node corresponds to a test on an attribute, each branch
corresponds to the result of the test, and each leaf node corresponds to a class label
or a continuous value.
The paths from root to leaf represent classification rules
Fig 1.19.1, illustrate the basic flow of decision tree for decision making with labels
(Rain (Yes), Rain (No)).

Structure of a Decision Tree


1. Root Node: Represents the entire dataset and the initial decision to be
made.
2. Internal Nodes: Represent decisions or tests on attributes. Each internal
node has one or more branches.
3. Branches: Represent the outcome of a decision or test, leading to another
node.
4. Leaf Nodes: Represent the final decision or prediction. No further splits
occur at these nodes.

How Decision Trees Work?


The process of creating a decision tree involves:
1. Selecting the Best Attribute: Using a metric like Gini impurity, entropy,
or information gain, the best attribute to split the data is selected.
2. Splitting the Dataset: The dataset is split into subsets based on the
selected attribute.
3. Repeating the Process: The process is repeated recursively for each
subset, creating a new internal node or leaf node until a stopping criterion
is met (e.g., all instances in a node belong to the same class or a
predefined depth is reached).

Advantages of Decision Trees


 Simplicity and Interpretability: Decision trees are easy to understand
and interpret. The visual representation closely mirrors human decision-
making processes.
 Versatility: Can be used for both classification and regression tasks.
 No Need for Feature Scaling: Decision trees do not require normalization
or scaling of the data.
 Handles Non-linear Relationships: Capable of capturing non-linear
relationships between features and target variables.
Disadvantages of Decision Trees
 Overfitting: Decision trees can easily overfit the training data, especially
if they are deep with many nodes.
 Instability: Small variations in the data can result in a completely
different tree being generated.
 Bias towards Features with More Levels: Features with more levels can
dominate the tree structure.

Pruning
To overcome overfitting, pruning techniques are used. Pruning reduces the size of
the tree by removing nodes that provide little power in classifying instances. There
are two main types of pruning:
 Pre-pruning (Early Stopping): Stops the tree from growing once it meets
certain criteria (e.g., maximum depth, minimum number of samples per
leaf).
 Post-pruning: Removes branches from a fully grown tree that do not
provide significant power.
Applications of Decision Trees
 Business Decision Making: Used in strategic planning and resource
allocation.
 Healthcare: Assists in diagnosing diseases and suggesting treatment
plans.
 Finance: Helps in credit scoring and risk assessment.
 Marketing: Used to segment customers and predict customer behaviour.

Bayesian Belief Network ,also known as a Bayesian


network, is a probabilistic graphical model used to represent
uncertain knowledge and make decisions based on that
knowledge.

 A Bayesian network is a graphical model that


represents probabilistic relationships between
variables.
 It consists of nodes (representing random variables)
and directed edges (arcs) that indicate conditional
dependencies.
 Also called a belief network, decision network,
or Bayesian model.

Components:
Nodes: Correspond to random variables (continuous or
discrete).
Arcs: Represent causal relationships or conditional probabilities
between nodes.
Directed Acyclic Graph (DAG): The network structure has no
cycles.
Q) Find the probability that ‘P1’ is true (P1 has called ‘gfg’), ‘P2’ is true (P2 has
called ‘gfg’) when the alarm ‘A’ rang, but no burglary ‘B’ and fire ‘F’ has
occurred.
=> P (P1, P2, A, ~B, ~F) [ where- P1, P2 & A are ‘true’ events and ‘~B’ & ‘~F’
are ‘false’ events]
[ Note: The values mentioned below are neither calculated nor computed. They
have observed values]
Burglary ‘B’ –
 P (B=T) = 0.001 (‘B’ is true i.e. burglary has occurred)
 P (B=F) = 0.999 (‘B’ is false i.e. burglary has not occurred)
Fire ‘F’ –
 P (F=T) = 0.002 (‘F’ is true i.e. fire has occurred)
 P (F=F) = 0.998 (‘F’ is false i.e. fire has not occurred)
Alarm ‘A’ –
B F P (A=T) P (A=F)

T T 0.95 0.05

T F 0.94 0.06

F T 0.29 0.71

F F 0.001 0.999

 The alarm ‘A’ node can be ‘true’ or ‘false’ (i.e. may have rung or may
not have rung). It has two parent nodes burglary ‘B’ and fire ‘F’ which
can be ‘true’ or ‘false’ (i.e. may have occurred or may not have
occurred) depending upon different conditions.
Person ‘P1’ –
A P (P1=T) P (P1=F)

T 0.95 0.05

F 0.05 0.95

The person ‘P1’ node can be ‘true’ or ‘false’ (i.e. may have called the
person ‘gfg’ or not). It has a parent node, the alarm ‘A’, which can be
‘true’ or ‘false’ (i.e. may have rung or may not have rung, upon
burglary ‘B’ or fire ‘F’).
Person ‘P2’ –
A P (P2=T) P (P2=F)

T 0.80 0.20

F 0.01 0.99

 The person ‘P2’ node can be ‘true’ or false’ (i.e. may have called the
person ‘gfg’ or not). It has a parent node, the alarm ‘A’, which can be
‘true’ or ‘false’ (i.e. may have rung or may not have rung, upon
burglary ‘B’ or fire ‘F’).
Solution: Considering the observed probabilistic scan –
With respect to the question — P (P1, P2, A, ~B, ~F), we need to get the
probability of ‘P1’. We find it with regard to its parent node – alarm ‘A’. To get
the probability of ‘P2’, we find it with regard to its parent node — alarm ‘A’.
We find the probability of alarm ‘A’ node with regard to ‘~B’ & ‘~F’ since
burglary ‘B’ and fire ‘F’ are parent nodes of alarm ‘A’.
From the observed probabilistic scan, we can deduce –
P (P1, P2, A, ~B, ~F)
= P (P1/A) * P (P2/A) * P (A/~B~F) * P (~B) * P (~F)
= 0.95 * 0.80 * 0.001 * 0.999 * 0.998
= 0.00075

Support Vector Machine (SVM)


A Support Vector Machine (SVM) is machine learning algorithm that analyses data for classification
and regression analysis. SVM is a supervised learning method that looks at data and sorts it into one
of two categories.

1. Objective of SVM:
o SVM aims to find the optimal hyperplane in an N-
dimensional space that can separate data points into
different classes.
o The hyperplane ensures that the margin between the
closest points of different classes is as maximum as
possible.
Applications of SVM:
i. Text and hypertext classification
ii. Image classification
iii. Recognizing handwritten characters iv. Biological sciences, including protein
classification.

Genetic Algorithm
A genetic algorithm is an adaptive heuristic search algorithm inspired by "Darwin's
theory of evolution in Nature."

Genetic Algorithms are being widely used in different real-world applications, for
example, Designing electronic circuits, code-breaking, image processing, and artificial
creativity.

Genetic algorithm (GA):


1. The genetic algorithm is a method for solving both constrained and unconstrained optimization
problems that is based on natural selection.

2. The genetic algorithm repeatedly modifies a population of individual solutions.

3. At each step, the genetic algorithm selects individuals at random from the current population to
be parents and uses them to produce the children for the next generation.

4. Over successive generations, the population evolves toward an optimal solution.

Flow chart: The genetic algorithm uses three main types of rules at each step to create the next
generation from the current population:

a. Selection rule: Selection rules select the individuals, called parents, that contribute to the
population at the next generation.

b. Crossover rule: Crossover rules combine two parents to form children for the next generation.

c. Mutation rule: Mutation rules apply random changes to individual parents to form children.
Certainly! Machine Learning (ML) has revolutionized various industries,
but it also comes with its share of challenges. Let’s explore some
common issues faced by ML professionals:
1. Inadequate Training Data:
o Lack of quality and quantity of data can hinder ML
algorithms.
o Noisy or unclean data affects model performance.
o Solutions: Collect more diverse and representative data,
preprocess and clean data effectively.
2. Overfitting and Underfitting:
o Overfitting: Model learns training data too well but performs
poorly on unseen data.
o Underfitting: Model is too simple and fails to capture
underlying patterns.
o Solutions: Use techniques like cross-validation,
regularization, and hyperparameter tuning.
3. Bias and Fairness:
o Models can inherit biases from training data.
o Fairness concerns arise when models discriminate based on
sensitive attributes (e.g., race, gender).
o Solutions: Regularly audit models for bias, use fairness-
aware algorithms, and diverse training data.
4. Interpretability:
o Many ML models (e.g., deep neural networks) are
considered “black boxes.”
o Understanding model decisions is crucial for trust and
accountability.
o Solutions: Explore interpretable models (e.g., decision trees),
feature importance analysis, and visualization.
5. Data Privacy and Security:
o Handling sensitive data requires robust privacy measures.
o Protecting user privacy while extracting useful insights is
challenging.
o Solutions: Anonymize data, use differential privacy, and
comply with privacy regulations.
6. Scalability and Efficiency:
o Training large models can be computationally expensive.
o Real-time applications demand efficient inference.
o Solutions: Optimize algorithms, use distributed computing,
and hardware acceleration.

Common classes of problem in machine learning:

1. Regression:
o Objective: Predict numerical values (continuous output).
o Examples: House price prediction, stock market forecasting.
o Algorithms: Linear regression, k-nearest neighbours (K-NN), random forest, neural
networks.
2. Classification:
o Objective: Categorize data into different classes (discrete output).
o Examples: Disease diagnosis, sentiment analysis, spam detection.
o Algorithms: Logistic regression, random forest, K-NN, gradient boosting, neural
networks1.
3. Clustering:
o Objective: Group similar data points into clusters.
o Examples: Customer segmentation, image segmentation.
o Algorithms: K-means, DBSCAN, hierarchical clustering, Gaussian mixture models1.
4. Time-Series Forecasting:
o Objective: Predict future values based on historical time-series data.
o Examples: Sales demand forecasting, stock price prediction.
o Algorithms: ARIMA, LSTM, exponential smoothing, Prophet1.
5. Anomaly Detection:
o Objective: Identify outliers or unexpected events in the dataset.
o Examples: Credit card fraud detection, network intrusion detection.
o Algorithms: Isolation Forest, Local Outlier Factor, One-class SVM1.
6. Ranking:
o Objective: Order results based on specific criteria.
o Examples: Search engine result ranking, recommendation systems.
Difference Between Data Science
and Machine Learning
Regression
and Bayesian
Learning

You might also like